phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4212 - phpcompta/trunk/include
Date: Fri, 14 Oct 2011 00:00:07 +0200 (CEST)

Author: danydb
Date: 2011-10-14 00:00:06 +0200 (Fri, 14 Oct 2011)
New Revision: 4212

Added:
   phpcompta/trunk/include/class_sort_table.php
Modified:
   phpcompta/trunk/include/constant.php
Log:
0000381: R?\195?\169?\195?\169criture des tri pour toutes les tables


Added: phpcompta/trunk/include/class_sort_table.php
===================================================================
--- phpcompta/trunk/include/class_sort_table.php                                
(rev 0)
+++ phpcompta/trunk/include/class_sort_table.php        2011-10-13 22:00:06 UTC 
(rev 4212)
@@ -0,0 +1,86 @@
+<?php
+
+/**
+ * Description of class_syn_sort_table
+ *
+ * @author dany
+ */
+class Sort_Table
+{
+
+    function __construct()
+    {
+       $this->nb = 0;
+       $this->array = array();
+    }
+
+    /**
+     address@hidden add row of a header in the internal array ($this->array)
+     * , it uses the $_GET['ord'] parameter,
+     * @param type $p_header label of the header
+     * @param type $p_url base url
+     * @param type $p_sql_asc sql if ascending
+     * @param type $p_sql_desc sql if descending
+     * @param type $p_get_asc the value in $_GET if ascending is choosen
+     * @param type $p_get_desc the value in $_GET if descending is choosen
+     */
+    function add($p_header, $p_url, $p_sql_asc, $p_sql_desc, $p_get_asc, 
$p_get_desc)
+    {
+       $array = array(
+           'head' => $p_header,
+           'url' => $p_url,
+           'sql_asc' => $p_sql_asc,
+           'sql_desc' => $p_sql_desc,
+           'parm_asc' => $p_get_asc,
+           'parm_desc' => $p_get_desc,
+           'car_asc' => '<span>&#9650</span>',
+           'car_desc' => '<span>&#9660</span>'
+       );
+       $ind = $this->nb;
+       $this->array[$ind] = $array;
+       $this->nb++;
+    }
+/**
+ * Returns the header (the value into th tags) with the symbol ascending and
+ * descending
+ * @param  $p_ind the element (from 0 to nb)
+ * @return string
+ */
+    function get_header($p_ind)
+    {
+       if ($p_ind < 0 || $p_ind > $this->nb)
+           return 'ERREUR TRI';
+       $file = str_replace('extension.php', '', $_SERVER['SCRIPT_FILENAME']);
+
+       $base = $this->array[$p_ind]['url'];
+       $str = '';
+       $str .= '<A style="display:inline" HREF="' . $base . '&ord=' . 
$this->array[$p_ind]['parm_asc'] . '">' .
+               $this->array[$p_ind]['car_asc'] .
+               '</A>' .
+               $this->array[$p_ind]['head'] .
+               '<A style="display:inline" HREF="' . $base . '&ord=' . 
$this->array[$p_ind]['parm_desc'] . '">' .
+                $this->array[$p_ind]['car_desc'] .
+               '</A>';
+       return $str;
+    }
+
+    function get_sql_order($p_get)
+    {
+       for ($i = 0; $i < $this->nb; $i++)
+       {
+           if ($p_get == $this->array[$i]['parm_asc'])
+           {
+               $this->array[$i]['car_asc'] = '<span 
style="color:red">&#9650</span>';
+               return $this->array[$i]['sql_asc'];
+           }
+           if ($p_get == $this->array[$i]['parm_desc'])
+           {
+               $this->array[$i]['car_desc'] = '<span 
style="color:red">&#9660</span>';
+               return $this->array[$i]['sql_desc'];
+           }
+       }
+    }
+
+}
+
+?>

Modified: phpcompta/trunk/include/constant.php
===================================================================
--- phpcompta/trunk/include/constant.php        2011-10-13 21:43:40 UTC (rev 
4211)
+++ phpcompta/trunk/include/constant.php        2011-10-13 22:00:06 UTC (rev 
4212)
@@ -35,8 +35,13 @@
 /*set to none for production */
 /* uncomment for production */
 
-$version_phpcompta=SVNINFO; 
-define ("DEBUG",false);
+/*
+ * $version_phpcompta=SVNINFO;
+ * define ("DEBUG",false);
+ *
+ */
+$version_phpcompta=4208;
+define ("DEBUG",true);
 
 define ("DBVERSION",97);
 define ("DBVERSIONREPO",13);




reply via email to

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