root / src / pip_history.TSP.php @ d072e29c
Historique | Voir | Annoter | Télécharger (873 octet)
1 | 1a2be799 | Florent Chuffart | <?php
|
---|---|---|---|
2 | 1a2be799 | Florent Chuffart | // a Trigger to display pipet info
|
3 | 1a2be799 | Florent Chuffart | $allevents = $this->myQuery("SELECT * FROM ".$this->tb); |
4 | 1a2be799 | Florent Chuffart | $allpipets = $this->myQuery("SELECT * FROM pip_stock"); |
5 | 1a2be799 | Florent Chuffart | |
6 | 1a2be799 | Florent Chuffart | /* there must be a more straightforward way to do this
|
7 | 1a2be799 | Florent Chuffart | * but this seems to work
|
8 | 1a2be799 | Florent Chuffart | */
|
9 | 1a2be799 | Florent Chuffart | // reach the event displayed
|
10 | 1a2be799 | Florent Chuffart | $foundevent = 0; |
11 | 1a2be799 | Florent Chuffart | while(!$foundevent && $event = mysql_fetch_object($allevents)){ |
12 | 1a2be799 | Florent Chuffart | if ($event->ID == $this->rec) |
13 | 1a2be799 | Florent Chuffart | $foundevent = 1; |
14 | 1a2be799 | Florent Chuffart | } |
15 | 1a2be799 | Florent Chuffart | // record Serial Number of the pipet considered
|
16 | 1a2be799 | Florent Chuffart | if ($event){ |
17 | 1a2be799 | Florent Chuffart | $SerialNum = $event->Serial_Number ; |
18 | 1a2be799 | Florent Chuffart | } |
19 | 1a2be799 | Florent Chuffart | |
20 | 1a2be799 | Florent Chuffart | // reach the pipet displayed
|
21 | 1a2be799 | Florent Chuffart | $foundpipet = 0; |
22 | 1a2be799 | Florent Chuffart | while(!$foundpipet && $pipet = mysql_fetch_object($allpipets)){ |
23 | 1a2be799 | Florent Chuffart | if ($pipet->Serial_Number == $SerialNum) |
24 | 1a2be799 | Florent Chuffart | $foundpipet = 1; |
25 | 1a2be799 | Florent Chuffart | } |
26 | 1a2be799 | Florent Chuffart | |
27 | 1a2be799 | Florent Chuffart | if ($pipet){ |
28 | 1a2be799 | Florent Chuffart | // print pipet infos
|
29 | 1a2be799 | Florent Chuffart | echo " Pipet : ". |
30 | 1a2be799 | Florent Chuffart | $pipet->Marque . " " . |
31 | 1a2be799 | Florent Chuffart | $pipet->Type . " " . |
32 | 1a2be799 | Florent Chuffart | "<BR>" .
|
33 | 1a2be799 | Florent Chuffart | "Serial Number: ".
|
34 | 1a2be799 | Florent Chuffart | $pipet->Serial_Number . "<BR>". "<BR>"; |
35 | 1a2be799 | Florent Chuffart | } |
36 | 1a2be799 | Florent Chuffart | |
37 | 1a2be799 | Florent Chuffart | ?> |