묻고답하기
제로보드는 아니지만..ㅠㅠ php 주문서 작성 후 수정부분..
2009.03.01 12:06
주문서 작성 후.. 고객이 다시 들어와서 수정하는 부분인데..
잘 되다가 뭘 건드렸는지.. 수정이 안되네요..ㅠㅠ
도와주세요.. 급해요..ㅠㅠ
작성부분
<?php
include("top.php");
include("admin/conn.php");
$sql=mysql_query("select * from user where id=".$_SESSION[userid]."",$conn);
$info=mysql_fetch_array($sql);
?>
<script Language=xxjavascript>
function move_save() {
var frm = document.frm;
if (confirm!("历厘窍矫摆嚼聪鳖")) {
frm.target = "_self";
frm.action = "savereg.php";
frm.submit();
}
}
function move_list() {
var frm = document.p_frm;
frm.target = "_self";
frm.action = "/list.jsp";
frm.submit();
}
function select_zipcode() {
var url, name, options;
url = "/zip_list.jsp";
name = "zip";
options = "top=100,left=100,width=400,height=350,resizable=no,menubar=no,scrollbars=yes,statusbar=no";
window.open(url, name, options);
}
</script>
<table align="center" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" width="639">
<form name="frm" method="POST" action="saveupdate.php?id=<?php echo $info[id];?>">
<tr height="2" bgcolor="#3c3c8c"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff">번호</td>
<td bgcolor="#ffffff" colspan="3"><?php echo $info[id];?></td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff"><font color=red>*</font>****</td>
<td bgcolor="#ffffff" colspan="3">
<textarea name="p_contents" cols="78" rows="3" value="<?php echo $info[p_contents];?>" class="input_text"></textarea>
</td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" bgcolor="#fff0ff"><font color=red>*</font>배송비</td>
<td bgcolor="#ffffff" colspan="3">
<input type="radio" name="deli_type" value="<?php $info[deli_type];?>" >
**
<input type="radio" name="deli_type" value="<?php $info[deli_type];?>" >
**
<input type="radio" name="deli_type" value="<?php $info[deli_type];?>">
****
<input type="radio" name="deli_type" value="<?php $info[deli_type];?>" />
****
<br>
*****
<br>
<span class=small_g>**** <b>****</b> *****</span> </td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" bgcolor="#fff0ff"><font color=red>*</font>****</td>
<td width="230" bgcolor="#ffffff">
<input type="text" name="receiver" size="20" maxlength="10" value="<?php echo $info[receiver];?>" class="input_text">
</td>
<td align="right" width="108" bgcolor="#fff0ff"><font color=red>*</font>****</td>
<td width="158" bgcolor="#ffffff">
<input type="text" name="pw" size="10" maxlength="4" value="<?php echo $info[pw];?>" class="input_text">
<span class="small">숫자 4자리</span> </td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff"><font color=red>*</font>입금액</td>
<td width="230" bgcolor="#ffffff">
<input type="text" name="amt" size="20" maxlength="20" value="<?php echo $info[i_amt];?>" class="input_text"></td>
<td align="right" width="108" bgcolor="#fff0ff"><font color=red>*</font>입금자명</td>
<td bgcolor="#ffffff">
<input type="text" name="payer" size="20" maxlength="10" value="<?php echo $info[payer];?>" class="input_text">
</td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff">****</td>
<td bgcolor="#ffffff">
<input type="text" name="cafe_name" size="20" maxlength="50" value="<?php echo $info[cafe_name];?>" class="input_text"> (Ex.Tealim.com)
</td>
<td align="right" width="108" bgcolor="#fff0ff">****</td>
<td bgcolor="#ffffff">
<input type="text" name="pay_desc" size="20" maxlength="25" value="<?php echo $info[pay_desc];?>" class="input_text">
</td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff"><font color=red>*</font>핸드폰</td>
<td bgcolor="#ffffff">
<input type="text" name="cell_phone" size="20" maxlength="50" value="<?php echo $info[cell_phone];?>" class="input_text">
</td>
<td align="right" width="108" bgcolor="#fff0ff"><font color=red>*</font>전화</td>
<td bgcolor="#ffffff">
<input type="text" name="phone" size="20" maxlength="50" value="<?php echo $info[phone];?>" class="input_text">
</td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff"><font color=red>*</font>주소</td>
<td bgcolor="#ffffff" colspan="3">
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td>
<input type="text" name="deli_addr" size="80" maxlength="50" value="<?php echo $info[deli_addr];?>" class="input_text">
</td>
</tr>
</table>
</td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff">고객메모</td>
<td bgcolor="#ffffff" colspan="3">
<textarea name="deli_req" cols="78" rows="3" value="<?php echo $info[deli_req];?>" class="txt_area"></textarea>
</td>
</tr>
<tr height="1" bgcolor="#bfcadf"><td colspan="5"></td></tr>
<tr>
<td align="right" width="103" bgcolor="#fff0ff">****</td>
<td bgcolor="#ffffff">
<input type="text" name="mall_name" size="20" maxlength="50" value="<?php echo $info[mall_name];?>" class="input_text">
***** </td>
<td align="right" width="108" bgcolor="#fff0ff">****</td>
<td bgcolor="#ffffff">
<input type="text" name="mall_phone" size="20" maxlength="50" value="<?php echo $info[mall_phone];?>" class="input_text">
</td>
</tr>
<tr height="1" bgcolor="#3c3c8c"><td colspan="5"></td></tr>
<table align="center" border="0" cellspacing="0" cellpadding="1" bgcolor="#ffffff" width="650">
<tr height="30">
<td width="400">
<a href="index.php"><img src="img/2_list.gif" border="0" align="absmiddle"></a>
</td>
<td><input type="image" value="" src="img/ok.gif" border="0" align="right"></td>
</tr>
</table>
</form>
</table>
수정부분
<?php
session_start();
$a=$_GET[id];
$contents = $_POST[p_contents];
$receiver = $_POST[receiver];
$password = $_POST[pw];
$i_amt = $_POST[amt];
$payer = $_POST[payer];
$type = $_POST[deli_type];
$cafe = $_POST[cafe_name];
$paydate = $_POST[pay_desc];
$phone = $_POST[phone];
$cellphone = $_POST[cell_phone];
$address = $_POST[deli_addr];
$req = $_POST[deli_req];
$company = $_POST[mall_name];
$companyphone = $_POST[mall_phone];
include("admin/conn.php");
mysql_query("UPDATE user SET p_contents='$contents',receiver='$receiver',pw='$password',i_amt='$i_amt',payer='$payer',,deli_type='$type',cafe_name='$cafe',pay_desc='$paydate',phone='$phone',cell_phone='$cellphone',deli_addr='$address',deli_req='$req',mall_name='$company',mall_phone='$companyphone' WHERE id=$a");
echo "<script>alert!('Successed!');window.location!='info_view.php';</script>";
?>