Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['action'])) {
- switch ($_POST['action']) {
- case 'insert':
- insert();
- break;
- }
- }
- $tabindex=1;
- function insert() {
- $data['username']='outthinking781346';
- $data['password']='ouhk78epe34csmed46d';
- $data['awb']=$orderid;
- $data = json_decode(stripslashes($_POST['data']));
- foreach($data as $id){
- $orderid = $id;
- $response = array();
- $url = 'https://plapi.ecomexpress.in/track_me/api/mawbd/?awb=awbnumber&order='.$orderid.'&username=outthinking781346&password=ouhk78epe34csmed46d';
- $ch = curl_init();
- $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);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- $output = curl_exec ($ch);
- curl_close($ch);
- $res = explode("\n",$output);
- if ( ! isset($res[13]))
- {
- $res[13] = null;
- }
- $status = str_replace('</field>.','',$res[13]);
- $statusfinal = str_replace('<field type="CharField" name="status">','',$status);
- if($statusfinal!='')
- {
- $sqlecom = "UPDATE do_order set in_transit='".$statusfinal.".',tconformed_by='Ecom' where order_id=".$orderid;
- $db_handleecom = new DBController();
- $resultecom = $db_handleecom->executeUpdate($sqlecom);
- }
- // store the responce in array
- $response[$orderid] = $statusfinal;
- return $response;
- }
- }
- exit;
- ?>
Add Comment
Please, Sign In to add comment