00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 require_once("class_iselect.php");
00025 require_once("class_ihidden.php");
00026 require_once("class_customer.php");
00027 require_once("class_ibutton.php");
00028 require_once('class_iaction.php');
00029 require_once('class_fiche_def.php');
00030 require_once('class_iaction.php');
00031 require_once('class_fiche_def.php');
00032 require_once('class_ipopup.php');
00033 require_once('class_admin.php');
00034
00035 global $g_user;
00036
00037 $low_action=(isset($_REQUEST['sb']))?$_REQUEST['sb']:"list";
00038
00039
00040
00041 $href=basename($_SERVER['PHP_SELF']);
00042
00043
00044 if ( $low_action == "" )
00045 $low_action="list";
00046
00047
00048
00049
00050
00051 if ( isset($_POST['delete_card'] ) )
00052 {
00053 if ( $g_user->check_action(FICADD) == 0 )
00054 {
00055 alert('Vous ne pouvez pas enlever de fiche');
00056 return;
00057 }
00058
00059 $f_id=$_REQUEST['f_id'];
00060
00061 $fiche=new Admin($cn,$f_id);
00062 $fiche->remove();
00063 $low_action="list";
00064
00065 }
00066
00067
00068
00069
00070 if ( $low_action == "list" )
00071 {
00072
00073 ?>
00074 <div class="content">
00075 <div>
00076 <form method="get" action="<?php echo $href; ?>">
00077 <?php
00078 echo dossier::hidden();
00079 $a=(isset($_GET['query']))?$_GET['query']:"";
00080 printf (_('Recherche').' <input class="input_text" type="text" name="query" value="%s">',
00081 $a);
00082 echo HtmlInput::request_to_hidden(array('ac'));
00083 $sel_card=new ISelect('cat');
00084 $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '.
00085 ' where frd_id='.FICHE_TYPE_ADM_TAX.
00086 ' order by fd_label ',1);
00087 $sel_card->selected=(isset($_GET['cat']))?$_GET['cat']:-1;
00088 $sel_card->javascript=' onchange="submit(this);"';
00089 echo _('Catégorie :').$sel_card->input();
00090
00091 ?>
00092 <input type="submit" class="button" name="submit_query" value="<?=_('recherche')?>">
00093 <input type="hidden" name="p_action" value="adm">
00094 </form>
00095 </div>
00096 <?php
00097 $adm=new Admin($cn);
00098 $search=(isset($_GET['query']))?$_GET['query']:"";
00099 $sql="";
00100 if ( isset($_GET['cat']))
00101 {
00102 if ( $_GET['cat'] != -1) $sql=sprintf(" and fd_id = %d",$_GET['cat']);
00103 }
00104
00105 echo '<div class="content">';
00106 echo $adm->Summary($search,'adm',$sql);
00107
00108
00109 echo '<br>';
00110 echo '<br>';
00111 echo '<br>';
00112 if ($g_user->check_action(FICADD)==1)
00113 {
00114
00115 $f_add_button=new IButton('add_card');
00116 $f_add_button->label=_('Créer une nouvelle fiche');
00117 $f_add_button->set_attribute('ipopup','ipop_newcard');
00118 $f_add_button->set_attribute('win_refresh','yes');
00119
00120 $f_add_button->set_attribute('type_cat',FICHE_TYPE_ADM_TAX);
00121 $f_add_button->javascript=" select_card_type(this);";
00122 echo $f_add_button->input();
00123
00124 $f_cat_button=new IButton('add_cat');
00125 $f_cat_button->set_attribute('ipopup','ipop_cat');
00126 $f_cat_button->set_attribute('type_cat',FICHE_TYPE_ADM_TAX);
00127 $f_cat_button->label=_('Ajout d\'une catégorie');
00128 $f_cat_button->javascript='add_category(this)';
00129 echo $f_cat_button->input();
00130 }
00131 echo '</div>';
00132 echo '</div>';
00133
00134
00135 }
00136
00137
00138
00139
00140 if ( $low_action == 'detail')
00141 {
00142
00143 require_once('category_card.inc.php');
00144 exit();
00145 }
00146
00147
00148
00149 html_page_stop();
00150 ?>