html - how to create javascript for work pie chart in php codeigniter -


controller (connect model , view )

function viewdashboard(){   $this->load->model('agentperformance/agentperformance_model');   $this->agentperformance_model->dashboard();  } 

model data in database.

function dashboard(){  $this->db->select("count(`idcall`) answercount",false)      ->from("call")      ->where("idemployee",20)      ->where("c_date",date("y-m-d 00:00:00", strtotime(2015-04-22)))      ->where("c_ansornot",'not answer')         ->get()->result_array();   $this->db->select("count(`idcall`) answercount",false)      ->from("call")      ->where("idemployee",20)      ->where("c_date",date("y-m-d 00:00:00", strtotime(2015-04-22)))      ->where("c_ansornot",'rejected')      ->get()->result_array();   }  } 

html (view )

<div id="container" style="min-width: 310px; height: 400px;  max-width: 600px; margin: 0 auto"></div> 

thanks in advance,

in controller assign value returned model variable , return json using json encode function

function viewdashboard(){   $this->load->model('agentperformance/agentperformance_model');   $result = $this->agentperformance_model->dashboard();    $val = json_encode($result);   return $val;     }     

now can value json in javascript.you can use

echo $val instead of return $val

hope helped...


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -