%PDF- %PDF-
Direktori : /home/ugotscom/public_html/dg/application/modules/emp/controllers/ |
Current File : /home/ugotscom/public_html/dg/application/modules/emp/controllers/Emp.php |
<?php class Emp extends CI_Controller{ function __construct(){ parent::__construct(); if(isset($_SESSION['username'])){ }else{ redirect('login'); } $this->load->library('datatables'); //load library ignited-dataTable $this->load->model('emp_model'); //load model crud_model } function index(){ $x['category']=$this->emp_model->get_category(); $data['content']='emp_view'; $this->load->view('common/layout',$data); $this->load->view('emp_view',$x); } function get_product_json() { //get product data and encode to be JSON object header('Content-Type: application/json'); echo $this->emp_model->get_all_product(); } function save(){ //insert record method $this->emp_model->insert_product(); redirect('bemp'); } function update(){ //update record method $this->emp_model->update_product(); redirect('bemp'); } function delete(){ //delete record method $this->emp_model->delete_product(); redirect('emp'); } public function edit($id) { $data['locations'] = $this->emp_model->get_location(); $data['category'] = $this->emp_model->get_source(); $data['customer'] = $this->emp_model->get_customer($id); $data['content'] = $this->load->view('edit',$data); $this->load->view('common/layout',$data); } public function view($id) { $data['customer'] = $this->emp_model->get_customer($id); $data['lead_type'] = $this->emp_model->get_lead_type(); $data['rlisting'] = $this->emp_model->rlisting($id); $data['content'] = $this->load->view('view',$data); $this->load->view('common/layout',$data); } function addremark(){ //insert record method $this->emp_model->add_remark(); redirect('emp'); } public function add() { $data['locations'] = $this->emp_model->get_location(); $data['category'] = $this->emp_model->get_source(); $data['content'] = $this->load->view('add',$data); $this->load->view('common/layout',$data); } public function del() { $data['content'] = $this->load->view('delete'); $this->load->view('common/layout',$data); } public function pdf($id) { $data['customer'] = $this->emp_model->get_customer($id); $this->load->library('mi_pdf'); $html=$this->load->view('pdfview',$data, true); // html file $pdfFilename = "sample.pdf"; $this->mi_pdf->pdf->SetMargins(0,0, 2); $this->mi_pdf->pdf->WriteHTML($html); $this->mi_pdf->pdf->Output($pdfFilename, "D"); $stylesheet = file_get_contents('pdf.css'); // external css } public function pdfeyetest($id) { $data['customer'] = $this->emp_model->get_customer($id); $this->load->library('mi_pdf'); $html=$this->load->view('eyetest',$data, true); // html file $pdfFilename = "sample.pdf"; $this->mi_pdf->pdf->WriteHTML($html); $this->mi_pdf->pdf->Output($pdfFilename, "D"); $stylesheet = file_get_contents('pdf.css'); // external css } public function pdfseasevice($id) { $data['customer'] = $this->emp_model->get_customer($id); $this->load->library('mi_pdf'); $html=$this->load->view('seaservice',$data, true); // html file $pdfFilename = "sample.pdf"; $this->mi_pdf->pdf->WriteHTML($html); $this->mi_pdf->pdf->Output($pdfFilename, "D"); $stylesheet = file_get_contents('pdf.css'); // external css } public function all($id) { $data['customer'] = $this->emp_model->get_customer($id); $this->load->library('mi_pdf'); $html1=$this->load->view('pdfview',$data, true); $html2=$this->load->view('seaservice',$data, true); $html3=$this->load->view('eyetest',$data, true); /// html file $pdfFilename = "sample.pdf"; $this->mi_pdf->pdf->SetMargins(0,0, 2); $this->mi_pdf->pdf->WriteHTML($html1); $this->mi_pdf->pdf->Addpage(); $this->mi_pdf->pdf->WriteHTML($html2); $this->mi_pdf->pdf->Addpage(); $this->mi_pdf->pdf->WriteHTML($html3); $this->mi_pdf->pdf->Output($pdfFilename, "D"); $stylesheet = file_get_contents('pdf.css'); // external css } }