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 == "view" || $mode =="duc" || " ") { $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_keyword, vb_prolang.seo_title 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["name"]; }else{ $u_tite = $pro_data["seo_title"]; } $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']; } if($mode=='news') { $newsid=isset($_GET["newid"]) ? intval($_GET["newid"]) : 0 ; $sql="select * from vb_news where newid = ".$newsid." and idmem =".$cid; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_title=$db->sql_fetchrow($result); $u_tite = $mem_title["title"]; } ?> 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!!!1","",__LINE__,__FILE__,$sql); } $pro_count_lg=$db->sql_numrows($result); $pro_data_lg=$db->sql_fetchrowset($result); ?>
" alt="" />
sql_query($sql_slide)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql_slide); } $slide_data=$db->sql_fetchrowset($result); foreach($slide_data as $dsslide) { $bg_slide = $site_base_href.'/sproducts/'.$dsslide["image"]; $slide .='

'.$dsslide["title"].'

'.htmlspecialchars_decode($dsslide["description"]).'

'; } //#slide //load post new $j=1; $popularpost ='
'; $sqlnews="select vb_newslang.title, vb_newslang.description, 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, 3"; 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) { $description = $datanw["description"]; if(mb_strlen($description, 'utf8') > 300) { $description = mb_substr($description, 0, 300, 'utf8').'...'; } $urlseo = strtolower(str_replace(' ', '-', convert_vi_to_en($datanw['title'] ))) ; if($j == 4){ $popularpost .='
'; $j=1; } $popularpost .='

'.$datanw["title"].'

'.htmlspecialchars_decode( $description).'

'; $j++; } $popularpost .= "
"; //load danh muc san pham $categories =""; $sql_slide = "SELECT * FROM vb_category, vb_categorylang WHERE vb_category.catID = vb_categorylang.catid and catpr = 2525 and lang_cat =".$lag." and memID =".$cid.' order by noorder asc'; $rs_slide = mysql_query($sql_slide); while($r_d = mysql_fetch_array($rs_slide)) { $categories .= '
  • '.$r_d['catname'].''; $sql_slide1 = "SELECT * FROM vb_category, vb_categorylang WHERE vb_category.catID = vb_categorylang.catid and catpr = ".$r_d['catID']." and lang_cat =".$lag." and memID =".$cid.' order by noorder asc'; $rs_slide1 = mysql_query($sql_slide1); if($rs_slide1 !=" ") { $categories .= ""; } $categories .='
  • '; } // all products =====// $sql="select * from vb_products where memID = ".$cid." order by no asc"; 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' ; $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 .=''; // 17-06-14 hien thi san pham =====// $sql="select * from vb_products where memID = ".$cid." and sethome = 1 order by no asc"; 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; $str .= '
    '; // 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' ; $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); $str .= '

    '.$ds_prolang[0]["name"].'

    '.$ds_prolang[0][
    '; $j++; } $str .='
    '; //set language $sqltem_d = "SELECT * FROM vb_choose_temp WHERE idmem =".$cid; $rs_d = mysql_query($sqltem_d); while($r_d = mysql_fetch_array($rs_d)) { $idtemp_d = $r_d["idtemp"]; $idmem_d = $r_d["idmem"]; } $sql="select * from vb_language_temp WHERE lang_cat =".$lag." and idtemp = ".$idtemp_d." and idmem =".$cid." order by noorder asc"; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql); } $pro_count_lg=$db->sql_numrows($result); $pro_data_lg=$db->sql_fetchrowset($result); $toppr = $pro_data_lg[4]['new_setting']; //load gioi thieu cong ty $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 customer $sql_customer="select * from vb_gallery where idmem = ".$cid." order by id desc"; if(!$result_customer=$db->sql_query($sql_customer)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql_customer); } $customer_data=$db->sql_fetchrowset($result_customer); foreach($customer_data as $customer){ $custom_img .= '
  • '; } //load support $sql_support="select * from vb_support where memid = ".$cid." order by id desc"; if(!$result_support=$db->sql_query($sql_support)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql_support); } $support_data=$db->sql_fetchrowset($result_support); foreach($support_data as $support){ $list_support .= '
    Support '.$support['name'].'
    '.$support['nick_chat'].'
    Support '.$support['phone'].'

    '; } $template->assign_vars(array( 'custom_img' =>$custom_img, 'list_support' => $list_support, 'bg_slide' =>$bg_slide, 'slide' => $slide, 'centerabuot' => htmlspecialchars_decode($mem_data['cominfor']), 'toppr' => $toppr, 'str' =>$str, 'list_pro' => $list_pro, 'categories' => $categories, 'titleLatestProducts' => $pro_data_lg[3]['new_setting'], 'titleCategories' => $pro_data_lg[4]['new_setting'], 'titleBuyersGuide' => $pro_data_lg[5]['new_setting'], 'us' =>$us, 'cn' =>$cn, 'vn' =>$vn, 'showlinklang' =>showlinklang(), 'com_photo' => !empty($mem_data["barner"]) ? "" : '' , 'companyName' => $mem_data["CompanyName_vn"], 'maintitle' =>$mem_data["CompanyName_vn"], 'photo' => !empty($mem_data["comImage"]) ? "" : '' , 'info' => $comInfo, 'company' => $mem_data["CompanyName_vn"], 'ContactName' => ($mem_data["Sex"]=="Male" ? "Ông " : "Bà ") .$memName, 'Address' =>str_replace(",","",$mem_data["Address_vn"]), 'email' => $stremail, 'Website' =>$strweb, 'city' =>$mem_data["City_vn"].", ".getContry($mem_data["countryID"]), 'zipCode' => $mem_data["Zip"], 'Telephone' => $mem_data["contrycode"] ."-".$mem_data["areacode"]."-".$mem_data["BusinessPhone"], 'divmobi' => !empty($mem_data["Mobile"]) ? 'bock' : 'none', 'divtel' => !empty($mem_data["BusinessPhone"]) ? 'bock' : 'none', 'divfax' => !empty($mem_data["FaxNumber"]) ? 'bock' : 'none', 'divweb' => !empty($mem_data["Web"]) ? 'bock' : 'none', 'divcontactName' =>strlen($memName)>9 ? 'bock' : 'none', 'mobiphone' =>$mem_data["Mobile"], 'fax' =>$mem_data["faxcontrycode"] ."-".$mem_data["faxareacode"]."-".$mem_data["FaxNumber"], 'aboutInfoSimple' =>$info_simple, 'supp' =>$memid, 'fNoproduct' =>$pro_count > 0 ? '' : 'style="display:none"' , 'companyExecutive' => ($mem_data["Sex"]=="Male" ? "Ông. " : (($mem_data["Sex"]=="Female ")? "Bà. " : "")) . $mem_data["lName_vn"] ." ".$mem_data["fName_vn"], 'url' =>"supplier.php?&act=productslarge&mode=main&supplier=".$memid."&ids=".$ids."&lang=vn" )); $template->set_filenames(array( "body" => $template_body_page )); $template->pparse('body'); } function ViewDetail(){ global $template_detail_page,$db,$template,$ids,$cid,$lag,$site_base_href,$pro_data_lg, $use_url ; $memid=isset($_GET["supplier"]) ? intval($_GET["supplier"]) : 0 ; if (isset($_POST['sendmail']) && $_POST['sendmail'] == "Gửi") { require_once('clsemail.php'); $mail = "haminhduc06@gmail.com"; $name = $_POST['userName']; $userEmail = $_POST['userEmail']; $userPhone = $_POST['userPhone']; $userMsg = $_POST['userMsg']; $cc = $name."( ".$userPhone. " )"; $body = ""; $k = "Webmaster"; //goi ham gui mail $clsEmail = new sendEmail($cc, $k,$mail); $clsEmail -> setHeader( $_POST, $k); $clsEmail -> setBody($userMsg, $k); $clsEmail -> sendit($_POST, $k,'sa'); }// ket thut ham gui mail // all products =====// $sql="select * from vb_products where memID = ".$cid." 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' ; $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 .=''; //load danh muc san pham $categories =""; $sql_slide = "SELECT * FROM vb_category, vb_categorylang WHERE vb_category.catID = vb_categorylang.catid and catpr = 2525 and lang_cat =".$lag." and memID =".$cid.' order by noorder asc'; $rs_slide = mysql_query($sql_slide); while($r_d = mysql_fetch_array($rs_slide)) { $categories .= '
  • '.$r_d['catname'].''; $sql_slide1 = "SELECT * FROM vb_category, vb_categorylang WHERE vb_category.catID = vb_categorylang.catid and catpr = ".$r_d['catID']." and lang_cat =".$lag." and memID =".$cid.' order by noorder asc'; $rs_slide1 = mysql_query($sql_slide1); if($rs_slide1 !=" ") { $categories .= ""; } $categories .='
  • '; } //load gioi thieu cong ty $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); // 18-06-14 load ngon ngu trang gioi thieu cong ty $sqlsl="select * from vb_companyprofilelang where lang_cat =".$lag." and memid = ".$cid; if(!$resultsl=$db->sql_query($sqlsl)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sqlsl); } $selectlang = $db->sql_fetchrow($resultsl); //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'].'

    '; } $comInfo_new=strlen($selectlang["cominfor"])<250 ? html_entity_decode($selectlang["cominfor"]) : html_entity_decode($selectlang["cominfor"]); $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); if(!$mem_data["memID"]){ //redirect("index.php?ids=".$ids); } //load customer $sql_customer="select * from vb_gallery where idmem = ".$cid." order by id desc"; if(!$result_customer=$db->sql_query($sql_customer)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql_customer); } $customer_data=$db->sql_fetchrowset($result_customer); foreach($customer_data as $customer){ $custom_img .= '
  • '; } //load support $sql_support="select * from vb_support where memid = ".$cid." order by id desc"; if(!$result_support=$db->sql_query($sql_support)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql_support); } $support_data=$db->sql_fetchrowset($result_support); foreach($support_data as $support){ $list_support .= '
    Support '.$support['name'].'
    '.$support['nick_chat'].'
    Support '.$support['phone'].'

    '; } $comInfo=strlen($mem_data["aboutInfo_vn"])<250 ? html_entity_decode(nl2br($mem_data["aboutInfo_vn"])) : html_entity_decode($mem_data["aboutInfo_vn"]); ////=======end====== $memName=$mem_data["lName_vn"] ." ".$mem_data["fName_vn"]; $template->assign_vars(array( 'custom_img' =>$custom_img, 'list_support' => $list_support, 'toptitle' => $pro_data_lg[1]['new_setting'], 'aboutus' => htmlspecialchars_decode($selectlang['cominfor']), 'abconten' => htmlspecialchars_decode($selectlang['conten']), 'list_pro' => $list_pro, 'categories' => $categories, 'titleLatestProducts' => $pro_data_lg[3]['new_setting'], 'titleCategories' => $pro_data_lg[4]['new_setting'], 'titleBuyersGuide' => $pro_data_lg[5]['new_setting'], 'categories' =>$categories, 'popularpost' => $popularpost, 'update' => $mem_data["lastEdit_vn"], 'barner' => $site_base_href.'/barner/'.$mem_data["barner"], 'supp' =>$memid, 'companyName' => $mem_data["CompanyName_vn"], 'maintitle' => $mem_data["CompanyName_vn"], 'Name' => $pro_data_lg[6]['new_setting'], 'Email' => $pro_data_lg[7]['new_setting'], 'Website' => $pro_data_lg[8]['new_setting'], 'submit' => $pro_data_lg[9]['new_setting'], 'logo' => !empty($mem_data["barner"]) ? "" : '' , 'photo' => !empty($mem_data["comImage"]) ? "" : '' , //oll 'cominfo' => $comInfo, 'cominfo' => $comInfo_new, '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"], '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', )); $template->set_filenames(array( "body" => $template_detail_page )); $template->pparse('body'); } function Viewnews(){ global $template_detail_page,$db,$template,$ids,$cid,$lag,$site_base_href, $pro_data_lg ; $memid=isset($_GET["supplier"]) ? intval($_GET["supplier"]) : 0 ; $newsid=isset($_GET["newid"]) ? intval($_GET["newid"]) : 0 ; // 18-06-14 load ngon ngu trang gioi thieu cong ty $sqlsl="select * from vb_companyprofilelang where lang_cat =".$lag." and memid = ".$cid; if(!$resultsl=$db->sql_query($sqlsl)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sqlsl); } $selectlang = $db->sql_fetchrow($resultsl); //load danh muc san pham $categories =""; $sql_slide = "SELECT * FROM vb_category, vb_categorylang WHERE vb_category.catID = vb_categorylang.catid and catpr = 2525 and lang_cat =".$lag." and memID =".$cid.'order by noorder asc'; $rs_slide = mysql_query($sql_slide); while($r_d = mysql_fetch_array($rs_slide)) { $categories .= '
  • '.$r_d['catname'].''; $sql_slide1 = "SELECT * FROM vb_category, vb_categorylang WHERE vb_category.catID = vb_categorylang.catid and catpr = ".$r_d['catID']." and lang_cat =".$lag." and memID =".$cid; $rs_slide1 = mysql_query($sql_slide1); if($rs_slide1 !=" ") { $categories .= ""; } $categories .='
  • '; } // all products =====// $sql="select * from vb_products where memID = ".$cid." 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' ; $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 .=''; //load post new $popularpost =""; $sqlnews="select vb_newslang.title, vb_news.newid, vb_news.lastedit , vb_news.images, vb_news.lastedit 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'].'

    '; } $sql="select vb_newslang.title, vb_newslang.content, vb_news.newid, vb_news.upload_file, vb_news.lastedit , vb_news.images, vb_news.lastedit from vb_news, vb_newslang where vb_newslang.newsid = vb_news.newid and `newsid` = ".$newsid." and vb_newslang.lang_cat =".$lag; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $news_data=$db->sql_fetchrow($result); $comInfo=strlen($mem_data["content"])<250 ? html_entity_decode($mem_data["content"]) : html_entity_decode(nl2br($mem_data["content"])); $memName = $news_data["title"]; //fload file dinh kem if($news_data["upload_file"] != NULL){ $linkdownload ='Download : '.$memName.'

    '; } //load customer $sql_customer="select * from vb_gallery where idmem = ".$cid." order by id desc"; if(!$result_customer=$db->sql_query($sql_customer)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql_customer); } $customer_data=$db->sql_fetchrowset($result_customer); foreach($customer_data as $customer){ $custom_img .= '
  • '; } //load support $sql_support="select * from vb_support where memid = ".$cid." order by id desc"; if(!$result_support=$db->sql_query($sql_support)){ message_die("Couldn't run the sql query!!!1","",__LINE__,__FILE__,$sql_support); } $support_data=$db->sql_fetchrowset($result_support); foreach($support_data as $support){ $list_support .= '
    Support '.$support['name'].'
    '.$support['nick_chat'].'
    Support '.$support['phone'].'

    '; } $template -> assign_vars(array( 'custom_img' =>$custom_img, 'list_support' => $list_support, 'categories' => $categories, 'aboutus' => htmlspecialchars_decode($selectlang['cominfor']), 'list_pro' => $list_pro, 'titleLatestProducts' => $pro_data_lg[3]['new_setting'], 'titleCategories' => $pro_data_lg[4]['new_setting'], 'titleBuyersGuide' => $pro_data_lg[5]['new_setting'], 'linkdownload' =>$linkdownload, 'centerabuot' => htmlspecialchars_decode($mem_data['cominfor']), 'toptitle' => $news_data["title"], 'title' =>''.$news_data["title"].'
    ', 'barner' => "'.$site_base_href.'/barner/".$news_data["barner"], 'supp' =>$memid, 'maintitle' => $news_data["title"], 'cominfo' => htmlspecialchars_decode($news_data["description"]), 'abconten' => htmlspecialchars_decode($news_data["content"]), 'update' => $news_data["lastedit"], 'logo' => !empty($mem_data["barner"]) ? "" : '' , 'photo' => !empty($mem_data["comImage"]) ? "" : '' , '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"], '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', )); $template->set_filenames(array( "body" => $template_detail_page )); $template->pparse('body'); } function showlinklang(){ global $template, $base_url, $db, $site_base_href, $cid ; $memid=isset($_GET["supplier"]) ? intval($_GET["supplier"]) : 0 ; $sql ="select CompanyName,CompanyName_vn,CompanyName_cn from vb_memberprofile where memID=".$memid ; //echo $sql; die() ; if(!$result=$db->sql_query($sql)){ message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql); } $mem_data=$db->sql_fetchrow($result); $vn=" Tiếng Việt " ; $cn=" 中文版 " ; $us=" English " ; if(($mem_data["CompanyName_cn"]=="NULL") or empty($mem_data["CompanyName_cn"]) ){ $linklang = '
    Chọn Ngôn Ngữ
    ' ; }elseif(($mem_data["CompanyName"]=="NULL")or empty($mem_data["CompanyName"]) ){ $linklang = '
    Chọn Ngôn Ngữ
    ' ; }elseif(($mem_data["CompanyName_vn"]=="NULL") or empty($mem_data["CompanyName_vn"])){ $linklang = '
    Chọn Ngôn Ngữ
    ' ; }else{ $linklang = '
    Chọn Ngôn Ngữ
    ' ; } return $linklang ; } ?>