Exemplo n.º 1
0
 function headers()
 {
     $this->load->library('cezpdf');
     $this->load->helper('pdf');
     prep_pdf();
     // creates the footer for the document we are creating.
     $db_data[] = array('name' => 'Jon Doe', 'phone' => '111-222-3333', 'email' => '*****@*****.**');
     $db_data[] = array('name' => 'Jane Doe', 'phone' => '222-333-4444', 'email' => '*****@*****.**');
     $db_data[] = array('name' => 'Jon Smith', 'phone' => '333-444-5555', 'email' => '*****@*****.**');
     $col_names = array('name' => 'Name', 'phone' => 'Phone Number', 'email' => 'E-mail Address');
     $this->cezpdf->ezTable($db_data, $col_names, 'Contact List', array('width' => 550));
     $this->cezpdf->ezStream();
 }
Exemplo n.º 2
0
 public function index()
 {
     //Llamado de librerias y helper
     $this->load->library('cezpdf');
     $this->load->helper('pdf');
     prep_pdf();
     //Obtener datos para reporte
     $municipios = $this->modelo_admin->obt_municipios();
     foreach ($municipios as $municipio) {
         $db_data[0] = $municipio;
     }
     /*print_r($db_data);
     		exit();*/
     //Asignacion de encabezados
     $col_names = array('nombre' => 'Nombre', 'nombre_departamento' => 'Departamento');
     $this->cezpdf->ezTable($db_data, $col_names, 'Listado de municipios', array('width' => 550));
     $this->cezpdf->ezStream();
 }
Exemplo n.º 3
0
 function export($type = 'pdf', $title = 'Export')
 {
     if ($type == 'pdf') {
         $this->load->library('cezpdf');
         $this->load->helper('pdf');
         prep_pdf();
         $tempfile = 'temp.txt';
         $h = fopen($tempfile, 'r');
         if (!$h) {
             $contents = array();
         } else {
             $contents = fread($h, filesize($tempfile));
         }
         fclose($h);
         $contents = unserialize($contents);
         //get the col names
         $cols = array_keys($contents[0]);
         $col_names = array();
         foreach ($cols as $col) {
             $col_names[$col] = humanizer($col);
         }
         /** testing data 
         			$db_data[] = array('name' => 'Jon Doe', 'phone' => '111-222-3333', 'email' => '*****@*****.**');
         			$db_data[] = array('name' => 'Jane Doe', 'phone' => '222-333-4444', 'email' => '*****@*****.**');
         			$db_data[] = array('name' => 'Jon Smith', 'phone' => '333-444-5555', 'email' => '*****@*****.**');
         		
         			$col_names = array(
         				'name' => 'Name',
         				'phone' => 'Phone Number',
         				'email' => 'E-mail Address'
         			);
         			/** end testing data **/
         $this->cezpdf->ezTable($contents, $col_names, ucwords(urldecode($title)), array('width' => 550));
         $this->cezpdf->ezStream();
     }
 }
Exemplo n.º 4
0
 public function print_ships()
 {
     if (!$this->is_logged) {
         redirect("user/login");
     }
     $this->load->library('cezpdf');
     $this->load->helper('pdf_helper');
     $user_id = $this->user_model->get_current_user_id();
     $this->db->select("shp_id, shp_ep_ref, fa.adr_contact as sender_name, ta.adr_contact as receiver_name, DATE_FORMAT(shp_date,'%d-%m-%Y') as shp_date, shp_rate, shp_trackingcode, shp_estdate, shp_status, shp_signedby, shp_type, shp_payment");
     $this->db->from('shipments as s');
     $this->db->join('addresses as fa', 'fa.adr_id = shp_from');
     $this->db->join('addresses as ta', 'ta.adr_id = shp_to');
     $this->db->join('country as fco', 'fa.adr_country = fco.cnt_code');
     $this->db->join('state as fs', 'fa.adr_state = fs.state_id');
     $this->db->join('city as fc', 'fa.adr_city = fc.city_id');
     $this->db->join('country as tco', 'ta.adr_country = tco.cnt_code');
     $this->db->join('state as ts', 'ta.adr_state = ts.state_id');
     $this->db->join('city as tc', 'ta.adr_city = tc.city_id');
     $this->db->where('s.shp_user', $user_id);
     $query = $this->db->get();
     $data = $query->result_array();
     $titlecolumn = array('shp_id' => 'Shipment ID', 'shp_ep_ref' => 'Shipment Reference', 'sender_name' => 'Sender', 'receiver_name' => 'Receiver', 'shp_date' => 'Date', 'shp_rate' => 'Price', 'shp_trackingcode' => 'Tracking Code', 'shp_estdate' => 'Delivery Date', 'shp_status' => 'Status', 'shp_signedby' => 'Signed By', 'shp_type' => 'Type', 'shp_payment' => 'Payment Status');
     prep_pdf();
     $this->cezpdf->ezTable($data, $titlecolumn, 'Shipment Data', array('fontSize' => 5));
     $this->cezpdf->ezStream();
 }
Exemplo n.º 5
0
 public function printoutput2($bulan, $tahun)
 {
     $this->general->checksess();
     $this->general->checkbulantahun($bulan, $tahun);
     $print = $this->getdata->getnamabulan($bulan);
     $data = $this->getdata->getprintkriteriarencana($bulan . $tahun);
     $data1 = $this->getdata->getprintrencana($bulan . $tahun);
     $this->load->helper('pdf');
     $this->load->library('cezpdf');
     prep_pdf();
     $a = 0;
     foreach ($data as $key) {
         $namapengeluaran = $this->getdata->getnamapengeluaran($key['id_pengeluaran']);
         $db_data[] = array('Nomor' => $a = $a + 1, 'category' => $namapengeluaran->nama, 'output' => 'Rp. ' . $key['pengeluaran2']);
     }
     $col_names = array('Nomor' => 'Nomor', 'category' => 'Uraian', 'output' => 'Jumlah');
     $a = 0;
     foreach ($data1 as $key) {
         $namapengeluaran = $this->getdata->getnamapengeluaran($key['id_pengeluaran']);
         $db_data1[] = array('Nomor' => $a = $a + 1, 'category' => $namapengeluaran->nama, 'output' => 'Rp. ' . $key['pengeluaran2']);
     }
     $col_names1 = array('Nomor' => 'Nomor', 'category' => 'Uraian', 'output' => 'Jumlah');
     $this->cezpdf->ezTable($db_data, $col_names, 'Kriteria Utama ' . $print->nama_bulan . ' ' . $tahun, array('width' => 10, 'showHeading' => 0));
     $this->cezpdf->addText(150, 800, 15, "Rencana Anggaran Pendapatan dan Belanja Sekolah");
     $this->cezpdf->ezTable($db_data1, $col_names1, 'Subkriteria ' . $print->nama_bulan . ' ' . $tahun, array('width' => 550, 'showHeading' => 0));
     $this->cezpdf->ezStream();
 }