diff --git a/ts.php b/ts.php index e49f4bb..006d5ea 100644 --- a/ts.php +++ b/ts.php @@ -679,9 +679,22 @@ class AcareOffice{ $map = array(); foreach($tosarray as $item){ $map[$item->code] = $item->id; - echo "UPDATE wp1m_acare_ts SET tos_id=$item->id WHERE tos='$item->code' and id > 0; \n"; + if ( $item->year ==2019) { + $newid = $nd->get_id_by_tos($item->code, 20200325); + if ($newid != 0){ + echo "UPDATE wp1m_acare_ts SET tos=$newid WHERE tos= $item->id and id > 0 and start>='2020-03-25 00:00:00'; \n" ; + } + } + //echo "UPDATE wp1m_acare_ts SET tos_id=$item->id WHERE tos='$item->code' and id > 0; \n"; } - //print_r($map); + return; + $sql = "SELECT * FROM $this->table_name WHERE start>='2020-03-25 00:00:00' order by start ASC ,staff ASC "; + echo $sql . "\n"; + $jobs = $this->db->get_results($sql); + foreach ($jobs as $job) { + echo "id= ". $job->id . " tos= ". $job->tos . " start= " . $job->start . "\n"; + } + } private function send_email_with_job_link($staff, $start, $finish)