. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 213.186.33.4 / Your IP :
216.73.216.146 [
Web Server : Apache System : Linux webm002.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : dealkatnwc ( 662330) PHP Version : 7.0.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dealkatnwc/www/GARAGE/php_action/ |
Upload File : |
<?php
require_once 'core.php';
$sql = "SELECT product.product_id, product.product_name, product.product_image, product.brand_id,
product.categories_id, product.quantity, product.rate, product.active, product.status,
brands.brand_name, categories.categories_name FROM product
INNER JOIN brands ON product.brand_id = brands.brand_id
INNER JOIN categories ON product.categories_id = categories.categories_id
WHERE product.status = 1 AND product.quantity>0";
$result = $connect->query($sql);
$output = array('data' => array());
if($result->num_rows > 0) {
// $row = $result->fetch_array();
$active = "";
while($row = $result->fetch_array()) {
$productId = $row[0];
// active
if($row[7] == 1) {
// activate member
$active = "<label class='label label-success'>Available</label>";
} else {
// deactivate member
$active = "<label class='label label-danger'>Not Available</label>";
} // /else
$button = '
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a type="button" data-toggle="modal" id="editProductModalBtn" data-target="#editProductModal" onclick="editProduct('.$productId.')"> <i class="glyphicon glyphicon-edit"></i> Edit</a></li>
<li><a type="button" data-toggle="modal" data-target="#removeProductModal" id="removeProductModalBtn" onclick="removeProduct('.$productId.')"> <i class="glyphicon glyphicon-trash"></i> Remove</a></li>
</ul>
</div>';
// $brandId = $row[3];
// $brandSql = "SELECT * FROM brands WHERE brand_id = $brandId";
// $brandData = $connect->query($sql);
// $brand = "";
// while($row = $brandData->fetch_assoc()) {
// $brand = $row['brand_name'];
// }
$brand = $row[9];
$category = $row[10];
$imageUrl = substr($row[2], 3);
$productImage = "<img class='img-round' src='".$imageUrl."' style='height:30px; width:50px;' />";
$output['data'][] = array(
// image
$productImage,
// product name
$row[1],
// rate
$row[6],
// quantity
$row[5],
// brand
$brand,
// category
$category,
// active
$active,
// button
$button
);
} // /while
}// if num_rows
header('location:../product.php');
$connect->close();
echo json_encode($output);