Advertisement
Guest User

Untitled

a guest
Mar 31st, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. <?
  2. if($user_home->is_admin() || $user_home->is_auditor){
  3.  
  4.  
  5.  
  6.  
  7. ?>
  8. <div class="row">
  9. <div class="col-lg-8 col-lg-offset-2">
  10. <h2 class="section-heading">Add Product</h2>
  11. <div class="text-center" style="input, select, textarea{
  12. color: #000;
  13. }">
  14.  
  15.  
  16. </div><BR>
  17.  
  18. <form role="form" class="userTrans" method="POST">
  19. <input type="hidden" value="iteminsert" name="act_userTrans">
  20.  
  21.  
  22. <div class="form-group">
  23. <label for="text">Item Name</label>
  24. <input type="text" class="form-control" id="itemInsert" name="itemname">
  25. </div>
  26.  
  27.  
  28.  
  29. <div class="form-group">
  30. <label for="itemcategory">Item Category</label>
  31. <select id="itemcategory" class="form-control" name="itemcategory">
  32. <option value="Tarpaulin">Tarpaulin</option>
  33. <option value="Rush ID">Rush ID</option>
  34. <option value="Photocopy">Photocopy</option>
  35. <option value="Graphic Layout">Graphic Layout</option>
  36. <option value="Invitation">Invitation</option>
  37. <option value="Panaflex">Panaflex</option>
  38. <option value="Signages">Signages</option>
  39. <option value="Stickers">Stickers</option>
  40. <option value="Sintra board">Sintra board</option>
  41. <option value="Large Format Photo">Large Format Photo</option>
  42. <option value="PVC ID">PVC ID</option>
  43. <option value="Lamination">Lamination</option>
  44. <option value="Bag Tags">Bag Tags</option>
  45. <option value="Notary Public">Notary Public</option>
  46. <option value="Scan">Scan</option>
  47. </select>
  48. </div>
  49.  
  50.  
  51.  
  52.  
  53. <div class="form-group">
  54. <label for="text">Item Quantity</label>
  55. <input type="text" class="form-control" id="itemquantity" name="itemquantity">
  56. </div>
  57. <div class="form-group">
  58. <label for="text">Is Hidden</label>
  59. <input type="text" class="form-control" id="ishidden" name="ishidden">
  60. </div>
  61. <div class="form-group">
  62. <label for="text">Item Price</label>
  63. <input type="text" class="form-control" id="itemprice" name="itemprice">
  64. </div>
  65.  
  66.  
  67. <button type="submit" class="btn btn-default userTrans">Submit</button>
  68. </form>
  69.  
  70.  
  71.  
  72. <?
  73. foreach ( $stmt as $rowItemz ){
  74. ?>
  75. <h3 class="section-heading">Modifying Item: <?=$rowItemz->title;?></h3>
  76. <form role="form" method="POST" class="userTrans">
  77. <input type="hidden" value="itemUpdate" name="act_userTrans">
  78.  
  79. <div class="form-group">
  80. <label for="title">Title:</label>
  81. <input type="text" class="form-control" id="title" name="title" value="<?=$rowItemz->title;?>">
  82. </div>
  83.  
  84. <div class="form-group">
  85. <label for="ctg">Category:</label>
  86. <select class="form-control" id="ctg" name="ctg">
  87. <option value="0" <?php if($rowItemz->ItemCategory==0) echo "selected";?>>Item Category 0</option>
  88. <option value="1" <?php if($rowItemz->ItemCategory==1) echo "selected";?>>Item Category 1</option>
  89. <option value="2" <?php if($rowItemz->ItemCategory==2) echo "selected";?>>Item Category 2</option>
  90. <option value="3" <?php if($rowItemz->ItemCategory==3) echo "selected";?>>Item Category 3</option>
  91. </select> <!--add more categs-->
  92. </div>
  93.  
  94.  
  95. <button type="submit" class="btn btn-default userTrans">Submit</button>
  96. </form>
  97. <?}?>
  98.  
  99.  
  100.  
  101. <BR>
  102. <div class="panel panel-default">
  103. <!-- Default panel contents -->
  104. <div class="panel-heading">Item List</div>
  105.  
  106. <!-- Table -->
  107. <table class="table bg-dark">
  108. <thead>
  109. <tr>
  110. <th>#</th>
  111. <th>Item Name</th>
  112. <th>Item Category</th>
  113. <th>Item Price</th>
  114. <th>Item Quantity</th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <?php if($_GET['do']==NULL){?>
  119. </form>
  120. <?}?>
  121. <?php if($_GET['do']=="update"){
  122. $id = (int)$_GET['id'];
  123. $stmt = $user_home->getItemDetail($id);
  124. if($stmt->rowCount()>0){
  125. ?>
  126. <?
  127. foreach ( $stmt as $row ){
  128. ?>
  129.  
  130.  
  131.  
  132.  
  133. </form>
  134. <?}}}?>
  135.  
  136.  
  137.  
  138.  
  139. <?php
  140. $stmt = $user_home->getItemList();
  141.  
  142. if($stmt->rowCount()>0){
  143. ?>
  144. <?
  145. foreach ( $stmt as $row ){
  146.  
  147. ?>
  148. <tr>
  149. <th scope="row"><?echo $row->itemID?></th>
  150. <td><?echo $row->ItemName?></td>
  151. <td><?echo $row->ItemCategory?></td>
  152. <td><?echo $row->ItemPrice?></td>
  153. <td><?echo $row->ItemQuantity?></td>
  154. <td><a href="?p=adminpanel&action=item&do=update&id=<?echo $row->itemID?>">Edit</a> /
  155. <form method="POST" class="userTransdoConfirm">
  156. <input type="hidden" value="doDeleteItem" name="act_userTrans">
  157. <input type="hidden" value="<?echo $row->itemID?>" name="id">
  158. <button class='button' style='background-color: #B1221C;'><strong>Delete</strong></button>
  159. </form>
  160. </td> </tr>
  161. <?
  162. }
  163. }
  164.  
  165. ?>
  166. </tbody> </table>
  167. </div>
  168.  
  169. </div>
  170. </div>
  171. <?php } ?>
  172.  
  173. <!-- TESTERS-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement