39 lines
2.6 KiB
PHP
Executable File
39 lines
2.6 KiB
PHP
Executable File
<?
|
|
function ListViewAjax($where,$table,$module)
|
|
{
|
|
require_once("modules/".$module."/row_template.php");
|
|
|
|
if($where)$z="SELECT ".$table.".*,users.user_name as assigned_user_name FROM ".$table." LEFT JOIN users ON (".$table.".assigned_user_id=users.id) WHERE ".$where." and ".$table.".deleted='0'";
|
|
else $z="SELECT ".$table.".*,users.user_name as assigned_user_name FROM ".$table." LEFT JOIN users ON (".$table.".assigned_user_id=users.id) WHERE ".$table.".deleted='0'";
|
|
if($_REQUEST['order_by'])$z.=" ORDER BY ".$_REQUEST['order_by'];
|
|
if($_REQUEST['sorder'])$z.=" ".$_REQUEST['sorder'];
|
|
$w=mysql_query($z);
|
|
$num=mysql_num_rows($w);
|
|
$html=$z.'
|
|
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
|
<tr>
|
|
<td COLSPAN="20" align="right">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" class="listViewPaginationTdS1"><a id=\'export_link\' onclick=\'return export_overlib();\' href="#" class="listViewPaginationLinkS1"><img src=\'themes/Sugar/images/export.gif\' width=\'10\' height=\'9\' alt=\'Export\' border=\'0\' align=\'absmiddle\'> Export</a> | Selected: <input class=\'listViewPaginationTdS1\' style=\'border: 0px; background: transparent; font-size: inherit; color: inherit\' type=\'text\' readonly name=\'selectCount[]\' value=\'0\' /></td>
|
|
<td nowrap align="right" class="listViewPaginationTdS1" id=\'listViewPaginationButtons\'><img src=\'themes/Sugar/images/start_off.gif\' width=\'13\' height=\'11\' alt=\'Start\' border=\'0\' align=\'absmiddle\'> Start <img src=\'themes/Sugar/images/previous_off.gif\' width=\'8\' height=\'11\' alt=\'Previous\' border=\'0\' align=\'absmiddle\'> Previous <span class=\'pageNumbers\'>(1 - 7 of 7)</span> Next <img src=\'themes/Sugar/images/next_off.gif\' width=\'8\' height=\'11\' alt=\'Next\' border=\'0\' align=\'absmiddle\'> End <img src=\'themes/Sugar/images/end_off.gif\' width=\'13\' height=\'11\' alt=\'End\' border=\'0\' align=\'absmiddle\'></td></tr></table>
|
|
</td>
|
|
</tr>';
|
|
$html.=HeaderTemplate();
|
|
while($r=mysql_fetch_array($w))
|
|
{
|
|
$html.=RowTemplate($r);
|
|
}
|
|
$html.="</table>";
|
|
return $html;
|
|
}
|
|
|
|
require_once("../../config.php");
|
|
|
|
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
|
|
mysql_select_db($sugar_config['dbconfig']['db_name']);
|
|
mysql_query("set names utf8");
|
|
mysql_query("set charaecter set utf8");
|
|
echo ListViewAjax($_REQUEST['where'],$_REQUEST['table'],$_REQUEST['module']);
|
|
mysql_close($sql);
|
|
?>
|
|
|