001.
<?
002.
$link
= mysqli_connect(
"$hostname"
,
"$username"
,
"$password"
,
"$database"
);
003.
$queryCleS
=
"SELECT * FROM student WHERE Cla_ID = '"
.
$_REQUEST
[
"Cla_ID"
].
"' and Roo_ID = '"
.
$_REQUEST
[
"Roo_ID"
].
"' ORDER by Tit_ID ASC,Stu_Code ASC"
;
004.
if
(
$resultCleS
= mysqli_query(
$link
,
$queryCleS
)) {
005.
$i
=1;
006.
while
(
$objCleS
= mysqli_fetch_object(
$resultCleS
)) {
007.
008.
$queryCleC
=
"SELECT * FROM stuscore WHERE Stu_Code = '"
.
$objCleS
->Stu_Code.
"' and Ind_ID ='"
.
$_REQUEST
[
"Ind_ID"
].
"' and SchD_ID = '"
.
$_REQUEST
[
"SchD_ID"
].
"' "
;
009.
$resultCleC
= mysqli_query(
$link
,
$queryCleC
);
010.
$rowCleC
= mysqli_fetch_array(
$resultCleC
, MYSQLI_ASSOC);
011.
012.
?>
013.
<tr>
014.
<td><?=++
$ob
?>
015.
<input type=
"hidden"
name=
"Stu_Code[]"
value=
"<?=$objCleS->Stu_Code ?>"
>
016.
</td>
017.
<td><?
018.
$query
=
"SELECT * FROM student WHERE Stu_Code = '"
.
$objCleS
->Stu_Code.
"' ORDER by Tit_ID ASC,Stu_Code ASC "
;
019.
$result
= mysqli_query(
$link
,
$query
);
020.
$row
= mysqli_fetch_array(
$result
, MYSQLI_ASSOC);
021.
echo
$row
[
"Stu_Name"
].
" "
.
$row
[
"Stu_Sername"
];
022.
023.
<td>
024.
<input type=
"text"
name=
"Ssc_Value[<?=$objCleS->Stu_Code?>]"
value=
"<?=$rowCleC["
Ssc_Value
"]; ?>"
>
025.
</td>
026.
</tr>
027.
<?
028.
$i
++;
029.
}mysqli_free_result(
$resultCleS
); }
030.
mysqli_close(
$link
);
031.
?>
032.
</tbody>
033.
</table>
034.
<!--
End
Table Striped-->
035.
</fieldset>
036.
037.
<!-- Code Father And Mother -->
038.
039.
<!--
End
Code Father And Mother -->
040.
041.
<footer>
042.
<input type=
"hidden"
name=
"SchD_ID"
value=
"<?=$_REQUEST["
SchD_ID
"] ?>"
>
043.
<input type=
"hidden"
name=
"Ind_ID"
value=
"<?=$_REQUEST["
Ind_ID
"]?>"
>
044.
<button type=
"button"
class
=
"btn-u btn-u-default"
onclick=
"window.history.back();"
>ยกเลิก</button>
045.
<button type=
"submit"
class
=
"btn-u"
name=
"add"
id=
"add"
>ตกลง</button>
046.
</footer>
047.
</form>
048.
<!--
End
Checkout-Form -->
049.
</div>
050.
051.
052.
053.
054.
</div>
055.
<!--===
End
Content ===-->
056.
057.
058.
<script language=
"javascript"
>
059.
var
CheckoutForm =
function
() {
060.
061.
return
{
062.
063.
064.
initCheckoutForm:
function
() {
065.
066.
$(
'#Yeae_ID'
).mask(
'9/9999'
, {placeholder:
'X'
});
067.
$(
'#card'
).mask(
'9999-9999-9999-9999'
, {placeholder:
'X'
});
068.
$(
'#year'
).mask(
'2099'
, {placeholder:
'X'
});
069.
070.
071.
$.validator.addMethod(
"creditcard"
,
function
(value, element, param) {
072.
if
( /[^0-9\-]+/.test(value) )
073.
{
074.
return
false;
075.
}
076.
},
077.
$.validator.format(
'Please enter a valid credit card number.'
));
078.
079.
080.
$(
'#sky-form'
).validate({
081.
082.
rules:
083.
{
084.
Ssc_Value[<?=
$objCleS
->Stu_Code?>]:
085.
{
086.
required: true
087.
},
088.
},
089.
090.
091.
messages:
092.
{
093.
Ssc_Value[<?=
$objCleS
->Stu_Code?>]:
094.
{
095.
required:
'กรอกข้อมูล'
096.
},
097.
098.
},
099.
100.
101.
errorPlacement:
function
(error, element)
102.
{
103.
error.insertAfter(element.parent());
104.
}
105.
});
106.
}
107.
108.
};
109.
110.
}();
111.
</script>