mirror of https://github.com/itflow-org/itflow
Added Department name on client PDF Export and contact CSV export
This commit is contained in:
parent
e6b45f9627
commit
1ed20217d1
2
cron.php
2
cron.php
|
|
@ -189,7 +189,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PAST DUE INVOICE ALERTS
|
// PAST DUE INVOICE Notifications
|
||||||
//$invoiceAlertArray = [$config_invoice_overdue_reminders];
|
//$invoiceAlertArray = [$config_invoice_overdue_reminders];
|
||||||
$invoiceAlertArray = [30,60,90,120,150,180,210,240,270,300,330,360,390,420,450,480,510,540,570,590,620];
|
$invoiceAlertArray = [30,60,90,120,150,180,210,240,270,300,330,360,390,420,450,480,510,540,570,590,620];
|
||||||
|
|
||||||
|
|
|
||||||
13
post.php
13
post.php
|
|
@ -4148,7 +4148,7 @@ if(isset($_GET['export_client_contacts_csv'])){
|
||||||
$client_name = $row['client_name'];
|
$client_name = $row['client_name'];
|
||||||
|
|
||||||
//Contacts
|
//Contacts
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
$sql = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN departments ON contact_department_id = department_id WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||||
if($sql->num_rows > 0){
|
if($sql->num_rows > 0){
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = $client_name . "-Contacts-" . date('Y-m-d') . ".csv";
|
$filename = $client_name . "-Contacts-" . date('Y-m-d') . ".csv";
|
||||||
|
|
@ -4157,12 +4157,12 @@ if(isset($_GET['export_client_contacts_csv'])){
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
|
|
||||||
//set column headers
|
//set column headers
|
||||||
$fields = array('Name', 'Title', 'Email', 'Phone', 'Mobile', 'Notes');
|
$fields = array('Name', 'Title', 'Department', 'Email', 'Phone', 'Mobile', 'Notes');
|
||||||
fputcsv($f, $fields, $delimiter);
|
fputcsv($f, $fields, $delimiter);
|
||||||
|
|
||||||
//output each row of the data, format line as csv and write to file pointer
|
//output each row of the data, format line as csv and write to file pointer
|
||||||
while($row = $sql->fetch_assoc()){
|
while($row = $sql->fetch_assoc()){
|
||||||
$lineData = array($row['contact_name'], $row['contact_title'], $row['contact_email'], $row['contact_phone'], $row['contact_mobile'], $row['contact_notes']);
|
$lineData = array($row['contact_name'], $row['contact_title'], $row['department_name'], $row['contact_email'], $row['contact_phone'], $row['contact_mobile'], $row['contact_notes']);
|
||||||
fputcsv($f, $lineData, $delimiter);
|
fputcsv($f, $lineData, $delimiter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6602,7 +6602,7 @@ if(isset($_GET['export_client_pdf'])){
|
||||||
$contact_email = $row['contact_email'];
|
$contact_email = $row['contact_email'];
|
||||||
$client_website = $row['client_website'];
|
$client_website = $row['client_website'];
|
||||||
|
|
||||||
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN departments ON contact_department_id = department_id WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||||
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id ORDER BY location_name ASC");
|
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id ORDER BY location_name ASC");
|
||||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||||
if(isset($_GET['passwords'])){
|
if(isset($_GET['passwords'])){
|
||||||
|
|
@ -6743,6 +6743,7 @@ if(isset($_GET['export_client_pdf'])){
|
||||||
}
|
}
|
||||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||||
$contact_email = $row['contact_email'];
|
$contact_email = $row['contact_email'];
|
||||||
|
$department_name = $row['department_name'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -6754,6 +6755,10 @@ if(isset($_GET['export_client_pdf'])){
|
||||||
text: <?php echo json_encode($contact_title); ?>,
|
text: <?php echo json_encode($contact_title); ?>,
|
||||||
style: 'item'
|
style: 'item'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: <?php echo json_encode($department_name); ?>,
|
||||||
|
style: 'item'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: <?php echo json_encode($contact_email); ?>,
|
text: <?php echo json_encode($contact_email); ?>,
|
||||||
style: 'item'
|
style: 'item'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue