<?php
 refreshReportStatus('extractMainDataFromDb', 'runningMainSQL', 0); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Insert($reportTable); $reportCopyInfo->setMainTable($DBTRd_users, 'user'); $reportCopyInfo->addJoinTable($DBTRd_users, 'addUser', 'user.idAddUser=addUser.id', 'LEFT'); $cols = [ 'user_id' => 'user.id', 'user_idOffice' => 'user.idOffice', 'user_idDepartment' => 'user.idDepartment', 'user_username' => 'user.username', 'user_titleCode' => 'user.title', 'user_firstName' => 'user.firstName', 'user_lastName' => 'user.lastName', 'user_job' => 'user.job', 'user_IDSeries' => 'user.ID_series', 'user_IDNumber' => 'user.ID_number', 'user_IDReleaseBy' => 'user.ID_releaseBy', 'user_IDReleaseDate' => 'user.ID_releaseDate', 'user_PNC' => 'user.PNC', 'user_comments' => 'user.comments', 'user_remarks' => 'user.remarks', 'user_processedRemarks' => 'user.processedRemarks', 'user_birthday' => 'user.birthday', 'user_address' => 'user.address', 'user_telephone' => 'user.telephone', 'user_fax' => 'user.fax', 'user_email' => 'user.email', 'user_deleted' => 'user.deleted', 'user_addDateTime' => 'user.addTime', 'user_idAddUser' => 'user.idAddUser', 'user_lastUpdateDateTime' => 'user.lastUpdateTime', 'user_idUpdateUser' => 'user.idUpdateUser', 'user_updatesCount' => 'user.updatesCount', 'user_passwordExpireDate' => 'user.passwordExpireDate', 'user_idUsersAccessProfile' => 'user.idUsersAccessProfile', 'user_lastLoginDateTime' => 'user.lastLogin', 'user_loginCount' => 'user.loginCount', 'user_cantLoginUntil' => 'user.cantLoginUntil', ]; $reportCopyInfo->setStructureColumns($cols); $reportCopyInfo->addStructureColumn("user_addUserName", "CONCAT(addUser.lastName, ' ', addUser.firstName)", 'addUser'); $reportCopyInfo->setActiveColumns($availableTableColumns); if ($reportFilters['addDate']['start']) { $reportCopyInfo->addFilter('user.addTime', '>=', $reportFilters['addDate']['start']." 00:00:00"); } if ($reportFilters['addDate']['end']) { $reportCopyInfo->addFilter('user.addTime', '<=', $reportFilters['addDate']['end']." 23:59:59"); } $reportCopyInfo->populate(); 