alert($modify); "; require_once("../lib/mydb.php"); $pdo = db_connect(); if($modify=='1') { try{ $sql = "select * from chandj.make where num=?"; // get target record $stmh = $pdo->prepare($sql); $stmh->bindValue(1,$num,PDO::PARAM_STR); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); } catch (PDOException $Exception) { $pdo->rollBack(); print "오류: ".$Exception->getMessage(); } try{ $pdo->beginTransaction(); $sql = "update chandj.make set text1=?, text2=? ,text3=?, text4=? ,text5=?, ordercompany=? , callname=? ,cutwidth=? ,cutheight=? ,number=? ,printside=? ,direction=? ,exititem=? ,intervalnum=? ,intervalnumsecond=? ,memo=? ,draw=? ,drawbottom1=? ,drawbottom2=? ,drawbottom3=? ,upnum=?, exitinterval=?, cover=?, outputnum=?, left_check=?, mid_check=?, right_check=?, done_check=?, remain_check=? "; $sql .= " where num=? LIMIT 1"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $text1, PDO::PARAM_STR); $stmh->bindValue(2, $text2, PDO::PARAM_STR); $stmh->bindValue(3, $text3, PDO::PARAM_STR); $stmh->bindValue(4, $text4, PDO::PARAM_STR); $stmh->bindValue(5, $text5, PDO::PARAM_STR); $stmh->bindValue(6, $ordercompany, PDO::PARAM_STR); $stmh->bindValue(7, $callname, PDO::PARAM_STR); $stmh->bindValue(8, $cutwidth, PDO::PARAM_STR); $stmh->bindValue(9, $cutheight, PDO::PARAM_STR); $stmh->bindValue(10, $number, PDO::PARAM_STR); $stmh->bindValue(11, $printside, PDO::PARAM_STR); $stmh->bindValue(12, $direction, PDO::PARAM_STR); $stmh->bindValue(13, $exititem, PDO::PARAM_STR); $stmh->bindValue(14, $intervalnum, PDO::PARAM_STR); $stmh->bindValue(15, $intervalnumsecond, PDO::PARAM_STR); $stmh->bindValue(16, $memo, PDO::PARAM_STR); $stmh->bindValue(17, $draw, PDO::PARAM_STR); $stmh->bindValue(18, $drawbottom1, PDO::PARAM_STR); $stmh->bindValue(19, $drawbottom2, PDO::PARAM_STR); $stmh->bindValue(20, $drawbottom3, PDO::PARAM_STR); $stmh->bindValue(21, $upnum, PDO::PARAM_STR); $stmh->bindValue(22, $exitinterval, PDO::PARAM_STR); $stmh->bindValue(23, $cover, PDO::PARAM_STR); $stmh->bindValue(24, $outputnum, PDO::PARAM_STR); $stmh->bindValue(25, $left_check, PDO::PARAM_STR); $stmh->bindValue(26, $mid_check, PDO::PARAM_STR); $stmh->bindValue(27, $right_check, PDO::PARAM_STR); $stmh->bindValue(28, $done_check, PDO::PARAM_STR); $stmh->bindValue(29, $remain_check, PDO::PARAM_STR); $stmh->bindValue(30, $num, PDO::PARAM_STR); $stmh->execute(); $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); print "오류: ".$Exception->getMessage(); } } elseif($modify=='2') // sorting 요청 { } else { // 데이터 신규 등록하는 구간 try{ $pdo->beginTransaction(); $sql = "insert into chandj.make(text1, text2, text3, text4, text5, "; $sql .= "ordercompany, callname,cutwidth,cutheight,number,printside,direction,exititem,intervalnum,intervalnumsecond,memo,draw,drawbottom1,drawbottom2,drawbottom3,upnum,exitinterval,cover,outputnum,left_check, mid_check, right_check, done_check, remain_check)"; $sql .= " values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $text1, PDO::PARAM_STR); $stmh->bindValue(2, $text2, PDO::PARAM_STR); $stmh->bindValue(3, $text3, PDO::PARAM_STR); $stmh->bindValue(4, $text4, PDO::PARAM_STR); $stmh->bindValue(5, $text5, PDO::PARAM_STR); $stmh->bindValue(6, $ordercompany, PDO::PARAM_STR); $stmh->bindValue(7, $callname, PDO::PARAM_STR); $stmh->bindValue(8, $cutwidth, PDO::PARAM_STR); $stmh->bindValue(9, $cutheight, PDO::PARAM_STR); $stmh->bindValue(10, $number, PDO::PARAM_STR); $stmh->bindValue(11, $printside, PDO::PARAM_STR); $stmh->bindValue(12, $direction, PDO::PARAM_STR); $stmh->bindValue(13, $exititem, PDO::PARAM_STR); $stmh->bindValue(14, $intervalnum, PDO::PARAM_STR); $stmh->bindValue(15, $intervalnumsecond, PDO::PARAM_STR); $stmh->bindValue(16, $memo, PDO::PARAM_STR); $stmh->bindValue(17, $draw, PDO::PARAM_STR); $stmh->bindValue(18, $drawbottom1, PDO::PARAM_STR); $stmh->bindValue(19, $drawbottom2, PDO::PARAM_STR); $stmh->bindValue(20, $drawbottom3, PDO::PARAM_STR); $stmh->bindValue(21, $upnum, PDO::PARAM_STR); $stmh->bindValue(22, $exitinterval, PDO::PARAM_STR); $stmh->bindValue(23, $cover, PDO::PARAM_STR); $stmh->bindValue(24, $outputnum, PDO::PARAM_STR); $stmh->bindValue(25, $left_check, PDO::PARAM_STR); $stmh->bindValue(26, $mid_check, PDO::PARAM_STR); $stmh->bindValue(27, $right_check, PDO::PARAM_STR); $stmh->bindValue(28, $done_check, PDO::PARAM_STR); $stmh->bindValue(29, $remain_check, PDO::PARAM_STR); $stmh->execute(); $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); print "오류: ".$Exception->getMessage(); } } header("Location:/make/write.php?num=$num&callname=$callname&cutwidth=$cutwidth&cutheight=$cutheight&ordercompany=$ordercompany&outworkplace=$ordercompany&number=$number&printside=$printside&direction=$direction&exititem=$exititem&intervalnum=$intervalnum&intervalnumsecond=$intervalnumsecond&memo=$memo&draw=$draw&drawbottom1=$drawbottom1&drawbottom2=$drawbottom2&drawbottom3=$drawbottom3&text2=$text2&sort=$sort&upnum=$upnum&exitinterval=$exitinterval&cover=$cover&outputnum=$outputnum&parentnum=$parentnum&number=$number&left_check=$left_check&mid_check=$mid_check&right_check=$right_check&done_check=$done_check&remain_check=$remain_check"); // 신규가입일때는 리스트로 이동 ?>