Guest User

fef

a guest
Feb 20th, 2018
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. <!-- close tool content -->
  2. <div style="clear:both;"></div>
  3. <div id="LeadManager" class="">
  4. <h3><?php echo $usertype;?></h3>ORDER DATE
  5. <?php
  6. $userToSearch='';
  7.  
  8.  
  9.  
  10.  
  11. if(isset($_POST['searchOrder']) && $_POST['searchOrder']!='')
  12. {
  13. if($logintype==2)
  14. {
  15. $userToSearch = "WHERE ready_to_packaging='Conformed' AND ready_to_dispatch IS NULL";
  16. }else{
  17. $userToSearch = "WHERE (sconformed_by LIKE '%%' OR sconformed_by IS NULL) AND ready_to_packaging='Conformed' AND (ready_to_dispatch LIKE '%%' OR ready_to_dispatch IS NULL)";
  18. }
  19. }
  20. else
  21. {
  22. if($logintype==2 && $userdepart==4){
  23. $userToSearch = "WHERE ready_to_dispatch IS NULL AND sconformed_by LIKE '%".$loginuser."%' AND ready_to_packaging='Conformed'";
  24. }else{
  25. $userToSearch = "WHERE (ready_to_dispatch LIKE '%%' OR ready_to_dispatch IS NULL) AND ready_to_packaging='Conformed'";
  26. }
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. $sqlresultdoorder = "SELECT * from do_order ".$userToSearch;
  35. $resultdoorder = $db_handle->runSelectQuery($sqlresultdoorder);
  36. $numrows =count($resultdoorder);
  37. $rows_per_page = 10;
  38. $lastpage= ceil($numrows/$rows_per_page);
  39. $pageno = (int)$pageno;
  40. if ($pageno > $lastpage) {
  41. $pageno = $lastpage;
  42. } // if
  43. if ($pageno < 1) {
  44. $pageno = 1;
  45. }
  46. $limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
  47. $sqlresult = "SELECT * from do_order ".$userToSearch." ORDER BY id DESC ".$limit;
  48. $orderrecords = $db_handle->runSelectQuery($sqlresult);
  49. ?>
  50. <table class="tbl-qa" border="1">
  51. <thead>
  52. <tr>
  53. <th class="table-header">ID</th>
  54. <th class="table-header">ORDERID</th>
  55. <th class="table-header">Status</th>
  56. </tr>
  57. </thead>
  58. <tbody id="table-body">
  59.  
  60.  
  61.  
  62. <?php
  63. $tabindex=1;
  64. if(!empty($orderrecords))
  65. {
  66. foreach($orderrecords as $k=>$v)
  67. {
  68.  
  69.  
  70. ?>
  71.  
  72. <?php
  73. $hide = '';
  74. $data['username']='outthinking781346';
  75. $data['password']='ouhk78epe34csmed46d';
  76. $data['awb']='890927143';
  77.  
  78. $url = 'https://plapi.ecomexpress.in/track_me/api/mawbd/?awb=awbnumber&order='.$orderrecords[$k]["order_id"].'&username=outthinking781346&password=ouhk78epe34csmed46d';
  79.  
  80. $ch = curl_init(); // initiate curl
  81. curl_setopt($ch, CURLOPT_URL,$url);
  82. curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something
  83. curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // define what you want to post
  84. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
  85. $output = curl_exec ($ch); // execute
  86.  
  87.  
  88. curl_close($ch);
  89.  
  90. $res = explode("\n",$output);
  91. //$status = $res[13];
  92. if ( ! isset($res[13])) {
  93. $res[13] = null;
  94. }
  95.  
  96. $status = $res[13];
  97.  
  98. if ($status == "" || strstr($status, "Delivered / Closed")|| strstr($status, "Undelivered") || (isset($_POST['searchOrder']) && $_POST['searchOrder']!=''))
  99.  
  100. {
  101. $userToSearch = "WHERE in_transit='Conformed'";
  102. $hide .= 'style="display: none;"';
  103. }
  104.  
  105. echo $userToSearch;
  106. ?>
  107.  
  108.  
  109.  
  110.  
  111.  
  112. <tr value="" <?php echo $hide;?> class="table-row" id="table-row-<?php echo $orderrecords[$k]["id"]; ?>" tabindex="<?php echo $tabindex;?>">
  113.  
  114. <td><input type="checkbox" onclick="assignorderids('<?php echo $orderrecords[$k]["order_id"]; ?>')" name="assigneeid" id="assigneeid-<?php echo $orderrecords[$k]["order_id"]; ?>" value="<?php echo $orderrecords[$k]["order_id"]; ?>"></td>
  115.  
  116. <td>
  117.  
  118. <?php echo $orderrecords[$k]["order_id"]; ?>
  119.  
  120. </td>
  121.  
  122. <td><?php echo $status;?></td>
  123.  
  124. </tr>
  125. <?php
  126. $tabindex++;
  127. }
  128. }?>
  129. </tbody>
  130. </table>
Add Comment
Please, Sign In to add comment