Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- close tool content -->
- <div style="clear:both;"></div>
- <div id="LeadManager" class="">
- <h3><?php echo $usertype;?></h3>ORDER DATE
- <?php
- $userToSearch='';
- if(isset($_POST['searchOrder']) && $_POST['searchOrder']!='')
- {
- if($logintype==2)
- {
- $userToSearch = "WHERE ready_to_packaging='Conformed' AND ready_to_dispatch IS NULL";
- }else{
- $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)";
- }
- }
- else
- {
- if($logintype==2 && $userdepart==4){
- $userToSearch = "WHERE ready_to_dispatch IS NULL AND sconformed_by LIKE '%".$loginuser."%' AND ready_to_packaging='Conformed'";
- }else{
- $userToSearch = "WHERE (ready_to_dispatch LIKE '%%' OR ready_to_dispatch IS NULL) AND ready_to_packaging='Conformed'";
- }
- }
- $sqlresultdoorder = "SELECT * from do_order ".$userToSearch;
- $resultdoorder = $db_handle->runSelectQuery($sqlresultdoorder);
- $numrows =count($resultdoorder);
- $rows_per_page = 10;
- $lastpage= ceil($numrows/$rows_per_page);
- $pageno = (int)$pageno;
- if ($pageno > $lastpage) {
- $pageno = $lastpage;
- } // if
- if ($pageno < 1) {
- $pageno = 1;
- }
- $limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
- $sqlresult = "SELECT * from do_order ".$userToSearch." ORDER BY id DESC ".$limit;
- $orderrecords = $db_handle->runSelectQuery($sqlresult);
- ?>
- <table class="tbl-qa" border="1">
- <thead>
- <tr>
- <th class="table-header">ID</th>
- <th class="table-header">ORDERID</th>
- <th class="table-header">Status</th>
- </tr>
- </thead>
- <tbody id="table-body">
- <?php
- $tabindex=1;
- if(!empty($orderrecords))
- {
- foreach($orderrecords as $k=>$v)
- {
- ?>
- <?php
- $hide = '';
- $data['username']='outthinking781346';
- $data['password']='ouhk78epe34csmed46d';
- $data['awb']='890927143';
- $url = 'https://plapi.ecomexpress.in/track_me/api/mawbd/?awb=awbnumber&order='.$orderrecords[$k]["order_id"].'&username=outthinking781346&password=ouhk78epe34csmed46d';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $output = curl_exec ($ch); // execute
- curl_close($ch);
- $res = explode("\n",$output);
- //$status = $res[13];
- if ( ! isset($res[13])) {
- $res[13] = null;
- }
- $status = $res[13];
- //if(strstr($status, "Undelivered") !== false || strstr($status, "Delivered / Closed") !== false )
- if(strstr($status, "Undelivered") !== false ||
- // $status == ""||
- trim($status)==""
- strstr($status, "Delivered / Closed") !== false
- )
- {
- $hide .= 'style="display: none;"';
- }
- ?>
- <tr value="" <?php echo $hide;?> class="table-row" id="table-row-<?php echo $orderrecords[$k]["id"]; ?>" tabindex="<?php echo $tabindex;?>">
- <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>
- <td>
- <?php echo $orderrecords[$k]["order_id"]; ?>
- </td>
- <td><?php echo $status;?></td>
- </tr>
- <?php
- $tabindex++;
- }
- }?>
- </tbody>
- </table>
Add Comment
Please, Sign In to add comment