|
dapat ape?...yg markah n gred tu kan yg coding board bg tu...aku try edit nak buat mcm table kat atas tu...xjd... |
|
|
|
|
|
|
|
cane board...mmc mane nak buat yg table mcm yg aku post tu? |
|
|
|
|
|
|
|
nama student tu nk letak kat mana n??? |
|
|
|
|
|
|
|
nama student letak kat sebelah subjek... |
|
|
|
|
|
|
|
n list kan semua nama.. tak berapa cantik
- $conn = mysql_connect($host, $user, $passwd) or die(mysql_error());
- $link = mysql_select_db($db, $conn) or die(mysql_error());
- $pass_mark = 50;
- function grade($mark){
- global $pass_mark;
- if(is_numeric($mark)){
- switch($mark):
- case $mark>=90:
- $grade='A';
- break;
- case $mark>=80&&$mark<90:
- $grade='B';
- break;
- case $mark>=70&&$mark<80:
- $grade='C';
- break;
- case $mark>=60&&$mark<70:
- $grade='D';
- break;
- case $mark>=50&&$mark<60:
- $grade='E';
- break;
- case $mark<$pass_mark:
- $grade='F';
- break;
- endswitch;
- return $grade;
- }
- }
- $sql = "SELECT * FROM student ORDER BY name";
- $query = mysql_query($sql);
- ?>
- <table border="1">
- <tr>
- <td>Name</td>
- <td>Subject</td>
- <td>Mark</td>
- <td>Gred</td>
- </tr>
- <? while($row=mysql_fetch_assoc($query)){ ?>
- <tr>
- <td><?= $row['name'] ?></td>
- <td><?= $row['subject'] ?></td>
- <td><?= $row['mark'] ?></td>
- <td<?= grade($row['mark'])=='F'?' style="color:#FF0000"':''?>><?= grade($row['mark']) ?></td>
- </tr>
- <? } ?>
- </table>
Copy the Code |
|
|
|
|
|
|
|
n pulak group by name
- $conn = mysql_connect($host, $user, $passwd) or die(mysql_error());
- $link = mysql_select_db($db, $conn) or die(mysql_error());
- $pass_mark = 50;
- function grade($mark){
- global $pass_mark;
- if(is_numeric($mark)){
- switch($mark):
- case $mark>=90:
- $grade='A';
- break;
- case $mark>=80&&$mark<90:
- $grade='B';
- break;
- case $mark>=70&&$mark<80:
- $grade='C';
- break;
- case $mark>=60&&$mark<70:
- $grade='D';
- break;
- case $mark>=50&&$mark<60:
- $grade='E';
- break;
- case $mark<$pass_mark:
- $grade='F';
- break;
- endswitch;
- return $grade;
- }
- }
- $sql = "SELECT name FROM student GROUP BY name";
- $query = mysql_query($sql);
- ?>
- <table border="1">
- <tr>
- <td>Name</td>
- <td>Subject</td>
- <td>Mark</td>
- <td>Gred</td>
- </tr>
- <? while($row=mysql_fetch_assoc($query)){ ?>
- <tr>
- <td colspan="4"><?= $row['name'] ?></td>
- </tr>
- <?
- $sql2 = "SELECT * FROM student WHERE name = '".$row['name']."' ORDER BY subject";
- $query2 = mysql_query($sql2);
- while($row2=mysql_fetch_assoc($query2)){
- ?>
- <tr>
- <td> </td>
- <td><?= $row2['subject'] ?></td>
- <td><?= $row2['mark'] ?></td>
- <td<?= grade($row2['mark'])=='F'?' style="color:#FF0000"':''?>><?= grade($row2['mark']) ?></td>
- </tr>
- <? }} ?>
- </table>
Copy the Code |
|
|
|
|
|
|
|
Board
Camna yang orang buat kalau nak pilih tarikh keluar calendar kecik then user boleh main click-click kat kalendar tu, terus jadi value field tu?
Aku nak buat ler.. hehe.. nampak pro |
|
|
|
|
|
|
|
board.....cane ek nak buat...based on pic bawah nie,...
dlm table temujanji aku tu ader status............so kalo kite terima..status dier akan tulis "Temujanji anda telah diterima"...
pastu kalo tolak..."Temujanji anda telah ditolak.."...
so aku nak create 1 lagi entiti iaitu status2..........status2 ni dier akan simpan nilai 1 kalo terima n nilai 0 kalo tolak...
sebabnya nanti aku nak display temujanji yg diterima je.... so cane ek kalo kite terima pastu dier simpan dlm status2 tu 1..........
ke board ade cara lain?
aku try letak "Temujanji anda telah ditolak.." as value dlm textfield...n name sbg status
pastu bile panggil aku wat gini
$status =&_POST['status'];
$sql="SELECT * FROM temujanji WHERE status = '$status' order by bil DESC";
tp dier xkuar gak....
lepas tu aku try la create dlm db tu aku letakla status2 tu nilai 1..........yg ni aku insert sindri dlm db...n then aku try panggil
$sql="SELECT * FROM temujanji WHERE status2 = 1 order by bil DESC";
dier jadik....so aku plan nak bwat mcm nie la....tp yg masalahnye cane aku nak masukkan nilai status2 tu adalah 1 bile aku Terima n nilai 0 bila aku Tolak.....
[ Last edited by pzan213 at 18-3-2009 02:48 ] |
|
|
|
|
|
|
|
board xde keee |
|
|
|
|
|
|
|
tak berapa nak faham soalan........
dah 4x baca..... |
|
|
|
|
|
|
|
ye ke xpaham..huhuhu...mcm nie...
dlm table temujanji tu kirenye ader 2 entiti.... status dan status2......kirenya status tu akan pegang nilai "temujanji diterima" dan status2 akan pegang nilai 1 bila pilih TERIMA dan HANTAR
n status tu akan pegang nilai "Temujanji Ditolak" dan status2 akan pegang nilai 0 bila pilih TOLAK n HANTAR....
lebey kurang mcm ni la...
Jika user memilih TERIMA........dier akan simpan status="Temujanji Diterima" and status2= 1
Jika user memilih TOLAK........dier akan simpan status="Temujanji Ditolak" and status2=0
so mcm mane carenye nak simpan dlm db ek?...nak kene wat syarat ke ape?
[ Last edited by pzan213 at 20-3-2009 03:28 ] |
|
|
|
|
|
|
|
mcm ni la...
page1
<form name="form1" method="post" action="page2.php">
 <select name="status" id="status">
            <option value="1">Terima</option>
            <option value="0">Tolak</option>
          </select>
          <input name="Submit" type="submit" id="Submit" value="Hantar">
page2
$status=$_POST['status'];
if ($status = "1")
                 {
                         UPDATE temujanji  SET status='Temujanji Anda Telah Dipersetujui. Sila datang pada hari dan tarikh yang telah ditetapkan.' and status2= '1'    WHERE bil = '$bil' "; 
}
else
                 ($status = "0")
          
                 {
 UPDATE temujanji  SET status='Temujanji Anda Telah ditolak. Sila membuat temujanji pada waktu yang lain. Terima kasih' and status2= '0' WHERE bil = '$bil' "; 
}
cane nak buat camni?kalo status 1 or 0 dier akan update mcm kat atas...
[ Last edited by pzan213 at 21-3-2009 00:10 ] |
|
|
|
|
|
|
|
xpela..dah dpt |
|
|
|
|
|
|
|
Originally posted by BorderManager at 12-3-2009 01:34
n list kan semua nama.. tak berapa cantik
$conn    = mysql_connect($host, $user, $passwd) or die(mysql_error());
$link    = mysql_select_db($db, $conn) or die(mysql_error());
$pass_mark = 50;
...
board..kalo nak kira jumlah markah n jumlah gred cane? |
|
|
|
|
|
|
|
buat mcm kat atas tu
1st create function - utk set kan mark sekian2 berapa grade dia
2nd call function tersebut
- <td<?= grade($row2['mark'])=='F'?' style="color:#FF0000"':''?>><?= grade($row2['mark']) ?></td>
Copy the Code |
|
|
|
|
|
|
|
Aku nak generate pdf file dari report2 yang aku buat.
Aku ada donwload 2-3 class pdf php tapi semuanya sangat2 blur dan banyak sangat coding.. aku bukan nak buat graf ke buat bulatan atau coloring bentuk cantik cantik... apa yang aku nak just apa yang report kuar tu lah yang kuar kat pdf.
Ada simple way tak? |
|
|
|
|
|
|
|
ko guna fpdf....
tapi buat pdf n memang pening, kalau aku org suruh buat report, 1 pdf tu paling kurang aku ambil RM300 |
|
|
|
|
|
|
| |
|