phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r4533 - phpcompta/trunk/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4533 - phpcompta/trunk/include
Date: Thu, 1 Dec 2011 02:47:48 +0100 (CET)

Author: danydb
Date: 2011-12-01 02:47:45 +0100 (Thu, 01 Dec 2011)
New Revision: 4533

Modified:
   phpcompta/trunk/include/dossier.inc.php
   phpcompta/trunk/include/modele.inc.php
Log:
Add a sort for template and folder

Modified: phpcompta/trunk/include/dossier.inc.php
===================================================================
--- phpcompta/trunk/include/dossier.inc.php     2011-12-01 00:46:27 UTC (rev 
4532)
+++ phpcompta/trunk/include/dossier.inc.php     2011-12-01 01:47:45 UTC (rev 
4533)
@@ -155,17 +155,30 @@
 // List of folder
 if ( $sa == 'list' )
 {
+       require_once('class_sort_table.php');
     echo 
HtmlInput::button_anchor(_('Rafraîchir'),'admin_repo.php?action=dossier_mgt');
     echo 
HtmlInput::button_anchor(_('Ajouter'),'admin_repo.php?action=dossier_mgt&sa=add');
-
+       $header=new Sort_Table();
+       $url=$_SERVER['PHP_SELF']."?sa=list&action=".$_REQUEST['action'];
+       $header->add("id",$url," order by dos_id asc"," order by dos_id 
desc","da","dd");
+       $header->add("Nom",$url," order by dos_name asc"," order by dos_name 
desc","na","nd");
+       $header->add("Description",$url," order by dos_description asc"," order 
by dos_description  desc","da","dd");
     $repo=new Dossier(0);
        $repocn=new Database();
-    $Res=$repo->show_dossier('all');
-    $compteur=1;
+       $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 '<TABLE 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');
 
-    echo '<TABLE class="table_large" >';
-    $r=th('ID').th('Nom du dossier ').th('Description').th('Taille').th('Nom 
base de données');
     $r=tr($r);
     echo $r;
     // show all dossiers

Modified: phpcompta/trunk/include/modele.inc.php
===================================================================
--- phpcompta/trunk/include/modele.inc.php      2011-12-01 00:46:27 UTC (rev 
4532)
+++ phpcompta/trunk/include/modele.inc.php      2011-12-01 01:47:45 UTC (rev 
4533)
@@ -199,9 +199,20 @@
        }
 }
 // Show all available templates
+require_once('class_sort_table.php');
+$url=$_SERVER['PHP_SELF']."?sa=list&action=".$_REQUEST['action'];
 
+$header=new Sort_Table();
+$header->add("id",$url," order by mod_id asc"," order by mod_id 
desc","ia","id");
+$header->add("Nom",$url," order by mod_name asc"," order by mod_name 
desc","na","nd");
+$header->add("Description",$url," order by mod_desc asc"," order by mod_desc 
desc","da","dd");
+
+$ord=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'na';
+$sql_order=$header->get_sql_order($ord);
+
 $Res = $cn->exec_sql("select mod_id,mod_name,mod_desc from
-                   modeledef order by mod_name");
+                   modeledef $sql_order");
+
 $count = Database::num_row($Res);
 echo '<div class="content" style="width:80%;margin-left:10%">';
 echo "<H2>Modèles</H2>";
@@ -209,7 +220,7 @@
 {
        if ($count == 0)
        {
-               echo "No template available";
+               echo "Aucun modèle disponible";
        }
        else
        {
@@ -219,11 +230,12 @@
                echo HtmlInput::button_anchor('Ajouter', 
'admin_repo.php?action=modele_mgt&sa=add');
 
                echo '<table class="result" 
style="border-spacing:10;border-collapse:separate" >';
-               echo "<TR><TH>Nom</TH>" .
-               "<TH>Description</TH>" .
+               echo "<TR>".
+                               "<TH>".$header->get_header(0)."</TH>" .
+                               "<TH>".$header->get_header(1)."</TH>" .
+                               "<TH>".$header->get_header(2)."</TH>" .
                "<th> </th>" .
                "<th> </th>" .
-               "<th> </th>" .
                "</TR>";
 
                for ($i = 0; $i < $count; $i++)
@@ -231,7 +243,7 @@
                        $mod = Database::fetch_array($Res, $i);
                        $class = ($i % 2 == 0) ? "odd" : "even";
                        printf('<TR class="' . $class . '" 
style="vertical-align:top">' .
-                                       '<TD>%d <b> %s</b> </TD>' .
+                                       '<TD>%d </td><td><b> %s</b> </TD>' .
                                        '<TD><I> %s </I></TD>' .
                                        '<td> ' .
                                        HtmlInput::button_anchor('Effacer', 
'?action=modele_mgt&sa=del&m=' . $mod['mod_id']) . '</td>' .




reply via email to

[Prev in Thread] Current Thread [Next in Thread]