001.
<!--------- *Calander* --------------->
002.
<script type=
"text/javascript"
>
003.
$(
function
()
004.
{
005.
$(
"#pj_date<?php echo $i; ?>"
).datepicker
006.
({
007.
dateFormat:
'dd-M-yy'
008.
});
009.
});
010.
</script>
011.
<!------------------------------------->
012.
013.
<body>
014.
<form name=
"save"
method=
"POST"
enctype=
"multipart/form-data"
action=
"projectTimeAdd_page.php"
>
015.
<table width=
"1350"
align=
"center"
>
016.
<!------- *Total Of IP Phase* ------------>
017.
<tr>
018.
<td width=
"220"
style=
"padding:10px"
><span
class
=
"glyphicon glyphicon-asterisk"
style=
"color:#C00"
></span><strong> Total of IP Phase</strong></td>
019.
<td width=
"492"
style=
"padding:10px"
>
020.
<div
class
=
"row"
><div
class
=
"col-xs-10"
>
021.
<select name=
"total_ipphase"
onChange=
"MM_jumpMenu('parent',this,0)"
class
=
"btn btn-default dropdown-toggle"
>
022.
<?php
023.
for
(
$i
= 0;
$i
<= 20;
$i
++)
024.
{
025.
if
(
$_GET
[
"Line"
] ==
$i
)
026.
{
027.
$sel
=
"selected"
;
028.
}
029.
else
030.
{
031.
$sel
=
""
;
032.
}
033.
?>
034.
<option value=
"<?php echo $_SERVER["
PHP_SELF
"]; ?>?Line=<?php echo $i;?>"
<?php
echo
$sel
; ?>><?php
echo
$i
;?></option>
035.
<?php
036.
} ?>
037.
</select>
038.
<font size=
"2"
><strong>**Please select at least one**</strong></font>
039.
<input type=
"hidden"
name=
"total_ipphase"
id=
"total_ipphase"
value=
"<?php echo $_GET["
Line
"]; ?>"
><!----- Valus total_ipphase ----->
040.
</div></div>
041.
</td>
042.
043.
<tr>
044.
<td height=
"41"
colspan=
"3"
style=
"padding:20px;padding-left:30px"
>
045.
<?php
046.
$line
=
$_GET
[
"Line"
];
047.
if
(
$line
== 1){
$line
= 1;}
048.
for
(
$i
= 1;
$i
<=
$line
;
$i
++)
049.
{
050.
?>
051.
052.
<!----- **Calander [i]** ------------->
053.
<tr>
054.
<td style=
"padding:10px"
>
055.
<span
class
=
"glyphicon glyphicon-asterisk"
style=
"color:#C00"
></span><strong style=
"font-size:13px"
>
Date
</strong>
056.
</td>
057.
<td style=
"padding:10px"
>
058.
<div
class
=
"row"
><div
class
=
"col-xs-4"
>
059.
<input type=
"text"
name=
"pj_date<?php echo $i; ?>"
id=
"pj_date"
class
=
"form-control"
style=
"font-size:16px"
placeholder=
"Click Here"
value=
""
required/>
060.
</div></div>
061.
</td>
062.
</tr>
063.
064.
<?php
065.
}
066.
?>
067.
<!------- *
END
Table IP Phase[i]* -------->
068.
</td>
069.
</tr>
070.
071.
<button type=
"submit"
name=
"save"
class
=
"btn btn-success"
onClick=
"return check();"
><span
class
=
"glyphicon glyphicon-floppy-disk"
></span> Save</button>
072.
<input type=
"hidden"
name=
"hdnLine"
value=
"<?php echo $i;?>"
>
073.
074.
075.
076.
<!------------------------------- Insert In Data Base ----------------------------->
077.
<?php
078.
if
(isset(
$_POST
[
"save"
]))
079.
{
080.
for
(
$i
= 0;
$i
<=
$_POST
[
"hdnLine"
];
$i
++)
081.
{
082.
if
(
$_POST
[
"id_projectipphase$i"
] != NULL)
083.
{
084.
$sqlDetail
=
" INSERT INTO sttb_projectdetail "
;
085.
$sqlDetail
.=
"(pj_date)"
;
086.
$sqlDetail
.=
" VALUES "
;
087.
$sqlDetail
.=
"('"
.
$_POST
[
"pj_date$i"
].
"')"
;
088.
$qryDetail
= mysql_query(
$sqlDetail
);
089.
}
090.
}
091.
if
(
$qryDetail
)
092.
{
echo
"<script>alert('Create New Project Completed!');</script>"
; }
093.
094.
else
095.
{
echo
"<script>alert('Can't Completed!');</script>"
; }
096.
}
097.
098.
}
099.
?>
100.
<!------------------------------------------------------------------------------------------------------------------------>
101.
</body>