echo all_main_prod_list($DATABASE1);
//include_once "tz_leftbanner.php3";
}
else
{
include_once "login.php3";
echo " ";
?>
//include_once "tz_leftbanner.php3";
echo all_main_prod_list($DATABASE1);
}
?>
|
|
function getVerifiedStatus($DATABASE1,$memberlogin) {
/*****************************************************************************************/
/*
Added by austin.
date : 19/07/2007.
This image states that the company is a 'verified' company.
*/
$sel_query_verified = "SELECT status , login
FROM $DATABASE1.`tz_get_verified`
where `login` = '$memberlogin'";
if ($res_verified = @mysql_query($sel_query_verified)) {
$arr_verified = @mysql_fetch_assoc($res_verified);
//echo ' -->'.$memberlogin.'------>'.$arr_verified['login'];
if (($arr_verified['status'] == 'Y' || $arr_verified['status'] == 'y') and ($arr_verified['login'] == $memberlogin))
return $getVerifiedIcon = ' ';
else
return 0;
}
/*****************************************************************************************/
}
//******************* Database Connection Link **********************************
$link = mysql_connect($DB_SERVER,$USERNAME,$PASSWORD);
//mysql_select_db($DATABASE,$link);
mysql_select_db($DATABASE1,$link);
//*********************End Of that Link ********************************************
//Paging script start from here*****************************************************
if(!empty($sort_type))
{
if(!empty($company_search) && $company_search!='Enter Company Name')
{
$tz_type = "select count(*) as count_company from $DATABASE1.`tz_company_mem_type` where status='Approved' and companyname LIKE '%$company_search%' order by $sort_type ASC";
}
else
{
$tz_type = "select count(*) as count_company from $DATABASE1.`tz_company_mem_type` where status='Approved' order by $sort_type ASC";
}
}
else
{
if(!empty($company_search))
{
$tz_type = "select count(*) as count_company from $DATABASE1.`tz_company_mem_type` where status='Approved' and companyname LIKE '%$company_search%' order by flag DESC";
}
else
{
$tz_type = "select count(*) as count_company from $DATABASE1.`tz_company_mem_type` where status='Approved' order by flag DESC";
}
}
$tz_result=mysql_query($tz_type);
$this_row=@mysql_fetch_array($tz_result);
$tz_num=$this_row['count_company'];
$scriptpath="companies.html?";
if(!$hits_per_page) $hits_per_page = 10;
$pages_per_page = 10;
// paging
if(!$from) ($from=0);
if(!$to) ($to=$hits_per_page-1);
if(!$nextpg_from) ($nextpg_from=0);
if(!$nextpg_to)
{
if(($tz_num/$hits_per_page)>$pages_per_page) ($nextpg_to = $pages_per_page);
else
{
if($tz_num>$hits_per_page)
{
$nextpg_to = intval($tz_num/$hits_per_page);
if($tz_num%$hits_per_page)$nextpg_to += 1;
}
else $nextpg_to = 1;
}
}
if($tz_num<=$hits_per_page)$to = $tz_num-1;
//*** 'From' and 'To' values displayed **
$display_from=$from+1;
$pgno = intval($display_from/$hits_per_page)+1;
(($to <= ($tz_num+1)) && ($display_to=$to+1)) || ($display_to=$tz_num);
$page_select_format=" >";
//*** previous page links **
if($nextpg_from>0)
{
$prevpg_from = $nextpg_from-$pages_per_page;
$prevpg_to = $nextpg_from;
$prev_from = $nextpg_from*$hits_per_page-$hits_per_page;
$prev_to = $prev_from +$hits_per_page -1;
$prev_url = $scriptpath."".
//"section=".r_($section)."".
//"view=".r_($view)."&".
"hits_per_page=".r_($hits_per_page)."&".
//"sortby=".r_($sortby)."&".
//"sortorder=".r_($sortorder)."&".
//"countrynews=".r_($countrynews)."&".
//"datenews=".r_($datenews)."&".
"from=$prev_from&to=$prev_to&nextpg_from=$prevpg_from&nextpg_to=$prevpg_to&sort_type=$sort_type&order=$order";
$page_select.="back ";
}
//*** Loop for printing the 1 2 3... Links **
for ($pageno=(1+$nextpg_from);$pageno <=($nextpg_to);$pageno++)
{
$temp=$page_select_format;
$temp=ereg_replace("","$pageno","$temp");
$page_from=$pageno * $hits_per_page - $hits_per_page;
$page_to= $page_from + $hits_per_page -1;
if ($page_to >= ($tz_num - 1))
{
$page_to=$num - 1;
}
$page_path=$scriptpath."".
//"section=".r_($section)."&".
//"view=".r_($view)."&".
"hits_per_page=".r_($hits_per_page)."&".
//"sortby=".r_($sortby)."&".
//"sortorder=".r_($sortorder)."&".
//"countrynews=".r_($countrynews)."&".
//"datenews=".r_($datenews)."&".
"from=$page_from&to=$page_to&nextpg_from=$nextpg_from&nextpg_to=$nextpg_to&sort_type=$sort_type&order=$order&company_search=$company_search";
if($pageno==$pgno)$temp = " $pgno";
else $temp=ereg_replace("","$page_path",$temp);
$page_select .=$temp;
}
$numofpages = intval($tz_num/$hits_per_page);
if($tz_num%$hits_per_page)$numofpages += 1;
//*** For generating [>>] link **
if($nextpg_to<$numofpages)
{
$page_from += $hits_per_page;
//*** assign $page_to for displaying the next set of records **
if($page_to<($tz_num - $hits_per_page)) $page_to += $hits_per_page;
else $page_to += $tz_num%$hits_per_page;
$nextpg_from = $nextpg_to;
//*** assign $nextpg_to for displaying the next set of pages **
if($nextpg_to< ($numofpages-($numofpages%$pages_per_page))) $nextpg_to += $pages_per_page;
else $nextpg_to +=($numofpages%$pages_per_page);
//*** generate the next url **
$next_url = $scriptpath."".
//"section=".r_($section)."&".
//"view=".r_($view)."&".
"hits_per_page=".r_($hits_per_page)."&".
//"sortby=".r_($sortby)."&".
//"sortorder=".r_($sortorder)."&".
//"countrynews=".r_($countrynews)."&".
//"datenews=".r_($datenews)."&".
"from=$page_from&to=$page_to&nextpg_from=$nextpg_from&nextpg_to=$nextpg_to&sort_type=$sort_type&order=$order&company_search=$company_search";
$page_select.=" more";
}
//paging ends here
?>
|