183 lines
8 KiB
PHP
183 lines
8 KiB
PHP
<?php
|
|
|
|
if(isset($_GET['a']))
|
|
$action=$_GET['a'];
|
|
|
|
else
|
|
$action='list';
|
|
switch($action):
|
|
|
|
case 'show';
|
|
if(isset($_GET['mid']) && $_GET['mid'] != '') {
|
|
$tourenliste = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$_GET['mid']."'");
|
|
if($tourenliste['num_rows'] == 1) {
|
|
|
|
$tourenlisterow = $GLOBALS['mysql']->query("SELECT * FROM touren");
|
|
while($tourenlisteinfo = $tourenlisterow->fetch_assoc()){
|
|
$option1.='<option value="'.$tourenlisteinfo['tour'].'" >'.$tourenlisteinfo['tour'].'</option>';
|
|
|
|
}
|
|
$template->assign('option1', $option1);
|
|
|
|
if(isset($_POST['savetour'])) {
|
|
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET Tour='".$_POST['Tour'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET Auflage='".$_POST['Auflage'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET Pakete='".$_POST['Pakete'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET Ladung='".$_POST['Ladung'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET Paket='".$_POST['Paket'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET Stellzeit='".$_POST['Stellzeit'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET StartRampe='".$_POST['StartRampe'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
// $GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']. SET EndeRampe='".$_POST['EndeRampe'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']." SET fahrer='".$_POST['Fahrer'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']." SET auto='".$_POST['Fahrzeug'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ".$tourenliste['tour']." SET infotext='".$_POST['infotext'][$_POST['savetour']]."' WHERE id='".$_POST['savetour']."'");
|
|
$success[]='Tour wurde geändert.' ; $template->assign('success', $success);
|
|
|
|
}
|
|
|
|
|
|
$key=0;
|
|
$touren = $GLOBALS['mysql']->query("SELECT * FROM ".$tourenliste['tour']." WHERE erl='0' LIMIT 200");
|
|
while($row = $touren->fetch_assoc()){
|
|
$touren2[$key]['id']=$row['id'];
|
|
/*
|
|
$touren2[$key]['jahr']=$row['jahr'];
|
|
$touren2[$key]['monat']=$row['monat'];
|
|
$touren2[$key]['tag']=$row['tag'];
|
|
*/
|
|
$wochentag=date('l',mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']));
|
|
$touren2[$key]['wt']=$wochentag=$GLOBALS['core']->translateDate($wochentag);
|
|
$touren2[$key]['kw']=date('W', mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']));
|
|
$touren2[$key]['tag']=date('d.m.Y', mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']));
|
|
$row_fahrer = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
|
|
$touren2[$key]['fahrer']=$row_fahrer['name'];
|
|
$touren2[$key]['fahrer_id']=$row_fahrer['id'];
|
|
$row_fahrer_array = $GLOBALS['mysql']->query_array("SELECT * FROM mitarbeiter");
|
|
$touren2[$key]['fahrer_array']=$row_fahrer_array;
|
|
|
|
$touren2[$key]['zeit']=$row['zeit'];
|
|
/*
|
|
$touren2[$key]['gewicht1']=$row['gewicht1'];
|
|
$touren2[$key]['gewicht2']=$row['gewicht2'];
|
|
$touren2[$key]['gewicht3']=$row['gewicht3'];
|
|
$touren2[$key]['gewicht4']=$row['gewicht4'];
|
|
$touren2[$key]['gewicht5']=$row['gewicht5'];
|
|
$touren2[$key]['gesammtgewicht']=$row['gewicht1']+$row['gewicht2']+$row['gewicht3']+$row['gewicht4']+$row['gewicht5'];
|
|
*/
|
|
|
|
$row_auto = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
|
|
$touren2[$key]['kennz']=$row_auto['kz'];
|
|
$touren2[$key]['auto_id']=$row['auto'];
|
|
$row_auto_array = $GLOBALS['mysql']->query_array("SELECT * FROM fahrzeuge");
|
|
$touren2[$key]['auto_array']=$row_auto_array;
|
|
|
|
|
|
// $touren2[$key]['auto']=$row['auto'];
|
|
$touren2[$key]['infotext']=$row['infotext'];
|
|
// $touren2[$key]['afirma']=$row['afirma'];
|
|
// $touren2[$key]['erl']=$row['erl'];
|
|
$key++;
|
|
|
|
}
|
|
|
|
// Vorabanzeige resultat
|
|
// echo "<pre>";
|
|
// print_r($touren2);
|
|
// echo "</pre>";
|
|
|
|
$template->assign('touren2', $touren2);
|
|
$template->assign('content', 'tpl/ttouren_show.tpl');
|
|
} else {
|
|
$error[]='Tour existiert nicht!'; $template->assign('error', $error);
|
|
$template->assign('content', 'tpl/leer.tpl');
|
|
}
|
|
|
|
|
|
} else {
|
|
$warning[]='Es wurde keine Tour ausgewählt!'; $template->assign('warning', $warning);
|
|
$template->assign('content', 'tpl/leer.tpl');
|
|
}
|
|
break;
|
|
|
|
case 'list';
|
|
default:
|
|
|
|
//if(isset($_POST['tour'])) { $GLOBALS['mysql']->insert("INSERT INTO touren (tour,infotitel) VALUES('".$_POST['tour']."','".$_POST['infotitel']."')"); }
|
|
//if(isset($_POST['delete'])) { $GLOBALS['mysql']->query("DELETE FROM touren WHERE id='".$_POST['delete']."'"); }
|
|
$tourenliste = $GLOBALS['mysql']->query_array("SELECT * FROM touren WHERE typ='1'");
|
|
$template->assign('tourenliste', $tourenliste);
|
|
$template->assign('content', 'tpl/ttouren_list.tpl');
|
|
endswitch;
|
|
?>
|
|
</head>
|
|
|
|
<div>
|
|
<table align="center" width="200">
|
|
<tr>
|
|
<td width="50%">Ausagbelimit</td>
|
|
<td width="50%">
|
|
<select name="ausgabelimit">
|
|
<option value="01">01</option>
|
|
<option value="02">02</option>
|
|
<option value="03">03</option>
|
|
<option value="04">04</option>
|
|
<option value="05">05</option>
|
|
<option value="06">06</option>
|
|
<option value="07">07</option>
|
|
<option value="08">08</option>
|
|
<option value="09">09</option>
|
|
<option value="10">10</option>
|
|
<option value="11">11</option>
|
|
<option value="12">12</option>
|
|
<option value="13">13</option>
|
|
<option value="14">14</option>
|
|
<option value="15">15</option>
|
|
<option value="16">16</option>
|
|
<option value="17">17</option>
|
|
<option value="18">18</option>
|
|
<option value="19">19</option>
|
|
<option value="20">20</option>
|
|
<option value="21">21</option>
|
|
<option value="22">22</option>
|
|
<option value="23">23</option>
|
|
<option value="24">24</option>
|
|
<option value="25">25</option>
|
|
<option value="26">26</option>
|
|
<option value="27">27</option>
|
|
<option value="28">28</option>
|
|
<option value="29">29</option>
|
|
<option value="30">30</option>
|
|
<option value="41">41</option>
|
|
<option value="42">42</option>
|
|
<option value="43">43</option>
|
|
<option value="44">44</option>
|
|
<option value="45">45</option>
|
|
<option value="46">46</option>
|
|
<option value="47">47</option>
|
|
<option value="48">48</option>
|
|
<option value="49">49</option>
|
|
<option value="50">50</option>
|
|
<option value="51">51</option>
|
|
<option value="52">52</option>
|
|
<option value="53">53</option>
|
|
<option value="54">54</option>
|
|
</select>
|
|
<?
|
|
while ($line = mysql_fetch_assoc($result_inst)) {
|
|
|
|
echo '<option value="'. $line['id_instrumente'] .'">' . $line['instrumente'] . '</option>';
|
|
|
|
}
|
|
?>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"><input type="submit" value="Los" /></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br />
|
|
|
|
|