can_request($cn,CLIENT); $href=basename($_SERVER['PHP_SELF']); // Menu // Remove a card if ( isset ($_POST['delete']) ) { $f_id=$_REQUEST['f_id']; $fiche=new Customer($cn,$f_id); $fiche->remove(); $sub_action="list"; } //----------------------------------------------------- // Add card if ( $sub_action=="insert" ) { $retour=widget::button_href("Retour", urldecode($_REQUEST['url'])); $customer=new Customer($cn); $customer->Save($_REQUEST['fd_id']); echo '
'; echo $retour; echo ""; echo $customer->Display(true); echo "
"; echo $retour; echo '
'; } //----------------------------------------------------- // Save modification if ( isset ($_POST['mod'])) { // modification is asked $f_id=$_REQUEST['f_id']; $client=new Customer($cn,$f_id); $client->Save(); } // by default open liste if ( $sub_action == "" ) $sub_action="list"; //----------------------------------------------------- //Display a blank card if ( $sub_action=="blank") { $retour=widget::button_href('Retour',$href.'?p_action=client&'.dossier::get()); echo '
'; echo $retour; $c=new Customer($cn); echo '
'; echo ''; echo ''; echo ''; echo $c->blank($_GET['fd_id']); echo ''; echo '
'; echo $retour; echo '
'; } //----------------------------------------------------- // list if ( $sub_action == "list" ) { ?>
', $a); ?>
name="fd_id"; $w->value= make_array($cn,"select fd_id,fd_label from fiche_def where ". " frd_id=".FICHE_TYPE_CLIENT); echo $w->IOValue(); ?>
'; echo $client->Summary($search); echo '
'; echo ''; } //----------------------------------------------------- // Show Detail if ( $sub_action == 'detail' ) { $f_id=$_REQUEST['f_id']; echo '
'; $client=new Customer($cn,$f_id); $retour=widget::button_href("Retour", urldecode($_REQUEST['url'])); echo $retour; echo '
'; echo dossier::hidden(); echo $client->Display(false); $w=new widget("hidden"); $w->name="p_action"; $w->value="client"; echo $w->IOValue(); $w->name="f_id"; $w->value=$f_id; echo $w->IOValue(); echo widget::submit('mod','Sauver les modifications'); echo widget::reset("Annuler"); echo widget::submit('delete','Effacer cette fiche','onclick="return confirm(\'Confirmer effacement ?\');"'); echo '
'; echo $retour; echo '
'; } html_page_stop(); ?>