Commit bad18390 by Tobin

booking page changes

parent 932589c6
......@@ -143,31 +143,31 @@ class Booking extends CI_Controller {
}
function downloadCSV(){
$dataRow = $this->session->userdata('report_data');
$fileName = $this->session->userdata('file_name');
$this->session->set_userdata('file_name','');
$this->session->set_userdata('report_data','');
if(empty($dataRow) || empty($fileName)){
return;
}
if($this->session->userdata['user_type'] != 1){
$company_id = $this->session->userdata['id'];
$this->db->query("UPDATE `company_payment_details`
SET `report_count`=report_count+1,
`outstanding_amount`=outstanding_amount+report_charge
WHERE `company_id`=".$company_id);
}
//Download CSV\\
$temp_memory = fopen('php://memory', 'w');
foreach ($dataRow as $line) {
fputcsv($temp_memory, $line, ',');
}
fseek($temp_memory, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $fileName . '";');
fpassthru($temp_memory);
$dataRow = $this->session->userdata('report_data');
$fileName = $this->session->userdata('file_name');
$this->session->set_userdata('file_name','');
$this->session->set_userdata('report_data','');
if(empty($dataRow) || empty($fileName)){
return;
}
if($this->session->userdata['user_type'] != 1){
$company_id = $this->session->userdata['id'];
$this->db->query("UPDATE `company_payment_details`
SET `report_count`=report_count+1,
`outstanding_amount`=outstanding_amount+report_charge
WHERE `company_id`=".$company_id);
}
//Download CSV\\
$temp_memory = fopen('php://memory', 'w');
foreach ($dataRow as $line) {
fputcsv($temp_memory, $line, ',');
}
fseek($temp_memory, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $fileName . '";');
fpassthru($temp_memory);
}
function formatReportData($reportData = array()){
......
......@@ -123,10 +123,12 @@
</li>
</ul>
</li>
<?php } ?>
<li><a href="<?= base_url('Booking/viewBookings') ?>">
<i class="fa fa-bars" aria-hidden="true">
</i><span>Booking Details</span></a>
</li>
<?php if($this->session->userdata['user_type'] == 1){ ?>
<li><a href="<?= base_url('Settings') ?>">
<img src="<?= base_url('assets/images/m7.png') ?>" />
</i><span>Settings</span></a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment