<?php
 $currDir=dirname(__FILE__).'/'; $reportFilters['addTime']['startDateStamp']=strtotime(standard2mysqlDateConversion($reportFilters['addTime']['startDate'])); $reportFilters['addTime']['endDateStamp']=strtotime(standard2mysqlDateConversion($reportFilters['addTime']['endDate']))+86399; list($reportFilters['idOffice'],$reportFilters['idUser'])=explodeClean("|", $reportFilters['addOfficeUser']['id']); include($currDir."reportData_executeSQL.php"); refreshReportStatus('processingRecords', 'getUserInfo', 0); if($tableColumns['userName'] || $tableColumns['userOfficeId'] || $tableColumns['userOfficeName'] || $tableColumns['idDepartment'] || $tableColumns['departmentName']){ $updateReportSQL="
		UPDATE 
			`$reportTable` AS rep, `$DBTUsers` AS users
	"; if($tableColumns['userOfficeName']) $updateReportSQL.=" LEFT JOIN `$DBTOffices` AS office ON  users.idOffice=office.id"; if($tableColumns['departmentName']) $updateReportSQL.=" LEFT JOIN `$DBTDepartments` AS department ON  users.idDepartment=department.id"; $updateReportSQL.="
		SET rep.idUser=users.id
	"; if($tableColumns['userName'] ) $updateReportSQL.="	,rep.userName=CONCAT(users.lastName,' ',users.firstName) "; if($tableColumns['userOfficeId'] ) $updateReportSQL.="	,rep.userOfficeId=users.idOffice"; if($tableColumns['userOfficeName']) $updateReportSQL.="	,rep.userOfficeName=office.name"; if($tableColumns['idDepartment'] ) $updateReportSQL.="	,rep.idDepartment=users.idDepartment"; if($tableColumns['departmentName']) $updateReportSQL.="	,rep.departmentName=department.name"; $updateReportSQL.="
		WHERE
			rep.idUser=users.id AND rep.idUser>0
	"; $updateReportEx=$db->Execute($updateReportSQL); if ($db->ErrorNo()) killReport("Could not run SQL in report. SQL: ".$updateReportSQL); } include_once('reportData_loopRecords.php'); ?>