Files
sam-kd/egimake/delete.php
hskwon aca1767eb9 초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경
- DB 연결 하드코딩 → .env 기반으로 변경
- MySQL strict mode DATE 오류 수정
2025-12-10 20:14:31 +09:00

57 lines
2.0 KiB
PHP

<?php
session_start();
$mode=$_REQUEST["mode"];
$num=$_REQUEST["num"];
$parentnum=$_REQUEST["parentnum"]; // 리스트번호
$sort=$_REQUEST["sort"];
$upnum=$_REQUEST["upnum"];
$tempnum=$_REQUEST["upnum"]; // 발주서 번호 비교를 위해 임시변수 만듦
$callname=$_REQUEST["callname"];
$cutwidth=$_REQUEST["cutwidth"];
$cutheight=$_REQUEST["cutheight"];
$number=$_REQUEST["number"];
$exititem=$_REQUEST["exititem"];
$memo=$_REQUEST["memo"];
$intervalnum=$_REQUEST["intervalnum"];
$intervalnumsecond=$_REQUEST["intervalnumsecond"];
$printside=$_REQUEST["printside"];
$direction=$_REQUEST["direction"];
$ordercompany=$_REQUEST["ordercompany"];
require_once("../lib/mydb.php");
$pdo = db_connect();
if($mode=="all")
{
try{
$pdo->beginTransaction();
$sql = "delete from chandj.egimake where upnum = ?";
$stmh = $pdo->prepare($sql);
$stmh->bindValue(1,$upnum,PDO::PARAM_STR);
$stmh->execute();
$pdo->commit();
} catch (Exception $ex) {
$pdo->rollBack();
print "오류: ".$Exception->getMessage();
}
}
else
{
try{
$pdo->beginTransaction();
$sql = "delete from chandj.egimake where num = ?";
$stmh = $pdo->prepare($sql);
$stmh->bindValue(1,$num,PDO::PARAM_STR);
$stmh->execute();
$pdo->commit();
} catch (Exception $ex) {
$pdo->rollBack();
print "오류: ".$Exception->getMessage();
}
}
header("Location:/egimake/write.php?upnum=$upnum&num=$num&ordercompany=$ordercompany&callname=$callname&cutheight=$cutheight&cutwidth=$cutwidth&number=$number&comment=$comment&printside=$printside&direction=$direction&exititem=$exititem&intervalnum=$intervalnum&intervalnumsecond=$intervalnumsecond&memo=$memo&parentnum=$parentnum&hinge=$hinge"); // 신규가입일때는 리스트로 이동
?>