application/controllers/Logistics.php
/*
    * It Fetches the products data from the product table 
    * this function is called from the datatable ajax function
    */
It Fetches the products data from the product table
this function is called from the datatable ajax function
It Fetches the products data from the product table this function is called from the datatable ajax function
public function fetchAssetData()
		{
			$curl = curl_init();
			curl_setopt_array($curl, array(
			CURLOPT_URL => API_URL."/api/queryAllAssets",
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_ENCODING => "",
			CURLOPT_MAXREDIRS => 10,
			CURLOPT_TIMEOUT => 0,
			CURLOPT_FOLLOWLOCATION => true,
			CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
			CURLOPT_CUSTOMREQUEST => "GET",
			CURLOPT_POSTFIELDS =>"Test",
			CURLOPT_HTTPHEADER => array("Content-Type: application/javascript"),
			));
			$response = curl_exec($curl);
			curl_close($curl);
			$response = json_decode($response, true);
			$response1 = json_decode($response['response'],true);
			$newdata = array();
			for($i = 0; $i < count($response1); $i++)
			{
				$newdata[$response1[$i]["Key"]]=$i;				
			}
			$newdata1 = array();			
			$newId = 0;
			for($i = 0; $i < count($response1); $i++)
			{
				$checkVars = array("PaFSendToLsp","LspSendToWh" ,"WhSendToPh", "PhSellToCo","HandoffToLogistics");
				If (in_array($response1[$newdata[$i+1]]["Record"]["AssetStatus"],$checkVars,true)) {
					$newdata1[$newId] = ($response1[$newdata[$i+1]]["Record"]);
					$newId = $newId+1;
				}
			}
			$this->data['DataTab']=$newdata1; 					
			$this->render_template('logistics/index', $this->data);
		}
public function fetchAssetData ( ) { $ curl = curl_init ( ) ; curl_setopt_array ( $ curl , array ( CURLOPT_URL => API_URL . " /api/queryAllAssets " , CURLOPT_RETURNTRANSFER => true , CURLOPT_ENCODING => " " , CURLOPT_MAXREDIRS => 10 , CURLOPT_TIMEOUT => 0 , CURLOPT_FOLLOWLOCATION => true , CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 , CURLOPT_CUSTOMREQUEST => " GET " , CURLOPT_POSTFIELDS => " Test " , CURLOPT_HTTPHEADER => array ( " Content-Type: application/javascript " ) , ) ) ; $ response = curl_exec ( $ curl ) ; curl_close ( $ curl ) ; $ response = json_decode ( $ response , true ) ; $ response1 = json_decode ( $ response [ 'response' ] , true ) ; $ newdata = array ( ) ; for ( $ i = 0 ; $ i < count ( $ response1 ) ; $ i ++ ) { $ newdata [ $ response1 [ $ i ] [ " Key " ] ] = $ i ; } $ newdata1 = array ( ) ; $ newId = 0 ; for ( $ i = 0 ; $ i < count ( $ response1 ) ; $ i ++ ) { $ checkVars = array ( " PaFSendToLsp " , " LspSendToWh " , " WhSendToPh " , " PhSellToCo " , " HandoffToLogistics " ) ; If ( in_array ( $ response1 [ $ newdata [ $ i + 1 ] ] [ " Record " ] [ " AssetStatus " ] , $ checkVars , true ) ) { $ newdata1 [ $ newId ] = ( $ response1 [ $ newdata [ $ i + 1 ] ] [ " Record " ] ) ; $ newId = $ newId + 1 ; } } $ this -> data [ 'DataTab' ] = $ newdata1 ; $ this -> render_template ( 'logistics/index' , $ this -> data ) ; }
It Fetches the products data from the product table
 this function is called from the datatable ajax function
It Fetches the products data from the product table this function is called from the datatable ajax function
// Sorting // 2 MfgSendToQC  - User-1 Manufacturer 	// 3 QcSendsToPaF - User-2 QC  // 4 PaFSendToLsp - User-1 Manufacturer 	// 5 LspSendToWh  - User-3 Logistics  // 6 WhSendToPh   - User-4 Wholesaler 	// 7 PhSellToCo   - User-5 Pharmacy		 //echo "<pre>"; print_r($this->data); exit();