|
 |
|
ด่วน !!! รบกวนช่วยเขียน โค้ด ตามตัวอย่างทีค่ะ สำคัญจริงค่ะ !!!! |
|
 |
|
|
 |
 |
|
เอ้าได้เวลาทดสอบเทพแห่ง php ได้ ออกอาวุธกันแล้ว
เช้าแล้ว ลุยยย
พอดีผมทำเกี่ยวกะระบบนี้พอดี แต่ยังไม่ลงโค๊ด เด่วรอให้คนอื่นทำก่อน.. เด่วผมฝอยต่อท้าย..
แบไต๋ก่อน สำหรับผมจะยัด ลง Array ก่อนค่อย เอามา show เด่วรอท่านอื่นตอบก่อนครับ..
|
 |
 |
 |
 |
Date :
2009-09-01 08:45:19 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มาตอนตี 03:36:42 แล้วจะส่งการบ้านวันไหน เหรอเนี่ย ถ้าวันนี้คงไม่มีครัยทำให้ได้หรอก ครับเพราะทุกคนก็ต่างมีหน้าที่ๆ ต้องทำประจำวันอยู่แล้ว
หรือท่านใดว่างก็ช่วยน้องเค้าหน่อย ละกันครับ
|
 |
 |
 |
 |
Date :
2009-09-01 10:25:01 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอ๊วววบร๊ะจร้าวว
เอางี้ละครับครับ ผมรอดนเติบ แระ แสดงว่ายังไม่มีคนตอบ
ผมจะให้ไกด์
Code (PHP)
<?php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.:: ทดสอบกรอกเกรด by Deawx ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
$actions = $_REQUEST['actions'];
if (!isset($actions)) {
$actions = "addgrade";
}
switch($actions) {
default:
?>
<form action="<?$PHP_SELF?>?actions=0" method="post" >
<table cellpadding="0" cellspacing="1" width="100%">
<tr>
<td ><div align="center"><strong>No</strong></div></td>
<td ><strong>รหัสวิชา</strong></td>
<td class="style1" >วิชา</td>
<td class="style1" >หน่วยกิต</td>
<td class="style1" >เกรด</td>
</tr>
<?php
for($i=1;$i<=8;$i++){ ?>
<tr>
<td><div align="center"><strong>
<?=$i?>
</strong></div></td>
<td ><input name="ids[]" type="text" id="ids[]" value="<?=str_pad($i,6,"0", STR_PAD_LEFT)?>">
</td>
<td ><input name="idn[]" type="text" id="idn[]" value="xxx-<?=rand().str_pad($i,6,"0", STR_PAD_RIGHT)?>">
</td>
<td ><input name="nk[]" type="text" id="nk[]" value="<?=rand(1, 4);
?>">
</td>
<td ><input name="gpa[]" type="text" id="gpa[]">
</td>
</tr>
<? } ?>
<tr>
<td colspan="5" ><input name="Submit" type="submit" id="Submit" value="ตกลง" /></td>
</tr>
</table>
</form>
<?php
break;
case "0":
$data = ( $_POST );
reset($data);
$a = $data[ids];
$b = $data[idn];
$c = $data[nk];
$d = $data[gpa];
?>
<table border="1" cellpadding="0" cellspacing="1" width="100%">
<tr>
<td ><div align="center"><strong>No</strong></div></td>
<td ><strong>รหัสวิชา</strong></td>
<td class="style1" >วิชา</td>
<td class="style1" >หน่วยกิต</td>
<td class="style1" >เกรด</td>
</tr>
<?php
for($i=0;$i<=count($a)-1;$i++){
?>
<tr>
<td ><div align="center"><strong>
<?=$i?>
</strong></div></td>
<td ><strong>
<?=$data[ids][$i];?>
</strong></td>
<td><?=$data[idn][$i];?></td>
<td><?=$data[nk][$i];?></td>
<td><?=$data[gpa][$i];?></td>
</tr>
<?php
}
?>
<tr>
<td > </td>
<td > </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td ><div align="right">หน่วยกิต :</div></td>
<td ><?=array_sum($c)?></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?php
break;
}
?>
</body>
</html>
?>
|
 |
 |
 |
 |
Date :
2009-09-01 10:29:48 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ส่วนการคิดค่า GPA ผมไม่รู้จริงๆ อ่ะ ว่ามันมีสูตรยังไง
deawx
[email protected]
ปรึกษา PHP ฟรีจ้า
|
 |
 |
 |
 |
Date :
2009-09-01 10:34:28 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
$arr_grade = array("A"=>4,"B+"=>3.5,"B"=>3,"C+"=>2.5,"C"=>2,"D+"=>1.5,"D"=>1,"F"=>0);
$form_cr = array(3,2,3,3); // หน่วยกิจ
$form_gps = array("B","B+","A","C"); //เกรด
echo "วิชา | หน่วยกิจ | เกรด<br>";
for($g=0; $g<count($form_cr ); $g++){
echo "วิชา".($g+1)." | ".$form_cr[$g]." | ".$form_gps[$g]."<br>";
$cr = $cr+$form_cr[$g];
$gps = $gps+($form_cr[$g]*$arr_grade[$form_gps[$g]]);
}
$gps = $gps/$cr;
echo $gps;
?>
|
 |
 |
 |
 |
Date :
2009-09-01 11:06:10 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ deawx ผมขออนุญาติแอดเมล์หนะครับ
|
 |
 |
 |
 |
Date :
2009-09-01 11:19:00 |
By :
chaiwit |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบพระคุณทุกท่านที่เมตตาช่วยเหลือค่ะ
เดี๋ยวหนูจะทดลองใช้ดูค่ะ
ขอบคุณจริงๆค่ะ
|
 |
 |
 |
 |
Date :
2009-09-01 12:40:51 |
By :
เหมียว |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอ แอดเมลล์นะงับ
|
 |
 |
 |
 |
Date :
2009-09-01 18:32:44 |
By :
popnakub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
-ขอแอดเมลล์ด้วยนะครับ คุณ dreamx
|
 |
 |
 |
 |
Date :
2009-09-01 20:21:07 |
By :
iruka1258 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|