Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TimeOutAdmin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TimeOut
TimeOutAdmin
Commits
bad18390
Commit
bad18390
authored
Feb 25, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
booking page changes
parent
932589c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
Booking.php
application/controllers/Booking.php
+25
-25
left-menu.php
application/views/Templates/left-menu.php
+2
-0
No files found.
application/controllers/Booking.php
View file @
bad18390
...
...
@@ -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
()){
...
...
application/views/Templates/left-menu.php
View file @
bad18390
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment