Location: PHPKode > projects > PMbyAS - Gestione Attivita > versione_4_1/pmbyas_4_1_script/PMbyAS-4-0/rppm01.php
<?php
/*******************************************************************************
 *  filename    : rppm01.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="rppm01.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";

// -------------------------------- rientro
$_SESSION['chiamante'] =  $pgm;
// --------------- Intestazione  standard 
$tsfun="Scelta programma";
$tsprint="noprint";
$len = 990;
require_once "./_fcom/tstnopm.php";

// -------------------------- Testata tabella
print "\n<div class=\"cpnn\">";
print "\n<table ><thead><tr>";
print "\n<th width=\"20\" class=\"t8c\">&nbsp;</th>";
print "\n<th width=\"265\" class=\"t8s\">codice e descrizione</th>";
print "\n<th width=\"16\" class=\"t8c\">C</th>";

print "\n<th width=\"5\">&nbsp;</th>";
print "\n<th width=\"20\" class=\"t8c\">&nbsp;</th>";
print "\n<th width=\"265\" class=\"t8s\">codice e descrizione</th>";
print "\n<th width=\"16\" class=\"t8c\">C</th>";

print "\n<th width=\"5\">&nbsp;</th>";
print "\n<th width=\"20\" class=\"t8c\">&nbsp;</th>";
print "\n<th width=\"265\" class=\"t8s\">codice e descrizione</th>";
print "\n<th width=\"16\" class=\"t8c\">C</th>";

// --- corpo scrollabile
print "\n<th  width=\"20\">&nbsp</th>";
print "\n</tr></thead>";
if ($tm <> "P")  
   {print "\n<tfoot><tr>";
    print "\n<td class=\"pd8s\"colspan=\"12\">&nbsp;</td>";}
else print "\n<td colspan=\"12\">&nbsp;</td>";
print "\n</tr></tfoot>";
print "\n<tbody><tr><td colspan=\"12\"><div class=\"win478\"><table class=\"tbover\">";

$query = "SELECT * FROM prog ORDER BY PgmDex";
$rspm = mysqli_query($connessione,$query) or die("Query fallita");
$nrec = mysqli_num_rows($rspm);
$righe1 = (int) (($nrec+2)/3);
$righe2 = $righe1 * 2;
$xx = 0; $yy = 0; $zz = 0; $xt = 0;

while ($rg = mysqli_fetch_assoc($rspm))
 {
   if ($xt < $righe1)
      {$pgm1[$xx] = $rg["PgmCod"]; $dex1[$xx] = $rg["PgmDex"]; $sta1[$xx] = $rg["PgmStato"]; 
       $xt = $xt + 1; $xx = $xx + 1;}
   elseif ($xt < $righe2)
      {$pgm2[$yy] = $rg["PgmCod"]; $dex2[$yy] = $rg["PgmDex"]; $sta2[$xx] = $rg["PgmStato"];
       $xt = $xt + 1; $yy = $yy + 1;}
      else
      {$pgm3[$zz] = $rg["PgmCod"]; $dex3[$zz] = $rg["PgmDex"]; $sta3[$xx] = $rg["PgmStato"];
       $xt = $xt + 1; $zz = $zz + 1;};
  }      

$xx = 0; $yy = 0; $zz = 0; $xt = 0;
while ($xt < $righe1)
 {
  print "<tr>";
//  $lk = $pgm1[$xx];
  $lk = "agdet_p.php?opt=PV-".$pgm1[$xx];
  print "\n<td width=\"18\" class=\"pup\"><a href=$lk>$_pup</a></td>";
  print "\n<td width=\"266\" class=\"c8s\">{$pgm1[$xx]} &middot; {$dex1[$xx]}</td>";
  print "\n<td width=\"16\" class=\"c8c\">{$sta1[$xx]}</td>";  
  print "\n<td width=\"5\">&nbsp;</td>";
  
//  $lk = $pgm2[$yy];
  $lk = "agdet_p.php?opt=PV-".$pgm2[$yy];
  print "\n<td width=\"18\" class=\"pup\"><a href=$lk>$_pup</a></td>";  
  print "\n<td width=\"266\" class=\"c8s\">{$pgm2[$yy]} &middot; {$dex2[$yy]}</td>";
  print "\n<td width=\"16\" class=\"c8c\">{$sta2[$xx]}</td>";
  print "\n<td width=\"5\">&nbsp;</td>";
  
//  $lk = $pgm3[$zz];
  $lk = "agdet_p.php?opt=PV-".$pgm3[$zz];
  if ($pgm3[$zz] > "0") {
  print "\n<td width=\"18\" class=\"pup\"><a href=$lk>$_pup</a></td>";  
  print "\n<td width=\"266\" class=\"c8s\">{$pgm3[$zz]} &middot; {$dex3[$zz]}</td>";
  print "\n<td width=\"16\" class=\"c8c\">{$sta3[$xx]}</td></tr>";}
  else {
  print "\n<td width=\"18\">&nbsp;</td>";  
  print "\n<td width=\"266\">&nbsp;</td>";
  print "\n<td width=\"16\">&nbsp;</td>";
  print "\n<td width=\"5\">&nbsp;</td></tr>";}   
  $xt = $xt+1; $xx = $xx+1; $yy = $yy+1; $zz =$zz+1;
 }

print "\n</table></div></td></tr></tbody></table></div>";

?>
</div></body></html> 
Return current item: PMbyAS - Gestione Attivita