Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. <div class="row">
  2. <!-- Left Box -->
  3. <div class="col-lg-6 col-sm-6" style="padding-right:15px; padding-left:0px">
  4. <div class="well" style="height: 300px;">
  5. <h2 style="text-align:center; font-size:8em;">
  6. <div id="SubmittedOrders"></div>
  7. </h2>
  8. <p style="text-align:center; font-size:1.5em;">Outstanding Orders</p>
  9. </div>
  10. </div>
  11. <!-- Right Box -->
  12.  
  13. <div class="col-lg-6 col-sm-6" style="padding-left:15px; padding-right:0px">
  14. <div class="well" style="height: 300px;">
  15. <h2 style="text-align:center; font-size:8em;">
  16. <div id ="OrderFulfilled"></div>
  17. </h2>
  18. <p style="text-align:center; font-size:1.5em;">Orders fulfiled today</p>
  19. </div>
  20. </div>
  21.  
  22. </div>
  23.  
  24. function getOrderStatus() {
  25.  
  26. ?>
  27.  
  28. <script>
  29. // IE5/6 support
  30.  
  31. function ajax_loop() {
  32.  
  33. if (window.XMLHttpRequest) {
  34. xmlhttp=new XMLHttpRequest();
  35. } else {
  36. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  37. }
  38.  
  39. // Create function for handling AJAX response
  40. // Set dashboard div's contents to the response for Submitted Orders
  41. xmlhttp.onreadystatechange=function() {
  42. if (xmlhttp.readyState==4 && xmlhttp.status==200) {
  43. document.getElementById("SubmittedOrders").innerHTML = xmlhttp.responseText;
  44. setTimeout(ajax_loop, 1000);
  45. }
  46. }
  47.  
  48. // Send AJAX request
  49. xmlhttp.open("POST","getOrderStatus.php");
  50. xmlhttp.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
  51. xmlhttp.send("action=update");
  52.  
  53. }
  54.  
  55. ajax_loop();
  56.  
  57. </script>
  58.  
  59. <?php
  60.  
  61. }
  62.  
  63. <?php
  64. // Query users table
  65. $sql = "SELECT COUNT(STATUS) from CE_TRANSACTIONS where STATUS = 0;";
  66.  
  67. // Execute query
  68. $result = mysqli_query( $link, $sql );
  69.  
  70. // Loop through rows and draw table
  71.  
  72. while ( $row = mysqli_fetch_assoc($result) ) {
  73.  
  74. foreach ( $row as $field ) {
  75. echo "$field";
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement