597
597
enforceUserPermission ("module_sales " , 1 );
598
598
enforceUserPermission ("module_financial " , 1 );
599
599
600
+ $ sql = mysqli_query ($ mysqli , "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1 " );
601
+ $ row = mysqli_fetch_array ($ sql );
602
+ $ company_name = nullable_htmlentities ($ row ['company_name ' ]);
603
+ $ company_phone_country_code = nullable_htmlentities ($ row ['company_phone_country_code ' ]);
604
+ $ company_phone = nullable_htmlentities (formatPhoneNumber ($ row ['company_phone ' ], $ company_phone_country_code ));
605
+ $ company_email = nullable_htmlentities ($ row ['company_email ' ]);
606
+ $ company_website = nullable_htmlentities ($ row ['company_website ' ]);
607
+ $ company_logo = nullable_htmlentities ($ row ['company_logo ' ]);
608
+
600
609
$ client_id = intval ($ _POST ["client_id " ]);
601
610
$ export_contacts = intval ($ _POST ["export_contacts " ]);
602
611
$ export_locations = intval ($ _POST ["export_locations " ]);
603
612
$ export_assets = intval ($ _POST ["export_assets " ]);
604
613
$ export_software = intval ($ _POST ["export_software " ]);
605
614
$ export_credentials = 0 ;
606
615
if (lookupUserPermission ("module_credential " ) >= 1 ) {
607
- $ export_credentials = intval ($ _POST ["export_credentials " ]);
616
+ $ export_credentials = intval ($ _POST ["export_credentials " ] ?? 0 );
608
617
}
609
618
$ export_networks = intval ($ _POST ["export_networks " ]);
610
619
$ export_certificates = intval ($ _POST ["export_certificates " ]);
747
756
$ pdf ->SetAuthor ($ session_company_name );
748
757
$ pdf ->SetTitle ("$ client_name - IT Documentation " );
749
758
759
+ // TODO: Add page numbers to footer, but can't work out how to do it without the ugly line
760
+ // $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
761
+ // $pdf->setFooterData();
762
+
750
763
// Enable auto page breaks with a margin from the bottom
751
764
$ pdf ->SetAutoPageBreak (true , 15 );
752
765
779
792
" ;
780
793
781
794
// Cover page section (for main content, not the TOC)
795
+ $ html .= '<div class="cover"> ' ;
796
+ if (!empty ($ company_logo )) {
797
+ $ pdf ->Image ('uploads/settings/ ' . $ company_logo , '' , '' , 35 , 35 , '' , '' , 'L ' , false , 300 , '' , false , false , 1 , false , false , false );
798
+ }
782
799
$ html .= "
783
- <div class='cover'>
784
- <h1> $ client_name</h1>
785
- <h2>IT Documentation</h2>
786
- <p>Export Date: " . date ("F j, Y " ) . "</p>
800
+ <h1>IT Documentation</h1>
801
+ <h2> $ client_name</h2>
802
+ <h4>Prepared by $ session_name on " . date ("F j, Y " ) . "</h4>
787
803
</div>
788
- <hr> " ;
804
+ " ;
805
+ $ html .= "
806
+ <br>
807
+ <h4> $ session_company_name</h4>
808
+ $ company_phone<br> $ company_email<br>
809
+ <hr>
810
+ " ;
789
811
790
812
// Client header information (non-table)
791
813
$ html .= "
792
814
<div class='client-header'>
815
+ <h3> $ client_name</h3>
793
816
<p><strong>Address:</strong> $ location_address</p>
794
817
<p><strong>City State Zip:</strong> $ location_city $ location_state $ location_zip</p>
795
818
<p><strong>Phone:</strong> $ contact_phone</p>
1203
1226
<th>Type</th>
1204
1227
<th>License</th>
1205
1228
<th>License Key</th>
1229
+ <th>Purchase Date</th>
1230
+ <th>Expiration Date</th>
1206
1231
<th>Notes</th>
1207
1232
</tr>
1208
1233
</thead>
1212
1237
$ software_type = nullable_htmlentities ($ row ["software_type " ]);
1213
1238
$ software_license_type = nullable_htmlentities ($ row ["software_license_type " ]);
1214
1239
$ software_key = nullable_htmlentities ($ row ["software_key " ]);
1240
+ $ software_purchase = nullable_htmlentities ($ row ['software_purchase ' ]);
1241
+ $ software_expire = nullable_htmlentities ($ row ['software_expire ' ]);
1215
1242
$ software_notes = nullable_htmlentities ($ row ["software_notes " ]);
1216
1243
$ html .= "
1217
1244
<tr style='page-break-inside: avoid;'>
1218
1245
<td> $ software_name</td>
1219
1246
<td> $ software_type</td>
1220
1247
<td> $ software_license_type</td>
1221
1248
<td> $ software_key</td>
1249
+ <td> $ software_purchase</td>
1250
+ <td> $ software_expire</td>
1222
1251
<td> $ software_notes</td>
1223
1252
</tr> " ;
1224
1253
}
1326
1355
<thead>
1327
1356
<tr>
1328
1357
<th>Domain Name</th>
1329
- <th>Expire </th>
1358
+ <th>Expiration Date </th>
1330
1359
</tr>
1331
1360
</thead>
1332
1361
<tbody> " ;
1383
1412
// Output the PDF document for download
1384
1413
$ pdf ->Output (strtoAZaz09 ($ client_name ) . "-IT_Documentation- " . date ("Y-m-d " ) . ".pdf " , "D " );
1385
1414
exit ;
1386
- }
1415
+ }
0 commit comments