Das ist die Sendeplan.php
<?php
defined ('main') or die ( 'no direct access' );
defined ('admin') or die ( 'only admin access' );
$design = new design ( 'Admins Area', 'Admins Area', 2 );
$design->header();
$tpl = new tpl ('radio/sendeplan.htm', 1);
if ($menu->getA(1) == 'd')
{
$id = escape($menu->getE(1),'integer');
db_query("DELETE FROM `prefix_radio_sendeplan` WHERE `id` = '$id'");
wd('admin.php?sendeplan', 'Eintrag Nr.'.$id.' wurde gelöscht!');
}
elseif (isset($_POST['save']))
{
$date = escape($_POST['date'],'string');
$time = escape($_POST['time'],'string');
$dj = escape($_POST['dj'],'integer');
$txt = escape($_POST['txt'],'textarea');
db_query("INSERT INTO `prefix_radio_sendeplan` (`date`,`time`,`dj_id`,`content`) VALUES ('$date','$time','$dj','$txt')");
wd('admin.php?sendeplan', 'Neuer Eintrag wurde hinzugefügt.');
}
elseif (isset($_POST['edit']))
{
$date = escape($_POST['date'],'string');
$time = escape($_POST['time'],'string');
$dj = escape($_POST['dj'],'integer');
$txt = escape($_POST['txt'],'textarea');
$id = escape($_POST['id'],'integer');
db_query("UPDATE `prefix_radio_sendeplan` SET `date` = '$date', `time` = '$time', `dj_id` = '$dj', `content` = '$txt' WHERE `id` = '$id'");
echo $dj;
wd('admin.php?sendeplan', 'Eintrag erfolgreich geändert.');
}
else
{
$tpl->out(0);
$limit = 30; // Limit
$page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1 );
$MPL = db_make_sites ($page , '' , $limit , "admin.php?sendeplan" , 'radio_sendeplan' );
$anfang = ($page - 1) * $limit;
$q = db_query("SELECT `id`,`date`,`time`,`dj_id` FROM `prefix_radio_sendeplan` LIMIT $anfang,$limit");
while($row = db_fetch_assoc($q))
{
$dj = db_result(db_query("SELECT `name` FROM `prefix_user` WHERE `id` = '".$row['dj_id']."'"));
$dj = empty($dj) ? 'Ex-DJ' : $dj;
$entry = $row['date'].', '.$row['time'];
$tpl->set('ID',$row['id']);
$tpl->set('DJ',$dj);
$tpl->set('ENTRY',$entry);
$tpl->out(1);
}
$tpl->set('MPL', $MPL);
if ($menu->getA(1) == 'e')
{
$id = escape($menu->getE(1),'integer');
$row = db_fetch_assoc(db_query("SELECT * FROM `prefix_radio_sendeplan` WHERE `id` = '$id'"));
$q = db_query("SELECT `a`.`name`,`b`.`userid` as djid FROM `prefix_radio_djs` b LEFT JOIN `prefix_user` a ON `a`.`id` = `b`.`userid`");
$djs = '<select name="dj">';
while ($row2 = db_fetch_assoc($q))
$djs .= '<option value="'.$row2['djid'].'"'.($row2['djid'] == $row['dj_id'] ? 'selected="selected"' : '').'>'.$row2['name'].'</option>';
$djs .= '</select>';
$dj = $row['djid'];
$date = $row['date'];
$time = $row['time'];
$text = $row['content']."\n\n\n[i]Letzte Änderung am ".date('d.m.Y').' um '.date('H:i').'[/i]';
$editid = '<input type="hidden" name="id" value="'.$id.'" />';
$tpl->set('DJ',$djs);
$tpl->set('DATE',$date);
$tpl->set('TIME',$time);
$tpl->set('TEXT',$text);
$tpl->set('METHOD','edit');
$tpl->set('EDITID',$editid);
$tpl->out(2);
}
else
{
$q = db_query("SELECT `a`.`name`,`b`.`userid` as djid FROM `prefix_radio_djs` b LEFT JOIN `prefix_user` a ON `a`.`id` = `b`.`userid`");
$djs = '<select name="dj">';
while ($row = db_fetch_assoc($q))
$djs .= '<option value="'.$row['djid'].'"'.($row['djid'] == $_SESSION['authid'] ? 'selected="selected"' : '').'>'.$row['name'].'</option>';
$djs .= '</select>';
$date = date('Y-m-d');
$time = date('H:i').' - '.date('H:i',mktime(date('H')+1,date('i'),date('s'),date('n'),date('j'),date('Y')));
$text = '';
$tpl->set('DJ',$djs);
$tpl->set('DATE',$date);
$tpl->set('TIME',$time);
$tpl->set('TEXT',$text);
$tpl->set('METHOD','save');
$tpl->set('EDITID','');
$tpl->out(2);
}
}
require_once('include/includes/class/scRadioModul.php');
echo getCopyright(false);
$design->footer();
?>
In der Sendeplan.php vom Sendeplan auf der Seite hatte ich diese Zeile geändert. Damit war es nach Datum sortiert.
$query = db_query("SELECT * FROM `prefix_radio_sendeplan` WHERE `date` = '$toshow' ORDER BY time");
Zuletzt modifiziert von deejay2302 am 24.02.2013 - 19:50:59