Go to the documentation of this file.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 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00025 require_once("class_iselect.php");
00026 require_once("class_ihidden.php");
00027 require_once("class_customer.php");
00028 require_once("class_ibutton.php");
00029 require_once('class_fiche_def.php');
00030
00031
00032
00033 $low_action = (isset($_REQUEST['sb'])) ? $_REQUEST['sb'] : "list";
00034
00035
00036
00037 $href=basename($_SERVER['PHP_SELF']);
00038
00039
00040 if ($low_action == "")
00041 $low_action = "list";
00042
00043
00044
00045
00046
00047 if (isset($_POST['delete_card']))
00048 {
00049 if ($g_user->check_action(FICADD) == 0)
00050 {
00051 alert(j(_('Vous ne pouvez pas enlever de fiche')));
00052 return;
00053 }
00054
00055 $f_id = $_REQUEST['f_id'];
00056
00057 $fiche = new Customer($cn, $f_id);
00058 $fiche->remove();
00059 $low_action = "list";
00060 }
00061
00062
00063
00064
00065 if ($low_action == "list")
00066 {
00067 ?>
00068 <div class="content">
00069 <div>
00070 <form method="get" action="<?php echo $href;?>">
00071 <?php
00072 echo '<h2>' . "Exercice " . $g_user->get_exercice() . '</h2>';
00073 echo dossier::hidden();
00074 $a = (isset($_GET['query'])) ? $_GET['query'] : "";
00075 printf(_('Recherche') . ' <input class="input_text" type="text" name="query" value="%s">', $a);
00076 $sel_card = new ISelect('cat');
00077 $sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' .
00078 ' where frd_id=' . FICHE_TYPE_CLIENT .
00079 ' order by fd_label ', 1);
00080 $sel_card->selected = (isset($_GET['cat'])) ? $_GET['cat'] : -1;
00081 $sel_card->javascript = ' onchange="submit(this);"';
00082 echo _('Catégorie :') . $sel_card->input();
00083 $nooperation = new ICheckBox('noop');
00084 $nooperation->selected = (isset($_GET['noop'])) ? true : false;
00085
00086 echo _('Inclure les clients sans opération :') . $nooperation->input();
00087 ?>
00088 <input type="submit" class="button" name="submit_query" value="<?php echo _('recherche')?>">
00089 <input type="hidden" name="ac" value="<?php echo $_REQUEST['ac']?>">
00090 </form>
00091 </div>
00092 <?php
00093 $client = new Customer($cn);
00094 $search = (isset($_GET['query'])) ? $_GET['query'] : "";
00095 $sql = "";
00096 if (isset($_GET['cat']))
00097 {
00098 if ($_GET['cat'] != -1)
00099 $sql = sprintf(" and fd_id = %d", $_GET['cat']);
00100 }
00101 $noop = (isset($_GET['noop'])) ? false : true;
00102 echo '<div class="content">';
00103 echo $client->Summary($search, 'client', $sql, $noop);
00104
00105
00106 echo '<br>';
00107 echo '<br>';
00108 echo '<br>';
00109
00110 $f_add_button = new IButton('add_card');
00111 $f_add_button->class="smallbutton";
00112 $f_add_button->label = _('Créer une nouvelle fiche');
00113 $f_add_button->set_attribute('ipopup', 'ipop_newcard');
00114 $f_add_button->set_attribute('win_refresh', 'yes');
00115
00116 $f_add_button->set_attribute('type_cat', FICHE_TYPE_CLIENT);
00117 $f_add_button->javascript = " select_card_type(this);";
00118 echo $f_add_button->input();
00119
00120 $f_cat_button=new IButton('add_cat');
00121 $f_cat_button->set_attribute('ipopup','ipop_cat');
00122 $f_cat_button->set_attribute('type_cat',FICHE_TYPE_CLIENT);
00123 $f_cat_button->label=_('Ajout d\'une catégorie');
00124 $f_cat_button->javascript='add_category(this)';
00125 echo $f_cat_button->input();
00126
00127 echo '</div>';
00128 echo '</div>';
00129
00130
00131 }
00132
00133
00134
00135
00136 if ( $low_action == 'detail')
00137 {
00138
00139 require_once('category_card.inc.php');
00140 exit();
00141 }
00142
00143 html_page_stop();
00144 ?>