added training locker cron job
This commit is contained in:
23
cron/lock_trainings.php
Normal file
23
cron/lock_trainings.php
Normal 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
0
cron/money_check.php
Executable file → Normal file
Reference in New Issue
Block a user