<?php

class others extends mainController {

    public function __construct() {
        parent::__construct();
        $this->load->model('others');
    }

    public function landing() {
        
    }

    public function app_tracking_map() {
        $vars['pageName'] = 'app_tracking_map';
        $vars['title'] = CommonLanguage::getMessage('app_tracking_map');
        $vars['system_name'] = CommonLanguage::getMessage('app_tracking_map');
        $vars['user_arr'] = $this->_registry->user->get_app_users();
        if (!empty($_GET['visit_id'])) {
            $vars['visit_id'] = $_GET['visit_id'];
        }else{
            $vars['visit_id']=0;
        }
        $vars['breadCrumb'] = [[CommonLanguage::getMessage('app_tracking_map'), 'others/app_tracking_map']];
        $this->load->view('others/app_tracking_map', $vars);
    }

    public function get_track_data() {
//        echo $_GET['visit_id'];die();
        if (!empty($_GET['visit_id'])) {
            $vars['track_data'] = json_encode(array("data"=>$this->_registry->customer->get_customer_visit_by_id($_GET['visit_id'])));
//               echo"<pre>";
//        die(print_r($vars['track_data']));
         } else {
            $url = track_map_url . '&action=get_track';
            $vars['track_data'] = file_get_contents($url);
        }
//        echo"<pre>";
//        die(print_r($vars['track_data']));
        die($vars['track_data']);
    }

}
