[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4090 - in phpcompta/trunk: html include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4090 - in phpcompta/trunk: html include |
Date: |
Sat, 14 May 2011 02:36:59 +0200 (CEST) |
Author: danydb
Date: 2011-05-14 02:36:59 +0200 (Sat, 14 May 2011)
New Revision: 4090
Modified:
phpcompta/trunk/html/test.php
phpcompta/trunk/include/class_html_table.php
Log:
add new function for creating a table from an SQL
Modified: phpcompta/trunk/html/test.php
===================================================================
--- phpcompta/trunk/html/test.php 2011-05-14 00:35:50 UTC (rev 4089)
+++ phpcompta/trunk/html/test.php 2011-05-14 00:36:59 UTC (rev 4090)
@@ -74,7 +74,8 @@
array(32,'Acc_Operation & children'),
array(33,'Ledger : reverse op'),
array(34,'Reconciliation'),
- array(35,'Bilan')
+ array(35,'Bilan'),
+ array(36,'SQL2Table')
);
$r='<form method="get">';
$r.='<select name="test_select" >';
@@ -298,6 +299,10 @@
require_once('class_acc_bilan.php');
Acc_Bilan::test_me();
break;
+case 36:
+ require_once('class_html_table.php');
+ Html_Table::test_me();
+ break;
}
Modified: phpcompta/trunk/include/class_html_table.php
===================================================================
--- phpcompta/trunk/include/class_html_table.php 2011-05-14 00:35:50 UTC
(rev 4089)
+++ phpcompta/trunk/include/class_html_table.php 2011-05-14 00:36:59 UTC
(rev 4090)
@@ -32,9 +32,46 @@
* Simple table without any feature (link in certain cell, sort,...)
* @param $cn database object
* @param $a_col header of the column it is an array of array
+ * indexes are link, name,image, style
* @param $sql query to execute
* @param $table_style style of the table
* @parm $a_sql_var array variable for the $sql DEFAULT NULL
address@hidden
+ static function test_me()
+ {
+ $cn=new Database(Dossier::id());
+ $order=" order by f_id desc ";
+ $url=HtmlInput::get_to_string(array("gDossier","test_select"));
+
+ if ( isset($_GET['sb']))
+ {
+ $order=" order by f_id";
+ $img="image/select1.gif";
+ }
+ else
+ {
+ $url=$url."&sb=as";
+ $img="image/select2.gif";
+ }
+ $sql="select f_id,name,quick_code from vw_client $order limit 10";
+ echo $sql;
+
+
+ echo Html_Table::sql2table($cn,
+ array(
+ array('name'=>'N° de fiche',
+ 'style'=>'text-align:right',
+ 'link'=>$url,
+ 'image'=>$img),
+ array('name'=>'Nom',
+ 'style'=>'text-align:right'),
+ array('name'=>'QuickCode')
+ )
+ ,
+ $sql
+ );
+ }
address@hidden
*/
static function
sql2table($cn,$a_col,$sql,$table_style="result",$a_sql_var=null)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4090 - in phpcompta/trunk: html include,
phpcompta-dev <=