<?php
refreshReportStatus('extractMainDataFromDb', 'updateOfficeDetails', 0); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_countries, 'office_countryName', 'office_countryCode', 'nameStd', 'code'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_cities, 'office_cityName', 'office_cityId', "nameStd"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_offices, 'office_addOfficeName', 'office_addOfficeId', "name"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'office_updateUserName', 'office_idUpdateUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); refreshReportStatus('extractMainDataFromDb', 'updateCorporateDetails', 0); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_corporateSegments, 'corp_segmentName', 'corp_idSegment', 'name'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'corp_accountManagerName', 'corp_idAccountManager', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'corp_collectionRespName', 'corp_idCollectionResp', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'corp_invoiceRespName', 'corp_idInvoiceResp', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_trusts, 'trust_name', 'trust_id', 'name'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_activityDomains, 'domain_name', 'domain_id', 'name'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_activityDomainCategories, 'domainCategory_name', 'domainCategory_id', 'name'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addJoinTable($DBTRd_corporates, 'realCorp', 'rep.realCorp_id=realCorp.id', 'LEFT'); $cols = [ 'realCorp_alias' => 'realCorp.alias', 'realCorp_companyNameStd' => 'realCorp.companyNameStd', 'realCorp_companyNameLoc' => 'realCorp.companyNameLoc', ]; $reportCopyInfo->setStructureColumns($cols); $reportCopyInfo->populate(); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addStructureColumn('corp_hasContract', '(SELECT 1 FROM `'.$DBTRd_corporateContracts.'` WHERE rep.corp_id = idCorporate AND deleted=0 LIMIT 1)', 'rep'); $reportCopyInfo->populate(); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'corp_addUserName', 'corp_idAddUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'corp_updateUserName', 'corp_idUpdateUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)");