Guest User

vgfrgfrg

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