<?php
 namespace App\Reports\Sources\Users; class PopulateInitialImport extends \App\Reports\Sources\PopulateAbstract { public function populate() :void { global $DBTRd_users; $this->reportGenerationStatusUpdate('extractMainDataFromDb', 'runningMainSQL', 0); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Insert( $this->tableManager->getTableName() ); $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( array_keys( $this->columnsManager->getStdColumns() ) ); $stdFilters = $this->filtersManager->getStdFilters(); if ($stdFilters['addDate']['start']) { $reportCopyInfo->addFilter('user.addTime', '>=', $stdFilters['addDate']['start']." 00:00:00"); } if ($stdFilters['addDate']['end']) { $reportCopyInfo->addFilter('user.addTime', '<=', $stdFilters['addDate']['end']." 23:59:59"); } $reportCopyInfo->populate(); } }