"")) $cid=(int)$_REQUEST["cid"]; if(isset($_REQUEST["browse"])&&($_REQUEST["browse"]<>"")) $browse=$_REQUEST["browse"]; switch($browse) { case "buy": $browse="buy"; $featured_label="Buying Leads"; $details_url="offers_buy.php"; $not_found_msg="$Not_found_any_buying_leads"; $prod="buy"; $es_type=2; break; case "profile": $browse="profile"; $featured_label="Company Profiles"; $details_url="company_index.php"; $not_found_msg="$Not_found_any_company_profile"; $es_type=4; break; case "product": $browse="product"; $featured_label="Product Catalogues"; $prod="prod"; $details_url="product.php"; $not_found_msg="$Not_found_any_product_catalogue"; $es_type=3; break; default : $browse="sell"; $prod="sell"; $details_url="offers.php"; $not_found_msg="$Not_found_any_selling_leads"; $featured_label="Selling Leads"; $es_type=1; } $tmp_cid=$cid; function main() { include($_SESSION['lang'].".php"); global $domain_url,$browse, $tmp_cid,$featured_label,$not_found_msg,$details_url,$es_type,$prod,$domain; $cid=$tmp_cid; $config=mysql_fetch_array(mysql_query("select * from esb2b_config")); if(($config["es_image_magik"]=="enable")) { $img_path=$domain_url."/thumbs2/"; $img_pmt=""; } else { $img_path=$domain_url."/uploadedimages/"; $img_pmt="width=".$config["es_th_width"]." height=".$config["es_th_width"]; } $recperpage=$config["es_recperpage"]; $search_str=""; $keyword_str=""; $keyword_str_profile=""; $strpass="";//"&browse=$browse"; $keyword=""; $searchkeyword=""; $gdate=""; $gdate1=""; $alpha=""; if(isset($_REQUEST["alpha"])&&($_REQUEST["alpha"]<>"")) { $alpha_company="AND es_companyname LIKE '".$_REQUEST["alpha"]."%'"; $alpha="AND es_title LIKE '".$_REQUEST["alpha"]."%'"; } if(isset($_REQUEST["show_save"]) && ($_REQUEST["show_save"]=='yes') ) $strpass.="&show_save=".$_REQUEST["show_save"]; $strpass.="&cid=".$cid; //_______________________keyword search________________________________ if(isset($_REQUEST["keyword"])&&($_REQUEST["keyword"]<>"")) { $keyword=$_REQUEST["keyword"]; $strpass.="&keyword=".$_REQUEST["keyword"]; if (!get_magic_quotes_gpc()) { $searchkeyword=str_replace('$', '\$',addslashes($_REQUEST["keyword"])); } else { $searchkeyword=str_replace('$', '\$',$_REQUEST["keyword"]); } $searchkeyword=trim($searchkeyword); if(isset($_REQUEST["search_method"])&& (($_REQUEST["search_method"]==2)||($_REQUEST["search_method"]==3))) { $strpass.="&search_method=".$_REQUEST["search_method"]; $log_operator="OR"; if($_REQUEST["search_method"]==2) $log_operator="AND"; $temp_str=""; $temp_str1=""; $keyword_arr=explode(" ",$searchkeyword); foreach($keyword_arr as $key) { if($temp_str=="") { $temp_str="(es_title like '%$key%' or es_description like '%$key%' or es_keywords like '%$key%') "; $temp_str1="(es_companyname like '%$key%' or es_companyprofile like '%$key%') "; } else { $temp_str.=" $log_operator (es_title like '%$key%' or es_description like '%$key%' or es_keywords like '%$key%') "; $temp_str1.=" $log_operator (es_companyname like '%$key%' or es_companyprofile like '%$key%' ) "; } } $keyword_str=" and ($temp_str)"; $keyword_str_profile=" and ($temp_str1)"; }// end if AND/ OR keywords else { $keyword_str=" and (es_title like '%$searchkeyword%' or es_description like '%$searchkeyword%' or es_keywords like '%$searchkeyword%')"; $keyword_str_profile=" and (es_companyname like '%$searchkeyword%' or es_companyprofile like '%$searchkeyword%')"; } } //_________________________________________________________________ if(isset($_REQUEST["country"])&&($_REQUEST["country"]<>"")) $strpass.="&country=".$_REQUEST["country"]; if(isset($_REQUEST["month"]) && isset($_REQUEST["day"])&& isset($_REQUEST["year"]) &&($_REQUEST["month"]<>0)&&($_REQUEST["day"]<>0)&&($_REQUEST["year"]<>0)) { $strpass=$strpass . "&month=" . $_REQUEST["month"]; $strpass=$strpass . "&day=" . $_REQUEST["day"]; $strpass=$strpass . "&year=" . $_REQUEST["year"]; $month=$_REQUEST["month"]; $day=$_REQUEST["day"]; if($_REQUEST["month"]<10) { $month="0".$_REQUEST["month"]; } if($_REQUEST["day"]<10) { $day="0".$_REQUEST["day"]; } $gdate=$_REQUEST["year"].$month.$day."235959"; } if(isset($_REQUEST["month1"]) && isset($_REQUEST["day1"])&& isset($_REQUEST["year1"]) && ($_REQUEST["month1"]<>0)&&($_REQUEST["day1"]<>0)&&($_REQUEST["year1"]<>0)) { $strpass=$strpass . "&month1=" . $_REQUEST["month1"]; $strpass=$strpass . "&day1=" . $_REQUEST["day1"]; $strpass=$strpass . "&year1=" . $_REQUEST["year1"]; $month1=$_REQUEST["month1"]; $day1=$_REQUEST["day1"]; if($_REQUEST["month1"]<10) { $month1="0".$_REQUEST["month1"]; } if($_REQUEST["day1"]<10) { $day1="0".$_REQUEST["day1"]; } $gdate1=$_REQUEST["year1"].$month1.$day1."000000"; } //==============================country Search================ if(isset($_REQUEST["country"])&&($_REQUEST["country"]<>"")) { $mem_list=-1; $mem_query=mysql_query("select * from esb2b_members where es_country=".$_REQUEST["country"]); while($mem=mysql_fetch_array($mem_query)) { $mem_list.=",".$mem["es_id"];} $search_str.=" and es_uid in ($mem_list)"; } //============================================================ if(isset($_REQUEST["mem_id"])&&($_REQUEST["mem_id"]<>"")) { $strpass.="&mem_id=".$_REQUEST["mem_id"]; $search_str.=" and es_uid=".$_REQUEST["mem_id"]; } //=================================date search================ if($gdate<>"") { $search_str.=" and es_postedon > $gdate"; } if($gdate1<>"") { $search_str.=" and es_postedon < $gdate1"; } //============================================================ $catname=""; $category=0; //echo "Select * from esb2b_categories where es_id=" . $cid ; $cat_query=mysql_query("Select * from esb2b_categories where es_id=" . $cid ); if ($cat=mysql_fetch_array($cat_query)) { $catname=$cat["es_cat_name"]; $category=$cat["es_id"]; } if(($cid!="") || ($cid!=0)){ $cat_tablesell = ", esb2b_offer_cats"; $cat_idsell="and esb2b_offers.es_id=esb2b_offer_cats.es_offer_id and esb2b_offer_cats.es_cid=$cid"; $cat_tablebuy = ", esb2b_offer_cats_buy"; $cat_idbuy="and esb2b_offers_buy.es_id=esb2b_offer_cats_buy.es_offer_id and esb2b_offer_cats_buy.es_cid=$cid"; $cat_tablepro = ", esb2b_product_cats"; $cat_idpro="and esb2b_products.es_id=esb2b_product_cats.es_offer_id and esb2b_product_cats.es_cid=$cid"; $cat_tableprof = ", esb2b_profile_cats"; $cat_idprof="and esb2b_companyprofiles.es_id=esb2b_profile_cats.es_profile_id and esb2b_profile_cats.es_cid=$cid"; } $catpath=""; //echo "Select * from esb2b_categories where es_id=" . $cid; $cat_query=mysql_query("Select * from esb2b_categories where es_id=" . $cid ); while ($rs=mysql_fetch_array($cat_query)){ //echo "
Select * from esb2b_productfocus where es_id=" . $rs["es_pid"]; $focus_query=mysql_fetch_array(mysql_query("Select * from esb2b_productfocus where es_id=" . $rs["es_pid"] )); $catpath ="".$focus_query["es_productfocus"]." > ".$rs["es_cat_name"].""; } $child_list=$cid; //echo "
select * from esb2b_categories where es_pid in ($child_list) and es_id not in ($child_list)"; $cat_q=mysql_query("select * from esb2b_categories where es_pid in ($child_list) and es_id not in ($child_list)"); while($cat_temp=mysql_fetch_array($cat_q)){ $child_list.=",".$cat_temp["es_id"]; //echo "
select * from esb2b_categories where es_pid in ($child_list) and es_id not in ($child_list)"; $cat_q=mysql_query("select * from esb2b_categories where es_pid in ($child_list) and es_id not in ($child_list)"); } $sell_id_list=-1; $buy_id_list=-1; $product_id_list=-1; $profile_id_list=-1; //echo "select * from esb2b_offer_cats where es_cid in ($child_list)"; $temp_q=mysql_query("select * from esb2b_offer_cats where es_cid in ($child_list)"); while($temp_rs=mysql_fetch_array($temp_q)) $sell_id_list.=",".$temp_rs["es_offer_id"]; //echo "
select * from esb2b_offer_cats_buy where es_cid in ($child_list)"; $temp_q=mysql_query("select * from esb2b_offer_cats_buy where es_cid in ($child_list)"); while($temp_rs=mysql_fetch_array($temp_q)) $buy_id_list.=",".$temp_rs["es_offer_id"]; //echo "select * from esb2b_product_cats where es_cid in ($child_list)"; $temp_q=mysql_query("select * from esb2b_product_cats where es_cid in ($child_list)"); while($temp_rs=mysql_fetch_array($temp_q)) $product_id_list.=",".$temp_rs["es_offer_id"]; $temp_q=mysql_query("select * from esb2b_profile_cats where es_cid in ($child_list)"); while($temp_rs=mysql_fetch_array($temp_q)) $profile_id_list.=",".$temp_rs["es_profile_id"]; //========================== Sell Offer ================================================= if($_GET[cid]=="" or $_GET[cid]==0) { if($keyword_str=='') { //$_GET[keyword]="Limin"; $req_url = explode("keyword=", $_SERVER['REQUEST_URI']); $req_url_key = explode("&", $req_url[1]); $url_keyword = $req_url_key[0]; $req_url_show = explode("show_save=", $_SERVER['REQUEST_URI']); $req_url_show = explode("&", $req_url_show[1]); $url_save_show = $req_url_show[0]; $page_strpass = "&show_save=$url_save_show&keyword=$url_keyword"; $keyword_str = "and (es_title like '%".$url_keyword."%' or es_description like '%".$url_keyword."%' or es_keywords like '%".$url_keyword."%')"; } //$temp_str="(es_title like '%$key%' or es_description like '%$key%' or es_keywords like '%$key%') "; $sell_cnt_q="select *,esb2b_offers.es_id, UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_offers, esb2b_members $cat_tablesell where es_approved='yes' and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() $search_str $keyword_str and esb2b_offers.es_uid=esb2b_members.es_id $cat_idsell $alpha "; //$sell_cnt_q="select * from esb2b_offer_cats, esb2b_offers, esb2b_members where es_approved='yes' and esb2b_offers.es_id=esb2b_offer_cats.es_offer_id and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() and es_cid IN (" .$child_list. ")"; //$sell_cnt_q="select *,esb2b_offers.es_id, UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_offers, esb2b_members $cat_tablesell where es_approved='yes' and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() $search_str $keyword_str and esb2b_offers.es_uid=esb2b_members.es_id $cat_idsell $alpha "; //$sell_cnt=mysql_num_rows(mysql_query($sell_cnt_q)); //echo "
In IF condition" .$sell_cnt; //echo mysql_error(); } else { $sell_cnt_q="select *,UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_offer_cats, esb2b_offers where es_approved='yes' and esb2b_offers.es_id=esb2b_offer_cats.es_offer_id and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() $search_str $keyword_str and es_cid in ($child_list)"; //$sell_cnt_q="select * from esb2b_offer_cats, esb2b_offers, esb2b_members where es_approved='yes' and esb2b_offers.es_id=esb2b_offer_cats.es_offer_id and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() and es_cid IN (" .$child_list. ")"; //$sell_cnt_q="select *,esb2b_offers.es_id, UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_offers, esb2b_members $cat_tablesell where es_approved='yes' and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() $search_str $keyword_str and esb2b_offers.es_uid=esb2b_members.es_id $cat_idsell $alpha "; //echo mysql_error(); } $sell_cnt=mysql_num_rows(mysql_query($sell_cnt_q)); //=============================================================================== //===================Bye Offer==================================================== if($_GET[cid]=="" or $_GET[cid]==0) { $buy_cnt_q="select *,esb2b_offers_buy.es_id, UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_offers_buy, esb2b_members $cat_tablebuy where es_approved='yes' and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_buy"]." MONTH) > NOW() $search_str $keyword_str and esb2b_offers_buy.es_uid=esb2b_members.es_id $cat_idbuy $alpha"; } else{ $buy_cnt_q="select *,UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_offer_cats_buy, esb2b_offers_buy where es_approved='yes' and esb2b_offers_buy.es_id=esb2b_offer_cats_buy.es_offer_id and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_buy"]." MONTH) > NOW() and es_cid in ($child_list)"; } $buy_cnt=mysql_num_rows(mysql_query($buy_cnt_q)); //================================================================================= //========================Products================================================== if($_GET[cid]=="" or $_GET[cid]==0) { $product_cnt_q="select *,esb2b_products.es_id, UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_products, esb2b_members $cat_tablepro where es_approved='yes' $search_str $keyword_str $gold_product and esb2b_products.es_uid=esb2b_members.es_id $cat_idpro $alpha"; } else{ $product_cnt_q="select *,UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_product_cats, esb2b_products where es_approved='yes' and esb2b_products.es_id=esb2b_product_cats.es_offer_id and es_cid in ($child_list)"; } //$product_cnt_q="select *,esb2b_products.es_id, UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_products, esb2b_members $cat_tablepro where es_approved='yes' $search_str $keyword_str $gold_product and esb2b_products.es_uid=esb2b_members.es_id $cat_idpro $alpha"; $product_cnt=mysql_num_rows(mysql_query($product_cnt_q)); //===================================================================================== //======================Profiles======================================================= if($_GET[cid]=="" or $_GET[cid]==0) { $profile_cnt_q="select *,esb2b_companyprofiles.es_id, es_companyname as es_title,es_companyprofile as es_description,UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_companyprofiles, esb2b_members $cat_tableprof where es_approved='yes' $search_str $keyword_str_profile and esb2b_companyprofiles.es_uid=esb2b_members.es_id $cat_idprof $alpha_company"; } else { $profile_cnt_q="select *,esb2b_companyprofiles.es_id, es_companyname as es_title,es_companyprofile as es_description,UNIX_TIMESTAMP(es_postedon) as ondate from esb2b_companyprofiles, esb2b_members $cat_tableprof where es_approved='yes' $search_str $keyword_str_profile and esb2b_companyprofiles.es_uid=esb2b_members.es_id $cat_idprof $alpha_company"; } $profile_cnt=mysql_num_rows(mysql_query($profile_cnt_q)); //echo mysql_error(); //====================================================================================== switch($browse) { case 'buy': $sql=$buy_cnt_q; break; case 'product': $sql=$product_cnt_q; break; case 'profile': $sql=$profile_cnt_q; break; default : $sql=$sell_cnt_q; break; } //$sell_cnt_q="select * from esb2b_offer_cats, esb2b_offers, esb2b_members where es_approved='yes' and esb2b_offers.es_id=esb2b_offer_cats.es_offer_id and DATE_ADD(es_postedon,INTERVAL ".$config["es_expiry_sell"]." MONTH) > NOW() and es_cid IN (" .$child_list . ") ORDER BY esb2b_members.es_memtype"; //$sql.=" ORDER BY esb2b_members.es_memtype "; $offer_query=mysql_query($sql); //_______________________________________PAGING____________________________________ if(!isset($_REQUEST["pg"])) { $pg=1; } else { $pg=$_REQUEST["pg"]; } $rcount=mysql_num_rows($offer_query); if ($rcount==0 ) { $pages=0; } else { $pages=floor($rcount / $recperpage); //echo "Out side if:".$pages; if (($rcount%$recperpage) > 0 ) { $pages=$pages+1; //echo "In side if:".$pages; } } if($pg>$pages) $pg=$pages; $jmpcnt=1; while ( $jmpcnt<=($pg-1)*$recperpage && $row = mysql_fetch_array($offer_query) ) { $jmpcnt = $jmpcnt + 1; } //____________________________________________________________________ ?>
0)) { ?>
 /> >>
"> "> "> "> "> "> "> "> " onClick="submit_form()">
" width="11">  'sell') if($_REQUEST['alpha']!="") { echo "$Sell ($sell_cnt)"; } else { if($_REQUEST["keyword"]=="" and $_REQUEST['show_save']==""){ if($catname==""){ echo "$Sell ($sell_cnt)"; }else{ echo "$Sell ($sell_cnt)"; } } else{ echo "$Sell ($sell_cnt)"; } } else echo "$Sell ($sell_cnt)"; ?> " width="9"> 
" width="11">  'buy') if($_REQUEST['alpha']!="") { echo "$Buy ($buy_cnt)"; } else { if($_REQUEST["keyword"]=="" and $_REQUEST['show_save']==""){ if($catname==""){ echo "$Buy ($buy_cnt)"; } else{ echo "$Buy ($buy_cnt)"; } } else { echo "$Buy ($buy_cnt)"; } } else echo "$Buy ($buy_cnt)"; ?> " width="9"> 
" width="11">  'product') if($_REQUEST['alpha']!="") { echo "$Products ($product_cnt)"; } else { if($_REQUEST["keyword"]=="" and $_REQUEST['show_save']==""){ if($catname==""){ echo "$Products ($product_cnt)"; }else{ echo "$Products ($product_cnt)"; } } else{ echo "$Products ($product_cnt)"; } } else echo "$PRODUCTS ($product_cnt)"; ?> " width="9"> 
" width="11">  'profile') if($_REQUEST['alpha']!="") { echo "$Profiles ($profile_cnt)"; } else { if($_REQUEST["keyword"]==""){ if($catname==""){ echo "$Profiles ($profile_cnt)"; }else{ echo "$Profiles ($profile_cnt)"; } } else{ echo "$Profiles ($profile_cnt)"; } } else echo "$PROFILES ($profile_cnt)"; ?> " width="9"> 
" method="post"> "; } ?>
"buy") { switch($browse) { case 'sell': $img_q="select * from esb2b_offer_images where es_offer_id=".$offer["es_id"]." order by es_id"; $images=mysql_fetch_array(mysql_query($img_q)); break; case 'product': $img_q="select * from esb2b_product_images where es_offer_id=".$offer["es_id"]." order by es_id"; $images=mysql_fetch_array(mysql_query($img_q)); break; case 'profile': $images["es_img_url"]=$offer["es_logo"]; break; } ?>
" /> "; }else{ echo ""; } } else echo ""; ?>
" target="_blank"> / target="_blank"> 50) { echo substr($offer["es_title"], 0, strrpos( substr($offer["es_title"], 0, 50),' ' )); } else { echo $offer["es_title"]; } ?> "profile") { $cur=mysql_fetch_array(mysql_query("select * from esb2b_currencies where escur_id=".$offer["es_price_cur_id"])); echo $cur["escur_symbol"]; echo $offer["es_price"]; } else { $cur=mysql_fetch_array(mysql_query("select * from esb2b_country where id=".$mem["es_country"])); $img_path_boom=$domain_url."/flags/"; echo ""; echo $cur["country"]; } ?>
"; break; case 'silver': echo ""; break; case 'bronze': echo ""; break; } ?>
:
: 250) { echo substr(strip_tags($offer["es_description"]), 0, strrpos( substr(strip_tags($offer["es_description"]), 0, 20),' ' )) . ".."; } else { echo strip_tags($offer["es_description"]); } ?>
$not_found_msg
">
" method="post"> "; } ?>
"buy") { switch($browse) { case 'sell': $img_q="select * from esb2b_offer_images where es_offer_id=".$offer["es_id"]." order by es_id"; $images=mysql_fetch_array(mysql_query($img_q)); break; case 'product': $img_q="select * from esb2b_product_images where es_offer_id=".$offer["es_id"]." order by es_id"; $images=mysql_fetch_array(mysql_query($img_q)); break; case 'profile': $images["es_img_url"]=$offer["es_logo"]; break; } ?>
" /> "; }else{ echo ""; } } else echo ""; ?>
" target="_blank"> / target="_blank"> 50) { echo substr($offer["es_title"], 0, strrpos( substr($offer["es_title"], 0, 50),' ' )); } else { echo $offer["es_title"]; } ?> "profile") { $cur=mysql_fetch_array(mysql_query("select * from esb2b_currencies where escur_id=".$offer["es_price_cur_id"])); echo $cur["escur_symbol"]; echo $offer["es_price"]; } ?> "sell" || $browse<>"buy" || $browse<>"product") { $cur=mysql_fetch_array(mysql_query("select * from esb2b_country where id=".$mem["es_country"])); $img_path_boom=$domain_url."/flags/"; echo ""; echo $cur["country"]; } ?>
"; break; case 'silver': echo ""; break; case 'bronze': echo ""; break; } ?>
:
: 250) { echo substr(strip_tags($offer["es_description"]), 0, strrpos( substr(strip_tags($offer["es_description"]), 0, 50),' ' )) . ".."; } else { echo substr(strip_tags($offer["es_description"],0,50)); } ?>
$not_found_msg
">
 
1) { if ($pg!=1) { if($cid=="" || $cid==0){ if($page_strpass!='') { $strpass = $page_strpass.$strpass; } ?> " > //.html?pg=" > 1) { ?> .html?pg=" > //.html"> "; } echo $jmpcnt; if ($jmpcnt!=$pg) { ?> "; } if ($jmpcnt<$pages) echo "   "; ?>   0) { if($cid=="" || $cid==0){ ?> "> //.html" > >" ?> 0) { ?>