Exemple #1
0
 function excel_export()
 {
     $data = $this->Employee->get_all()->result_object();
     $this->load->helper('report');
     $rows = array();
     $row = array(lang('common_first_name'), lang('common_last_name'), lang('common_gender'), lang('common_dob'), lang('common_identity_no'), lang('common_age'), lang('common_email'), lang('common_phone_number'), lang('common_address'), lang('common_comments'));
     $rows[] = $row;
     foreach ($data as $r) {
         $row = array($r->first_name, $r->last_name, $r->gender, $r->dob, $r->identity_no, $r->age, $r->email, $r->phone_number, $r->address_1, $r->comments, $r->person_id);
         $rows[] = $row;
     }
     $content = array_to_spreadsheet($rows);
     force_download('employees_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
     exit;
 }
Exemple #2
0
 function excel_export()
 {
     $data = $this->Giftcard->get_all()->result_object();
     $this->load->helper('report');
     $rows = array();
     $row = array(lang('giftcards_giftcard_number'), lang('giftcards_card_value'));
     $rows[] = $row;
     foreach ($data as $r) {
         $row = array($r->giftcard_number, $r->value);
         $rows[] = $row;
     }
     $content = array_to_spreadsheet($rows);
     force_download('giftcards_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
     exit;
 }
Exemple #3
0
 function excel_export()
 {
     $data = $this->Customer->get_all($this->Customer->count_all())->result_object();
     $this->load->helper('report');
     $rows = array();
     $header_row = $this->_excel_get_header_row();
     $header_row[] = lang('customers_customer_id');
     $rows[] = $header_row;
     foreach ($data as $r) {
         $row = array($r->first_name, $r->last_name, $r->gender, $r->dob, $r->identity_no, $r->age, $r->email, $r->phone_number, $r->address_1, $r->comments, $r->person_id);
         $rows[] = $row;
     }
     $content = array_to_spreadsheet($rows);
     force_download('customers_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
     exit;
 }
Exemple #4
0
if ($export_excel == 1) {
    $rows = array();
    $row = array();
    foreach ($headers as $header) {
        $row[] = strip_tags($header['data']);
    }
    $rows[] = $row;
    foreach ($data as $datarow) {
        $row = array();
        foreach ($datarow as $cell) {
            $row[] = str_replace('‑', '-', strip_tags($cell['data']));
        }
        $rows[] = $row;
    }
    $content = array_to_spreadsheet($rows);
    force_download(strip_tags($title) . '.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
    exit;
}
$this->load->view("partial/header");
?>
<div id="content-header">
    <h1 > <i class="fa fa-bar-chart"> </i><?php 
echo lang('reports_reports');
?>
 - <?php 
echo $title;
?>
	</h1>
</div>
Exemple #5
0
 function excel()
 {
     $this->load->helper('report');
     $header_row = $this->_excel_get_header_row();
     $content = array_to_spreadsheet(array($header_row));
     force_download('batch_sale_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
 }
Exemple #6
0
 function excel_export()
 {
     $data = $this->Loan->get_all($this->Loan->count_all())->result_object();
     $this->load->helper('report');
     $rows = array();
     $header_row = $this->_excel_get_header_row();
     $header_row[] = lang('loans_id');
     $rows[] = $header_row;
     $i = 1;
     foreach ($data as $r) {
         $row = array($i, $r->first_name, $r->last_name, $r->amount, $r->deposit, $r->rate, $r->duration, $r->borrow_date, $r->start_date, $r->end_date, $r->currency, $r->product_name, $r->comments, $r->loan_id);
         $rows[] = $row;
         $i++;
     }
     $content = array_to_spreadsheet($rows);
     force_download('loans_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
     exit;
 }
Exemple #7
0
 function excel_export()
 {
     $data = $this->Item_kit->get_all()->result_object();
     $this->load->helper('report');
     $rows = array();
     $row = array(lang('items_item_number'), lang('items_product_id'), lang('item_kits_name'), lang('items_category'), lang('items_supplier_id'), lang('items_cost_price'), lang('items_unit_price'), lang('items_tax_1_name'), lang('items_tax_1_percent'), lang('items_tax_2_name'), lang('items_tax_2_percent'), lang('items_tax_2_cummulative'), lang('item_kits_description'));
     $rows[] = $row;
     foreach ($data as $r) {
         $taxdata = $this->Item_kit_taxes_finder->get_info($r->item_kit_id);
         if (sizeof($taxdata) >= 2) {
             $r->taxn = $taxdata[0]['name'];
             $r->taxp = $taxdata[0]['percent'];
             $r->taxn1 = $taxdata[1]['name'];
             $r->taxp1 = $taxdata[1]['percent'];
             $r->cumulative = $taxdata[1]['cumulative'] ? 'y' : '';
         } else {
             if (sizeof($taxdata) == 1) {
                 $r->taxn = $taxdata[0]['name'];
                 $r->taxp = $taxdata[0]['percent'];
                 $r->taxn1 = '';
                 $r->taxp1 = '';
                 $r->cumulative = '';
             } else {
                 $r->taxn = '';
                 $r->taxp = '';
                 $r->taxn1 = '';
                 $r->taxp1 = '';
                 $r->cumulative = '';
             }
         }
         $row = array($r->item_kit_number, $r->product_id, $r->name, $r->category, $r->cost_price, $r->unit_price, $r->taxn, $r->taxp, $r->taxn1, $r->taxp1, $r->cumulative, $r->description);
         $rows[] = $row;
     }
     $content = array_to_spreadsheet($rows);
     force_download('itemkits_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
     exit;
 }
Exemple #8
0
 function excel_export()
 {
     $data = $this->Item->get_all($this->Item->count_all())->result_object();
     $this->load->helper('report');
     $header_row = $this->_excel_get_header_row();
     $header_row[] = lang('items_item_id');
     $rows[] = $header_row;
     foreach ($data as $r) {
         $row = array();
         $row[] = $r->item_number;
         $row[] = $r->product_id;
         $row[] = $r->name;
         $row[] = $r->category;
         $row[] = $r->supplier_id;
         $row[] = to_currency_no_money($r->cost_price, 10);
         $row[] = to_currency_no_money($r->unit_price);
         foreach ($this->Tier->get_all()->result() as $tier) {
             $tier_id = $tier->id;
             $tier_row = $this->Item->get_tier_price_row($tier_id, $r->item_id);
             $value = '';
             if (is_object($tier_row) && property_exists($tier_row, 'tier_id')) {
                 $value = $tier_row->unit_price !== NULL ? to_currency_no_money($tier_row->unit_price) : $tier_row->percent_off . '%';
             }
             $row[] = $value;
         }
         $row[] = $r->tax_included ? 'y' : '';
         $row[] = $r->is_service ? 'y' : '';
         $row[] = to_quantity($r->quantity, FALSE);
         $row[] = to_quantity($r->reorder_level, fALSE);
         $row[] = $r->description;
         $row[] = $r->allow_alt_description ? 'y' : '';
         $row[] = $r->is_serialized ? 'y' : '';
         $row[] = $r->size;
         $commission = '';
         if ($r->commission_fixed) {
             $commission = to_currency_no_money($r->commission_fixed);
         } elseif ($r->commission_percent) {
             $commission = to_currency_no_money($r->commission_percent) . '%';
         }
         $row[] = $commission;
         $row[] = $r->item_id;
         $rows[] = $row;
     }
     $content = array_to_spreadsheet($rows);
     force_download('items_export.' . ($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'), $content);
     exit;
 }