<?php
defined('BASEPATH') OR exit('No direct script access allowed');
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED);
session_start();
class Ws_Client extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->library('session');
$this->load->helper('url');
$this->load->model('token/token_model','tkn');
}
public function index()
{
$token = $this->tkn->token_feeder();
echo $token;
}
public function client()
{
$token = $this->tkn->token_feeder();
$filter = '';
$order = '';
$limit = 100;
$offset = 0;
$myProfil = array('act'=>'GetMatkulKurikulum', 'token'=>$token, 'filter'=>$filter, 'order'=>$order, 'limit'=>$limit, 'offset'=>$offset);
$profil_pt = json_encode($myProfil);
$ch = curl_init('http://192.168.30.99:8082/ws/live2.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $profil_pt);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($profil_pt))
);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($profil_pt)));
$result_profil = curl_exec($ch);
//echo json_encode($result_profil);
echo $result_profil;
curl_close($ch);
}
}
defined('BASEPATH') OR exit('No direct script access allowed');
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED);
session_start();
class Ws_Client extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->library('session');
$this->load->helper('url');
$this->load->model('token/token_model','tkn');
}
public function index()
{
$token = $this->tkn->token_feeder();
echo $token;
}
public function client()
{
$token = $this->tkn->token_feeder();
$filter = '';
$order = '';
$limit = 100;
$offset = 0;
$myProfil = array('act'=>'GetMatkulKurikulum', 'token'=>$token, 'filter'=>$filter, 'order'=>$order, 'limit'=>$limit, 'offset'=>$offset);
$profil_pt = json_encode($myProfil);
$ch = curl_init('http://192.168.30.99:8082/ws/live2.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $profil_pt);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($profil_pt))
);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($profil_pt)));
$result_profil = curl_exec($ch);
//echo json_encode($result_profil);
echo $result_profil;
curl_close($ch);
}
}
Comments
Post a Comment