<?php
/*******************************************************************************
* filename : nsbase.php
* last change : 2006 - 11 - 20
*
* http://www.avesan.it/
* Copyright 2006 Alberto Santoro
*
* PMbyAS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
******************************************************************************/
$pgm="nsbase.php";
// --------------- connessione
require_once "./_fcom/fconn.php";
// --------------- sessione
require_once "./_fcom/fsess.php";
// --------------- dati di sessione
require_once "./_fcom/fperiodo.php";
// inclusione della testata HTML
require_once "./_fcom/doctype.php";
// ------------- inclusione barra navigazione
require_once "./_fcom/nav.php";
//if (isset($_REQUEST['merr']))
// {$merr = "Errore: " . "{$_REQUEST['merr']}";}
//else $merr = " ";
// --------------- Intestazione standard
$tsfun="Nota Spese";
$tsdt2=" $SE_rsucod $SE_rsudex ";
require_once "./_fcom/tstday.php";
// --------------- modulo per nuova Nota Spese
print "<form action=\"nsdett.php\" method=\"post\">";
print "\n<div class=\"cpst\"><div class=\"dvtlab2\">$SE_rsucod $SE_rsudex</div>";
print "\n<div class=\"dvtext\"><span class=\"bold7\">Prepara una nuova nota spese</div>";
print "\n<div class=\"dvpmsp40\"><input class=\"sub\" type=\"submit\" name=\"submit\" value=\"prepara\"></div></div>";
print "</form>";
// ----------------- elenco spese registrate
print "\n<div class=\"cpst\"><div class=\"dvtlab2\">Elenco Note Spese registrate</div></div>";
// ----------------- elenco note spese registrate
print "\n<div class=\"cpnn\">";
print "<table><thead><tr>";
print "\n<th width=\"20\"> </th>";
print "\n<th class=\"t8d\" width=\"60\">numero</th>";
print "\n<th class=\"t8d\" width=\"100\">registrazione</th>";
print "\n<th class=\"t8d\" width=\"100\">dal</th>";
print "\n<th class=\"t8d\" width=\"100\">al</th>";
print "\n<th width=\"120\"> </th>";
print "\n<th width=\"20\"> </th>";
print "\n</tr></thead>";
print "\n<tbody><tr><td class=\"tdtab\" colspan=\"7\"><div class=\"win380\"><table class=\"tbover\">";
$query = "SELECT * FROM proto_spese
WHERE PrsRsu = \"$SE_rsucod\"
ORDER BY PrsNum ";
$qrs = mysqli_query($connessione,$query) or die("Query sp fallita");
while ($rg = mysqli_fetch_assoc($qrs))
{
print "\n<tr>";
print "\n<td width=\"20\"class=\"pup\"><a href=\"nsvis.php?opt=PV&num={$rg["PrsNum"]}\">$_pup</a></td>";
print "\n<td width=\"60\" class=\"c8d\">{$rg["PrsNum"]}</td>";
$data = substr($rg["PrsDRG"],8,2).".".substr($rg["PrsDRG"],5,2).".".substr($rg["PrsDRG"],0,4);
print "\n<td width=\"100\" class=\"c8d\">$data</td>";
$data = substr($rg["PrsDIN"],8,2).".".substr($rg["PrsDIN"],5,2).".".substr($rg["PrsDIN"],0,4);
print "\n<td width=\"100\" class=\"c8d\">$data</td>";
$data = substr($rg["PrsDFN"],8,2).".".substr($rg["PrsDFN"],5,2).".".substr($rg["PrsDFN"],0,4);
print "\n<td width=\"100\" class=\"c8d\">$data</td>";
if ($rg["PrsStato"] == "A")
{$data = substr($rg["PrsStDay"],8,2).".".substr($rg["PrsStDay"],5,2).".".substr($rg["PrsStDay"],0,4);
print "\n<td width=\"120\" class=\"c8d\">Ann $data</td>";}
else print "\n<td width=\"120\"> </td>";
}
// --------------------------------------------- Fine tabella
print "\n</tr></table></div></td></tr></tbody>"; // --- chiusura corpo tabella
// --------------------- piede tabella
print "\n<tfoot><tr>";
print "\n<td colspan=\"2\" class=\"pd8s\"> </td>";
// ---------------------------------
print "\n</tr></tfoot></table</div>";
// -------------------------------- chiusura corpo pagina video
if ($tm <> "P") print "\n</div>";
?>
</div></body></html>