Files
firstgarden-web-gnu/manager/bakery/bakery_stock.ajax.delete.php

19 lines
571 B
PHP

<?php
include_once "_common.php";
if(!$_SESSION['user_id']) exit; // 로그인 되어있지 않으면 확인 불가
// 기본적인 보안 조치로 모든 데이터는 필터링하여 보관됩니다.
$idx = isset($_POST['idx']) ? intval($_POST['idx']) : 0;
// 데이터 행 삭제 쿼리
$query = "DELETE FROM {$fg['bakery_inventory_table']} WHERE idx = $idx";
// 쿼리 실행
$result = sql_query($query);
header("Content-Type: application/json");
if ($result) {
echo json_encode(["isSuccess" => true]);
} else {
echo json_encode(["isSuccess" => false]);
}