'N° de fiche',
'style'=>'text-align:right',
'link'=>$url,
'image'=>$img),
array('name'=>'Nom',
'style'=>'text-align:right'),
array('name'=>'QuickCode')
)
,
$sql
);
}
@endcode
*/
static function sql2table($cn,$a_col,$sql,$table_style='class="result"',$a_sql_var=null)
{
$r='';
$r=sprintf('
',$table_style);
$r.='';
for ( $i=0;$i %s',$a_col[$i]['image'],$content);
}
if ( isset($a_col[$i]['link']) )
{
$content=sprintf('%s',
$a_col[$i]['link'],
$content);
$r.="$content | ";
}
else
$r.= "". h($content)." | ";
}
$r.='
';
$ret=$cn->exec_sql($sql,$a_sql_var);
for ($i=0;$i';
$row=Database::fetch_row($ret,$i);
for ($e=0;$e'.$row[$e].'';
else
$r.=td($content,$style);
}
$r.='';
}
$r.='
';
return $r;
}
static function test_me()
{
$cn=Dossier::connect();
$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
);
}
}