jb-data.de/template/tpl/ppal.tpl
2025-08-11 22:23:30 +02:00

351 lines
12 KiB
Smarty

<section class="col-md-9">
<div class="row sortable">
<!-- Main Section -- mittlere Spalte -->
<div class="col-md-2">
<div class="panel panel-warning">
<div class="panel-heading">Auswahl</div>
<div class="panel-body">
<table class="table-hover" style="font-size:11pt">
<tbody>
{foreach from=$tage item=tage}
<tr>
{if $tage.tagt==1} <td><hr></td><td><hr></td></tr><tr> {/if}
{if $tage.aktiv>0}
<td nowrap style="width:5px;line-height:120%;font-size:8pt;background:#FF0"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tage.tag}&tour={$tour}'">{$tage.wt}
</td>
<td nowrap style="width:70px;line-height:120%;font-size:12pt;background:#FF0"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tage.tag}&tour={$tour}'">{$tage.datum}
</td>
{elseif $tage.ft>0}
<td nowrap style="width:5px;line-height:120%;font-size:8pt;background:#F5A50D"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tage.tag}&tour={$tour}'">{$tage.wt}
</td>
<td nowrap style="width:70px;line-height:120%;font-size:12pt;background:#F5A50D"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tage.tag}&tour={$tour}'">{$tage.datum}
</td>
{else}
<td nowrap style="width:5px;line-height:120%;font-size:8pt"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tage.tag}&tour={$tour}'">{$tage.wt}
</td>
<td nowrap style="width:70px;line-height:120%;font-size:12pt"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tage.tag}&tour={$tour}'">{$tage.datum}
</td>
{/if}
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<!-- --------------------------- Tourauswahl -->
{if $atour>0}
{foreach from=$agtour item=agtour}
<div class="col-md-2">
<button type="button" class="btn btn-info btn-block"
onclick="window.location='?s=ppal&jahr={$jahr}&monat={$monat}&tag={$tag}&tour={$agtour.tid}'">{$agtour.tour}</button>
</div>
{/foreach}
{/if}
{if $tour>0}
<div class="col-md-10">
<div class="panel panel-primary">
<div class="panel-body"><mark>{$tname}</mark>&nbsp;Palette für <mark>{$wtag}</mark>,den <mark>{$tag}.{$monat}.{$jahr}</div>
</div>
</div>
{/if}
{if $tour==0 && $atour==0}
<div class="col-md-10">
<div class="panel panel-danger">
<p class="bg-danger">&nbsp;keine PIN-AG-Tour in der Datenbank für den {$tag}.{$monat}.{$jahr} !!!</p>
</div>
</div>
{/if}
{if $tour==0 && $atour>0}
<div class="col-md-10">
<div class="panel panel-danger">
<p class="bg-danger">&nbsp;Bitte Tour auswählen !!!</p>
</div>
</div>
{/if}
{if $tour>0 && $atour>0}
<div class="col-md-10">
<div class="panel panel-primary">
<div class="panel-body">
<table class="table-hover" style="font-size:11pt">
<thead>
<tr>
<td style="width:60px">Menge</td>
<td style="width:140px">Fahrer</td>
<td style="width:240px">Bezeichnung</td>
<td style="width:60px">einzel</td>
<td style="width:40px">speichern</td>
</tr>
</thead>
<tbody>
<tr>{$tname}
<form action="" method="post">
<td nowrap style="width:60px;font-size:11pt;">
<input type="float" value="0.50" style="width:45px;text-align:right;" name="menge" placeholder="0.25">
</td>
<!-- --------------------------- fahrer -->
<td nowrap style="width:160px;font-size:11pt;">
<select name="Fahrer" style="width:150px;">
{foreach from=$fahrer_array item=allfahrer}
{html_options values=$allfahrer.id output=$allfahrer.name selected=$fahrer_id}
{/foreach}
</select>
</td>
<td nowrap style="width:285px;font-size:11pt;">
<input type="text" style="width:240px;" name="info" placeholder="Bezeichnung"></td>
<td>
<input type="num" style="width:20px;" name="efahrt" placeholder="0"></td>
</td>
<input type="hidden" name="savetour" value="{$ptour.id}"/>
<input type="hidden" name="sendtour" value="{$ptour.id}"/>
<td>
<input type="submit" name="datesave" value="Speichern" >
</td>
</form>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-10">
<div class="panel panel-primary">
<div class="panel-body">
<table class="table table-striped" style="font-size:11pt">
<thead>
<tr>
<td style="width:80px">Datum</td>
<!-- <td style="width:20px">Tour</td> -->
<td style="width:140px">Fahrer</td>
<td style="width:20px">Menge</td>
<td style="width:200px">Bezeichnung</td>
<td style="width:20px">Extrafahrt</td>
</tr>
</thead>
<tbody>
{foreach from=$anz item=anz}
<tr>
<td nowrap style="width:80px;line-height:2;font-size:11pt;">{$anz.tag}.{$anz.monat}.{$anz.jahr}</td>
<!-- <td nowrap style="width:100px;line-height:2;font-size:11pt;">{$anz.tour}</td> -->
<td nowrap style="width:140px;line-height:2;font-size:11pt;">{$anz.fahrer}</td>
<td nowrap style="width:100px;line-height:2;font-size:11pt;">{$anz.menge} Pal.</td>
<td nowrap style="width:200px;line-height:2;font-size:11pt;">{$anz.info}</td>
<td nowrap style="width:20px;line-height:2;font-size:11pt;">{$anz.efahrt} x einzel</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
{/if}
</div>
</section>
<!-- Sidebar -->
<aside class="col-md-3">
<div id="rightmenu" class="panel panel-default">
<header class="panel-heading">
<table class="no-style full">
<tbody>
<td nowrap style=align:center;"width:160px;font-size:20pt">
<a class="fa fa-arrow-left" href="?s=ppin&wahl=1&jahr={$jahr}&monat={$monat}"></a>
<strong>{$monat}/{$jahr} </strong>
<a class="fa fa-arrow-right" href="?s=ppin&wahl=2&jahr={$jahr}&monat={$monat}"></a></td>
</tbody>
</table>
</header>
</div>
{foreach from=$kalinfo item=maf1 }
{if $maf1.tid==$tour}
<div id="rightmenu" class="panel panel-info">
{else}
<div id="rightmenu" class="panel panel-default">
{/if}
<header class="panel-heading"><h2 class="panel-title">{$maf1.tour} - {$tag}.{$monat}.{$jahr}</h2></header>
<div class="panel-body"><h2 class="panel-title">{$maf1.fahrer}</h2></header></div>
</div>
{/foreach}
<!--
<div id="rightmenu" class="panel panel-default">
<header class="panel-heading"><h2 class="panel-title">AG-Kalender f&uuml;r {$tag}.{$monat}.{$jahr}</h2></header>
<div class="panel-body">
<table class="no-style full">
<tbody> {foreach from=$kalinfo item=maf1 }
<tr>
<td nowrap style="width:125px;font-size:10pt"> {$maf1.tour}</td>
<td nowrap style="width:150px;font-size:10pt"> {$maf1.fahrer}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
-->
</aside>
<script> var tagheute = '{$datum_unix|date_format:"%Y-%m-%d"}';</script>
{literal}
<script>
function load_free_cars(tourID,date) {
$.ajax({
type: 'POST',
url: "ajax.php?s=paktuell&a=load_free_cars",
dataType: 'json',
data: 'tourID=' + tourID + "&date=" + date,
success: function (data) {
console.log(data)
$("#pkw").html("");
$("#trp").html("");
$("#caddy").html("");
$("#trptag").html("");
$("#caddytag").html("");
$.each( data.pkwtag, function( key, value ) {
$("#pkwtag").append(value+"<br>");
});
$.each( data.caddy, function( key, value ) {
$("#caddy").append(value+"<br>");
});
$.each( data.trp, function( key, value ) {
$("#trp").append(value+"<br>");
});
$.each( data.caddytag, function( key, value ) {
$("#caddytag").append(value+"<br>");
});
$.each( data.trptag, function( key, value ) {
$("#trptag").append(value+"<br>");
});
}
});
}
function save_car(tourID) {
//alert($("#car_"+tourID).val());
$.ajax({
type: 'POST',
url: "ajax.php?s=paktuell&a=car_save",
dataType: 'json',
data: 'tourID=' + tourID + "&car=" + $("#car_"+tourID).val(),
success: function (data) {
if(data.success == true) {
$.notify({
icon: 'glyphicon glyphicon-warning-ok',
message: data.lastnote
},{
type: 'success',
showProgressbar: true,
delay: 300,
newest_on_top: false,
element: 'body',
placement: {
from: "bottom",
align: "right"
},
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});
load_free_cars(tourID,tagheute)
}
console.log(data)
}
});
}
load_free_cars(0,tagheute);
function save_info(tourID) {
$.ajax({
type: 'POST',
url: "ajax.php?s=paktuell&a=info_save",
dataType: 'json',
data: 'tourID=' + tourID + "&info=" + $("#info_"+tourID).val(),
success: function (data) {
$.notify({
icon: 'glyphicon glyphicon-warning-ok',
message: data.lastnote
},{
type: 'info',
showProgressbar: true,
delay: 300,
newest_on_top: false,
element: 'body',
placement: {
from: "bottom",
align: "right"
},
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});
console.log(data)
}
});
}
function save_user(tourID) {
//alert($("#car_"+tourID).val());
$.ajax({
type: 'POST',
url: "ajax.php?s=paktuell&a=user_save",
dataType: 'json',
data: 'tourID=' + tourID + "&user=" + $("#user_"+tourID).val(),
success: function (data) {
if(data.success == true) {
$.notify({
icon: 'glyphicon glyphicon-warning-ok',
message: data.lastnote
},{
type: 'success',
showProgressbar: true,
delay: 300,
newest_on_top: false,
element: 'body',
placement: {
from: "bottom",
align: "right"
},
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});
}
console.log(data)
}
});
}
</script>
{/literal}