<?php
class DokterCR extends CI_Controller {

    function __construct(){
        parent::__construct();
      
         $this->load->model('live_model');
         $this->load->helper('content');
    }

    function index(){
    	set_time_limit(0);
        ini_set('memory_limit', '1024M');

        $view['error'] = '';
        $view['content'] = 'page/dokter';
        $view['data'] = $this->live_model->view_thamrin()->result();

        $this->load->view('index', $view);
    }

    function search_tanggal()
    {
        $start = $this->input->post('tanggal');
        $startformat = date("d F Y", strtotime($start));
        $finish = $this->input->post('tanggal_to');
        $finishformat = date("d F Y", strtotime($finish));

        $data['data'] = $this->live_model->view_thamrin()->result();
        $data['content'] = 'table/tabledokter';
        $data["tanggal_from"] = $startformat;
        $data["tanggal_last"] = $finishformat;
        $tanggal    =   $this->input->post('tanggal');
        $tanggal_to = $this->input->post('tanggal_to');
        $data['results']    =   $this->live_model->show_data_by_date_range($tanggal,$tanggal_to);
        $this->load->view('index',$data);
    }

}
?>