File: //home/cafsindia/.trash/application.1/controllers/Timelog_data.php
<?php if ( ! defined('BASEPATH')) exit('No direct script is allowed');
require_once("Action_controller.php");
class Timelog_data extends Action_controller{
public function __construct(){
parent::__construct('timelog_data');
}
// LOAD PAGE QUICK LINK,FILTERS AND TABLE HEADERS
public function index(){
$this->load->view("$this->control_name/manage",$data);
}
public function load_data(){
$cron_tbl_qry = 'select * from cw_cron_status where trans_status=1 and cron_for = "read_etime_data" order by process_date desc';
$table_info = $this->db->query("CALL sp_a_run ('SELECT','$cron_tbl_qry')");
$table_result = $table_info->result();
$table_info->next_result();
echo json_encode(array('success' => True,"table_data"=>$table_result));
}
public function time_log_entry(){
$timelog_date = $this->input->post('date');
$file_name = "DATA_".$timelog_date.".txt";
$path ='time_log/'.$file_name;
if(file_exists($path)){
$post_url = base_url()."app/api_controller.php";
$post_data['frm'] = "read_etime_data";
$post_data['manual'] = 'manual';
$post_data['date'] = $timelog_date;
$result = $this->curl($post_url,$post_data);
if($result){
echo json_encode(array('success' => True, 'message' =>"Successfully Inserted"));
}
}else{
echo json_encode(array('success' => FALSE, 'message' =>"Text file not exist"));
exit(0);
}
}
}
?>