first commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Agent extends Agent_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$in['limit'] = 5;
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['today_list'] = $out['result_list'];
|
||||
//echo $out['status'];
|
||||
//print_r($out);
|
||||
|
||||
$this->renderAgentPage('view_agent_dash', $data);
|
||||
}
|
||||
|
||||
public function calendar() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
|
||||
$in['limit'] = 30;
|
||||
$in["transport_id"] = 0;
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
|
||||
$data['page_name'] = "Transport Calendar";
|
||||
$this->renderAgentPage('view_agent_calendar', $data);
|
||||
}
|
||||
|
||||
public function profile() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
$data['page_name'] = "My Profile";
|
||||
$this->renderAgentPage('view_agent_profile', $data);
|
||||
}
|
||||
|
||||
public function mylog() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
$data['page_name'] = "Activity Logs";
|
||||
$this->renderAgentPage('view_agent_mylog', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Dash extends Agent_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data = $this->indexPageReal(array());
|
||||
|
||||
$this->load->library('googlemaps');
|
||||
$config['center'] = 'atalnta,GA,USA';
|
||||
$config['zoom'] = 'auto';
|
||||
$config['directions'] = TRUE;
|
||||
$config['directionsStart'] = '4201 defoors farm trail, powder springs, GA 30127, USA';
|
||||
$config['directionsEnd'] = '2324 stancrest ln, lawrenceville, 30044, GA, USA';
|
||||
$config['directionsDivID'] = 'directionsDiv';
|
||||
$this->googlemaps->initialize($config);
|
||||
$data['map'] = $this->googlemaps->create_map();
|
||||
|
||||
$this->renderAgentPage('view_agent_dash', $data);
|
||||
}
|
||||
|
||||
public function indexPage() {
|
||||
$data = $this->indexPageReal(array());
|
||||
$data['do_not_script'] = true;
|
||||
$this->load->view('agent/extra/transport_list', $data);
|
||||
}
|
||||
|
||||
private function indexPageRealDELETE($data) {
|
||||
$data['do_not_script'] = false;
|
||||
$data['pageNumber'] = $this->input->get('pageNumber');
|
||||
if ($data['pageNumber']=='' || $data['pageNumber']<1) $data['pageNumber'] = 1;
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 30;
|
||||
$in["transport_id"] = 0;
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
|
||||
$data['result_per_page'] = 10;
|
||||
$data['result_total'] = count($out['result_list']);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$pages = ceil(1.0*$data['result_total']/$data['result_per_page']);
|
||||
if ($data['pageNumber']>$pages) $data['pageNumber'] = 1;
|
||||
|
||||
$offset = $data['result_per_page'] * ($data['pageNumber'] - 1);
|
||||
$data['result_list'] = array_slice($out['result_list'],$offset,$data['result_per_page']);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function transp_modal() {
|
||||
// $data = $this->getSessionArray();
|
||||
$data['transport_id'] = trim($this->input->get('transport_id'));
|
||||
|
||||
if ($data["transport_id"] != '' and $data["transport_id"] > 0) {
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 30;
|
||||
$in["transport_id"] = $data["transport_id"];
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['selected_transport'] = $out['result_list'];
|
||||
$data['transport_data'] = $data['selected_transport'][0];
|
||||
|
||||
$out = $this->makeGoogleAddress($data['transport_data']);
|
||||
$this->load->library('googlemaps');
|
||||
$config['center'] = 'atlanta,GA,USA';
|
||||
$config['zoom'] = 'auto';
|
||||
$config['directions'] = TRUE;
|
||||
$config['directionsStart'] = $out['directionsStart']; //'4201 defoors farm trail, powder springs, GA 30127, USA';
|
||||
$config['directionsEnd'] = $out['directionsEnd']; //'2324 stancrest ln, lawrenceville, 30044, GA, USA';
|
||||
$config['directionsDivID'] = 'directionsDiv';
|
||||
$this->googlemaps->initialize($config);
|
||||
$data['map'] = $this->googlemaps->create_map();
|
||||
|
||||
$data['directionsStart'] = $out['directionsStart'];
|
||||
$data['directionsEnd'] = $out['directionsEnd'];
|
||||
// $lat_long = get_lat_long_from_address($config['center']);
|
||||
// $data['latCenter'] = $lat_long[0];
|
||||
// $data['longCenter'] = $lat_long[1];
|
||||
// $data['transport_request_id'] = $transport_request_id;
|
||||
$this->load->view('agent/modals/view_dash_modal', $data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Login extends AGT_Controller {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data['action_message'] = '';
|
||||
|
||||
// temporary data to fix all aspect
|
||||
$data['username'] = 'ses66181+agent456@gmail.com';
|
||||
$data['password'] = 'agentpass';
|
||||
|
||||
|
||||
if ($this->input->post()) {
|
||||
// echo 'ameye';
|
||||
$valid_entry = false;
|
||||
$username = $password = $error_message = '';
|
||||
$this->testLoginInput($username, $password, $error_message, $valid_entry);
|
||||
if ($valid_entry == true) {
|
||||
$in['username'] = $username;
|
||||
$in['password'] = $password;
|
||||
$in['action'] = MEDTRANS_TRANSP_LOGIN;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_LOGIN, $in, $out);
|
||||
//print_r($out);
|
||||
// echo $ret;
|
||||
// print_r($_SESSION);
|
||||
|
||||
if ($ret == PHP_LOGIN_OK) {
|
||||
$out = $this->populateAgentsession($out); // just for testing - will be removed
|
||||
// $this->buildUserSession($ret, $out);
|
||||
redirect('dash');
|
||||
} else {
|
||||
$data['action_message'] = $this->formatedMesage('ERROR', 'Invalid Username/Password');
|
||||
}
|
||||
} else {
|
||||
|
||||
$data['action_message'] = $this->formatedMesage('ERROR', $error_message);
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->view('user/view_login', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Logout extends AGT_Controller {
|
||||
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->load->view('home/start_page');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Paymnt extends Agent_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$in['limit'] = 5;
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['today_list'] = $out['result_list'];
|
||||
//echo $out['status'];
|
||||
//print_r($out);
|
||||
|
||||
$this->renderAgentPage('view_agent_dash', $data);
|
||||
}
|
||||
|
||||
public function calendar() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
|
||||
$this->renderAgentPage('view_agent_calendar', $data);
|
||||
}
|
||||
|
||||
public function profile() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
|
||||
$this->renderAgentPage('view_agent_profile', $data);
|
||||
}
|
||||
|
||||
|
||||
public function mylog()
|
||||
{
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
|
||||
$this->renderAgentPage('view_agent_mylog', $data);
|
||||
|
||||
}
|
||||
|
||||
public function invoice()
|
||||
{
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
$data['page_name'] = "Pending Invoice";
|
||||
|
||||
$this->renderAgentPage('view_agent_pinvoice', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Report extends Agent_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$in['limit'] = 5;
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['today_list'] = $out['result_list'];
|
||||
//echo $out['status'];
|
||||
//print_r($out);
|
||||
|
||||
$this->renderAgentPage('view_agent_dash', $data);
|
||||
}
|
||||
|
||||
public function calendar() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
|
||||
$this->renderAgentPage('view_agent_calendar', $data);
|
||||
}
|
||||
|
||||
public function profile() {
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
|
||||
$this->renderAgentPage('view_agent_profile', $data);
|
||||
}
|
||||
|
||||
|
||||
public function mylog()
|
||||
{
|
||||
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
|
||||
|
||||
$this->renderAgentPage('view_agent_mylog', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Signup extends AGT_Controller {
|
||||
|
||||
public function index() {
|
||||
// https://www.codeigniter.com/userguide3/libraries/form_validation.html#form-validation-tutorial
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
//$this->form_validation->set_rules('username', 'Username', 'trim|required');
|
||||
$this->form_validation->set_rules('password', 'Password', 'trim|required', array('required' => 'You must provide a %s.')
|
||||
);
|
||||
$this->form_validation->set_rules('firstname', 'First name', 'trim|required');
|
||||
$this->form_validation->set_rules('lastname', 'Last name', 'trim|required');
|
||||
$this->form_validation->set_rules('agent_name', 'Agent, Transporter or Interpreter business name', 'trim|required');
|
||||
$this->form_validation->set_rules('tos', 'terms of service', 'trim|required', array('required' => 'You must accept the %s.')
|
||||
);
|
||||
$this->form_validation->set_rules('city', 'City', 'trim|required');
|
||||
$this->form_validation->set_rules('zipcode', 'Zip code', 'trim|required');
|
||||
$this->form_validation->set_rules('street', 'Business address', 'trim|required');
|
||||
$this->form_validation->set_rules('phone', 'Phone', 'trim|required');
|
||||
$this->form_validation->set_rules('username', 'Your Username - Email', 'trim|required|valid_email');
|
||||
$this->form_validation->set_rules('state', 'State', 'trim|required|min_length[2]');
|
||||
$this->form_validation->set_rules('agent_type', 'Account type', 'trim|required');
|
||||
|
||||
$data = array();
|
||||
$data['username'] = $data['password'] = $data['action_message'] = $data['firstname'] = $data['lastname'] = $data['agent_name'] = $data['tos'] = '';
|
||||
$data['city'] = $data['zipcode'] = $data['street'] = $data['phone'] = $data['state'] = $data['agent_type'] = '';
|
||||
|
||||
if ($this->input->post()) {
|
||||
|
||||
$data = $this->input->post();
|
||||
|
||||
if ($this->form_validation->run() == FALSE) {
|
||||
$data['action_message'] = $this->formatedMesage('signup', 'Invalid input, please correct the fields below');
|
||||
$this->load->view('user/view_signup', $data);
|
||||
} else {
|
||||
|
||||
$post = array(
|
||||
"email" => $data['username'],
|
||||
"agent_name" => $data['agent_name'],
|
||||
"firstname" => $data['firstname'],
|
||||
"lastname" => $data['lastname'],
|
||||
"street" => $data['street'],
|
||||
"city" => $data['city'],
|
||||
"zipcode" => $data['zipcode'],
|
||||
"state" => $data['state'],
|
||||
"country" => "US",
|
||||
"agent_type" => $data['agent_type'],
|
||||
"username" => $data['username'],
|
||||
"password" => $data['password'],
|
||||
"phone" => $data['phone'],
|
||||
"login" => 1
|
||||
);
|
||||
|
||||
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_CREATE, $post, $out); // call the API
|
||||
|
||||
if ($ret == PHP_LOGIN_OK) {
|
||||
$out = $this->populateAgentsession($out); // just for testing - will be removed
|
||||
// $this->buildUserSession($ret, $out);
|
||||
redirect('dash');
|
||||
} else {
|
||||
ob_start();
|
||||
//var_dump($response);
|
||||
$data['action_message'] = $this->formatedMesage('signup', ob_get_clean());
|
||||
$this->load->view('user/view_signup_success', $data);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
|
||||
// $data['action'] = MEDTRANS_TRANSP_LOGIN;
|
||||
// $out = array();
|
||||
// $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_CREATE, $data, $out);
|
||||
|
||||
// echo $ret;
|
||||
// echo "<hr size='1'>";
|
||||
// var_dump($out);
|
||||
|
||||
*
|
||||
$content = json_encode($post);
|
||||
$url = "https://oameye.extlayer.medtransgo.net/agent/createagent";
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
curl_close($curl);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
$data['action_message'] = $this->formatedMesage('signup',"Error: API call failed with the status $status, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
$this->load->view('user/view_signup', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
//ob_start();
|
||||
//var_dump($response);
|
||||
//$data['action_message'] = $this->formatedMesage('signup',ob_get_clean());
|
||||
//$this->load->view('user/view_signup_success', $data);
|
||||
|
||||
if ($response["internal_return"] == 100) {
|
||||
$out = $this->populateAgentsession($json_response); // just for testing - will be removed
|
||||
redirect('dash');
|
||||
}
|
||||
*/
|
||||
}
|
||||
} else {
|
||||
$this->load->view('user/view_signup', $data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vi:ts=2
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Site extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('home/start_page');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,603 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Transp extends Agent_Controller {
|
||||
|
||||
|
||||
public function traspsel() {
|
||||
$in["transport_id"] = $this->input->get('transport_id');
|
||||
|
||||
if ($in["transport_id"] != '' and $in["transport_id"] > 0) {
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 30;
|
||||
//$in["transport_id"] = 0;
|
||||
$in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
$data['selected_transport'] = $out['result_list'];
|
||||
|
||||
$data['rect'] = $data['selected_transport'][0];
|
||||
$data['assign_detail'] = "<b>Assign Date : </b>" . $data['rect']['assign_date']; // "<b>Assigned to :</b> " . $data['rect']['agent_name'] . "<br><b>Location :</b>" . $data['rect']['loc_name'].",". $data['rect']['street'].",". $data['rect']['city'].",". $data['rect']['state']."-". $data['rect']['zipcode'];
|
||||
$data['assign_phone'] = ""; //"<b>Phone :</b> " . $data['rect']['phone'];
|
||||
$data['cancel_reason_combo'] = "Cancellation Reason Combo Here";
|
||||
|
||||
$this->load->view('agent/extra/transport_form', $data);
|
||||
}
|
||||
// echo 'A transport line was selected';
|
||||
}
|
||||
|
||||
|
||||
private function transportList($data)
|
||||
{
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
$in["transport_id"] = 0;
|
||||
// $in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
// $out = array();
|
||||
// $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
// $data['result_list'] = $out['result_list'];
|
||||
|
||||
$data['page_name'] = "Completed Transport Request";
|
||||
$this->renderAgentPage('view_agent_transport', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function completed() {
|
||||
|
||||
$data = array();
|
||||
$data = $this->indexPageReal(array());
|
||||
$data['flags'] = 1000;
|
||||
$data['page_name'] = "Completed Transport Request";
|
||||
$this->transportList($data);
|
||||
}
|
||||
|
||||
public function active() {
|
||||
|
||||
$data = array();
|
||||
$data = $this->indexPageReal(array());
|
||||
$data['flags'] = 1000;
|
||||
$data['page_name'] = "Active Transport Request";
|
||||
$this->transportList($data);
|
||||
}
|
||||
|
||||
public function confirmed() {
|
||||
$data = array();
|
||||
$data = $this->indexPageReal(array());
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
$in["transport_id"] = 0;
|
||||
// $in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
// $out = array();
|
||||
// $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
// $data['result_list'] = $out['result_list'];
|
||||
|
||||
$data['page_name'] = "Confirmed Transport Request";
|
||||
$this->renderAgentPage('view_agent_transport', $data);
|
||||
}
|
||||
|
||||
public function pending() {
|
||||
$data = array();
|
||||
$data = $this->indexPageReal(array());
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 10;
|
||||
$in["transport_id"] = 0;
|
||||
// $in['action'] = MEDTRANS_USER_GET_TRANSLIST;
|
||||
// $out = array();
|
||||
// $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
|
||||
// $data['result_list'] = $out['result_list'];
|
||||
|
||||
$data['page_name'] = "Pending Transport Request";
|
||||
$this->renderAgentPage('view_agent_transport', $data);
|
||||
}
|
||||
|
||||
public function addlanguage() {
|
||||
$data["translator_id"] = $this->input->get('translator_id');
|
||||
$data["lang_code"] = $this->input->get('lang_code');
|
||||
$ret = $this->add_language($data);
|
||||
echo $ret=="Language added"?"0":$ret;
|
||||
}
|
||||
|
||||
private function add_language($data) {
|
||||
$in = array();
|
||||
$in["mode"] = 100; // => MODE_ADD
|
||||
$in["interpreter_id"] = $data["translator_id"];
|
||||
$in["lang_code"] = $data["lang_code"];
|
||||
$in["action"] = MEDTRANS_TRANSP_MANAGELANGUAGE;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($in["action"], $in, $out);
|
||||
return $ret==0?"Language added":"Failed to add language";
|
||||
}
|
||||
|
||||
private function add_edit_location($data) {
|
||||
$in = $data; // Do we validate?
|
||||
if ($data['location_id']>0) {
|
||||
$action = MEDTRANS_TRANSP_EDITLOCATION;
|
||||
} else {
|
||||
$action = MEDTRANS_TRANSP_ADDLOCATION;
|
||||
}
|
||||
$in["action"] = $action;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($action, $in, $out);
|
||||
$data["message"] = isset($out["status"])?$out["status"]:($data['location_id']>0?"Location updated":"Location added");
|
||||
if ($data["message"]==1) $data["message"] = "Location added";
|
||||
return $data["message"];
|
||||
}
|
||||
|
||||
public function mylocation() {
|
||||
$data = array();
|
||||
$data["message"] = "";
|
||||
if ($this->input->post()) {
|
||||
$data = $this->input->post();
|
||||
if ($data['mode']=='add_language') {
|
||||
$data['message'] = $this->add_language($data);
|
||||
} else {
|
||||
$data['message'] = $this->add_edit_location($data);
|
||||
}
|
||||
}
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 5;
|
||||
$in['action'] = MEDTRANS_TRANSP_LISTLOCATION;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_LISTLOCATION, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$this->load->model('combo_model');
|
||||
$this->combo_model->defaultComboMessage = 'Select your State';
|
||||
$data['states_combo'] = $this->combo_model->getStatesCombo('state', "GA");
|
||||
|
||||
|
||||
$data['page_name'] = "Transport Locations";
|
||||
$this->renderAgentPage('view_agent_locations', $data);
|
||||
}
|
||||
|
||||
public function mylocation_load()
|
||||
{
|
||||
$data['location_id'] = $this->input->get('location_id');
|
||||
if ($data['location_id']>0) {
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['location_id'] = $data['location_id'];
|
||||
$in['action'] = MEDTRANS_TRANSP_GET_TRANSPORTER;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSPORTER, $in, $out);
|
||||
echo json_encode($out);
|
||||
} else {
|
||||
echo "{\"status\":\"-2\"}";
|
||||
}
|
||||
}
|
||||
|
||||
private function add_edit_driver($data) {
|
||||
$in = $data; // Do we validate?
|
||||
$action = MEDTRANS_TRANSP_DRIVERSCALL;
|
||||
if ($data['driver_id']>0) {
|
||||
$in['mode'] = MODE_UPDATE;
|
||||
} else {
|
||||
$in['mode'] = MODE_ADD;
|
||||
}
|
||||
$in["action"] = $action;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($action, $in, $out);
|
||||
$data["message"] = isset($out["status"])?$out["status"]:($data['driver_id']>0?"Driver updated":"Driver added");
|
||||
if ($data["message"]==1) $data["message"] = "Driver added";
|
||||
return $data["message"];
|
||||
}
|
||||
|
||||
|
||||
public function drivers() {
|
||||
$data = array();
|
||||
$data["message"] = "";
|
||||
if ($this->input->post()) {
|
||||
$data = $this->input->post();
|
||||
$data['message'] = $this->add_edit_driver($data);
|
||||
}
|
||||
|
||||
$this->load->model('combo_model');
|
||||
$this->combo_model->defaultComboMessage = 'Select your State';
|
||||
$data['states_combo'] = $this->combo_model->getStatesCombo('state', "GA");
|
||||
|
||||
|
||||
|
||||
$this->combo_model->defaultComboMessage = 'Select your Licence State';
|
||||
$data['lic_states_combo'] = $this->combo_model->getStatesCombo('lic_state', "GA");
|
||||
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 50;
|
||||
$in['driver_id'] = 0;
|
||||
$in['mode'] = MODE_LIST;
|
||||
|
||||
$in['action'] = MEDTRANS_TRANSP_DRIVERSCALL;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_DRIVERSCALL, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$data['page_name'] = "Tranport Drivers";
|
||||
$this->renderAgentPage('view_agent_drivers', $data);
|
||||
}
|
||||
|
||||
public function drivers_load()
|
||||
{
|
||||
$data['driver_id'] = $this->input->get('driver_id');
|
||||
if ($data['driver_id']>0) {
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['driver_id'] = $data['driver_id'];
|
||||
$in['mode'] = MODE_LIST;
|
||||
$in['action'] = MEDTRANS_TRANSP_DRIVERSCALL;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_DRIVERSCALL, $in, $out);
|
||||
echo json_encode($out);
|
||||
} else {
|
||||
echo "{\"status\":\"-2\"}";
|
||||
}
|
||||
}
|
||||
|
||||
public function cfglocation() {
|
||||
echo 'ameye ....';
|
||||
}
|
||||
|
||||
// array(5) { ["document_id"]=> string(1) "2" ["agent_id"]=> string(1) "4" ["interpreter_id"]=> string(2) "16" ["language_id"]=> string(2) "99" ["ts"]=> string(10) "1508509712" }
|
||||
public function download() {
|
||||
$data = $this->input->get();
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['interpreter_id'] = $data['interpreter_id'];
|
||||
$in['language_id'] = $data['language_id'];
|
||||
$in['document_id'] = $data['document_id'];
|
||||
$in['action'] = MEDTRANS_DOWNLOAD;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_DOWNLOAD, $in, $out);
|
||||
if ($ret==0 && isset($out["file"]) && $out["file"]!="") {
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="'.basename($out["file"]).'"');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . strlen($out["data"]));
|
||||
echo $out["data"];
|
||||
exit();
|
||||
} else {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
header('Status: 400 Bad Request');
|
||||
echo "{\"status\":\"Cannot download file\"}";
|
||||
}
|
||||
}
|
||||
|
||||
public function cfgtranslator() {
|
||||
|
||||
$proc = $this->input->get('proc');
|
||||
$data['translator_id'] = $this->input->get('translator_id');
|
||||
if ($data['translator_id']>0) {
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['interpreter_id'] = $data['translator_id'];
|
||||
if ($proc=='STATUS') {
|
||||
$in['language_id'] = $this->input->get('language_id');
|
||||
$in['lang_code'] = $this->input->get('lang_code');
|
||||
$in['mode'] = $this->input->get('status')=='Disable' ? MODE_DELETE : MODE_ADD;
|
||||
$in['action'] = MEDTRANS_TRANSP_MANAGELANGUAGE;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($in['action'], $in, $out);
|
||||
if ($ret!=0) {
|
||||
var_dump($out);
|
||||
echo "\\r";
|
||||
}
|
||||
echo $ret;
|
||||
} else if ($proc=='FLAGS') {
|
||||
$in['language_id'] = $this->input->get('language_id');
|
||||
$in['lang_code'] = $this->input->get('lang_code');
|
||||
$in['flags'] = (int)$this->input->get('flags');
|
||||
$in['mode'] = MODE_UPDATE;
|
||||
$in['action'] = MEDTRANS_TRANSP_MANAGELANGUAGE;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($in['action'], $in, $out);
|
||||
if ($ret!=0) {
|
||||
var_dump($out);
|
||||
echo "\\r";
|
||||
}
|
||||
echo $ret;
|
||||
} else {
|
||||
|
||||
$in['language_id'] = 0; // LIST ALL
|
||||
|
||||
$in['action'] = MEDTRANS_TRANSP_GET_TRANSLATOR;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLATOR, $in, $translator_data);
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_USER_GET_LANGUAGE, $in, $language_list); // may load into global for speed latter
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_LANGUAGELIST, $in, $my_language); // may load into global for speed latter
|
||||
|
||||
$this->renderlanguageConfig($translator_data, $language_list,$my_language);
|
||||
}
|
||||
} else {
|
||||
echo "{\"status\":\"-2\"}";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function renderlanguageConfig($translator_data, $language_list,$my_language) {
|
||||
// echo json_encode($translator_data);
|
||||
$language_array = $language_list["result_list"];
|
||||
|
||||
echo "
|
||||
<form method=\"post\" id=\"add_language\" action=\"/transp/addlanguage\">
|
||||
<input type=\"hidden\" name=\"mode\" value=\"add_language\">
|
||||
<input type=\"hidden\" name=\"translator_id\" value=\"".$translator_data['id']."\">
|
||||
Configure languages for :
|
||||
<table class=\"table table-striped\">
|
||||
<tr>
|
||||
<td><b>" . $translator_data['firstname'] . " " . $translator_data['lastname'] . "</b>-[PH: " . $translator_data['phone'] . "]
|
||||
" . $translator_data['street'] . " " . $translator_data['city'] . " " . $translator_data['state'] . " " . $translator_data['zipcode'] . " " . $translator_data['country'] . "
|
||||
</td>
|
||||
</tr>
|
||||
<td>
|
||||
<div class=\"row\">
|
||||
<div class=\"col-xs-2\">
|
||||
Languages
|
||||
</div>
|
||||
<div class=\"col-xs-8\">
|
||||
" . $this->makeCombo($language_array, "language", "code", "lang_code") . "
|
||||
</div>
|
||||
<div class=\"col-xs-2\">
|
||||
<button class=\"btn btn-info btn-block btn-xs\"style=\"float: right\" onclick=\"return addlanguage('".$translator_data['id']."','".$translator_data['agent_id']."',this.form.lang_code.value,this);\">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr size='1'>
|
||||
</td>
|
||||
</tr>
|
||||
</table></form>". $this->translatorLanguageList($my_language);
|
||||
|
||||
|
||||
|
||||
// echo json_encode($language_list);
|
||||
}
|
||||
|
||||
private function makeCombo($dataArray,$text1,$code1, $name="") {
|
||||
$sl = "<select ".($name!=""?"name=\"${name}\"":"")." class='form-control'>";
|
||||
foreach ($dataArray as $drow) {
|
||||
$sl .= "<option value='".$drow[$code1]."'>".$drow[$text1]."</option>";
|
||||
}
|
||||
$sl .= "</select>";
|
||||
|
||||
return $sl;
|
||||
}
|
||||
|
||||
/*
|
||||
* translatorLanguageList
|
||||
* THIS FUNCTION LIST THE LANGUAGES THAT A TRANSLATOR HAVE CLAIMED TO UNDERSTAND
|
||||
* THERE IS NEED TO UPLOAD CETIFICATIONS FOR LEGEAL PURPOSE
|
||||
*/
|
||||
private function translatorLanguageList($my_language) {
|
||||
|
||||
$result_list = $my_language['result_list'];
|
||||
|
||||
$tb1 = "<table class='table'><tr><th>Language</th><th>Document</th><th>Approved</th><th>Disable</th></tr>";
|
||||
|
||||
foreach ($result_list as $rect) {
|
||||
|
||||
if ($rect['document_id'] == 0) {
|
||||
$flup = "<form method=\"post\" action=\"?\" enctype=\"multipart/form-data\">
|
||||
<input type=\"hidden\" name=\"mode\" value=\"file_upload\">
|
||||
<input type=\"hidden\" name=\"agent_id\" value=\"".$rect["agent_id"]."\">
|
||||
<input type=\"hidden\" name=\"language_id\" value=\"".$rect["language_id"]."\">
|
||||
<input type=\"hidden\" name=\"interpreter_id\" value=\"".$rect["interpreter_id"]."\">
|
||||
<div class=\"row\" style=\"float: right\">
|
||||
<label class=\"custom-file\">
|
||||
<input type=\"file\" name=\"file_contents\" id=\"file_contents\" class=\"custom-file-input\">
|
||||
<span class=\"custom-file-control\"></span>
|
||||
</label> <input type=\"submit\" value=\"Upload File\" class=\"btn btn-info btn-xs\" name=\"submit\" onclick=\"return uploadFile(this.form);\">
|
||||
<div id=\"progress_".$rect["interpreter_id"]."_".$rect["language_id"]."\" style='display:none;background:#0f0;width:0px;'></div>
|
||||
</form></row>";
|
||||
} else {
|
||||
$flup = "<a href='/transp/download?document_id=".$rect['document_id']."&agent_id=".$rect["agent_id"]."&interpreter_id=".$rect["interpreter_id"]."&language_id=".$rect["language_id"]."&ts=".time()."'>" . $rect['document'] . "</a> | <a class=\"text-danger\" href=\"#\"><b>Del.</b></a>";
|
||||
}
|
||||
|
||||
$tb1 .= "<tr><td style='width:180px;'>" . $rect['language'] . "</td>"
|
||||
. "<td>" . $flup . "</td>"
|
||||
. "<td style='width:45px;'><input class=\"form-control\" type=\"checkbox\" value=\"1\" onchange=\"return manageLanguageFlags(this, '".$rect["interpreter_id"]."','".$rect["language_id"]."','".$rect["lang_code"]."')\"".($rect['flags']==1?" checked":"")."></td>";
|
||||
if ($rect['status'] == 0) {
|
||||
$tb1 .= "<td style='width:85px;'><button class=\"btn btn-primary btn-xs\" style=\"float: right\" onclick=\"return manageLanguageStatus(this,'".$rect["interpreter_id"]."','".$rect["language_id"]."','".$rect["lang_code"]."');\">Enable</button></td></tr>";
|
||||
} else {
|
||||
$tb1 .= "<td style='width:85px;'><button class=\"btn btn-danger btn-xs\" style=\"float: right\" onclick=\"return manageLanguageStatus(this,'".$rect["interpreter_id"]."','".$rect["language_id"]."','".$rect["lang_code"]."');\">Disable</button></td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
// END TO BE REMOVED
|
||||
|
||||
$tb1 .= "</table>";
|
||||
return $tb1;
|
||||
}
|
||||
|
||||
/*
|
||||
* {"added":"2017-10-13 16:10:39.226379","agent_id":"4","city":"Marietta","country":"US","email":"ses66181+interpreter76@gmail.com","firstname":"Anatolii","id":"15","interpreter_id":"15","lastname":"Okhotnikov","loc":"104.238.127.115","phone":"664651123","pid":"100","state":"GA","status":"1","street":"2600 Bentley Rd SE","zipcode":"30067","internal_return":"0"}
|
||||
*/
|
||||
private function add_edit_translator($data)
|
||||
{
|
||||
$in = $data; // Do we validate?
|
||||
if ($data['interpreter_id']>0) {
|
||||
$action = MEDTRANS_TRANSP_EDIT_TRANSLATOR;
|
||||
} else {
|
||||
$action = MEDTRANS_TRANSP_ADD_TRANSLATOR;
|
||||
}
|
||||
$in["action"] = $action;
|
||||
$in["email"] = urlencode($data["email"]);
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($action, $in, $out);
|
||||
$data["message"] = isset($out["status"])?$out["status"]:($data['interpreter_id']>0?"Translator updated":"Translator added");
|
||||
if ($data["message"]==1) $data["message"] = "Translator added";
|
||||
return $data["message"];
|
||||
}
|
||||
|
||||
public function upload()
|
||||
{
|
||||
if ($this->input->post()) {
|
||||
$data = $this->input->post();
|
||||
/*
|
||||
unset($data['data']);
|
||||
var_dump($data);return; */
|
||||
echo $this->file_upload($data);
|
||||
} else {
|
||||
echo "Invalid request";
|
||||
}
|
||||
}
|
||||
|
||||
private function file_upload($data)
|
||||
{
|
||||
$in['interpreter_id'] = $data['interpreter_id'];
|
||||
$in['language_id'] = $data['language_id'];
|
||||
$in['action'] = MEDTRANS_UPLOADS; // 4505;
|
||||
$in['name'] = $data['name'];
|
||||
$in['data'] = $data['data'];
|
||||
unset($data);
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api($in['action'], $in, $out);
|
||||
return $ret==0?"File uploaded":"Failed to upload";
|
||||
}
|
||||
|
||||
public function translators()
|
||||
{
|
||||
$data = array();
|
||||
$data["message"] = "";
|
||||
if ($this->input->post()) {
|
||||
$data = $this->input->post();
|
||||
if ($data['mode']=='add_language') {
|
||||
$data['message'] = $this->add_language($data);
|
||||
} else if ($data['mode']=='file_upload') {
|
||||
$data['message'] = $this->file_upload($data);
|
||||
} else {
|
||||
$data['message'] = $this->add_edit_translator($data);
|
||||
}
|
||||
}
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 5;
|
||||
$in['action'] = MEDTRANS_TRANSP_LIST_TRANSLATOR;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_LIST_TRANSLATOR, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
|
||||
|
||||
$data['page_name'] = "Interpreters";
|
||||
$this->renderAgentPage('view_agent_interpreters', $data);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
public function language()
|
||||
{
|
||||
$data = array();
|
||||
$data["message"] = "";
|
||||
if ($this->input->post()) {
|
||||
$data = $this->input->post();
|
||||
if ($data['mode']=='add_language') {
|
||||
$data['message'] = $this->add_language($data);
|
||||
} else if ($data['mode']=='file_upload') {
|
||||
$data['message'] = $this->file_upload($data);
|
||||
} else {
|
||||
$data['message'] = $this->add_edit_translator($data);
|
||||
}
|
||||
}
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['language_id'] = 0; // all
|
||||
$in['action'] = MEDTRANS_TRANSP_AGENTLANGUAGE;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_AGENTLANGUAGE, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
|
||||
$data['page_name'] = "Language List";
|
||||
$this->renderAgentPage('view_agent_language', $data);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function translators_load()
|
||||
{
|
||||
$data['translator_id'] = $this->input->get('translator_id');
|
||||
if ($data['translator_id']>0) {
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['interpreter_id'] = $data['translator_id'];
|
||||
$in['action'] = MEDTRANS_TRANSP_GET_TRANSLATOR;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLATOR, $in, $out);
|
||||
echo json_encode($out);
|
||||
} else {
|
||||
echo "{\"status\":\"-2\"}";
|
||||
}
|
||||
}
|
||||
|
||||
public function mydevices() {
|
||||
$data = array();
|
||||
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['limit'] = 5;
|
||||
$in['action'] = MEDTRANS_TRANSP_LISTLOCATION;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_LISTLOCATION, $in, $out);
|
||||
$data['result_list'] = $out['result_list'];
|
||||
|
||||
$this->load->model('combo_model');
|
||||
$this->combo_model->defaultComboMessage = 'Select your State';
|
||||
$data['states_combo'] = $this->combo_model->getStatesCombo('state', "GA");
|
||||
|
||||
|
||||
|
||||
$data['page_name'] = "Transport Devices";
|
||||
$this->renderAgentPage('view_agent_device', $data);
|
||||
}
|
||||
|
||||
public function listdevices() {
|
||||
// echo 'ameye';
|
||||
// url: "/transp/listdevices?proc=NCOMPLETE&locID=" + locID + "&agent_id=" + agent_id
|
||||
|
||||
|
||||
$in['location_id'] = $this->input->get('locID');
|
||||
|
||||
if ($in['location_id'] > 0) {
|
||||
$in['agent_id'] = $_SESSION['agent_id'];
|
||||
$in['location_id'] = $in['location_id'];
|
||||
$in['action'] = MEDTRANS_TRANSP_GET_TRANSPORTER;
|
||||
$out = array();
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSPORTER, $in, $outx);
|
||||
// echo json_encode($out);
|
||||
|
||||
|
||||
|
||||
$data = array(
|
||||
"agent_id" => $_SESSION["agent_id"],
|
||||
"location_id" => $in["location_id"],
|
||||
"sessionid" => $_SESSION["agent_sessionid"]
|
||||
);
|
||||
|
||||
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_DEVICELIST, $data, $data); // call the API
|
||||
$data['rect'] = $outx;
|
||||
$this->load->view('/agent/extra/devicelist_form', $data);
|
||||
}
|
||||
}
|
||||
|
||||
public function adddevices()
|
||||
{
|
||||
|
||||
// echo 'Ameye';
|
||||
|
||||
$this->load->model('combo_model');
|
||||
$this->combo_model->defaultComboMessage = 'Select your State';
|
||||
$data['states_combo'] = $this->combo_model->getStatesCombo('state', "GA");
|
||||
|
||||
|
||||
|
||||
$this->combo_model->defaultComboMessage = 'Select your Licence State';
|
||||
$data['lic_states_combo'] = $this->combo_model->getStatesCombo('lic_state', "GA");
|
||||
$data['form_title'] = "Add New Device";
|
||||
|
||||
$this->load->view('/agent/extra/deviceadd_edit', $data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Welcome extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('welcome_message');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user