mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
Cronjob: SponsionJob: Sponsionsdatum als ZGV-Datum übernehmen
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* FH-Complete
|
||||
*
|
||||
*
|
||||
* Cronjobs to be run for inserting the date of Sponsion as Date ZGV for further applications.
|
||||
* Cronjobs to be run for inserting the date of Sponsion as Date ZGV of absolvents
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@@ -20,29 +20,40 @@ class SponsionJob extends JOB_Controller
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Abschlusspruefung_model', 'AbschlusspruefungModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
}
|
||||
|
||||
public function insertDate()
|
||||
{
|
||||
$allAbsolventsWithDateSponsion = $this->AbschlusspruefungModel->getAbsolventsWithSponsionDate()->retval;
|
||||
$count = 0;
|
||||
$countBewerbungen = 0;
|
||||
|
||||
print_r("-----------------------------------------------------------------\n");
|
||||
print_r("Cronjob START\n");
|
||||
print_r("Sponsionsdatum als ZGV-Datum eintragen:\n");
|
||||
|
||||
foreach ($allAbsolventsWithDateSponsion as $absolvent)
|
||||
{
|
||||
$this->AbschlusspruefungModel->insertDatumSponsionAsZgvmadatum($absolvent->prestudent_id, $absolvent->sponsion);
|
||||
|
||||
//get all prestudents of person_id with Status Interessent
|
||||
$allBewerbungen = $this->PrestudentModel->getPrestudentsOfPersonId($absolvent->person_id, 'Interessent')->retval;
|
||||
foreach ($allBewerbungen as $bewerbung)
|
||||
{
|
||||
$this->AbschlusspruefungModel->insertDatumSponsionAsZgvmadatum($bewerbung->prestudent_id, $absolvent->sponsion);
|
||||
print_r (" Bewerbung: personId: " . $absolvent->person_id . " prestudentId: " . $bewerbung->prestudent_id. " DateSponsion: " . $absolvent->sponsion."\n");
|
||||
$countBewerbungen++;
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
print_r("\nAnzahl Absolventen: " . $count);
|
||||
print_r("\nAnzahl Inserts Bewerbungen: " . $countBewerbungen);
|
||||
print_r("\nCronjob END\n");
|
||||
print_r("-----------------------------------------------------------------\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//******************************************************************************************************************
|
||||
// PRIVATE FUNCTIONS
|
||||
//******************************************************************************************************************
|
||||
|
||||
private function getAbsolventsWithSponsion()
|
||||
{
|
||||
$mResult = $this->AbschlusspruefungModel->getAbsolventsWithSponsionDate();
|
||||
$absolventList = getData($mResult);
|
||||
// $vorgesetzte = array();
|
||||
// $toSend = array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user