001.
<?
002.
session_start();
003.
include
(
"config/connect.php"
);
004.
005.
$y
=
date
(Y);
006.
$m
=
date
(m);
007.
$d
=
date
(d);
008.
$str_bui
=
"SELECT * FROM plan_building INNER JOIN plan_periodwork ON (plan_building.bui_id=plan_periodwork.bui_id) WHERE plan_periodwork.period_id='$_GET[per_id]'"
;
009.
$rs_bui
=mysql_query(
$str_bui
);
010.
$arr_bui
=mysql_fetch_array(
$rs_bui
);
011.
012.
$start3_data
=
explode
(
"-"
,
$arr_bui
[
"per_start"
]);
013.
$y3
=
$start3_data
[0]+543;
014.
$m3
=
$start3_data
[1];
015.
$d3
=
$start3_data
[2];
016.
$start2
=
$d3
.
"/"
.
$m3
.
"/"
.
$y3
;
017.
$start4_data
=
explode
(
"-"
,
$arr_bui
[
"per_final"
]);
018.
$y4
=
$start4_data
[0]+543;
019.
$m4
=
$start4_data
[1];
020.
$d4
=
$start4_data
[2];
021.
$finish2
=
$d4
.
"/"
.
$m4
.
"/"
.
$y4
;
022.
?>
023.
<?php
024.
$str
=
"SELECT * FROM plan_building WHERE bui_id=$_GET[bui] "
;
025.
$rs
=mysql_query(
$str
);
026.
while
(
$arr
=mysql_fetch_array(
$rs
)){
027.
$str_n
=
"SELECT MAX(per_number) FROM plan_periodplan WHERE bui_id='$arr[bui_id]' "
;
028.
$rs_n
=mysql_query(
$str_n
);
029.
$num_s
=mysql_fetch_array(
$rs_n
);
030.
031.
?>
032.
<?php
033.
}
034.
?>
037.
<head>
038.
<script type=
'text/javascript'
>
039.
function
checkNumber(data){
040.
if
(!data.value.match(/^\d*$/)){
041.
alert(
'กรอกตัวเลขเท่านั้น'
);
042.
data.value=
''
;
043.
}
044.
}
045.
</script>
046.
<script type=
"text/javascript"
src=
"script/jscalendar/calendar.js"
></script>
047.
<!-- language
for
the calendar -->
048.
<script type=
"text/javascript"
src=
"script/jscalendar/lang/calendar-th.js"
></script>
049.
<!-- the following script defines the Calendar.setup helper
function
, which makes
050.
adding a calendar a matter of 1
or
2 lines of code. -->
051.
<script type=
"text/javascript"
src=
"script/jscalendar/calendar-setup.js"
></script>
052.
<!-- edit mask-->
053.
<script type=
"text/javascript"
src=
"script/editmark.js"
></script>
054.
<link href=
"bc.css"
rel=
"stylesheet"
type=
"text/css"
/>
055.
<link href=
"script/jscalendar/calendar-blue.css"
rel=
"stylesheet"
type=
"text/css"
>
056.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=windows-874"
/>
057.
<title>Untitled Document</title>
058.
</head>
059.
060.
<body>
061.
<script language=
"javascript"
>
062.
function
fncSum()
063.
{
064.
var
tot = 0;
065.
var
sum = 0;
066.
for
(i=1;i<=document.form1.hdnLine.value;i++)
067.
{
068.
tot = parseInt(
eval
(
"document.form1.Vol1_"
+i+
".value"
)) * parseFloat(
eval
(
"document.form1.per_percentage_"
+i+
".value"
)) / 100
069.
eval
(
"document.form1.per_cost_"
+i+
".value="
+tot);
070.
sum = tot * sum;
071.
document.form1.txtSum.value=sum;
072.
}
073.
}
074.
</script>
075.
<form id=
"form1"
name=
"form1"
method=
"post"
action=
"tag_period_update_process.php"
>
076.
<table width=
"800"
border=
"0"
align=
"center"
class
=
""
>
077.
<tr>
078.
<td bgcolor=
"#FFFFCC"
></td>
079.
</tr>
080.
<tr>
081.
<td align=
"center"
><table width=
"800"
border=
"0"
align=
"center"
class
=
"calendar"
>
082.
<tr>
083.
<td height=
"38"
colspan=
"3"
align=
"center"
bgcolor=
"#FFFFCC"
><h6><strong
class
=
"VIEWSTATE"
>ข้อมูลงวดงาน</strong></h6></td>
084.
</tr>
085.
<tr>
086.
<td width=
"19%"
height=
"29"
><strong>1.ชื่ออาคาร</strong></td>
087.
<td width=
"3%"
align=
"center"
>:</td>
088.
<td width=
"78%"
align=
"left"
><input name=
"bui_name"
type=
"text"
id=
"bui_name"
size=
"70"
value=
"<? echo $arr_bui["
bui_name
"];?>"
disabled=
"disabled"
/>
089.
<input name=
"per"
type=
"hidden"
id=
"per"
value=
"<? echo $_GET[per_id]; ?>"
/></td>
090.
</tr>
091.
<tr>
092.
<td height=
"32"
bgcolor=
"#FFFFCC"
><strong>2.งวดงานที่</strong></td>
093.
<td align=
"center"
bgcolor=
"#FFFFCC"
>:</td>
094.
<td align=
"left"
bgcolor=
"#FFFFCC"
><input name=
"textfield2"
type=
"text"
id=
"textfield2"
size=
"5"
maxlength=
"5"
value=
"<? echo $arr_bui["
per_number
"]; ?>"
disabled=
"disabled"
/></td>
095.
</tr>
096.
<tr>
097.
<td align=
"right"
bgcolor=
"#EEEEFF"
><strong>จำนวนเงิน</strong></td>
098.
<td align=
"center"
bgcolor=
"#EEEEFF"
>:</td>
099.
<td align=
"left"
bgcolor=
"#EEEEFF"
><label
for
=
"yy1"
></label>
100.
<strong>
101.
<?
102.
$str
=
"SELECT * FROM plan_building WHERE bui_id=$_GET[bui] "
;
103.
$rs
=mysql_query(
$str
);
104.
while
(
$arr
=mysql_fetch_array(
$rs
)){
105.
$str_n
=
"SELECT MAX(per_number) FROM plan_periodplan WHERE bui_id='$arr[bui_id]' "
;
106.
$rs_n
=mysql_query(
$str_n
);
107.
$num_s
=mysql_fetch_array(
$rs_n
);
108.
109.
?>
110.
<input name=
"Vol1_1"
id=
"Vol1_1"
type=
"text"
value=
" <? echo number_format($arr[bui_cost],2,"
.
","
,
");?>"
readonly onClick=
""
=
"fncSum()"
onKeyUp=
"if(this.value*1!=this.value) this.value='' ;"
>
111.
<?php
112.
}
113.
?>
114.
115.
<input name=
"cost"
type=
"text"
id=
"code3"
size=
"40"
value=
"<? echo $arr_bui["
per_cost_1
"]; ?>"
onkeyup=
"checkNumber(this)"
/>
116.
บาท
117.
<select name=
"bud_id"
id=
"bud_id"
>
118.
<?
if
(
$arr_bui
[
"bud_id"
]==
"0"
){ ?><option value=
"0"
selected=
"selected"
>กรุณาเลือกงบประมาณ</option><? }
else
{ ?><option value=
"0"
>กรุณาเลือกงบประมาณ</option><? } ?>
119.
<?
if
(
$arr_bui
[
"bud_id"
]==
"1"
){ ?><option value=
"1"
selected=
"selected"
>งบประมาณแผ่นดิน</option><? }
else
{ ?><option value=
"1"
>งบประมาณแผ่นดิน</option><? } ?>
120.
<?
if
(
$arr_bui
[
"bud_id"
]==
"2"
){ ?> <option value=
"2"
selected=
"selected"
>เงินนอกงบประมาณ</option><? }
else
{ ?><option value=
"2"
>เงินนอกงบประมาณ</option><? } ?>
121.
<?
if
(
$arr_bui
[
"bud_id"
]==
"3"
){ ?> <option value=
"3"
selected=
"selected"
>ผูกพันงบประมาณ</option><? }
else
{ ?><option value=
"3"
>ผูกพันงบประมาณ</option><? } ?>
122.
</select>
123.
<span
class
=
"EMAILLINK"
><?
echo
$_GET
[
"x"
];
echo
$_GET
[
"y"
]; ?></span></strong></td>
124.
</tr>
125.
<tr>
126.
<td height=
"33"
align=
"right"
bgcolor=
"#FFFFCC"
><strong>งบประมาณเบิกล่วงหน้า</strong></td>
127.
<td align=
"center"
bgcolor=
"#FFFFCC"
>:</td>
128.
<td align=
"left"
bgcolor=
"#FFFFCC"
><input name=
"per_percentage_1"
type=
"text"
id=
"code3"
size=
"5"
value=
"<? echo $arr_bui[per_percentage_1]; ?>"
/>%</td>
129.
</tr>
130.
<tr>
131.
<td height=
"117"
align=
"right"
bgcolor=
"#EEEEFF"
><strong>รายละเอียด</strong></td>
132.
<td align=
"center"
bgcolor=
"#EEEEFF"
>:</td>
133.
<td align=
"left"
bgcolor=
"#EEEEFF"
><textarea name=
"note"
cols=
"60"
rows=
"5"
id=
"note"
><?
echo
$arr_bui
[per_note]; ?></textarea>
134.
<strong><span
class
=
"EMAILLINK"
><?
echo
$_GET
[
"z"
]; ?></span></strong></td>
135.
</tr>
136.
<tr>
137.
<td height=
"33"
align=
"right"
bgcolor=
"#FFFFCC"
><strong>เริ่มปฏิบัติงาน</strong></td>
138.
<td align=
"center"
bgcolor=
"#FFFFCC"
>:</td>
139.
<td align=
"left"
bgcolor=
"#FFFFCC"
><span
class
=
"boxtitle"
>
140.
<input name=
"start2"
type=
"text"
id=
"start2"
onkeyup=
"editMaskDateTime('start2','DD/MM/YYYY','')"
value=
"<? echo $start2;?>"
size=
"12"
/>
141.
<a href=
"#"
><img src=
"script/jscalendar/calendar.gif"
alt=
"เลือกวันที่"
name=
"bt_start2"
width=
"21"
height=
"21"
border=
"0"
align=
"absmiddle"
id=
"bt_start2"
/></a>
142.
<script type=
"text/javascript"
>
143.
Calendar.setup({
144.
inputField :
"start2"
,
145.
ifFormat :
"%d/%m/%z"
,
146.
displayArea :
"show_e"
,
147.
daFormat :
"%A, %B %d, %z"
,
148.
button :
"bt_start2"
,
149.
150.
singleClick : true
151.
});
152.
</script></span></td>
153.
</tr>
154.
<tr>
155.
<td height=
"31"
align=
"right"
bgcolor=
"#EEEEFF"
><strong>วันที่สิ้นสุด</strong></td>
156.
<td align=
"center"
bgcolor=
"#EEEEFF"
>:</td>
157.
<td align=
"left"
bgcolor=
"#EEEEFF"
><span
class
=
"boxtitle"
>
158.
<input name=
"start3"
type=
"text"
id=
"start3"
onkeyup=
"editMaskDateTime('start3','DD/MM/YYYY','')"
value=
"<? echo $finish2;?>"
size=
"12"
/>
159.
<a href=
"#"
><img src=
"script/jscalendar/calendar.gif"
alt=
"เลือกวันที่"
name=
"bt_start3"
width=
"21"
height=
"21"
border=
"0"
align=
"absmiddle"
id=
"bt_start3"
/></a>
160.
<script type=
"text/javascript"
>
161.
Calendar.setup({
162.
inputField :
"start3"
,
163.
ifFormat :
"%d/%m/%z"
,
164.
displayArea :
"show_e"
,
165.
daFormat :
"%A, %B %d, %z"
,
166.
button :
"bt_start3"
,
167.
168.
singleClick : true
169.
});
170.
</script>
171.
</span></td>
172.
</tr>
173.
<tr>
174.
<td height=
"33"
align=
"right"
bgcolor=
"#FFFFCC"
><strong>สถานะการดำเนินงาน</strong></td>
175.
<td align=
"center"
bgcolor=
"#FFFFCC"
>:</td>
176.
<td align=
"left"
bgcolor=
"#FFFFCC"
><select name=
"percen"
id=
"percen"
>
177.
<?
if
(
$arr_bui
[per_percen]==
"0"
){?><option value=
"0"
selected=
"selected"
>0</option><? }
else
{ ?><option value=
"0"
>0</option><? }?>
178.
<?
if
(
$arr_bui
[per_percen]==
"10"
){?><option value=
"10"
selected=
"selected"
>10</option><? }
else
{ ?><option value=
"10"
>10</option><? }?>
179.
<?
if
(
$arr_bui
[per_percen]==
"20"
){?><option value=
"20"
selected=
"selected"
>20</option><? }
else
{ ?><option value=
"20"
>20</option><? }?>
180.
<?
if
(
$arr_bui
[per_percen]==
"30"
){?> <option value=
"30"
selected=
"selected"
>30</option><? }
else
{ ?><option value=
"30"
>30</option><? }?>
181.
<?
if
(
$arr_bui
[per_percen]==
"40"
){?> <option value=
"40"
selected=
"selected"
>40</option><? }
else
{ ?><option value=
"40"
>40</option><? }?>
182.
<?
if
(
$arr_bui
[per_percen]==
"50"
){?> <option value=
"50"
selected=
"selected"
>50</option><? }
else
{ ?><option value=
"50"
>50</option><? }?>
183.
<?
if
(
$arr_bui
[per_percen]==
"60"
){?> <option value=
"60"
selected=
"selected"
>60</option><? }
else
{ ?><option value=
"60"
>60</option><? }?>
184.
<?
if
(
$arr_bui
[per_percen]==
"70"
){?> <option value=
"70"
selected=
"selected"
>70</option><? }
else
{ ?><option value=
"70"
>70</option><? }?>
185.
<?
if
(
$arr_bui
[perpercen]==
"80"
){?> <option value=
"80"
selected=
"selected"
>80</option><? }
else
{ ?><option value=
"80"
>80</option><? }?>
186.
<?
if
(
$arr_bui
[per_percen]==
"90"
){?> <option value=
"90"
selected=
"selected"
>90</option><? }
else
{ ?><option value=
"90"
>90</option><? }?>
187.
<?
if
(
$arr_bui
[per_percen]==
"100"
){?> <option value=
"100"
selected=
"selected"
>100</option><? }
else
{ ?><option value=
"100"
>100</option><? }?>
188.
</select>
189.
%</td>
190.
</tr>
191.
<tr>
192.
<td height=
"53"
align=
"right"
bgcolor=
"#EEEEFF"
><strong>ปัญหา / อุปสรรค</strong></td>
193.
<td align=
"center"
bgcolor=
"#EEEEFF"
>:</td>
194.
<td align=
"left"
bgcolor=
"#EEEEFF"
><textarea name=
"comment"
cols=
"60"
id=
"comment"
><?
echo
$arr_bui
[per_comment];?></textarea></td>
195.
</tr>
196.
<tr>
197.
<td height=
"19"
align=
"right"
bgcolor=
"#EEEEFF"
> </td>
198.
<td align=
"center"
bgcolor=
"#EEEEFF"
> </td>
199.
<td align=
"left"
bgcolor=
"#EEEEFF"
> </td>
200.
</tr>
201.
</table></td>
202.
</tr>
203.
<tr>
204.
<td align=
"center"
><input type=
"submit"
name=
"button"
id=
"button"
value=
"บันทึกข้อมูล"
/>
205.
</td>
206.
</tr>
207.
</table>
208.
</form>
209.
210.
</body>
211.
</html>