first commit theloftstore
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
require_once(__DIR__ . '/class/db-functions.php');
|
||||
|
||||
$db = DBHandlerSelect::getInstance();
|
||||
$pdo = $db->getConnection();
|
||||
|
||||
$row = json_decode($_POST['row'] ?? '', true);
|
||||
if (!$row || !isset($row['id'])) {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Invalid data']);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$sql = "UPDATE importdb SET
|
||||
collection = :collection,
|
||||
category = :category,
|
||||
model = :model,
|
||||
model_description = :model_description,
|
||||
description = :description,
|
||||
finish_code = :finish_code,
|
||||
finishing_description = :finishing_description,
|
||||
available_qty = :available_qty,
|
||||
wh = :wh,
|
||||
price = :price,
|
||||
updated_on = CURRENT_TIMESTAMP
|
||||
WHERE id = :id";
|
||||
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([
|
||||
':collection' => $row['collection'] ?? null,
|
||||
':category' => $row['category'] ?? null,
|
||||
':model' => $row['model'] ?? null,
|
||||
':model_description' => $row['model_description'] ?? null,
|
||||
':description' => $row['description'] ?? null,
|
||||
':finish_code' => $row['finish_code'] ?? null,
|
||||
':finishing_description' => $row['finishing_description'] ?? null,
|
||||
':available_qty' => $row['available_qty'] ?? null,
|
||||
':wh' => $row['wh'] ?? null,
|
||||
':price' => $row['price'] ?? null,
|
||||
':id' => $row['id']
|
||||
]);
|
||||
|
||||
echo json_encode(['status' => 'ok']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
|
||||
}
|
||||
Reference in New Issue
Block a user