← Back
Editing: clienti_ed.php
<?php ###___###___###___###___###___###___###___###___###___###___###___###___### ### SmaDIB: Smart Database Interface Builder 1.0.b1 ### ### by Smartmedia 2000 http://www.smartmedia2000.it/ ### ### info email: smadib@smartmedia2000.it ### ### released under GPLv2 license http://www.gnu.org/licenses/gpl.txt ### ###___###___###___###___###___###___###___###___###___###___###___###___### require_once ("../funct.php"); require_once ("sess.php"); require_once ("conn.php"); $table = "clienti"; $ptitolo = "Clienti per fatture"; require_once ("testacoda.php"); # html snippets file $perpg = 50; # amount of rows per page displayed $pgb = 49; # upper ad lower limit for bottom page count $noEmpty = array ('denominazione', 'indirizzo', 'codfisc', 'partiva'); # insert here the field names you want to be compiled for query to go $dateFlds = array (); # date fields to be converted in dd//mm/yyyy $valop = "ds"; $query = new doQuery (); if ($az == "canc") { $query->delete (); header("Location: ".$_SERVER['PHP_SELF']."?pg=$pg"); } $_POST['denominazione'] = nl2br ($_POST['denominazione']); $_POST['indirizzo'] = nl2br ($_POST['indirizzo']); $_POST['codfisc'] = strtoupper ($_POST['codfisc']); if ($op == "ds") $query->insert ($_POST, $noEmpty); else if ($op == "up") $query->update ($_POST, $noEmpty); if ($az == "ed") { $row = $query->selectById (0); $valop = "up"; } $elenco.= "<tr bgcolor=\"#FFFFFF\"><td valign=\"bottom\" rowspan=\"3\"> funzioni</td> <td><b>Denominazione</b></td> <td><b>Indirizzo</b></td> <td><b>Codice Fiscale</b></td> <td><b>Partita IVA</b></td> </tr> <tr bgcolor=\"#EEEEEE\"> <td><textarea name=\"denominazione\" cols=\"30\" rows=\"3\" >".str_replace ('<br />', '', $row->denominazione)."</textarea></td> <td><textarea name=\"indirizzo\" cols=\"30\" rows=\"3\" >".str_replace ('<br />', '', $row->indirizzo)."</textarea></td> <td valign=\"top\"><input name=\"codfisc\" type=\"text\" size=\"16\" maxlenght=\"16\" value=\"".$row->codfisc."\" /></td> <td valign=\"top\"><input name=\"partiva\" type=\"text\" size=\"11\" maxlenght=\"11\" value=\"".$row->partiva."\" /></td> </tr><tr bgcolor=\"#FFFFFF\"><td colspan=\"5\" align=\"center\"> <input type=\"submit\" name=\"invio\" value=\"$intesta\" /> <input type=\"hidden\" name=\"op\" value=\"$valop\" /> <input type=\"hidden\" name=\"id\" value=\"$row->id\" /> <input type=\"hidden\" name=\"pg\" value=\"$pg\" /> </td></tr><tr><td colspan=\"5\" bgcolor=\"#000000\" height=\"4\"></td>"; $rows = $query->selectAll ($table, array('denominazione'=>'ASC'), 0); foreach ($rows as $i=>$row) { $bgcolor = rowCol ($i); $elenco.= " </tr> <tr bgcolor=\"#$bgcolor\" rowspan=\"1\"><td nowrap>\n"; if ($az != "ed") $elenco.= " <a href=\"".$_SERVER['PHP_SELF']."?id=$row->id&az=ed&pg=$pg\"><img src=\"images/edit.gif\" border=\"0\" hspace=\"3\" alt=\"modifica riga\" align=\"absmiddle\" /></a> <a href=\"#\" onClick=\"javascript:confDel($row->id)\"><img src=\"images/delete.gif\" border=\"0\" alt=\"cancella riga\" align=\"absmiddle\" /></a></td>"; $elenco.= " </td> <td>".$row->denominazione."</td> <td>".$row->indirizzo."</td> <td>".$row->codfisc."</td> <td>".$row->partiva."</td>\n"; } $elenco.= " </tr> <tr><td colspan=\"5\" bgcolor=\"#000000\" height=\"2\"></td></tr> <tr><td colspan=\"5\" align=\"center\">". pager ($pg) ."</td></tr>"; echo "$testa <script type=\"text/javascript\" language=\"JavaScript\"> function confDel(id) { if (confirm('Vuoi cancellare veramente questa riga? Premi OK per confermare.')) document.location='".$_SERVER['PHP_SELF']."?id='+ id +'&az=canc&pg=$pg'; } </script> <h2 align=\"center\">$ptitolo</h2> <form name=\"form1\" method=\"post\" action=\"".$_SERVER['PHP_SELF']."\" > <table align=\"center\"> $elenco </table></form> $coda"; ?>
Save File
Cancel