Location: PHPKode > projects > GECO > Admin_Del_DDT.php
<?

include("dblib.inc");

include("clublib.inc");

checkAdmin();
$message = "";

if (isset($actionflag) && $actionflag=="Delete")
	{
		$result = delRow($DDT_table, "ID_DDT", $ID_DDT);
		header("Location: Admin_DDT.php");
		exit;	
	}
		
	
if (! isset($actionflag))

		{

		// recupero i dati dell'ordine dal db
		
		$form = getRow($DDT_table, "ID_DDT", $ID_DDT);
		
		// faccio qualche operazione sulla data
		// converto la data in Unix timestamp
		$ts_Data_Ordine = strtotime ($form['Data_DDT']);
		
		// ricavo giorno, mese, anno
		$giorno = strftime("%d", $ts_Data_DDT);
		$mese = strftime("%m", $ts_Data_DDT);
		$anno = strftime("%Y", $ts_Data_DDT);
		// print $giorno ."-".$mese."-".$anno  ;
		// print strftime ($form['Data_Ordine']);
		
		}
if ($form['ID_Pagamento'] == "")
	$message = "Sei sicuro di voler rimuovere la fattura?";


		

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">



<html>

<head>

	<title>Visualizzazione Fattura</title>



	<link rel="stylesheet" type="text/css" href="Themes/Facet/Style.css">

</head>



<body bgcolor="#FFFFFF" link="#504C43" alink="#000000" vlink="#504C43" text="#000000">

<? 

include("Header.php"); 



?>

<form method="post" action="<?php print $PHP_SELF;?>" name="pws_fatturas">

<!-- flag di invio del modulo -->

<input type="Hidden" name="actionflag" value="Delete">

<input type="Hidden" name="ID_DDT" value="<? print $ID_DDT; ?>">
<div align="center"><font class="FacetFormHeaderFont">Fattura</font></div>

<table border="0" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="center">

  <!-- BEGIN Error -->

  <tr>

    <td colspan="2" class="FacetDataTD">

	<?php

	if (! $message == "")

	{

	print "$message";

	}

	?>

	</td>

  </tr>

  <!-- END Error -->

  
  
  <tr>

    <td class="FacetFieldCaptionTD">Numero Fattura</td>

    <td class="FacetDataTD"><input type="text" name="form[Prog_Fattura_Annuo]" disabled value="<?php print $form["Prog_DDT_Annuo"] ?>" maxlength="30" size="20" class="FacetInput">&nbsp;</td>

  </tr>

  <tr>

    <td class="FacetFieldCaptionTD">Cliente * &nbsp;</td>

    <td class="FacetDataTD"><select name="form[ID_Cliente]" disabled  class="FacetSelect">

	

<?php 
// imposto come selzionato il cliente che e' nel database
print "<option value=\"".$form['ID_Cliente']."\" selected>".$form['Ragione_Sociale']."</option>\n";
 ?>
 
 <option value=""></option>
 
 <?php 
// recupero tutti i clienti per la select del form


$result = dynQuery('*', $customers_table);
 


while ($a_row = dbms_fetch_array ($result))

	{

	print "<option value=\"".$a_row['ID_Cliente']."\">".$a_row['Ragione_Sociale']." - ".$a_row['Cognome']."</option>\n";

	}

	?>

	 </select></td>

  </tr>

 <td colspan="2" align="right" nowrap class="FacetFooterTD">
<?
if ($form['ID_Pagamento'] == "")

	{
     print " <input name=\"Insert\" type=\"submit\" value=\"Delete\" class=\"FacetButton\">";
	}
?>

    </td>

</table>

</form>



</body>

</html>

Return current item: GECO