Ejemplo n.º 1
0
$url = basename($_SERVER['PHP_SELF']) . "?action=" . $_REQUEST['action'];
$header->add(_("Login"), $url, " order by use_login asc", "order by use_login desc", "la", "ld");
$header->add(_("Nom"), $url, " order by use_name asc,use_first_name asc", "order by use_name desc,use_first_name desc", "na", "nd");
$header->add(_('Dossier'), $url, ' order by ag_dossier asc', 'order by ag_dossier desc', 'da', 'dd');
$header->add(_("Actif"), $url, " order by use_active asc", "order by  use_active desc", "aa", "ad");
$ord = isset($_REQUEST['ord']) ? $_REQUEST['ord'] : 'la';
$sql = $header->get_sql_order($ord);
$a_user = $repo->get_user_folder($sql);
if (!empty($a_user)) {
    echo '<span style="display:block">';
    echo _('Filtre') . HtmlInput::infobulle(22);
    echo HtmlInput::filter_table("user", "0,1,2,5", "1");
    echo '</span>';
    echo '<table id="user" class="result">';
    echo '<tr>';
    echo '<th>' . $header->get_header(0) . '</th>';
    echo '<th>' . $header->get_header(1) . '</th>';
    echo th(_("Prénom"));
    echo '<th>' . $header->get_header(3) . '</th>';
    echo "<th>" . _('Type') . "</th>";
    echo '<th>' . $header->get_header(2) . '</th>';
    echo '</tr>';
    foreach ($a_user as $r_user) {
        $compteur++;
        $class = $compteur % 2 == 0 ? "odd" : "even";
        echo "<tr class=\"{$class}\">";
        if ($r_user['use_active'] == 0) {
            $Active = $g_failed;
        } else {
            $Active = $g_succeed;
        }
Ejemplo n.º 2
0
 $header->add(_("Description"), $url, " order by dos_description asc", " order by dos_description  desc", "da", "dd");
 $repo = new Dossier(0);
 $repocn = new Database();
 $ord = isset($_REQUEST['ord']) ? $_REQUEST['ord'] : 'na';
 $sql_order = $header->get_sql_order($ord);
 $Res = $repocn->get_array("select *  from ac_dossier {$sql_order}");
 $compteur = 1;
 $template = "";
 echo '<div class="content">';
 echo '<span style="display:block">';
 echo _('Filtre') . HtmlInput::infobulle(23);
 echo HtmlInput::filter_table("t_dossier", "0,1,2", "1");
 echo '</span>';
 echo '<TABLE id="t_dossier" class="table_large" >';
 $r = "";
 $r .= '<th>' . $header->get_header(0) . '</td>';
 $r .= '<th>' . $header->get_header(1) . '</td>';
 $r .= '<th>' . $header->get_header(2) . '</td>';
 $r .= th(_('Taille')) . th(_('Nom base de données'));
 $r = tr($r);
 echo $r;
 // show all dossiers
 if ($Res != null) {
     foreach ($Res as $Dossier) {
         if ($compteur % 2 == 0) {
             $cl = 'class="odd"';
         } else {
             $cl = 'class="even"';
         }
         echo "<TR id=\"folder{$Dossier['dos_id']}\" {$cl}><TD style=\"vertical-align:top\"> " . $Dossier['dos_id'] . "</td><td> <B>" . h($Dossier['dos_name']) . "</B> </TD>";
         $str_name = domaine . 'dossier' . $Dossier['dos_id'];
Ejemplo n.º 3
0
$tb->add(_("Nom"), $p_url, " order by r_name asc", "order by r_name desc", "ona", "ond");
$tb->add(_("Adresse"), $p_url, " order by r_adress asc", "order by r_adress desc", "oaa", "oad");
$tb->add(_("Ville"), $p_url, " order by r_city asc", "order by r_city desc", "ova", "ovd");
$tb->add(_("Pays"), $p_url, " order by r_country asc", "order by r_country desc", "opa", "opd");
$tb->add(_("Téléphone"), $p_url, " order by r_phone asc", "order by r_phone desc", "opa", "opd");
$sql = "select * from stock_repository ";
$ord = isset($_GET['ord']) ? $_GET['ord'] : "ona";
$order = $tb->get_sql_order($ord);
$array = $cn->get_array($sql . " " . $order);
?>
<div class="content">

<table class="result">
	<tr>
		<th><?php 
echo $tb->get_header(0);
?>
</th>
		<th><?php 
echo $tb->get_header(1);
?>
</th>
		<th><?php 
echo $tb->get_header(2);
?>
</th>
		<th><?php 
echo $tb->get_header(3);
?>
</th>
		<th><?php 
Ejemplo n.º 4
0
    }
}
echo '<div id="list_profile" class="content">';
$table = new Sort_Table();
$url = $_SERVER['REQUEST_URI'];
$table->add(_('Nom'), $url, "order by p_name asc", "order by p_name desc", "na", "nd");
$table->add(_('Description'), $url, "order by p_desc asc", "order by p_desc desc", "da", "dd");
$table->add(_('Calculatrice visible'), $url, "order by with_calc asc", "order by with_calc desc", "ca", "cd");
$table->add(_('Accès Direct visible'), $url, "order by with_direct_form asc", "order by with_direct_form desc", "fa", "fd");
$ord = isset($_REQUEST['ord']) ? $_REQUEST['ord'] : 'na';
$order = $table->get_sql_order($ord);
$menu = new Profile_sql($cn);
$ret = $menu->seek("where p_id > 0 " . $order);
echo '<table class="result">';
echo '<tr>';
echo '<th>' . $table->get_header(0) . '</th>';
echo '<th>' . $table->get_header(1) . '</th>';
echo '<th>' . $table->get_header(2) . '</th>';
echo '<th>' . $table->get_header(3) . '</th>';
echo '</tr>';
$gDossier = Dossier::id();
for ($i = 0; $i < Database::num_row($ret); $i++) {
    $row = $menu->get_object($ret, $i);
    $js = sprintf('<a href="javascript:void(0)" style="text-decoration:underline" onclick="get_profile_detail(\'%s\',\'%s\')">', $gDossier, $row->p_id);
    echo '<tr>';
    echo "<td>" . $js . $row->p_name . '</a>' . '</td>';
    echo td($row->p_desc);
    echo td($row->with_calc);
    echo td($row->with_direct_form);
    echo '</tr>';
}
Ejemplo n.º 5
0
?>
	<?php 
echo HtmlInput::request_to_hidden(array('ac', 'gDossier', 'ord'));
?>
</form>
     <?php 
echo _('Filtre'), HtmlInput::filter_table('menu_tb', '0,1,2,4', '1');
?>
</fieldset>
<?php 
$gDossier = Dossier::id();
echo HtmlInput::button("Add_plugin", _("Ajout d'un plugin"), "onclick=add_plugin({$gDossier})");
echo HtmlInput::button("Add_menu", _("Ajout d'un menu"), "onclick=create_menu({$gDossier})");
echo '<table class="result" id="menu_tb">';
echo '<tr>';
echo '<th>' . $table->get_header(0) . '</th>';
echo '<th>' . $table->get_header(1) . '</th>';
echo '<th>' . $table->get_header(2) . '</th>';
echo '<th>' . $table->get_header(3) . HtmlInput::infobulle(33) . '</th>';
echo '<th>' . $table->get_header(4) . '</th>';
echo '<th>' . $table->get_header(5) . '</th>';
echo '<th>' . $table->get_header(6) . '</th>';
echo '<th>' . $table->get_header(7) . '</th>';
echo '</tr>';
for ($i = 0; $i < Database::num_row($ret); $i++) {
    $row = $menu->get_object($ret, $i);
    $js = $row->me_code;
    switch ($row->me_type) {
        case 'PL':
            $js = sprintf('<A class="line" href="javascript:void(0)"  onclick="mod_plugin(\'%s\',\'%s\')">%s</A>', $gDossier, $row->me_code, $row->me_code);
            break;
Ejemplo n.º 6
0
$count = Database::num_row($Res);
echo '<div class="content" style="width:80%;margin-left:10%">';
echo "<H2>" . _('Modèles') . "</H2>";
if ($sa == 'list') {
    echo '<p>';
    echo HtmlInput::button(_('Ajouter'), _('Ajouter un modèle'), " onclick=\$('folder_add_id').show()");
    echo '</p>';
    if ($count == 0) {
        echo _("Aucun modèle disponible");
    } else {
        echo '<span style="display:block;margin-top:10">';
        echo _('Filtre') . HtmlInput::infobulle(23);
        echo HtmlInput::filter_table("t_modele", "0,1,2", "1");
        echo '</span>';
        echo '<table id="t_modele" class="table_large" style="border-spacing:10;border-collapse:separate" >';
        echo "<TR>" . "<TH>" . $header->get_header(0) . "</TH>" . "<TH>" . $header->get_header(1) . "</TH>" . "<TH>" . $header->get_header(2) . "</TH>" . "<TH>" . _('Nom base de données') . "</TH>" . "<th> </th>" . "<th> </th>" . "</TR>";
        for ($i = 0; $i < $count; $i++) {
            $mod = Database::fetch_array($Res, $i);
            $class = $i % 2 == 0 ? "odd" : "even";
            $str_name = domaine . 'mod' . $mod['mod_id'];
            printf('<TR class="' . $class . '" style="vertical-align:top">' . '<TD>%d </td><td><b> %s</b> </TD>' . '<TD><I> %s </I></TD>' . '<td>' . $str_name . '</td>' . '<td> ' . HtmlInput::anchor(_('Effacer'), '?action=modele_mgt&sa=del&m=' . $mod['mod_id'], " onclick = \"modele_drop('{$mod['mod_id']}') \"") . '</td>' . '</td>' . '<td>' . HtmlInput::anchor(_('Modifie'), '?action=modele_mgt&sa=mod&m=' . $mod['mod_id'], " onclick = \"modele_modify('{$mod['mod_id']}') \"") . '</td>' . '</td>' . '<td>' . HtmlInput::anchor(_('Backup'), 'backup.php?action=backup&sa=b&t=m&d=' . $mod['mod_id']) . '</td>' . '</TR>', $mod['mod_id'], $mod['mod_name'], $mod['mod_desc']);
        }
        // for
        echo "</table>";
    }
    // if count = 0
    echo "<p class=\"notice\">" . _("Si vous voulez r&eacute;cup&eacute;rer toutes les adaptations d'un dossier " . " dans un autre dossier, vous pouvez en faire un modèle." . " Seules les fiches, la structure des journaux, les p&eacute;riodes,... seront reprises " . "et aucune donn&eacute;e du dossier sur lequel le dossier est bas&eacute;. Les données contenues dans les extensions ne sont pas effacées") . "</p>";
}
?>
<div id="folder_add_id" class="inner_box" style="display:none;top:50px">
    <?php 
Ejemplo n.º 7
0
 /**
 * @brief Show all the operation
 * @param$sql is the sql stmt, normally created by build_search_sql
 * @param$offset the offset
 * @param$p_paid if we want to see info about payment
  \code
  // Example
  // Build the sql
  list($sql,$where)=$Ledger->build_search_sql($_GET);
  // Count nb of line
  $max_line=$cn->count_sql($sql);
 
  $step=$_SESSION['g_pagesize'];
  $page=(isset($_GET['offset']))?$_GET['page']:1;
  $offset=(isset($_GET['offset']))?$_GET['offset']:0;
  // create the nav. bar
  $bar=navigation_bar($offset,$max_line,$step,$page);
  // show a part
  list($count,$html)= $Ledger->list_operation($sql,$offset,0);
  echo $html;
  // show nav bar
  echo $bar;
 
  \endcode
 * \see build_search_sql
 * \see display_search_form
 * \see search_form
 
 * \return HTML string
 */
 public function list_operation($sql, $offset, $p_paid = 0)
 {
     global $g_parameter, $g_user;
     bcscale(2);
     $table = new Sort_Table();
     $gDossier = dossier::id();
     $amount_paid = 0.0;
     $amount_unpaid = 0.0;
     $limit = $_SESSION['g_pagesize'] != -1 ? " LIMIT " . $_SESSION['g_pagesize'] : "";
     $offset = $_SESSION['g_pagesize'] != -1 ? " OFFSET " . Database::escape_string($offset) : "";
     $order = "  order by jr_date_order asc,jr_internal asc";
     // Sort
     $url = "?" . CleanUrl();
     $str_dossier = dossier::get();
     $table->add(_("Date"), $url, 'order by jr_date asc,substring(jr_pj_number,\'[0-9]+$\')::numeric asc', 'order by  jr_date desc,substring(jr_pj_number,\'[0-9]+$\')::numeric desc', "da", "dd");
     $table->add(_('Echeance'), $url, " order by  jr_ech asc", " order by  jr_ech desc", 'ea', 'ed');
     $table->add(_('Paiement'), $url, " order by  jr_date_paid asc", " order by  jr_date_paid desc", 'eap', 'edp');
     $table->add(_('Pièce'), $url, ' order by  substring(jr_pj_number,\'[0-9]+$\')::numeric asc ', ' order by  substring(jr_pj_number,\'[0-9]+$\')::numeric desc ', "pja", "pjd");
     $table->add(_('Tiers'), $url, " order by  name asc", " order by  name desc", 'na', 'nd');
     $table->add(_('Montant'), $url, " order by jr_montant asc", " order by jr_montant desc", "ma", "md");
     $table->add(_("Description"), $url, "order by jr_comment asc", "order by jr_comment desc", "ca", "cd");
     $ord = !isset($_GET['ord']) ? 'da' : $_GET['ord'];
     $order = $table->get_sql_order($ord);
     // Count
     $count = $this->db->count_sql($sql);
     // Add the limit
     $sql .= $order . $limit . $offset;
     // Execute SQL stmt
     $Res = $this->db->exec_sql($sql);
     //starting from here we can refactor, so that instead of returning the generated HTML,
     //this function returns a tree structure.
     $r = "";
     $Max = Database::num_row($Res);
     if ($Max == 0) {
         return array(0, _("Aucun enregistrement trouvé"));
     }
     $r .= '<table class="result">';
     $r .= "<tr >";
     $r .= "<th>" . _("n° interne") . "</th>";
     if ($this->type == 'ALL') {
         $r .= th('Journal');
     }
     $r .= '<th>' . $table->get_header(0) . '</th>';
     if ($p_paid != 0) {
         $r .= '<th>' . $table->get_header(1) . '</td>';
     }
     if ($p_paid != 0) {
         $r .= '<th>' . $table->get_header(2) . '</th>';
     }
     $r .= '<th>' . $table->get_header(3) . '</th>';
     $r .= '<th>' . $table->get_header(4) . '</th>';
     $r .= '<th>' . $table->get_header(6) . '</th>';
     $r .= th('Notes', ' style="width:15%"');
     $r .= '<th>' . $table->get_header(5) . '</th>';
     // if $p_paid is not equal to 0 then we have a paid column
     if ($p_paid != 0) {
         $r .= "<th> " . _('Payé') . "</th>";
     }
     $r .= "<th>" . _('Concerne') . "</th>";
     $r .= "<th>" . _('Document') . "</th>";
     $r .= "</tr>";
     // Total Amount
     $tot = 0.0;
     $gDossier = dossier::id();
     for ($i = 0; $i < $Max; $i++) {
         $row = Database::fetch_array($Res, $i);
         if ($i % 2 == 0) {
             $tr = '<TR class="odd">';
         } else {
             $tr = '<TR class="even">';
         }
         $r .= $tr;
         //internal code
         // button  modify
         $r .= "<TD>";
         // If url contains
         //
         $href = basename($_SERVER['PHP_SELF']);
         $r .= sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>', $row['jr_id'], $gDossier, $row['jr_internal']);
         $r .= "</TD>";
         if ($this->type == 'ALL') {
             $r .= td($row['jrn_def_name']);
         }
         // date
         $r .= "<TD>";
         $r .= $row['str_jr_date'];
         $r .= "</TD>";
         // echeance
         if ($p_paid != 0) {
             $r .= "<TD>";
             $r .= $row['str_jr_ech'];
             $r .= "</TD>";
             $r .= "<TD>";
             $r .= $row['str_jr_date_paid'];
             $r .= "</TD>";
         }
         // pj
         $r .= "<TD>";
         $r .= $row['jr_pj_number'];
         $r .= "</TD>";
         // Tiers
         $other = $row['quick_code'] != '' ? '[' . $row['quick_code'] . '] ' . $row['name'] . ' ' . $row['first_name'] : '';
         $r .= td($other);
         // comment
         $r .= "<TD>";
         $tmp_jr_comment = h($row['jr_comment']);
         $r .= $tmp_jr_comment;
         $r .= "</TD>";
         $r .= td(h($row['n_text']), ' style="font-size:0.87em%"');
         // Amount
         // If the ledger is financial :
         // the credit must be negative and written in red
         $positive = 0;
         // Check ledger type :
         if ($row['jrn_def_type'] == 'FIN') {
             $positive = $this->db->get_value("select qf_amount from quant_fin where jr_id=\$1", array($row['jr_id']));
             if ($this->db->count() != 0) {
                 $positive = $positive < 0 ? 1 : 0;
             }
         }
         $r .= "<TD align=\"right\">";
         $t_amount = $row['jr_montant'];
         if ($row['total_invoice'] != null && $row['total_invoice'] != $row['jr_montant']) {
             $t_amount = $row['total_invoice'];
         }
         $tot = $positive != 0 ? bcsub($tot, $t_amount) : bcadd($tot, $t_amount);
         //STAN $positive always == 0
         if ($row['jrn_def_type'] == 'FIN') {
             $r .= $positive != 0 ? "<font color=\"red\">  - " . nbm($t_amount) . "</font>" : nbm($t_amount);
         } else {
             $r .= $t_amount < 0 ? "<font color=\"red\">  " . nbm($t_amount) . "</font>" : nbm($t_amount);
         }
         $r .= "</TD>";
         // Show the paid column if p_paid is not null
         if ($p_paid != 0) {
             $w = new ICheckBox();
             $w->name = "rd_paid" . $row['jr_id'];
             $w->selected = $row['jr_rapt'] == 'paid' ? true : false;
             // if p_paid == 2 then readonly
             $w->readonly = $p_paid == 2 ? true : false;
             $h = new IHidden();
             $h->name = "set_jr_id" . $row['jr_id'];
             $r .= '<TD>' . $w->input() . $h->input() . '</TD>';
             if ($row['jr_rapt'] == 'paid') {
                 $amount_paid = bcadd($amount_paid, $t_amount);
             } else {
                 $amount_unpaid = bcadd($amount_unpaid, $t_amount);
             }
         }
         // Rapprochement
         $rec = new Acc_Reconciliation($this->db);
         $rec->set_jr_id($row['jr_id']);
         $a = $rec->get();
         $r .= "<TD>";
         if ($a != null) {
             foreach ($a as $key => $element) {
                 $operation = new Acc_Operation($this->db);
                 $operation->jr_id = $element;
                 $l_amount = $this->db->get_value("select jr_montant from jrn " . " where jr_id={$element}");
                 $r .= "<A class=\"detail\" HREF=\"javascript:modifyOperation('" . $element . "'," . $gDossier . ")\" > " . $operation->get_internal() . "[" . nbm($l_amount) . "]</A>";
             }
             //for
         }
         // if ( $a != null ) {
         $r .= "</TD>";
         if ($row['jr_valid'] == 'f') {
             $r .= "<TD>" . _("Opération annulée") . "</TD>";
         } else {
         }
         // else
         //document
         if ($row['jr_pj_name'] != "") {
             $r .= '<td>' . HtmlInput::show_receipt_document($row['jr_id']) . '</td>';
         } else {
             $r .= "<TD></TD>";
         }
         // end row
         $r .= "</tr>";
     }
     $amount_paid = round($amount_paid, 4);
     $amount_unpaid = round($amount_unpaid, 4);
     $tot = round($tot, 4);
     $r .= "<TR>";
     $r .= '<TD COLSPAN="5">Total</TD>';
     $r .= '<TD ALIGN="RIGHT">' . nbm($tot) . "</TD>";
     $r .= "</tr>";
     if ($p_paid != 0) {
         $r .= "<TR>";
         $r .= '<TD COLSPAN="5">' . _("Payé") . '</TD>';
         $r .= '<TD ALIGN="RIGHT">' . nbm($amount_paid) . "</TD>";
         $r .= "</tr>";
         $r .= "<TR>";
         $r .= '<TD COLSPAN="5">' . _("Non payé") . '</TD>';
         $r .= '<TD ALIGN="RIGHT">' . nbm($amount_unpaid) . "</TD>";
         $r .= "</tr>";
     }
     $r .= "</table>";
     return array($count, $r);
 }
Ejemplo n.º 8
0
 /**
  * myList($p_base, $p_filter = "", $p_search = "") 
  * Show list of action by default if sorted on date
  * @param $p_base base url with ac...
  * @param $p_filter filters on the document_type
  * @param $p_search must a valid sql command ( ex 'and  ag_title like upper('%hjkh%'))
  * @return string containing html code
  */
 function myList($p_base, $p_filter = "", $p_search = "")
 {
     // for the sort
     $url = HtmlInput::get_to_string(array("closed_action", "remind_date_end", "remind_date", "sag_ref", "only_internal", "state", "qcode", "ag_dest_query", "action_query", "tdoc", "date_start", "date_end", "hsstate", "searchtag")) . '&' . $p_base;
     $table = new Sort_Table();
     $table->add('Date Doc.', $url, 'order by ag_timestamp asc', 'order by ag_timestamp desc', 'da', 'dd');
     $table->add('Date Comm.', $url, 'order by last_comment', 'order by last_comment desc', 'dca', 'dcd');
     $table->add('Date Limite', $url, 'order by ag_remind_date asc', 'order by ag_remind_date  desc', 'ra', 'rd');
     $table->add('Tag', $url, 'order by tags asc', 'order by tags desc', 'taa', 'tad');
     $table->add('Réf.', $url, 'order by ag_ref asc', 'order by ag_ref desc', 'ra', 'rd');
     $table->add('Groupe', $url, "order by coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe')", "order by coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') desc", 'dea', 'ded');
     $table->add('Dest/Exp', $url, 'order by name asc', 'order by name desc', 'ea', 'ed');
     $table->add('Titre', $url, 'order by ag_title asc', 'order by ag_title desc', 'ta', 'td');
     $ord = !isset($_GET['ord']) ? "dcd" : $_GET['ord'];
     $sort = $table->get_sql_order($ord);
     if (strlen(trim($p_filter)) != 0) {
         $p_filter_doc = " dt_id in ( {$p_filter} )";
     } else {
         $p_filter_doc = " 1=1 ";
     }
     $sql = "\n             select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,\n                to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,\n                to_char(coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp),'DD.MM.YY') as str_last_comment,\n                coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp) as last_comment,\n                f_id_dest,\n                s_value,\n                ag_title,dt_value,ag_ref, ag_priority,ag_state,\n                coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,\n                (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,\n                array_to_string((select array_agg(t1.t_tag) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags\n            from action_gestion as ag\n                join document_type on (ag_type=dt_id)\n                join document_state on (ag_state=s_id)\n             where {$p_filter_doc} {$p_search} {$sort}";
     $max_line = $this->db->count_sql($sql);
     $step = $_SESSION['g_pagesize'];
     $page = isset($_GET['offset']) ? $_GET['page'] : 1;
     $offset = isset($_GET['offset']) ? Database::escape_string($_GET['offset']) : 0;
     if ($step != -1) {
         $limit = " LIMIT {$step} OFFSET {$offset} ";
     } else {
         $limit = '';
     }
     $bar = navigation_bar($offset, $max_line, $step, $page);
     $Res = $this->db->exec_sql($sql . $limit);
     $a_row = Database::fetch_all($Res);
     $r = "";
     $r .= '<p>' . $bar . '</p>';
     $r .= '<table class="document">';
     $r .= "<tr>";
     $r .= '<th name="ag_id_td" style="display:none" >' . ICheckBox::toggle_checkbox('ag', 'list_ag_frm') . '</th>';
     $r .= '<th>' . $table->get_header(0) . '</th>';
     $r .= '<th>' . $table->get_header(1) . '</th>';
     $r .= '<th>' . $table->get_header(2) . '</th>';
     $r .= '<th>' . $table->get_header(3) . '</th>';
     $r .= '<th>' . $table->get_header(4) . '</th>';
     $r .= '<th>' . $table->get_header(5) . '</th>';
     $r .= '<th>' . $table->get_header(6) . '</th>';
     $r .= '<th>' . $table->get_header(7) . '</th>';
     $r .= th('Priorité');
     $r .= "</tr>";
     // if there are no records return a message
     if (sizeof($a_row) == 0 or $a_row == false) {
         $r = '<div style="clear:both">';
         $r .= '<hr>Aucun enregistrement trouvé';
         $r .= "</div>";
         return $r;
     }
     $today = date('d.m.Y');
     $i = 0;
     $checkbox = new ICheckBox("mag_id[]");
     //show the sub_action
     foreach ($a_row as $row) {
         $href = '<A class="document" HREF="do.php?' . $p_base . HtmlInput::get_to_string(array("closed_action", "remind_date_end", "remind_date", "sag_ref", "only_internal", "state", "gDossier", "qcode", "ag_dest_query", "action_query", "tdoc", "date_start", "date_end", "hsstate", "searchtag", "ac"), "&") . '&sa=detail&ag_id=' . $row['ag_id'] . '">';
         $i++;
         $tr = $i % 2 == 0 ? 'even' : 'odd';
         if ($row['ag_priority'] < 2) {
             $tr = 'priority1';
         }
         $st = '';
         if ($row['my_date'] == $today) {
             $st = ' style="font-weight:bold; border:2px solid orange;"';
         }
         $date_remind = format_date($row['my_remind'], 'DD.MM.YYYY', 'YYYYMMDD');
         $date_today = date('Ymd');
         if ($date_remind != "" && $date_remind == $date_today && $row['ag_state'] != 1 && $row['ag_state'] != 3) {
             $st = ' style="font-weight:bold;background:orange"';
         }
         if ($date_remind != "" && $date_remind < $date_today && $row['ag_state'] != 1 && $row['ag_state'] != 3) {
             $st = ' style="font-weight:bold;background:#FF0000;color:white;"';
         }
         $r .= "<tr class=\"{$tr}\" {$st}>";
         $checkbox->value = $row['ag_id'];
         $r .= '<td name="ag_id_td" style="display:none">' . $checkbox->input() . '</td>';
         $r .= "<td>" . $href . smaller_date($row['my_date']) . '</a>' . "</td>";
         $r .= "<td>" . $href . $row['str_last_comment'] . '</a>' . "</td>";
         $r .= "<td>" . $href . smaller_date($row['my_remind']) . '</a>' . "</td>";
         $r .= "<td>" . $href . h($row['tags']) . '</a>' . "</td>";
         $r .= "<td>" . $href . $row['ag_ref'] . '</a>' . "</td>";
         $r .= "<td>" . $href . h($row['dest']) . '</a>' . "</td>";
         // Expediteur
         $fexp = new Fiche($this->db);
         $fexp->id = $row['f_id_dest'];
         $qcode_dest = $fexp->strAttribut(ATTR_DEF_QUICKCODE);
         $qexp = $qcode_dest == NOTFOUND ? "Interne" : $qcode_dest;
         $jsexp = sprintf("javascript:showfiche('%s')", $qexp);
         if ($qexp != 'Interne') {
             $r .= "<td>{$href}" . $qexp . " : " . $fexp->getName() . '</a></td>';
         } else {
             $r .= "<td>{$href} Interne </a></td>";
         }
         $ref = "";
         $r .= '<td>' . $href . h($row['ag_title']) . "</A></td>";
         /*
          * State
          */
         switch ($row['ag_priority']) {
             case 1:
                 $priority = 'Haute';
                 break;
             case 2:
                 $priority = "Moyenne";
                 break;
             case 3:
                 $priority = "Important";
                 break;
         }
         $r .= td($priority);
         $r .= "<td>" . $ref . "</td>";
         $r .= "</tr>";
     }
     $r .= "</table>";
     $r .= '<p>' . $bar . '</p>';
     return $r;
 }