Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.27 KB | None | 0 0
  1. <?php  
  2. include ('admin.php');
  3. ?>
  4. <div align="center">
  5.     <td width="100%"><font size="5" color="darkgreen"><b>Inventory</b></td></font>
  6. </div>
  7. <title>Inventory</title>
  8. <table border="0" align="center">
  9. <td>
  10.  
  11. </table>
  12. <table border=0 align="center" >
  13. <td>
  14. </table>
  15. <!-- //dagdag
  16. //$uid = addslashes(strip_tags($_POST["uid"]));
  17. //$uname = addslashes(strip_tags($_POST["uname"]));
  18. //$fname = addslashes(strip_tags($_POST["fname"]));
  19. //$lname = addslashes(strip_tags($_POST["lname"]));
  20. //$sex = addslashes(strip_tags($_POST["sex"]));
  21. //$age = addslashes(strip_tags($_POST["age"]));
  22. //$cnumber = addslashes(strip_tags($_POST["cnumber"]));
  23. //$address = addslashes(strip_tags($_POST["address"])); -->
  24.  
  25.     <form action='activitylogsearch2.php' method='POST' enctype='multipart/form-data'>
  26.     <table border='0' class='style' align='center'>
  27.         <thead>
  28.             <th align='left'>ID</th>
  29.             <th align='left'>Image</th>
  30.             <th align='left'>Category</th>
  31.             <th align='left'>Product Name</th>
  32.             <th align='left'>Description</th>
  33.             <th align='left'>Stock</th>
  34.             <th align='left'>Price</th>
  35.             <th align='left'>Date added</th>
  36.         </thead>
  37.         <tbody>
  38. <?php
  39.  
  40.    
  41.     if (isset($_POST['search'],$_POST['Make'])){
  42.         $search = mysql_real_escape_string($_POST['search']);
  43.         $Make = mysql_real_escape_string($_POST['Make']);
  44.  
  45.         $query = mysql_query ("SELECT * FROM `products` WHERE $Make LIKE '%$search%'");
  46.  
  47.         while ($rows=mysql_fetch_array($query)){
  48.             $userid= $rows['id'];
  49.             $category = $rows['category'];
  50.             $pname = $rows['pname'];
  51.             $description = $rows['description'];
  52.             $stock = $rows['stock'];
  53.             $price = $rows['price'];
  54.             $date_added = $rows['date_added'];
  55.             $ext = $rows['ext'];
  56.  
  57.                 echo "<tr>
  58.                 <td align='left'>".$user_id."</td>
  59.                 <td><img src='uploads/$user_id.$ext' height=35 width=35/></td>
  60.                 <td align='left'>$category</td>
  61.                 <td align='left'>$pname</td>
  62.                 <td align='left'>$description</td>
  63.                 <td align='left'>$stock</td>
  64.                 <td align='left'>$price</td>
  65.                 <td align='left'>$date_added</td>
  66.                 </tr>";
  67.                
  68.         }
  69.        
  70.     } else {
  71.         $query = mysql_query ("SELECT * FROM `products` WHERE $Make LIKE '%$search%'");
  72.  
  73.         while ($rows=mysql_fetch_array($query)){
  74.             $userid= $rows['id'];
  75.             $category = $rows['category'];
  76.             $pname = $rows['pname'];
  77.             $description = $rows['description'];
  78.             $stock = $rows['stock'];
  79.             $price = $rows['price'];
  80.             $date_added = $rows['date_added'];
  81.             $ext = $rows['ext'];
  82.  
  83.                 echo "<tr>
  84.                 <td align='left'>".$user_id."</td>
  85.                 <td><img src='uploads/$user_id.$ext' height=35 width=35/></td>
  86.                 <td align='left'>$category</td>
  87.                 <td align='left'>$pname</td>
  88.                 <td align='left'>$description</td>
  89.                 <td align='left'>$stock</td>
  90.                 <td align='left'>$price</td>
  91.                 <td align='left'>$date_added</td>
  92.                 </tr>";
  93.                
  94.         }
  95.     }
  96.                                
  97. ?>
  98.         </tbody>
  99.     </table>
  100.     </form>
  101. </div>
  102.  
  103. <center>
  104. <br>
  105. <script type="text/javascript">
  106.  
  107. function print1(strid)
  108. {
  109. if(confirm("Do you want to print?"))
  110. {
  111. var values = document.getElementById(strid);
  112. var printing =
  113. window.open('','','left=0,top=0,width=550,height=400,toolbar=0,scrollbars=0,sta­?tus=0');
  114. printing.document.write(values.innerHTML);
  115. printing.document.close();
  116. printing.focus();
  117. printing.print();
  118. printing.close();
  119. }
  120. }
  121. </script>
  122.  
  123.  
  124.  
  125.  
  126. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement