jb-data.de/sscheck.php
2025-08-11 22:23:30 +02:00

38 lines
No EOL
1.4 KiB
PHP

<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
header("Content-Type: text/html; charset=utf-8");
//----------------------------------------------------------------------------------------------------------
require('lib/config.php');
require('lib/mysql.class.php');
$jahr = (int)date('Y');
$kw = (int)date('W');
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
$rasql = new mysql(CONFIG_RASQL_HOST,CONFIG_RASQL_USER,CONFIG_RASQL_PW,CONFIG_RASQL_DB);
$mdata = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
$abfrageS = $rasql->query_array("SELECT * FROM tliste WHERE kw='".$kw."' AND jahr='".$jahr."' AND sped=1");
$abfrage_jb = $mdata->query("SELECT * FROM tourenliste WHERE kw='".$kw."' AND jahr='".$jahr."' AND typ=19");
while($row = $abfrage_jb->fetch_assoc()) {
//echo $row['id'];
$tour_id= array_search($row['tour'], array_column($abfrageS, 'tour'));
echo "Tour: ".$abfrageS[$tour_id]['id']." Status: ".$abfrageS[$tour_id]['status']."</br>";
//$abfrage1 = $rasql->query_single("SELECT * FROM tliste WHERE kw='".$kw."' AND jahr='".$jahr."' AND tour='".$row['tour']."'");
if($row['status']!=$abfrageS[$tour_id]['status']) {
$mdata->query("UPDATE tourenliste SET status='".$abfrageS[$tour_id]['status']."' WHERE id='".$row['id']."'");
}
}
// mysql_close ($GLOBALS['rasql']);
// mysql_close ($GLOBALS['mysql']);
echo "fertig";
?>