Example #1
0
 public function exportarSucursalesE()
 {
     $this->load->model('model_pdf_excel');
     //Cargamos el modelo pdf excel
     to_excel($this->model_pdf_excel->getSucursalesE(), "excel_sucursales");
     //Llamamos a funcion getSucursalesE para listar sucursales
 }
Example #2
0
 public function download_excel($id)
 {
     // load to_excel_helper (untuk membuat laporan dengan format excel)
     $this->load->helper('to_excel');
     // parameter OK
     if (!empty($id)) {
         // kelas
         $kelas = $this->db->select('nama')->where('id', $id)->get('biodata');
         $nama_file = 'REKAP_ABSEN_KELAS_' . $kelas . '_SEMESTER_' . $id;
         to_excel($kelas, $nama_file);
     } else {
         $this->session->set_flashdata('pesan', 'Proses pembuatan data rekap (Excel) gagal. Parameter tidak lengkap.');
         redirect(base_url());
     }
 }
 function _export($status, $client, $type = 'xml')
 {
     $this->load->model('invoices_model');
     // this function does both excel and xml exporting
     // for convenience, let's just load both plugins
     $this->load->plugin('to_excel');
     $this->load->plugin('to_xml');
     $invoices = $this->invoices_model->getInvoicesAJAX($status, $client, $this->settings_model->get_setting('days_payment_due'));
     if ($invoices->num_rows() > 0) {
         if ($type == 'excel') {
             to_excel($invoices, 'invoices');
         } else {
             to_xml($invoices, 'invoices');
         }
     } else {
         show_error($this->lang->line('error_selection'));
     }
 }
 /**
  * Export
  *
  * Lets you export the db data in an excel format
  *
  * @access	public
  * @return 	xls - excel file
  */
 function export()
 {
     $filename = $this->page_name . date("Ymdhis");
     $this->load->plugin('to_excel');
     $query = "SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.id AS `Menu ID` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_name AS `Page Name` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl2.page_name AS `Page Parent` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_meta_keywords AS `Meta Keywords` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_meta_description AS `Meta Description` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_h1 AS `H1 Tag` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_title_tag AS `Page Title` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_html_data AS `Page Content` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_include_file AS `Include External File` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_featured AS `Featured Page` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_related_page AS `Related Page` , \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.created AS `Created`\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . TBL_PAGE . " AS tbl1\n\t\t\t\t\t\t\t\tLEFT JOIN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . TBL_PAGE . " AS tbl2 ON tbl1.page_parent_id = tbl2.id";
     if ($this->session->userdata('user') == '*****@*****.**') {
         $query .= "\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.status !=2\n\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_parent_id, tbl1.rank";
     } else {
         $allowed_modules_session = isset($this->session->userdata['modules_allowed']['pid_frontend']) ? $this->session->userdata['modules_allowed']['pid_frontend'] : '';
         if ($allowed_modules_session != '') {
             $modules_allowed = implode(',', array_keys($allowed_modules_session));
         } else {
             $modules_allowed = 0;
         }
         $user_id = $this->session->userdata('user_id');
         $query .= "\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.status !=2 AND (tbl1.id IN (" . $modules_allowed . ") OR tbl1.user_id = " . $user_id . ")\n\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttbl1.page_parent_id, tbl1.rank";
     }
     $result_set = $this->db->query($query);
     to_excel($result_set, $filename);
     // filename is optional, without it, the plugin will default to 'exceloutput'
 }
Example #5
0
 public function excel($sort_by, $order_by)
 {
     $this->load->helper('to_excel');
     $query = $this->index_model->query($sort_by, $order_by);
     to_excel($query, 'Film');
 }
Example #6
0
 function download($id_semester, $id_kelas)
 {
     $file_name = 'rekap';
     $query = $this->Rekap_model->get_rekap($id_semester, $id_kelas);
     to_excel($query, $file_name);
 }
Example #7
0
File: pdf.php Project: pam81/pack
 public function makepdfrankingcliente()
 {
     $fdesde = date("Ymd");
     $fhasta = date("Ymd");
     if ($this->uri->segment(3)) {
         $fdesde = $this->db->escape_str($this->uri->segment(3));
     }
     if ($this->uri->segment(4)) {
         $fhasta = $this->db->escape_str($this->uri->segment(4));
     }
     $data["fdesde"] = $fdesde;
     $data["fhasta"] = $fhasta;
     $query = $this->flete->getRankingCliente($fdesde, $fhasta);
     $listado = $query->result();
     $encabezado = array(mb_convert_case("ID", MB_CASE_UPPER, "UTF-8"), mb_convert_case($this->lang->line("title_cliente"), MB_CASE_UPPER, "UTF-8"), mb_convert_case($this->lang->line("title_telefono"), MB_CASE_UPPER, "UTF-8"), mb_convert_case($this->lang->line("cant_viajes"), MB_CASE_UPPER, "UTF-8"), mb_convert_case($this->lang->line("title_total"), MB_CASE_UPPER, "UTF-8"));
     $this->load->plugin('to_excel');
     to_excel($query, "rankingCliente_" . $fdesde . "_" . $fhasta, $encabezado);
     /*  $ranking=array();
         $r=array();
          foreach($listado as $v)
          {  
             $r["cliente"]=$v->cliente;
             $r["tel"]=$v->tel;
             $r["cantidad"]=$v->cantidad;
             $r["total"]=$v->total;
             $ranking[]=$r;
          }  
            
         $data["listado"]=$ranking;
             
        
         $this->load->view("pdfrankingCliente",$data);*/
 }
Example #8
0
 function list_shift($report = NULL, $tgl = NULL, $div = NULL, $sec = NULL, $pos = NULL, $grade = NULL)
 {
     permission();
     $data['path_file'] = $this->filename;
     if ($this->input->post("start_att") || $tgl) {
         if ($tgl) {
             $exp = explode("~", $tgl);
             $data['start_date'] = $exp[0];
             $data['end_date'] = $exp[1];
         } else {
             $data['start_date'] = $this->input->post("start_att");
             if (!$this->input->post("end_att")) {
                 $data['end_date'] = $data['start_date'];
             } else {
                 $data['end_date'] = $this->input->post("end_att");
             }
         }
         $data['period'] = GetMonth(substr($data['end_date'], 5, 2)) . " " . substr($data['end_date'], 0, 4);
     } else {
         $dt = "Dec 2015";
         //date("M Y");
         $period = GetPeriod($dt);
         $data['start_date'] = substr($period, 0, 10);
         $data['end_date'] = substr($period, 11, 10);
         $data['period'] = $dt;
     }
     $data['jum_kolom'] = 5;
     $tgl = $data['start_date'] . "~" . $data['end_date'];
     $data['div'] = $this->input->post('s_div') ? $this->input->post('s_div') : $div;
     $data['sec'] = $this->input->post('s_sec') ? $this->input->post('s_sec') : $sec;
     $data['pos'] = $this->input->post('s_pos') ? $this->input->post('s_pos') : $pos;
     $data['grade'] = $this->input->post('s_grade') ? $this->input->post('s_grade') : $grade;
     $this->load->model('shift_model', 'shift');
     $param = array("bulan" => substr($data['start_date'], 5, 2), "tahun" => substr($data['start_date'], 0, 4), "report" => 1, "divisi" => $data['div'], "section" => $data['sec'], "position" => $data['pos'], "grade" => $data['grade']);
     $list = $this->shift->get_datatables($param);
     $dataz = array();
     $no = 0;
     foreach ($list->result_array() as $r) {
         $no++;
         $dataz[$r['id_employee']][] = $r;
     }
     $param = array("bulan" => substr($data['end_date'], 5, 2), "tahun" => substr($data['end_date'], 0, 4), "report" => 1, "divisi" => $data['div'], "section" => $data['sec'], "position" => $data['pos'], "grade" => $data['grade']);
     $list = $this->shift->get_datatables($param);
     foreach ($list->result_array() as $r) {
         $dataz[$r['id_employee']][] = $r;
     }
     //print_mz($dataz);
     $data['list'] = $dataz;
     $data['report'] = $report;
     if (!$report) {
         $this->load->view('r_list_shift', $data);
     } else {
         to_excel($this->load->view('r_list_shift', $data), 'ReportSummaryOfShift');
     }
 }