sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_data = $db->sql_fetchrow($result); ?> sql_query($sqldefault)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sqldefault); } $setdefault=$db->sql_fetchrow($result); if($mode =="home" || $mode =="duc" || " " || $mode == "view" || $mode=='news') { $u_tite = $setdefault['webtitle']; $description = $setdefault['description']; $keyword_vn = $setdefault['keyword']; //$u_tite = $title; } if($mode == 'productDetail'){ $proid = isset($_GET["pid"]) ? $_GET["pid"] : 0; $sql = "select vb_prolang.name, vb_prolang.seo_description,vb_prolang.seo_title, vb_prolang.seo_keyword from vb_prolang, vb_products where vb_prolang.proid = vb_products.proID and vb_prolang.lang_cat =".$lag." and vb_products.proID=".$proid; if(!$result = $db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_data = $db->sql_fetchrow($result); if($pro_data["seo_title"] != NULL) { $u_tite = $pro_data["seo_title"]; }else{ $u_tite = $pro_data["name"]; } $description = $pro_data['seo_keyword']; $keyword_vn = $pro_data['seo_description']; } if($mode == 'catalog') { $sql="SELECT * FROM vb_categorylang WHERE lang_cat =".$lag." and catid =".$catID; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_count=$db->sql_numrows($result); $pro_data=$db->sql_fetchrow($result); $u_tite =$pro_data['title']; $description = $pro_data['description']; } ?> sql_query($sqlanalytics)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sqlanalytics); } $setanalytics = $db -> sql_fetchrow($resultana); echo $setanalytics['google']; ?>

sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_data=$db->sql_fetchrow($result); $sql="select * from vb_products where proID=".$proid; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_data=$db->sql_fetchrow($result); // end oll============= // 18-06-14 load ngon ngu trang gioi thieu cong ty $sqlsp="select * from vb_prolang where lang_cat =".$lag." and proID=".$proid; if(!$resultsp=$db->sql_query($sqlsp)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sqlsp); } $selectpro = $db->sql_fetchrow($resultsp); ////=======end====== $simages=''; //$simages=''; if(!ereg(".jpg",$pro_data["sImages"]) && !ereg(".gif",$pro_data["sImages"]) ){ //$simages=''; $simages=''; } $memName=$mem_data["lName_vn"] ." ".$mem_data["fName_vn"]; //load companyprofile $sql = "select * from vb_companyprofilelang where lang_cat = ".$lag." and memid=".$cid; if(!$result = $db -> sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_data = $db->sql_fetchrow($result); //load danh muc san pham $categories =""; $sql_slide = "SELECT * FROM vb_category WHERE memID =".$cid." limit 0, 7"; $rs_slide = mysql_query($sql_slide); while($r_d = mysql_fetch_array($rs_slide)) { $sql="select * from vb_categorylang WHERE lang_cat =".$lag." and catid = ".$r_d["catID"]; $result = $db->sql_query($sql); $cat_lag = $db->sql_fetchrow($result); $categories .='
  • '.$cat_lag['catname'].'
  • '; } //load post new $popularpost =""; $sqlnews="select vb_newslang.title, vb_news.newid, vb_news.lastedit , vb_news.images from vb_news, vb_newslang where vb_newslang.newsid = vb_news.newid and catactive = 1 and vb_newslang.lang_cat =".$lag." and idmem =".$cid." order by newid desc limit 0, 7"; if(!$resultnew=$db->sql_query($sqlnews)){ message_die("Couldn't run the sql query!!!2","",__LINE__,__FILE__,$sqlnews); } $news_data=$db->sql_fetchrowset($resultnew); foreach($news_data as $datanw) { $urlseo = strtolower(str_replace(' ', '-', convert_vi_to_en($datanw['title'] ))) ; $popularpost .='

    '.$datanw['title'].'

    '.$datanw['lastedit'].'

    '; } // 17-06-14 hien thi san pham =====// $sql="select * from vb_products where memID = ".$cid." and sethome = 1 order by proID desc"; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_count=$db->sql_numrows($result); $pro_data=$db->sql_fetchrowset($result); $j=1; $list_pro .= ''; // HIEN THI THONG TIN SAN PHAM for($i=0;$i<$pro_count;$i++){ //pro link 02-07 $proLink ='../p/'.strtolower(str_replace(' ', '-', convert_vi_to_en($pro_data[$i]["ProductName_vn"]))).'-'.$memid.'-'.$pro_data[$i]["proID"].'-'.$pro_data[$i]["catID"].'.html' ; //$proLink ='p/'.$pro_data[$i]["ProductName_vn"].'-'.$memid.'-'.$pro_data[$i]["proID"].'-'.$pro_data[$i]["catID"].'.html' ; //23-05 $proLink = 'http://sh.yellowpages.vn/vn/supplier.php?supplier='.$memid.'&act=products&mode=productDetail&pid='.$pro_data[$i]["proID"]."&catID=".$pro_data[$i]["catID"]."&ids=".$ids."&lang=vn"; $proImage = ''; $sqllang = "SELECT * FROM `vb_prolang` WHERE `lang_cat` =".$lag." and proid =".$pro_data[$i]["proID"]; if(!$resultlg=$db->sql_query($sqllang)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sqllang); } $ds_prolang=$db->sql_fetchrowset($resultlg); $list_pro .= '
  • '.$ds_prolang[0]["name"].'
  • '; } $list_pro .= ""; $template->assign_vars(array( 'Main-Services' => $pro_data_lg[6]['new_setting'], 'toptitle' => $pro_data_lg[2]['new_setting'], 'list_pro' =>$list_pro, 'categories' =>$categories, 'popularpost' => $popularpost, 'proName' => $selectpro["name"], 'update' => $selectpro["lastEdit"], 'description' => html_entity_decode($selectpro["description"]), 'proconten' => html_entity_decode($selectpro["details"]), 'productDetail' =>''.$pro_data["Keywords_vn"].' > '. $pro_data["ProductName_vn"], 'companyName' => $mem_data["CompanyName_vn"], 'maintitle' => $mem_data["CompanyName_vn"], 'com_photo' => !empty($mem_data["barner"]) ? "  " : '' , 'viewlarger' => 'Xem hình lớn', 'ProModel' =>!empty($pro_data["Model_vn"]) ? 'Model : '.$pro_data["Model_vn"] : '' , 'supp' =>$cid, 'proDescription' =>html_entity_decode(nl2br($pro_data["Description_vn"])), 'photo' => $simages, 'nophoto' => $simages ? ' ' : 'style="display:none"', 'company' => $mem_data["CompanyName_vn"], 'ContactName' =>($mem_data["Sex"]=="Male" ? "Ông. " : "Bà. ") . $mem_data["lName_vn"] ." ".$mem_data["fName_vn"], 'Address' =>$mem_data["Address_vn"], 'city' =>$mem_data["City_vn"].", ".getContry($mem_data["countryID"]), 'zipCode' =>$mem_data["Zip"], 'Telephone' => $mem_data["contrycode"] ."-".$mem_data["areacode"]."-".$mem_data["BusinessPhone"], 'mobiphone' =>$mem_data["Mobile"], 'fax' =>$mem_data["faxcontrycode"] ."-".$mem_data["faxareacode"]."-".$mem_data["FaxNumber"], // 'Website' =>$mem_data["Web"], 'a_action' =>"supplier.php?supplier=".$cid."&act=memcontacts&mode=main", 'lid' =>$proid, 'detaildis' =>!empty($pro_data["Description_vn"]) ? 'bock' : 'none', 'divtel' => !empty($mem_data["BusinessPhone"]) ? 'bock' : 'none', 'divmobi' => !empty($mem_data["Mobile"]) ? 'bock' : 'none', 'divfax' => !empty($mem_data["FaxNumber"]) ? 'bock' : 'none', 'divweb' => !empty($mem_data["Web"]) ? 'bock' : 'none', 'divcontactName' =>strlen($memName)>9 ? 'bock' : 'none', )); //hien thi san pham lien quan global $template, $db, $template_products_body,$catID,$cid,$keyw,$site_base_href,$base_url,$langUrl,$ids ; $start = isset($_GET["start"]) ? intval($_GET["start"]) : 0; $txtgoto=isset($_POST['txtgoto']) ? intval($_POST['txtgoto']) : 0; $display=15; if($txtgoto){ $start = floor(($txtgoto-1)*$display); } $sql="SELECT vb_prolang.proid, vb_prolang.name, vb_prolang.description, vb_prolang.details, vb_products.catID, vb_products.Images FROM vb_prolang, vb_products WHERE vb_prolang.proid = vb_products.proID AND vb_prolang.lang_cat = ".$lag." and vb_products.catID =".$catID." order by vb_prolang.proid desc limit 0, 5"; //$sql="select * from vb_products where proActive=1 and memID=".$cid." order by ProductName_vn limit $start,5" ; //echo $sql; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_count=$db->sql_numrows($result); $pro_data=$db->sql_fetchrowset($result); $sql = "SELECT count(proID) AS total FROM vb_products where proActive=1 and memID=".$cid ; if ( !$result = $db->sql_query($sql) ) { message_die("Couldn't run the sql query!!!", __LINE__, __FILE__, $sql); } $total = $db->sql_fetchrow($result); if($total['total']<1){ echo '
    There are no product

    '; return ; } $pagination = g3_pagination("supplier.php?supplier=".$cid."&act=products&mode=main", $total['total'], $display, $start, 'start', 'Page:' . '////')." "; $total_pages = ceil($total['total']/$display); $db->sql_freeresult($result); for ($i=0; $i<$pro_count; $i++){ $simages=''; $detail=html_entity_decode(nl2br($pro_data[$i]["Description_vn"])); $detail_full = $detail; $arrStr=explode(' ',$detail); $k= count($arrStr)<18 ? count($arrStr) : 18; $detail=''; for($j=0;$j<$k;$j++){ $detail.=$arrStr[$j].' '; } if($k==18){ $detail.=' ...'; } $proLink =$use_url.'/p/'.strtolower(str_replace(' ', '-', convert_vi_to_en($pro_data[$i]["name"]))).'-'.$cid.'-'.$pro_data[$i]["proid"].'-'.$pro_data[$i]["catID"].'.html' ; //$proLink = 'http://sh.yellowpages.vn/vn/supplier.php?supplier='.$cid.'&act=products&mode=productDetail&pid='.$pro_data[$i]["proID"]."&catID=".$pro_data[$i]["catID"]."&ids=".$ids."&lang=vn"; $proImage = ''; $template->assign_block_vars("productList", array( 'pname' => ''.$pro_data[$i]["name"].'', 'rephoto' => ''.$simages.'', 'CHECKBOX' => '', 'model' => $pro_data[$i]["Model"] ? 'Model No : '. $pro_data[$i]["Model"] : " ", 'pdetail' => $detail_full )); } //ket thut hien thi san pham lien quan $template->set_filenames(array( "body" => $template_proDetail )); $template->pparse('body'); } //hien thi san pham lien quan function listproducts(){ global $template, $db, $template_products_body,$catID,$cid,$keyw,$site_base_href,$base_url,$langUrl,$ids ; $start = isset($_GET["start"]) ? intval($_GET["start"]) : 0; $txtgoto=isset($_POST['txtgoto']) ? intval($_POST['txtgoto']) : 0; $display=15; if($txtgoto){ $start = floor(($txtgoto-1)*$display); } $sql="select * from vb_products where proActive=1 and memID=".$cid." order by ProductName_vn limit $start,$display" ; //echo $sql; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_count=$db->sql_numrows($result); $pro_data=$db->sql_fetchrowset($result); $sql = "SELECT count(proID) AS total FROM vb_products where proActive=1 and memID=".$cid ; if ( !$result = $db->sql_query($sql) ) { message_die("Couldn't run the sql query!!!", __LINE__, __FILE__, $sql); } $total = $db->sql_fetchrow($result); if($total['total']<1){ echo '
    There are no product

    '; return ; } $pagination = g3_pagination("supplier.php?supplier=".$cid."&act=products&mode=main", $total['total'], $display, $start, 'start', 'Page:' . '////')." "; $total_pages = ceil($total['total']/$display); $db->sql_freeresult($result); for ($i=0; $i<$pro_count; $i++){ $simages=''; if(!ereg(".jpg",$pro_data[$i]["sImages"]) && !ereg(".gif",$pro_data[$i]["Images"]) ){ $simages=''; } $detail=html_entity_decode(nl2br($pro_data[$i]["Description_vn"])); $detail_full = $detail; $arrStr=explode(' ',$detail); $k= count($arrStr)<18 ? count($arrStr) : 18; $detail=''; for($j=0;$j<$k;$j++){ $detail.=$arrStr[$j].' '; } if($k==18){ $detail.=' ...'; } $template->assign_block_vars("productList", array( 'pname' => ''.$pro_data[$i]["ProductName_vn"].'', 'rephoto' => ''.$simages.'', 'CHECKBOX' => '', 'model' => $pro_data[$i]["Model"] ? 'Model No : '. $pro_data[$i]["Model"] : " ", 'pdetail' => $detail_full )); } $template->set_filenames(array( "body" => $template_products_body )); $template->pparse('body'); } //ket thut hien thi san pham lien quan //hien thi danh sach san pha trang chu function mainproducts(){ global $pro_data_lg, $template, $db, $template_products_body,$catID,$cid,$keyw,$site_base_href,$base_url,$langUrl,$ids ; $start = isset($_GET["start"]) ? intval($_GET["start"]) : 0; $txtgoto=isset($_POST['txtgoto']) ? intval($_POST['txtgoto']) : 0; $display=15; if($txtgoto){ $start = floor(($txtgoto-1)*$display); } $sql="select * from vb_products where proActive=1 and memID=".$cid." order by ProductName_vn limit $start,$display" ; //echo $sql; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_count=$db->sql_numrows($result); $pro_data=$db->sql_fetchrowset($result); $sql = "SELECT count(proID) AS total FROM vb_products where proActive=1 and memID=".$cid ; if ( !$result = $db->sql_query($sql) ) { message_die("Couldn't run the sql query!!!", __LINE__, __FILE__, $sql); } $total = $db->sql_fetchrow($result); if($total['total']<1){ echo '
    There are no product

    '; return ; } $pagination = g3_pagination("supplier.php?supplier=".$cid."&act=products&mode=main", $total['total'], $display, $start, 'start', 'Page:' . '////')." "; $total_pages = ceil($total['total']/$display); $db->sql_freeresult($result); for ($i=0; $i<$pro_count; $i++){ $simages=''; if(!ereg(".jpg",$pro_data[$i]["sImages"]) && !ereg(".gif",$pro_data[$i]["Images"]) ){ $simages=''; } $detail=html_entity_decode(nl2br($pro_data[$i]["Description_vn"])); $detail_full = $detail; $arrStr=explode(' ',$detail); $k= count($arrStr)<18 ? count($arrStr) : 18; $detail=''; for($j=0;$j<$k;$j++){ $detail.=$arrStr[$j].' '; } if($k==18){ $detail.=' ...'; } $template->assign_block_vars("productList", array( 'pname' => ''.$pro_data[$i]["ProductName_vn"].'', 'photo' => ''.$simages.'', 'CHECKBOX' => '', 'model' => $pro_data[$i]["Model"] ? 'Model No : '. $pro_data[$i]["Model"] : " ", 'pdetail' => $detail_full )); } $sql="select m.memID, m.FirstName, m.LastName, m.CompanyName, m.Sex, m.AlternativeEmail,m. BusinessType, m.IndustryCategory, m.NumberEmployees, m.Address, m.City, m.State, m.Zip, m.Web, m.JobTitle, m.contrycode, m.areacode, m.BusinessPhone, m.faxcontrycode, m.faxareacode, m.FaxNumber, m.Mobile, m.fName, m.countryID, m.orthJob, m.lName, m.CompanyName_vn, m.Address_vn, m.fName_vn, m.lName_vn, m.FirstName_vn, m.LastName_vn, m.City_vn, m.State_vn, m.orthJob_vn, m.lastEdit, m.lastEdit_vn, m.id,c.* from vb_companyprofile c inner join vb_memberprofile m on c.memID=m.memID where c.memID=".$cid; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_data=$db->sql_fetchrow($result); $memName=$mem_data["lName_vn"] ." ".$mem_data["fName_vn"]; //luu giu cat id khi chuyen qua viewlist va view gellary $strvar; if($catID==0) $strvar='mode=main'; else $strvar='catID='.$catID; $template->assign_vars(array( 'Main-Services' => $pro_data_lg[6]['new_setting'], 'barner' => "../barner/".$mem_data["barner"], 'Products' =>'Sản Phẩm', 'companyName' => $mem_data["CompanyName_vn"], 'com_photo' => !empty($mem_data["barner"]) ? "" : '' , 'supp' => $cid, 'maintitle' => $mem_data["CompanyName_vn"], 'company' => $mem_data["CompanyName_vn"], 'ContactName' =>($mem_data["Sex"]=="Male" ? "Ông. " : "Bà. ") . $mem_data["lName_vn"] ." ".$mem_data["fName_vn"], 'Address' => $mem_data["Address_vn"], 'city' => $mem_data["City_vn"].", ".getContry($mem_data["countryID"]), 'zipCode' => $mem_data["Zip"], 'Telephone' => $mem_data["contrycode"] ."-".$mem_data["areacode"]."-".$mem_data["BusinessPhone"], 'mobiphone' => $mem_data["Mobile"], 'fax' => $mem_data["faxcontrycode"] ."-".$mem_data["faxareacode"]."-".$mem_data["FaxNumber"], 'Website' => $mem_data["Web"], 'a_action' => "supplier.php?supplier=".$cid."&act=memcontacts&mode=main&ids=".$ids."&lang=vn", 'NAVIGATOR' => $pagination, 'g_action' => "supplier.php?supplier=".$cid."&act=products&mode=main&ids=".$ids."&lang=vn", 'divtel' => !empty($mem_data["BusinessPhone"]) ? 'bock' : 'none', 'divmobi' => !empty($mem_data["Mobile"]) ? 'bock' : 'none', 'divfax' => !empty($mem_data["FaxNumber"]) ? 'bock' : 'none', 'divweb' => !empty($mem_data["Web"]) ? 'bock' : 'none', 'divcontactName' =>strlen($memName)>9 ? 'bock' : 'none', 'navidis' => $total_pages>1? 'display' : 'none', 'oldurl' => $langUrl, 'varlink'=>$ids, 'varlink1'=>$cid, 'strvar'=>$strvar )); $template->set_filenames(array( "body" => $template_products_body )); $template->pparse('body'); } //hien thi danh sach san pham function viewProduct(){ global $template, $db, $template_products_body,$catID,$cid,$keyw,$site_base_href,$base_url,$langUrl,$ids,$lag,$use_url,$pro_data_lg; $start = isset($_GET["start"]) ? intval($_GET["start"]) : 0; $txtgoto = isset($_POST['txtgoto']) ? intval($_POST['txtgoto']) : 0; $display =21; if($txtgoto){ $start = floor($txtgoto*$display)-1; } //load san pham $sql="select * from vb_products where memID = ".$cid." ORDER BY ProductName_vn limit $start,$display" ; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $pro_count = $db->sql_numrows($result); $pro_data = $db->sql_fetchrowset($result); $sql = "SELECT count(proID) AS total FROM vb_products where memID=".$cid ; if ( !$result = $db->sql_query($sql) ) { message_die("Couldn't run the sql query!!!", __LINE__, __FILE__, $sql); } $total = $db->sql_fetchrow($result); $pagination = g3_pagination("", $total['total'], $display, $start, 'start', 'start:' . '//<>')." "; $total_pages = ceil($total['total']/$display); $db->sql_freeresult($result); $j=0; $str .= ''; // HIEN THI THONG TIN SAN PHAM for($i=0;$i<$pro_count;$i++){ $proLink ='../p/'.strtolower(str_replace(' ', '-', convert_vi_to_en($pro_data[$i]["ProductName_vn"]))).'-'.$cid.'-'.$pro_data[$i]["proID"].'-'.$pro_data[$i]["catID"].'.html' ; $proImage = ''; $sqllang = "SELECT * FROM `vb_prolang` WHERE `lang_cat` =".$lag." and proid =".$pro_data[$i]["proID"]; if(!$resultlg=$db->sql_query($sqllang)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sqllang); } $ds_prolang = $db->sql_fetchrowset($resultlg); $description = $ds_prolang[0]["description"]; if(mb_strlen($description, 'utf8') > 300) { $description = mb_substr($description, 0, 300, 'utf8').'...'; } if($j == 2){ $str .='
    '; $j=0; } $str .='

    '.htmlspecialchars_decode($description).'

    '; $j++; } $str .=''; $wrap_pagination .='
    '; //load companyprofile $sql = "select * from vb_companyprofilelang where lang_cat = ".$lag." and memid=".$cid; if(!$result = $db -> sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_data = $db->sql_fetchrow($result); $memName=$mem_data["lName_vn"] ." ".$mem_data["fName_vn"]; //luu giu cat id khi chuyen qua viewlist va view gellary $strvar; if($catID==0) $strvar='mode=main'; else $strvar='catID='.$catID; $template->assign_vars(array( 'Main-Services' => $pro_data_lg[6]['new_setting'], 'str' => $str, 'barner' => "../barner/".$mem_data["barner"], 'companyName' => $mem_data["CompanyName_vn"], 'wrap_pagination' => $wrap_pagination, )); $template->set_filenames(array( "body" => $template_products_body )); $template->pparse('body'); } ?>