Initial commit
This commit is contained in:
79
wort_wahl.php
Normal file
79
wort_wahl.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/*
|
||||
# Fuer debugging
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
#echo __LINE__."<br>";
|
||||
*/
|
||||
|
||||
include_once 'classes/lg-on_Smarty.class.php';
|
||||
$smarty = new lgon_Smarty();
|
||||
require_once("config.inc.php");
|
||||
require_once("func_rollenrechte.php");
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
require_once "language/german.inc.php";
|
||||
|
||||
|
||||
// Rechteüberprüfung
|
||||
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
|
||||
if(!rore($user_admin,'a_wahl','RE')){require("lib/rechte.php");exit;}
|
||||
// Rechteüberprüfung ende
|
||||
|
||||
|
||||
|
||||
if(isset($_GET['action'])){
|
||||
$action = $_GET['action'];
|
||||
}else{
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if($action == ''){
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($action == 'ort'){
|
||||
$lid = $_POST['wort'];
|
||||
$smarty->assign('lid', "$lid");
|
||||
}
|
||||
|
||||
|
||||
#$smarty->assign('action', "$action");
|
||||
|
||||
|
||||
$db = dbconnect();
|
||||
$result_gd = $db->query( "SELECT wgd FROM profil WHERE user = '$user_admin'" );
|
||||
$row_gd = $result_gd->fetch_array();
|
||||
|
||||
|
||||
$query = "SELECT DISTINCT lid, DATE_Format(datum, '%d.%m.%Y')AS datum, DATE_Format(datum, '%Y%m%d')AS datum_sort, ueberschrift, DATE_Format(datum, '%d') tag, DATE_Format(datum, '%m') monat, DATE_Format(datum, '%Y') jahr, kid, ukid
|
||||
FROM quelle
|
||||
WHERE inhalt != ''
|
||||
ORDER BY datum_sort DESC
|
||||
";
|
||||
$result = $db->query( $query);
|
||||
|
||||
while ($row = $result->fetch_array())
|
||||
{
|
||||
$wochentag = date("l", mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']));
|
||||
|
||||
if($wochentag == 'Wednesday' AND $row_gd['wgd'] != '0' AND ($row['ukid'] != "25" AND $row['ukid'] != "26" AND $row['ukid'] != "22" )){
|
||||
$datum = date("d.m.Y", mktime(0,0,0,$row['monat'],$row['tag']+$row_gd['wgd'],$row['jahr']));
|
||||
}else{
|
||||
$datum = date("d.m.Y", mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']));
|
||||
}
|
||||
|
||||
|
||||
$row['datum'] = $datum;
|
||||
$value[] = $row;
|
||||
}
|
||||
|
||||
// Assign this array to smarty...
|
||||
$smarty->assign('table_data', $value);
|
||||
|
||||
|
||||
|
||||
$smarty->assign('action', "$action");
|
||||
$smarty->display("$template/$templatename");
|
||||
|
||||
?>
|
Reference in New Issue
Block a user