added training locker cron job

This commit is contained in:
Tóth Richárd
2019-11-21 21:59:05 +01:00
parent 2ef6b2dd95
commit de638392f9
2 changed files with 23 additions and 0 deletions

23
cron/lock_trainings.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
//add some security check
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'cegledcoach.hu') $sql = new sql('cegled_mysql','root','','badminton_coach');
else $sql = new sql('localhost','livingsp_coach','R186er012qw5','livingsp_badminton');
//get today trainings
$today = date("Y-m-d");
$trainings = $sql->assoc_array("SELECT * FROM training WHERE tr_deleted = 0 AND tr_date LIKE '{$today}%'");
foreach ($trainings as $key => $training) {
$sql->update_table("training", array(
"tr_locked" => 1
),
array(
"tr_id" => $training["tr_id"]
));
}
?>

0
cron/money_check.php Executable file → Normal file
View File