00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 require_once("class_admin.php");
00022 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
00023 $User->AccessRequest($cn,ADMIN);
00024
00029 ?>
00030
00031 <?
00032
00033
00034 if ( isset ($_POST['delete']) )
00035 {
00036 echo 'delete';
00037 $f_id=$_REQUEST['f_id'];
00038
00039 $fiche=new Admin($cn,$f_id);
00040 $fiche->remove();
00041 $sub_action="list";
00042 }
00043
00044
00045 if ( $sub_action=="insert" )
00046 {
00047 $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
00048 urldecode($_REQUEST['url']));
00049
00050 $admin=new Admin($cn);
00051 $admin->Save($_REQUEST['fd_id']);
00052 echo $retour;
00053 echo "<table>";
00054 echo $admin->Display(true);
00055 echo "</table>";
00056 echo $retour;
00057
00058 }
00059
00060
00061 if ( isset ($_POST['mod']))
00062 {
00063
00064 $f_id=$_REQUEST['f_id'];
00065
00066 $sup=new Admin($cn,$f_id);
00067 $sup->Save();
00068 }
00069
00070 if ( $sub_action == "" )
00071 $sub_action="list";
00072
00073
00074 if ( $sub_action=="blank")
00075 {
00076 $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
00077 "commercial.php?p_action=admin");
00078 echo '<div class="u_redcontent">';
00079
00080 echo $retour;
00081 $c=new Admin($cn);
00082 echo '<form method="post" action="commercial.php"';
00083 echo '<input type="hidden" name="p_action" value="admin">';
00084 echo '<input type="hidden" name="sa" value="insert">';
00085 echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
00086 echo '<input type="hidden" name="url" value="'.$_GET['url'].'">';
00087 echo $c->blank($_GET['fd_id']);
00088 echo '<input type="Submit" value="Sauve">';
00089 echo '</form>';
00090 echo $retour;
00091 echo '</div>';
00092 }
00093
00094
00095 if ( $sub_action == "list" )
00096 {
00097 ?>
00098 <div class="u_content">
00099 <span>
00100 <form method="get" action="commercial.php">
00101 <?
00102 $a=(isset($_GET['query']))?$_GET['query']:"";
00103 printf ('<input type="text" name="query" value="%s">',
00104 $a);
00105 ?>
00106 <input type="submit" name="submit_query" value="recherche">
00107 <input type="hidden" name="p_action" value="admin">
00108 </form>
00109 </span>
00110 <span>
00111 <form method="get" action="commercial.php">
00112 <input type="hidden" name="url" <? $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
00113 <input type="hidden" name="p_action" value="admin">
00114
00115 <?
00116 $w=new widget("select");
00117 $w->name="fd_id";
00118 $w->value= make_array($cn,"select fd_id,fd_label from fiche_def where ".
00119 " frd_id=".FICHE_TYPE_ADM_TAX);
00120 echo $w->IOValue();
00121 ?>
00122 <input type="hidden" name="sa" value="blank">
00123 <input type="submit" name="submit_query" value="Ajout Sup">
00124
00125 </form>
00126 </span>
00127 <?
00128 $sup=new Admin($cn);
00129 $search=(isset($_GET['query']))?$_GET['query']:"";
00130
00131 echo '<div class="u_redcontent">';
00132 echo $sup->Summary($search);
00133 echo '</div>';
00134 echo '</div>';
00135
00136 }
00137
00138
00139 if ( $sub_action == 'detail' )
00140 {
00141 $f_id=$_REQUEST['f_id'];
00142 echo '<div class="u_redcontent">';
00143 $sup=new Admin($cn,$f_id);
00144 $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
00145 urldecode($_REQUEST['url']));
00146 echo $retour;
00147 echo '<form action="'.$_REQUEST['url'].'" method="post">';
00148 echo $sup->Display(false);
00149 $w=new widget("hidden");
00150 $w->name="p_action";
00151 $w->value="admin";
00152 echo $w->IOValue();
00153 $w->name="f_id";
00154 $w->value=$f_id;
00155 echo $w->IOValue();
00156
00157 echo $w->Submit('mod','Sauver les modifications');
00158 echo $w->Reset("Annuler");
00159 echo $w->Submit('delete','Effacer cette fiche');
00160 echo '</form>';
00161 echo $retour;
00162 echo '<div>';
00163 }
00164 html_page_stop();
00165 ?>