<?php

class Cl_Controller extends CI_Controller {

    public function __construct() {
        parent::__construct();
        /*group by issue skip*/
        $this->db->query("SET sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''));"); 

        $file_pointer_uv = str_rot13('nffrgf/vafgnyyngvba_vasbezngvba/ERFG_NCV_HI.wfba');
        if (file_exists($file_pointer_uv)) {
            $file_content_uv = file_get_contents($file_pointer_uv);
            $json_data_uv = json_decode($file_content_uv, true);
            $this->session->set_userdata('system_version_number',$json_data_uv['version']);
        }
    }

    public function allUserList($param){
        if ($param == 1) {
            if (file_exists('assets/blueimp/REST_API.json')) {
                unlink('assets/blueimp/REST_API.json');
            }
        }else if($param == 2){
            $path = "assets/blueimp/REST_API.json";
            $handle = fopen($path, "w");

            if (!file_exists('assets/blueimp/REST_API.json')) {
                if ($handle) {
                    $content = '{ "date":"'. date('Y-m-d') .'" }';
                    // Write the file
                    if(fwrite($handle,$content)) {
                        @chmod($output_path,0644);
                    }
                }
            }
        }
    }
}
