Vendor & contractor integration
This commit is contained in:
100
reports.php
100
reports.php
@@ -104,6 +104,7 @@
|
||||
<option value="<?php echo $_POST['reporttype']; ?>" placeholder="<?php echo $transLang['REPORTS']; ?>"><?php echo $_POST['reporttype']; ?></option>
|
||||
<?php else: ?>
|
||||
<option value="Default" selected><?php echo $transLang['DEFAULT']; ?></option>
|
||||
<option value="Vendors">Vendors</option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -113,7 +114,7 @@
|
||||
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['SITE']; ?>:</span>
|
||||
<?php if (isset($_POST['repsite'])) { $currentrepsite = $_POST['repsite']; } else { $currentrepsite = "0"; }; ?>
|
||||
<select name="repsite" class="form-control form-control-lg">
|
||||
<?php if($session_user["0"]["users_usertype"] == "ADMIN") { ?>
|
||||
<?php if($session_user["0"]["users_usertype"] == "USER-TYPES-ADMIN") { ?>
|
||||
<option value="all"<?php if ($currentrepsite == "all") {echo " selected";}; ?>><?php echo $transLang['ALL']; ?></option>
|
||||
<?php } ?>
|
||||
<?php foreach($SiteInfo->getSite("0", $uid, "0", "0") as $row): ?>
|
||||
@@ -149,7 +150,7 @@
|
||||
</div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<button type="submit" class="form-control form-control-lg btn btn-lg btn-primary"><i class="fas fa-play"></i> <?php echo $transLang['SAVE']; ?></button>
|
||||
<button type="submit" class="form-control form-control-lg btn btn-lg btn-primary"><i class="fas fa-play"></i> <?php echo $transLang['REPORT-EXECUTE']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -178,7 +179,7 @@
|
||||
<td><?php if (!empty($row['visits_outtime'])) {echo $timeout_disp; } else {echo $transLang['IN'];} ?></td>
|
||||
<td><?php echo $SiteInfo->getSite($row['visits_site_id'], $uid, "0", "0")[0]["sites_name"]; ?></td>
|
||||
<td><?php echo $row['visits_company']; ?></td>
|
||||
<td><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]['visittypes_name']]; ?></td>
|
||||
<td><?php echo $transLang[$VisitTypeInfo->getInfoVisitType("%", $row['visits_reason'])[0]['visittypes_name']]; ?></td>
|
||||
<td><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br /><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50" alt="Signature" /></td>
|
||||
<td><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50" alt="Escort Signature" />'; } ?></td>
|
||||
<td><?php echo $row['visits_badge']; ?></td>
|
||||
@@ -197,6 +198,99 @@
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if ($_POST['reporttype'] == "Vendors"): ?>
|
||||
<div class="container-fluid">
|
||||
<table id="report" class="table table-striped table-bordered table-sm table-responsive-sm text-nowrap">
|
||||
<thead><tr><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['OUT']; ?></th><th><?php echo $transLang['SITE']; ?></th><th><?php echo $transLang['COMPANY']; ?></th><th><?php echo $transLang['REASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['SIGNINBY']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th><?php echo $transLang['CARNUM']; ?></th><th><?php echo $transLang['SSANUM']; ?></th><?php } ?><?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?><th><?php echo $transLang['CITIZEN']; ?></th><?php } ?><th><?php echo $transLang['ID_TYPE']; ?></th><th><?php echo $transLang['TICKET']; ?></th><th><?php echo $transLang['DECLINE']; ?></th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$approval = "2";
|
||||
if ($_POST['repsite'] == "all") { $selsite="%"; } else { $selsite=$_POST['repsite'];}
|
||||
foreach ($VisitInfo->getVisitInfo($selsite, "%", "%", "%", "%", $_POST['starttime'], $_POST['endtime'], "%", "%") as $row):
|
||||
$timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC'));
|
||||
$timeout = new DateTime($row['visits_outtime'], new DateTimeZone('UTC'));
|
||||
$timein->setTimezone(new DateTimeZone("$timezone"));
|
||||
$timeout->setTimezone(new DateTimeZone("$timezone"));
|
||||
$timein_disp = $timein->format('Y-m-d H:i:s');
|
||||
$timeout_disp = $timeout->format('Y-m-d H:i:s');
|
||||
if(!empty($row['visits_carnum'])) { $carnum=$row['visits_carnum']; } else { $carnum="";}
|
||||
if(!empty($row['visits_ssanum'])) { $ssanum=$row['visits_ssanum']; } else { $ssanum="";}
|
||||
if ($row['visits_isvendor']===1) {
|
||||
?>
|
||||
<?php foreach ($VisitInfo->getInfoVendorVisitFinal($row['visits_id']) as $vnrow) {
|
||||
$db_vendorinfo_id = $vnrow['db_vendorinfo_id'];
|
||||
$db_vendorinfo_contact1 = $vnrow['db_vendorinfo_contact1'];
|
||||
$db_vendorinfo_contact2 = $vnrow['db_vendorinfo_contact2'];
|
||||
$db_vendorinfo_workstart = $vnrow['db_vendorinfo_workstart'];
|
||||
$db_vendorinfo_workend = $vnrow['db_vendorinfo_workend'];
|
||||
$db_vendorinfo_checklistrequired= $vnrow['db_vendorinfo_checklistrequired'];
|
||||
$db_vendorinfo_routinework = $vnrow['db_vendorinfo_routinework'];
|
||||
$db_vendorinfo_nonroutinework = $vnrow['db_vendorinfo_nonroutinework'];
|
||||
$db_vendorinfo_coi = $vnrow['db_vendorinfo_coi'];
|
||||
$db_vendorinfo_worksummary = $vnrow['db_vendorinfo_worksummary'];
|
||||
$db_vendorinfo_equipmentsummary = $vnrow['db_vendorinfo_equipmentsummary'];
|
||||
$db_vendorinfo_checklistcompleted = $vnrow['db_vendorinfo_checklistcompleted'];
|
||||
$db_vendorinfo_workcompleted = $vnrow['db_vendorinfo_workcompleted'];
|
||||
$db_vendorinfo_sitecleanup = $vnrow['db_vendorinfo_sitecleanup'];
|
||||
$db_vendorinfo_doccompleted = $vnrow['db_vendorinfo_doccompleted'];
|
||||
?>
|
||||
<tr>
|
||||
<td rowspan="3"><?php echo $timein_disp; ?></td>
|
||||
<td rowspan="3"><?php if (!empty($row['visits_outtime'])) {echo $timeout_disp; } else {echo $transLang['IN'];} ?></td>
|
||||
<td><?php echo $SiteInfo->getSite($row['visits_site_id'], $uid, "0", "0")[0]["sites_name"]; ?></td>
|
||||
<td><?php echo $row['visits_company']; ?></td>
|
||||
<td><?php echo $transLang[$VisitTypeInfo->getInfoVisitType("%", $row['visits_reason'])[0]['visittypes_name']]; ?></td>
|
||||
<td><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br /><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50" alt="Signature" /></td>
|
||||
<td><?php echo $row['visits_badge']; ?></td>
|
||||
<td><?php echo $Users->readUserFirstAndLast($row['visits_initials'])[0]["users_firstname"] . " " . $Users->readUserFirstAndLast($row['visits_initials'])[0]["users_lastname"]; ?></td>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
|
||||
<td><?php echo $carnum; ?></td>
|
||||
<td><?php echo $ssanum; ?></td>
|
||||
<?php } ?>
|
||||
<?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?> <td><?php echo $row['visits_citizen']; ?></td> <?php } ?>
|
||||
<td><?php if(isset($row['visits_id_type'])){echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]['idtypes_name']];} ?></td>
|
||||
<td><?php echo $row['visits_id_reference']; ?></td>
|
||||
<td><?php echo $row['visits_notes']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-CONTACT1']; ?>: <?php echo $db_vendorinfo_contact1; ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-CONTACT2']; ?>: <?php echo $db_vendorinfo_contact2; ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-WORKSTART']; ?>: <?php echo $db_vendorinfo_workstart; ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-WORKEND']; ?>: <?php echo $db_vendorinfo_workend; ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-CHECKLISTREQUIRED']; ?>: <?php if($db_vendorinfo_checklistrequired===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_checklistrequired===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-ROUTINEWORK']; ?>: <?php if($db_vendorinfo_routinework===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_routinework===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-NONROUTINEWORK']; ?>: <?php if($db_vendorinfo_nonroutinework===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_nonroutinework===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-COI']; ?>: <?php if($db_vendorinfo_coi===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_coi===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-WORKSUMMARY']; ?>: <?php echo $db_vendorinfo_worksummary; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted"> </td>
|
||||
<td class="text-muted"> </td>
|
||||
<td class="text-muted"> </td>
|
||||
<td class="text-muted"> </td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-CHECKLISTCOMPLETED']; ?>: <?php if($db_vendorinfo_checklistcompleted===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_checklistcompleted===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-WORKCOMPLETED']; ?>: <?php if($db_vendorinfo_workcompleted===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_workcompleted===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-SITECLEANUP']; ?>: <?php if($db_vendorinfo_sitecleanup===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_sitecleanup===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-DOCCOMPLETED']; ?>: <?php if($db_vendorinfo_doccompleted===0){echo $transLang['COMMON-NO'];}elseif($db_vendorinfo_doccompleted===1){echo $transLang['COMMON-YES'];} ?></td>
|
||||
<td class="text-muted"><?php echo $transLang['VENDORINFO-EQUIPMENTSUMMARY']; ?>: <?php echo $db_vendorinfo_equipmentsummary; ?></td>
|
||||
|
||||
<?php }; ?>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php }; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else: ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user