Rows($sql); $co_id = $r[0]['co_id']; #-------------------------------------------------------------------------- $pro_id = intval($_REQUEST['id']); $sql1 = " SELECT A1.*, A2.main_name, A2.website, A2.address, A2.email, A3.mn_name ,A4.ca_name, A5.prot_name FROM tbl_product as A1 left join tbl_company as A2 on A1.co_id = A2.co_id left join tbl_money as A3 on A1.mn_id = A3.mn_id left join tbl_category as A4 on A1.ca_id = A4.ca_id left join tbl_product_type as A5 on A1.prot_id = A5.prot_id WHERE A1.co_id = '$co_id' AND A1.pro_id='$pro_id'"; $r1=$db->Rows($sql1); if(isset($_POST['mod']) && $_POST['mod']=='send') { //$IS_SAVE = 0; $email = $_POST['txtEMAIL']; $fullname = $_POST['txtFULLNAME']; $so_luong = $_POST['txtSO_LUONG']; $address = $_POST['txtADDRESS']; $phone = $_POST['txtPHONE']; $title = $_POST['txtTITLE']; $content = $_POST['txtCONTENT']; $pro_name = $r1[0]['pro_name']; $gia = $r1[0]['price']; $website = $r1[0]['website']; #SEND MAIL //require $siteroot.'/email_templates/email_buy_product.php'; $to=$r1[0]['email']; $cc="infohoidoanhnhan.vn"; $subject = $title; $headers = 'MIME-Version: 1.0' . "\r\n". 'Content-type: text/html; charset=utf-8'. "\r\n". 'Họ Tên: '.$fullname. "\r\n" . 'From: '.$from. "\r\n" . 'Reply-To: '.$email . "\r\n" . 'Số lượng: '.$so_luong. "\r\n" . 'Địa chỉ: '.$address . "\r\n" . 'Phone: '.$phone. "\r\n" . 'Tiêu đề: '.$title. "\r\n" . 'Nội dung: '.$content. "\r\n" . 'X-Mailer: PHP/'; $message=$strMESSAGE; mail($to, $subject, $message, $headers); mail($cc, $subject, $message, $headers); #END SEND MAIL //header("Location: e-store_product_detail.php?company=".$company."&id=".$r1[0]['pro_id']); } #--------Menu------------------------------------------------------------ $menu="select san_phamtb,loi_chao,backgrounb from tbl_menubg backgrounb where co_id='$co_id'"; $row_menu=$db->Rows($menu); #---option--------------------------------------------------------------- $ds = "SELECT * FROM tbl_option WHERE co_id='$co_id'"; $r8=$db->Rows($ds); #-------------------------------------------------------------------------- $smarty->assign("r",$r); $smarty->assign("r1",$r1); $smarty->assign("company",$company); $smarty->assign("r8",$r8); #-------------------------------------------------------------------------- $sqltemp = "Select * From tbl_template a,tbl_company b where a.id_template = b.id_template AND co_id = $co_id"; $rtemp = $db->Rows($sqltemp); #-------------------------------------------------------------------------- $smarty->assign("rtemp",$rtemp); $smarty->assign("row_menu",$row_menu); $smarty->display($template_root.$rtemp[0]["url_template"].'/e-store_buy_product.tpl'); ?>