-=[ Mr. Bumblebee ]=-
_Indonesia_
<?php
include("global_header.php");
define('SECTION','6');
define("ID",$_REQUEST['id']);
$sql = "select product.*,product_desc.name as name, product_desc.detail as detail, product_desc.detail2, product_desc.wrote_by,product_desc.seo_title,product_desc.seo_desc,product.seo_keyword from ".TB_PRODUCT." as product , ".TB_PRODUCT_DESC." as product_desc ";
$sql .= " where ";
$sql .= " product.id=product_desc.product_id ";
$sql .= " and product_desc.language_id='".CURRENT_LANG."' ";
$sql .= " and product.disabled='0' ";
$sql .= " and product.id='".ID."' ";
$sql .= " and start_date<='".TODAY."' ";
$sql .= " and end_date>='".TODAY."' ";
define('THIS_PAGE_SQL',$sql);
$rows2 = $G_DB_CONNECT->query($sql);
if($G_DB_CONNECT->affected_rows > 0){
while($data2 = $G_DB_CONNECT->fetch_array($rows2)){
$product_name = $data2['name'];
$product_detail = displayHTML($data2['detail']);
$meta_title2 = $data2['seo_title'];
$meta_desc = formatSEOInfo($data2['seo_desc']);
$meta_keyword = $data2['seo_keyword'];
if($meta_title == ''){
$meta_title = $product_name;
}
$meta_title = $meta_title;
if($meta_desc == ''){
//$meta_desc = formatSEOInfo($product_detail);
}
}
}else{
include("index.php");
exit();
}
$sql = "select img from ".TB_PRODUCT_PHOTO;
$sql .= " where ";
$sql .= " disabled='0' ";
$sql .= " and product_id='".ID."' ";
$sql .= " order by sort_order asc limit 0,1";
$rowsp = $G_DB_CONNECT->query($sql);
//$k=0;
if($G_DB_CONNECT->affected_rows > 0){
while($datap = $G_DB_CONNECT->fetch_array($rowsp)){
$img = DIR_PATH.$datap['img'];
$arr_data = getThumbPhotoPath($img,"thumb",$target_width,$target_height);
$og_image = OUR_SERVER.$arr_data['img_path'];
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php include("meta_header.php"); ?>
</head>
<body>
<?php include("header.php"); ?>
<h1>
<?php echo TITLE_PRODUCT;?>
<div class="btn_back"><a href="products.php">back</a></div>
</h1>
<div id="main_content_left" >
<?php
$rows2 = $G_DB_CONNECT->query(THIS_PAGE_SQL);
if($G_DB_CONNECT->affected_rows > 0){
while($data2 = $G_DB_CONNECT->fetch_array($rows2)){
$product_name = $data2['name'];
$product_detail = displayHTML($data2['detail']);
$product_detail2 = displayHTML($data2['detail2']);
$product_brief = nl2br($data2['brief']);
$product_date = formatDate($data2['display_date']);
$product_wrote_by= $data2['wrote_by'];
$product_total_rate= $data2['total_rate'];
}
}
?>
<div class="section_content">
<div class="box_content">
<div class="box_content_left">
<?php include('inc_products-detail-gallery.php'); ?>
<div style="clear:both"></div></div>
<div class="box_content_right">
<h2 class="section_title"><?php echo $product_name; ?></h2>
<?php echo $product_detail; ?>
<!-- content_footer_info -->
<div style="clear:both"></div>
<div class="content_footer_info">
<div class="rank update_rate" style="margin-left:0px;"><?php echo $product_total_rate; ?></div>
<div class="rate" >
<?php
$sql = " select * from ".TB_PRODUCT_VOTE." where member_id='".MEMBER_ID."' and product_id='".ID."' order by create_date desc limit 0,1 ";
$before_rank = 0;
$rows = $G_DB_CONNECT->query($sql);
$total_record = $G_DB_CONNECT->affected_rows;
if($G_DB_CONNECT->affected_rows > 0){
while($data = $G_DB_CONNECT->fetch_array($rows)){
$before_rank = $data['rank'];
}
}
?>
<form name="frm_product_vote" id="frm_product_vote" method="POST" enctype="multipart/form-data" action="" target="_self" autocomplete="off" >
<input name="data_id" id="data_id" value="<?php echo ID;?>" type="hidden" />
<input name="rank" id="rank" value="<?php echo $before_rank; ?>" type="hidden" required="yes" label="Please select a rank"/>
<div class="loading2"></div>
<div class="wait_loading_area">
<table w border="0" cellspacing="0" cellpadding="0" class="table_rank">
<tr>
<td class="title">Rating </td>
<td class="content"><div class="jquery_raty_product" data-rating="<?php echo $before_rank; ?>"></div></td>
</tr>
</table>
<div style="clear:both"></div></div>
</form>
<div style="clear:both"></div></div>
<div style="clear:both"></div></div>
<!-- content_footer_info -->
<div class="social_area">
<?php
$addthis_url = OUR_SERVER.'products-detail.php?id='.ID;
print_social_link($addthis_url);
?>
<div style="clear:both"></div></div>
<div style="clear:both"></div></div>
<div style="clear:both"></div></div>
<div style="clear:both"></div></div>
<div style="clear:both"></div>
<div class="btn_back"><a href="products.php">back</a></div>
<?php include("footer.php"); ?>
<script>
$(document).ready(function(){
$('.jquery_raty_product').raty({
readOnly : false,
half : false,
score: function() {
return $(this).attr('data-rating');
},
click: function(score, evt) {
<?php if($_SESSION['falready_login']){ ?>
$('#frm_product_vote #rank').val(score);
validForm_product_vote();
<?php }else{?>
top.location.href = 'login.php?redirect=<?php echo $_SERVER['PHP_SELF'];?>?id=<?php echo ID;?>';
<?php }?>
},
starOff: 'rank/big-star-off.png',
starOn: 'rank/big-star-on.png',
number : 5,
size: 23,
hints: ['Bad', 'Ok', 'Well', 'Good', 'Very Good'],
noRatedMsg : '',
target : '',
targetKeep : false
});
function validForm_product_vote(){
submitForm_product_vote();
}
function submitForm_product_vote(){
$('.frm_product_vote .loading2').show();
$('.frm_product_vote .wait_loading_area').hide();
var ajax_json_path = "json_vote_product.php";
var params=$('#frm_product_vote').serialize();
$.ajax({
url:ajax_json_path,
type:'post',
dataType:'json',
data:params,
success: function(json){
success = json.success;
if(success){
$('.frm_product_vote .loading2').hide();
$('.frm_product_vote .wait_loading_area').show();
document.frm_product_vote.reset();
$('.update_rate').html(json.update_rate);
openDialogConfirm('<?php echo $product_name; ?>','Thank for your rating');
}else{
}
} ,
error: function(json){
}
});
return false;
}
});
</script>
</body>
</html>
Copyright © 2017 || Recoded By Mr.Bumblebee