www
/
wwwroot
/
magazinmiorita.be
➕ New
📤 Upload
✎ Editing:
product_details.php
← Back
<?php include('includes/inc.config.php'); require_once('header.php'); $products_results = array(); $products = $database->execute(" SELECT * FROM `products` WHERE `status` = '1' and id='".$_GET['id']."' "); while($row = $database->fetch($products)){ $check_promo = $database->execute("SELECT * FROM `promotions` WHERE `pid` = '".$row['id']."'"); $irow = $database->assoc($check_promo); if($database->num($check_promo) > 0){ $row['price'] = $irow['new_price']; }else{ $row['price'] = $row['price']; } $query = $database->execute("SELECT avg(rating_points) as avg_rate, sum(rating_count) as total_count, sum(rating_points) as total_points FROM prod_rating WHERE prod_id = '".$row['id']."'"); $ratingRow = $database->assoc($query); $row['avg'] = round($ratingRow['avg_rate']); $row['count'] = $ratingRow['total_count']; $row['price_eu'] = number_format($row['price'],2); $products_results[] = $row; } $related_products_results = array(); $related_products = $database->execute(" SELECT * FROM `products` WHERE cat_id='".$data->item_data($_GET['id'],'cat_id')."' and `status` = '1' order by RAND() limit 4 "); while($row = $database->fetch($related_products)){ $row['price_eu'] = number_format($row['price'],2); $row['com_count'] = ROOT_URL.'/article.php?id='.$rows['id']; $query = $database->execute("SELECT avg(rating_points) as avg_rate, sum(rating_count) as total_count, sum(rating_points) as total_points FROM prod_rating WHERE prod_id = '".$row['id']."'"); $ratingRow = $database->assoc($query); $row['avg'] = round($ratingRow['avg_rate']); $row['count'] = $ratingRow['total_count']; $row['price_eu'] = number_format($row['price'],2); $related_products_results[] = $row; } $screenshots_results = array(); $screenshots = $database->execute(" SELECT * FROM `screnshots` WHERE `item_id` = '".$_GET['id']."' "); while($row = $database->fetch($screenshots)){ $screenshots_results[] = $row; } $weight_results = array(); $weight = $database->execute(" SELECT * FROM `prod_weight` WHERE `prod_id` = '".$_GET['id']."' order by type "); while($row = $database->fetch($weight)){ $weight_results[] = $row; } $pageURL = (@$_SERVER["HTTPS"] == "on" ? "https://" : "http://"); if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } $smarty->assign("comm_url", $pageURL); $smarty->assign("weight_results", $weight_results); $smarty->assign("screnshots", $screenshots_results); $smarty->assign("products", $products_results); $smarty->assign("related_products", $related_products_results); $smarty->display('product_details.tpl'); ?>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel