Project

General

Profile

Statistics
| Branch: | Revision:

colonymech / docs / www / colonyscout / internal / inventory_viewpart.php @ f59acf11

History | View | Annotate | Download (1.81 KB)

1
<?php
2
        if(!isset($_GET["q"])) {
3
                echo "<h1 style=\"color:#FF6600;\">Please search for a part..</h1>";
4
        } else {
5
                $info = getPartInfo($_GET["q"]);
6
                $datasheet = ($info["datasheet"]=="") ? $info["url"]        : $info["datasheet"];
7
                $systems = getSystemsForPart($info["data"]["ID"]);$usedString="";
8
                if (!empty($systems)) {
9
                        foreach($systems as $sysName) {$usedString.=$sysName.", ";}
10
                }
11
                
12
                echo ($info["data"]==0)
13
                ?
14
                        "<h1 style=\"color:#FF6600;\">Sorry, that part number could not be found.</h1>"
15
                : 
16
                        "
17
                        <div style=\"overflow:hidden;\">
18
                                <img src=\"".$info["thumb"]."\" width=\"200px\" class=\"box-img\"/>
19
                                <div class=\"box-part-title\"><h1>".$info["data"]["Name"]." ".$info["data"]["Description"]."</h1><br/>
20
                                        <h2 class=\"part\">".$info["vendor"].": ".$info["data"]["VendorPartNo"]."<a target=\"_blank;\" href=\"".$info["url"]."\">
21
                                        <img src=\"images/shortcut.png\"/></a></h2>
22
                                </div>
23
                                <div class=\"box-part-text\">
24
                                        <table class=\"part-content\">
25
                                        <tr>
26
                                                <td align=\"right\"><b>Datasheet:</b></td>
27
                                                <td><a href=\"".$datasheet."\"><img src=\"images/pdf.gif\"/> ".$info["data"]["VendorPartNo"]."</a></td>
28
                                                <td width=\"150px\" rowspan=\"5\">".getPriceTable($info["data"]["VendorPartNo"])."</td>                                                
29
                                        </tr>
30
                                        <tr>
31
                                                <td width=\"160px\" align=\"right\"><b>Manufacturer:</b></td>
32
                                                <td width=\"190px\">".$info["data"]["ManufacturerName"]."</td>
33
                                        </tr>
34
                                        <tr>        
35
                                                <td align=\"right\"><b>Manufacturer Part No: </b></td>
36
                                                <td>".$info["data"]["ManufacturerPartNo"]."</td>
37
                                        </tr>
38
                                        <tr>
39
                                                <td align=\"right\"><b>Used:</b></td>
40
                                                <td>".$usedString." ".$info["data"]["WhereUsed"]."</td>
41
                                        </tr>
42
                                        <tr>
43
                                                <td align=\"right\"><b>Qty In Stock:</b></td>
44
                                                <td>".$info["data"]["InStock"]."</td>
45
                                        </tr>
46
                                        </table>
47
                                </div>
48
                        </div>
49
                        ";
50
        }                                
51
?>