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