Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.12 KB | None | 0 0
  1. <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
  2. <thead>
  3. <tr>
  4. <th>Customer Email</th>
  5. <th>Shipping Company</th>
  6. <th>Delivery Date</th>
  7. <th>Tracking ID</th>
  8. <th>Destination Address</th>
  9. <th>Destination ZIP</th>
  10. <th>Mark As Recieved</th>
  11.  
  12. </tr>
  13. </thead>
  14. <tbody>
  15. <?php
  16. require('config.php');
  17. $conn = new PDO("mysql:host=".$DB_HOST.";dbname=".$DB_NAME,$DB_USER,$DB_PASS);
  18. $sql = "SELECT * FROM packages_to_be_shipped_on_bremail_address";
  19.  
  20. $q = $conn->prepare($sql);
  21. $q->execute();
  22.  
  23. $q->bindColumn(2, $custemail);
  24. $q->bindColumn(3, $shipcompany);
  25. $q->bindColumn(4, $deliverydate);
  26. $q->bindColumn(5, $trackingid);
  27. $q->bindColumn(6, $destaddress);
  28. $q->bindColumn(7, $destzip);
  29. $q->bindColumn(8, $status);
  30.  
  31. while($q->fetch()){
  32. ?>
  33. <tr class="odd gradeX">
  34. <td><?php echo $custemail ; ?></td>
  35. <td><?php echo $shipcompany; ?></td>
  36. <td><?php echo $deliverydate; ?></td>
  37. <td><?php echo $trackingid; ?></td>
  38. <td><?php echo $destaddress; ?></td>
  39. <td><?php echo $destzip; ?></td>
  40. <td>
  41. <?php
  42. if($status == "Pending") {
  43. echo "
  44. <form action='#' method='post' name='updatestatus'>
  45. <input type='submit' name='submit' value='Mark As Recieved' />
  46. </form>
  47. ";
  48. }
  49. else {
  50. echo "Recieved";
  51. }
  52. }
  53. ?>
  54. </td>
  55. </tr>
  56. <?php
  57. $status = "Recieved";
  58. if(isset($_POST['submit'])){
  59. while($q->fetch()) {
  60. $sql = "UPDATE packages_to_be_shipped_on_bremail_address SET status=? WHERE cust_email=?";
  61. $q = $conn->prepare($sql);
  62. $q->execute(array($status,$custemail));
  63. header('Location:cust_orders.php');
  64. }
  65. }
  66. ?>
  67. </tbody>
  68. </table>
  69.  
  70. <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
  71. <thead>
  72. <tr>
  73. <th>Customer Email</th>
  74. <th>Shipping Company</th>
  75. <th>Delivery Date</th>
  76. <th>Tracking ID</th>
  77. <th>Destination Address</th>
  78. <th>Destination ZIP</th>
  79. <th>Mark As Recieved</th>
  80.  
  81. </tr>
  82. </thead>
  83. <tbody>
  84. <?php
  85. require('config.php');
  86. $conn = new PDO("mysql:host=".$DB_HOST.";dbname=".$DB_NAME,$DB_USER,$DB_PASS);
  87. $sql = "SELECT * FROM packages_to_be_shipped_on_bremail_address";
  88.  
  89. $q = $conn->prepare($sql);
  90. $q->execute();
  91.  
  92. $q->bindColumn(1, $pid);
  93. $q->bindColumn(2, $custemail);
  94. $q->bindColumn(3, $shipcompany);
  95. $q->bindColumn(4, $deliverydate);
  96. $q->bindColumn(5, $trackingid);
  97. $q->bindColumn(6, $destaddress);
  98. $q->bindColumn(7, $destzip);
  99. $q->bindColumn(8, $status);
  100.  
  101. while($q->fetch()){
  102. ?>
  103. <tr class="odd gradeX">
  104. <td><?php echo $custemail ; ?></td>
  105. <td><?php echo $shipcompany; ?></td>
  106. <td><?php echo $deliverydate; ?></td>
  107. <td><?php echo $trackingid; ?></td>
  108. <td><?php echo $destaddress; ?></td>
  109. <td><?php echo $destzip; ?></td>
  110. <td>
  111. <?php
  112. if($status == "Pending") {
  113. echo "
  114. <form action='#' method='post' name='updatestatus'>
  115. <input type='hidden' name='pid' value='$pid'>
  116. <input class='btn btn-inverse' type='submit' name='submit' value='Mark As Recieved'><i class='icon-refresh icon-white'></i></input>
  117. </form>
  118. ";
  119. }
  120. else {
  121. echo "Recieved";
  122. }
  123. }
  124. ?>
  125. </td>
  126. </tr>
  127. <?php
  128. $status = "Recieved";
  129. if(isset($_POST['submit'])){
  130. $sql = "UPDATE packages_to_be_shipped_on_bremail_address SET status=? WHERE package_id=?";
  131. $q = $conn->prepare($sql);
  132. $q->execute(array($status,$_POST['pid']));
  133. header('Location:cust_orders.php');
  134. }
  135. ?>
  136. </tbody>
  137. </table>
  138.  
  139. <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
  140. <thead>
  141. <tr>
  142. <th>Customer Email</th>
  143. <th>Shipping Company</th>
  144. <th>Delivery Date</th>
  145. <th>Tracking ID</th>
  146. <th>Destination Address</th>
  147. <th>Destination ZIP</th>
  148. <th>Mark As Recieved</th>
  149.  
  150. </tr>
  151. </thead>
  152. <tbody>
  153. <?php
  154. require('config.php');
  155. $conn = new PDO("mysql:host=".$DB_HOST.";dbname=".$DB_NAME,$DB_USER,$DB_PASS);
  156. $sql = "SELECT * FROM packages_to_be_shipped_on_bremail_address";
  157.  
  158. $q = $conn->prepare($sql);
  159. $q->execute();
  160.  
  161. $q->bindColumn(2, $custemail);
  162. $q->bindColumn(3, $shipcompany);
  163. $q->bindColumn(4, $deliverydate);
  164. $q->bindColumn(5, $trackingid);
  165. $q->bindColumn(6, $destaddress);
  166. $q->bindColumn(7, $destzip);
  167. $q->bindColumn(8, $status);
  168.  
  169. while($q->fetch()){
  170. ?>
  171. <tr class="odd gradeX">
  172. <td><?php echo $custemail ; ?></td>
  173. <td><?php echo $shipcompany; ?></td>
  174. <td><?php echo $deliverydate; ?></td>
  175. <td><?php echo $trackingid; ?></td>
  176. <td><?php echo $destaddress; ?></td>
  177. <td><?php echo $destzip; ?></td>
  178. <td>
  179. <?php
  180. if($status == "Pending") {
  181. echo "
  182. <form action='#' method='post' name='updatestatus'>
  183. <input type='submit' name='submit' value='Mark As Recieved' />
  184. <input type='hidden' name='cust_email' value='<?php echo $custemail; ?>' />
  185. </form>
  186. ";
  187. }
  188. else {
  189. echo "Recieved";
  190. }
  191. }
  192. ?>
  193. </td>
  194. </tr>
  195. <?php
  196. $status = "Recieved";
  197. if(isset($_POST['submit'])){
  198. while($q->fetch()) {
  199. $sql = "UPDATE packages_to_be_shipped_on_bremail_address SET status=? WHERE cust_email=?";
  200. $q = $conn->prepare($sql);
  201. $q->execute(array($status,$_POST['cust_email']));
  202. header('Location:cust_orders.php');
  203. }
  204. }
  205. ?>
  206. </tbody>
  207.  
  208. <form action='#' method='post' name='updatestatus'>
  209. <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
  210. <thead>
  211. <tr>
  212. <th>Customer Email</th>
  213. <th>Shipping Company</th>
  214. <th>Delivery Date</th>
  215. <th>Tracking ID</th>
  216. <th>Destination Address</th>
  217. <th>Destination ZIP</th>
  218. <th>Mark As Recieved</th>
  219.  
  220. </tr>
  221. </thead>
  222. <tbody>
  223. <?php
  224. require('config.php');
  225. $conn = new PDO("mysql:host=".$DB_HOST.";dbname=".$DB_NAME,$DB_USER,$DB_PASS);
  226. $sql = "SELECT * FROM packages_to_be_shipped_on_bremail_address";
  227.  
  228. $q = $conn->prepare($sql);
  229. $q->execute();
  230.  
  231. $q->bindColumn(2, $custemail);
  232. $q->bindColumn(3, $shipcompany);
  233. $q->bindColumn(4, $deliverydate);
  234. $q->bindColumn(5, $trackingid);
  235. $q->bindColumn(6, $destaddress);
  236. $q->bindColumn(7, $destzip);
  237. $q->bindColumn(8, $status);
  238.  
  239. while($q->fetch()){
  240. ?
  241. <tr class="odd gradeX">
  242. <td><?php echo $custemail ; ?></td>
  243. <td><?php echo $shipcompany; ?></td>
  244. <td><?php echo $deliverydate; ?></td>
  245. <td><?php echo $trackingid; ?></td>
  246. <td><?php echo $destaddress; ?></td>
  247. <td><?php echo $destzip; ?></td>
  248. <td>
  249. <?php
  250. if($status == "Pending") {
  251. echo "
  252. <input type='checkbox' name='cust_email[]' value='<?php echo $custemail; ?>' />
  253. ";
  254. }
  255. else {
  256. echo "Recieved";
  257. }
  258. }
  259. ?>
  260. </td>
  261. </tr>
  262. <tr class="odd gradeX">
  263. <td colspan="7">
  264. <input type='submit' name='submit' value='Mark As Recieved' />
  265. </td>
  266. <tr>
  267. </tbody></table></form>
  268. <?php
  269. $status = "Recieved";
  270. if(isset($_POST['submit'])){
  271. while($q->fetch()) {
  272. $sql = "UPDATE packages_to_be_shipped_on_bremail_address SET status=? WHERE cust_email=?";
  273. $q = $conn->prepare($sql);
  274. foreach($_POST['cust_email'] as $cust_email)
  275. $q->execute(array($status,$cust_email));
  276. header('Location:cust_orders.php');
  277. }
  278. }
  279. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement