묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
폼에서 ok,no 를 선택했을때 date값을 가져오는거에 대해서요...
2002.04.15 23:44
일단 꼭 부탁드리겠습니다..
제가 워낙 초보인데다..갑자기 필요해서요...소스를 올려드리겠습니다..
<?
//오전작업입니다.
include "time1tree_config.php";
?>
<html>
<head>
<title>time1write</title>
<style>
<!--
td { font-size:9pt; height:15pt;}
A:link {text-decoration:none; font:9pt; color:navy;}
A:visited {text-decoration:none}
-->
</style>
<SCRIPT LANGUAGE=JAVASCRIPT>
function content_check(form)
{
ye1=form.ye1.value.length;
mo1=form.mo1.value.length;
da1=form.da1.value.length;
if( ye1 ==0 ) {
alert("년도을입력하세요.!");
form.ye1.focus();
return (false);
}
if( mo1 ==0 ) {
alert("월을 입력하세요.!");
form.mo1.focus();
return (false);
}
if( da1 ==0 ) {
alert("일자를 입력하세요.!");
form.da1.focus();
return (false);
}
return (true);
}
function oncheck(){
document.suhoi.ye1.focus();
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function outDate(){
var time =new Date()
var hour = time.getHours()
var minute = time.getMinutes()
var second = time.getSeconds()
var temp = "" + ((hour > 24) ? hour - 24 : hour)
if(hour==0) temp = "24"
if(temp.length==1) temp = " " + temp
temp += ((minute < 10) ? ":0" : ":") + minute
temp += ((second < 10) ? ":0" : ":") + second
temp += (hour >= 24) ?"":""
document.suhoi.bat.value = temp
}
-->
</SCRIPT>
</head>
<body bgcolor=#FFFFFF marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 onload=oncheck();>
<center>
<?
echo ("<form action=time1insert.php?toodboard=$tooboard&too_mod=tre&id=$id method=post name=suhoi onSubmit="return content_check(this)">");
if ($too_mod)
{
$result=mysql_query("select * from $tooboard where id=$id");
$row=mysql_fetch_array($result);
$mo1=$row[mo1];
if(!($too_mod=="tre"))
{
$ye1=$row[ye1];
$na1=$row[mo1];
}
$mo1=$row[mo1];
$na1=$row[na1];
mysql_close($db);
}
?>
<table border="0" width="731" bordercolorlight="#4A6BAD" cellspacing="0" cellpadding="0" bordercolordark="#4A6BAD" bordercolor="#4A6BAD" bgcolor="#FFFFFF">
<tr>
<td width="730" bgcolor="#FFFFFF" valign="top">
<table border="1" width="730" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#000000" bordercolor="#000000">
<tr>
<td bgcolor="#D3D3D3" bordercolorlight="#000000" bordercolor="#000000" bordercolordark="#FFFFFF" width="730">
<p align="center"><font color="#FFFFFF" size=3><b>
<? echo $board_writed ?>
</b></font>
▒▒종합통제센터 시간별 업무확인 Report(오전현황)▒▒</p>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#FFFFFF" width="730" height=20>
<b>●확인일자:</b><INPUT type=text name=ye1 size=4 maxlength=4 value=<? echo $ye1; ?>>년<INPUT type=text name=mo1 size=2 maxlength=2 value=<? echo $mo1; ?>>월<INPUT type=text name=da1 size=2 maxlength=2 value=<? echo $da1; ?>>일
<select name=we1 value=<? echo $we1; ?>>
<option></option>
<option value="월요일">월요일</option>
<option value="화요일">화요일</option>
<option value="수요일">수요일</option>
<option value="목요일">목요일</option>
<option value="금요일">금요일</option>
<option value="토요일">토요일</option>
<option value="일요일">일요일</option>
</select>요일-<INPUT type=text name=mo2 size=2 maxlength=2 value=<? echo $mo2; ?>>월<INPUT type=text name=da2 size=2 maxlength=2 value=<? echo $da2; ?>>일 <b>●담당근무자:</b>
<select name=na1 value=<? echo $na1; ?>>
<option></option>
<option value="이준흥">이준흥</option>
<option value="노상우">노상우</option>
<option value="전원석">전원석</option>
<option value="권현오">권현오</option>
<option value="진희현">진희현</option>
<option value="경덕현">경덕현</option>
<option value="이대운">이대운</option>
</select>
<TABLE border="1" bordercolorlight="#4A6BAD" cellspacing="0" cellpadding="0" bordercolordark="#4A6BAD" bordercolor="#4A6BAD" bgcolor="#FFFFFF" width="730">
<TR>
<TD width=40 height=20 align=left>09:00</TD>
<TD width=360> Batch Scheduler & Backup Problem확인</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<INPUT type=text name="bat" size=8 maxlength=8 value=<? echo $bat; ?>>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select onchange="outDate();">
<option></option>
<option value="OK">OK</option>
<option value="NOT">NOT</option>
</select>
</TD>
<TD width=40 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=100 height=20 align=center bgcolor=#FFFFFF>
</TD>
</TR>
<TR>
<TD width=40 height=20 align=left>09:05</TD>
<TD bgcolor=99CCFF> 전자금융 아침 개시사항확인<제휴창구></TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<INPUT type=text name=el size=8 maxlength=8 value=<? echo $el; ?>>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select>
<option></option>
<option value="OK">OK</option>
<option value="NOT">NOT</option>
</select>
</TD>
<TD width=40 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select name=elh>
<option></option>
<option value="이준흥">이준흥</option>
<option value="노상우">노상우</option>
<option value="전원석">전원석</option>
<option value="권현오">권현오</option>
<option value="진희현">진희현</option>
<option value="경덕현">경덕현</option>
<option value="이대운">이대운</option>
</select>
</TD>
<TD width=100 height=20 align=center bgcolor=#FFFFFF>
</TD>
</TR>
<TR>
<TD width=30 height=20 align=left>17:00</TD>
<TD> 야간근무자에게 인수인계</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<INPUT type=text name=insu size=8 maxlength=8 value=<? echo $insu; ?>>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select>
<option></option>
<option value="OK">OK</option>
<option value="NOT">NOT</option>
</select>
</TD>
<TD width=40 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=100 height=20 align=center bgcolor=#FFFFFF>
</TD>
</TR>
</TABLE>
<br>
<?
echo("<INPUT type=submit name=submit size=10 value='등록하기'>");
?>
<INPUT type=reset name=submit size=10 value="취소하기">
</td>
</tr>
</table>
</tbale>
</center>
<?
echo ("
<TABLE align=left>
<TR>
<TD>
<a href=time1list.php?tooboard=$tooboard&pageok=$pageok><img src=/pic1/i_list.gif border=0 alt=리스트보기></a>
</TD>
</TR>
</TABLE>
");
?>
</body>
</html>
일단 소스가 무지 지저분한거에 대해서 죄송스럽게 생각하구요..워낙 실력이 안되다보니...
말루 설명드리자면.. a , b ,c 라는 작업이 있을떄 9시에 a 라는 작업을 했으면 ok를 눌르면 9시가
보여지구요 10시에 b라는 작업을 했다면 b에ㅐ는 10시가 찍히고 a 값은 9시 그대로 있는 방법을 원합니다...
다시 한번 지저분하게 올린거 사과드리고요./...
답변 주시면 정말 고맙겠습니다....
제가 워낙 초보인데다..갑자기 필요해서요...소스를 올려드리겠습니다..
<?
//오전작업입니다.
include "time1tree_config.php";
?>
<html>
<head>
<title>time1write</title>
<style>
<!--
td { font-size:9pt; height:15pt;}
A:link {text-decoration:none; font:9pt; color:navy;}
A:visited {text-decoration:none}
-->
</style>
<SCRIPT LANGUAGE=JAVASCRIPT>
function content_check(form)
{
ye1=form.ye1.value.length;
mo1=form.mo1.value.length;
da1=form.da1.value.length;
if( ye1 ==0 ) {
alert("년도을입력하세요.!");
form.ye1.focus();
return (false);
}
if( mo1 ==0 ) {
alert("월을 입력하세요.!");
form.mo1.focus();
return (false);
}
if( da1 ==0 ) {
alert("일자를 입력하세요.!");
form.da1.focus();
return (false);
}
return (true);
}
function oncheck(){
document.suhoi.ye1.focus();
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function outDate(){
var time =new Date()
var hour = time.getHours()
var minute = time.getMinutes()
var second = time.getSeconds()
var temp = "" + ((hour > 24) ? hour - 24 : hour)
if(hour==0) temp = "24"
if(temp.length==1) temp = " " + temp
temp += ((minute < 10) ? ":0" : ":") + minute
temp += ((second < 10) ? ":0" : ":") + second
temp += (hour >= 24) ?"":""
document.suhoi.bat.value = temp
}
-->
</SCRIPT>
</head>
<body bgcolor=#FFFFFF marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 onload=oncheck();>
<center>
<?
echo ("<form action=time1insert.php?toodboard=$tooboard&too_mod=tre&id=$id method=post name=suhoi onSubmit="return content_check(this)">");
if ($too_mod)
{
$result=mysql_query("select * from $tooboard where id=$id");
$row=mysql_fetch_array($result);
$mo1=$row[mo1];
if(!($too_mod=="tre"))
{
$ye1=$row[ye1];
$na1=$row[mo1];
}
$mo1=$row[mo1];
$na1=$row[na1];
mysql_close($db);
}
?>
<table border="0" width="731" bordercolorlight="#4A6BAD" cellspacing="0" cellpadding="0" bordercolordark="#4A6BAD" bordercolor="#4A6BAD" bgcolor="#FFFFFF">
<tr>
<td width="730" bgcolor="#FFFFFF" valign="top">
<table border="1" width="730" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#000000" bordercolor="#000000">
<tr>
<td bgcolor="#D3D3D3" bordercolorlight="#000000" bordercolor="#000000" bordercolordark="#FFFFFF" width="730">
<p align="center"><font color="#FFFFFF" size=3><b>
<? echo $board_writed ?>
</b></font>
▒▒종합통제센터 시간별 업무확인 Report(오전현황)▒▒</p>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#FFFFFF" width="730" height=20>
<b>●확인일자:</b><INPUT type=text name=ye1 size=4 maxlength=4 value=<? echo $ye1; ?>>년<INPUT type=text name=mo1 size=2 maxlength=2 value=<? echo $mo1; ?>>월<INPUT type=text name=da1 size=2 maxlength=2 value=<? echo $da1; ?>>일
<select name=we1 value=<? echo $we1; ?>>
<option></option>
<option value="월요일">월요일</option>
<option value="화요일">화요일</option>
<option value="수요일">수요일</option>
<option value="목요일">목요일</option>
<option value="금요일">금요일</option>
<option value="토요일">토요일</option>
<option value="일요일">일요일</option>
</select>요일-<INPUT type=text name=mo2 size=2 maxlength=2 value=<? echo $mo2; ?>>월<INPUT type=text name=da2 size=2 maxlength=2 value=<? echo $da2; ?>>일 <b>●담당근무자:</b>
<select name=na1 value=<? echo $na1; ?>>
<option></option>
<option value="이준흥">이준흥</option>
<option value="노상우">노상우</option>
<option value="전원석">전원석</option>
<option value="권현오">권현오</option>
<option value="진희현">진희현</option>
<option value="경덕현">경덕현</option>
<option value="이대운">이대운</option>
</select>
<TABLE border="1" bordercolorlight="#4A6BAD" cellspacing="0" cellpadding="0" bordercolordark="#4A6BAD" bordercolor="#4A6BAD" bgcolor="#FFFFFF" width="730">
<TR>
<TD width=40 height=20 align=left>09:00</TD>
<TD width=360> Batch Scheduler & Backup Problem확인</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<INPUT type=text name="bat" size=8 maxlength=8 value=<? echo $bat; ?>>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select onchange="outDate();">
<option></option>
<option value="OK">OK</option>
<option value="NOT">NOT</option>
</select>
</TD>
<TD width=40 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=100 height=20 align=center bgcolor=#FFFFFF>
</TD>
</TR>
<TR>
<TD width=40 height=20 align=left>09:05</TD>
<TD bgcolor=99CCFF> 전자금융 아침 개시사항확인<제휴창구></TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<INPUT type=text name=el size=8 maxlength=8 value=<? echo $el; ?>>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select>
<option></option>
<option value="OK">OK</option>
<option value="NOT">NOT</option>
</select>
</TD>
<TD width=40 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select name=elh>
<option></option>
<option value="이준흥">이준흥</option>
<option value="노상우">노상우</option>
<option value="전원석">전원석</option>
<option value="권현오">권현오</option>
<option value="진희현">진희현</option>
<option value="경덕현">경덕현</option>
<option value="이대운">이대운</option>
</select>
</TD>
<TD width=100 height=20 align=center bgcolor=#FFFFFF>
</TD>
</TR>
<TR>
<TD width=30 height=20 align=left>17:00</TD>
<TD> 야간근무자에게 인수인계</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<INPUT type=text name=insu size=8 maxlength=8 value=<? echo $insu; ?>>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
<select>
<option></option>
<option value="OK">OK</option>
<option value="NOT">NOT</option>
</select>
</TD>
<TD width=40 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=60 height=20 align=center bgcolor=#FFFFFF>
</TD>
<TD width=100 height=20 align=center bgcolor=#FFFFFF>
</TD>
</TR>
</TABLE>
<br>
<?
echo("<INPUT type=submit name=submit size=10 value='등록하기'>");
?>
<INPUT type=reset name=submit size=10 value="취소하기">
</td>
</tr>
</table>
</tbale>
</center>
<?
echo ("
<TABLE align=left>
<TR>
<TD>
<a href=time1list.php?tooboard=$tooboard&pageok=$pageok><img src=/pic1/i_list.gif border=0 alt=리스트보기></a>
</TD>
</TR>
</TABLE>
");
?>
</body>
</html>
일단 소스가 무지 지저분한거에 대해서 죄송스럽게 생각하구요..워낙 실력이 안되다보니...
말루 설명드리자면.. a , b ,c 라는 작업이 있을떄 9시에 a 라는 작업을 했으면 ok를 눌르면 9시가
보여지구요 10시에 b라는 작업을 했다면 b에ㅐ는 10시가 찍히고 a 값은 9시 그대로 있는 방법을 원합니다...
다시 한번 지저분하게 올린거 사과드리고요./...
답변 주시면 정말 고맙겠습니다....