ใบ transcript จะทำไงอ่ะครับ ผมจะทำ รายงานผลการเรียน ให้เป็นลักษณะเหมือน Transcript
เล่นคำถามกว้างแบบนี้ คงหาคำตอบยากครับ
และอีกอย่าง ไม่มีใครเห็นโค๊ดที่เขียน ก็ไม่รู้จะช่วยแก้ไขกันยังไง
โพสต์โค๊ดไว้นะครับ
Date :
2009-08-27 10:00:03
By :
deawx
ขอ โค้ด นีสสสนึงนะครับ
Date :
2009-08-27 10:06:07
By :
Sek-Artdrinker
ตอบง่ายๆนะครับ ก็เอา ปีไปเป็นหัว คอลั่มครับ(อย่าโกรธนะถามกว้างไปครับ)
อ่านเพิ่มเติ่มได้ที่ http://www.thaiems.net
Date :
2009-08-27 11:53:48
By :
konlata
เป็นใบแสดงผลการเรียนแบบในรูปอ่ะครับ ส่วนโค้ดดังข้างล่างนี้ครับ
<?php
if(isset($_GET['id'])){
$bID = $_GET['id'];
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$today = date("F j, Y");
mysql_select_db($database_conn_grade, $conn_grade);
$query_rcsReport = "SELECT tblgrade.stdcode,tblgrade.semester, tblgrade.year, tblgrade.coursecode, tblgrade.credit, tblgrade.grade FROM tblgrade WHERE (((tblgrade.stdcode)=".$_GET['id'].")) ORDER BY tblgrade.year ";
$rcsReport = mysql_query($query_rcsReport, $conn_grade) or die(mysql_error());
$row_rcsReport = mysql_fetch_assoc($rcsReport);
$totalRows_rcsReport = mysql_num_rows($rcsReport);
mysql_select_db($database_conn_grade, $conn_grade);
$query_rcsGroupSem = "SELECT stdcode, semester, year FROM tblgrade WHERE stdcode = ".$_GET['id']." GROUP BY tblgrade.semester, tblgrade.year ORDER BY tblgrade.year ";
$rcsGroupSem = mysql_query($query_rcsGroupSem, $conn_grade) or die(mysql_error());
$row_rcsGroupSem = mysql_fetch_assoc($rcsGroupSem);
$totalRows_rcsGroupSem = mysql_num_rows($rcsGroupSem);
mysql_select_db($database_conn_grade, $conn_grade);
$query_rcsLinktbl = "SELECT Tblgrade.stdcode, Tblgrade.semester, Tblgrade.year, Tblgrade.coursecode, Tblcourse.Course_Title, Tblgrade.credit, Tblgrade.grade, Tbltypegrade.Gvalue FROM (Tblgrade INNER JOIN Tblcourse ON Tblgrade.coursecode = Tblcourse.Course_Code) INNER JOIN Tbltypegrade ON Tblgrade.grade = Tbltypegrade.Gtype WHERE (((tblgrade.stdcode)=".$_GET['id'].")) ORDER BY tblgrade.year, tblgrade.coursecode";
$rcsLinktbl = mysql_query($query_rcsLinktbl, $conn_grade) or die(mysql_error());
$row_rcsLinktbl = mysql_fetch_assoc($rcsLinktbl);
$totalRows_rcsLinktbl = mysql_num_rows($rcsLinktbl);
mysql_select_db($database_conn_grade, $conn_grade);
$query_rscMember = "SELECT Tblmember.Username, Tblmember.Prefix_Name_E, Tblmember.FirstName, Tblmember.LastName, Tblmember.Thesis_Advisor, Tblmember.Thesis_Title, Tblmember.Degree, Tblmember.Program, Tblmember.UniBase FROM Tblmember WHERE (((Tblmember.Username)=".$_GET['id'].")); ";
$rscMember = mysql_query($query_rscMember, $conn_grade) or die(mysql_error());
$row_rscMember = mysql_fetch_assoc($rscMember);
$totalRows_rscMember = mysql_num_rows($rscMember);
?>
<table width="95%" border="5" align="center" bordercolor="#999999">
<tr>
<td height="805"><table width="100%" height="779" border="0" align="center" bgcolor="#FFFFFF">
<tr>
<td height="55" valign="top"><div align="right"><img src="images/jgseelogo_update.gif" width="270" height="56" /></div></td>
</tr>
<tr>
<td valign="top"><div align="center" class="style1 style2">Interim Grade Report</div>
<div align="center" class="style1">
<table width="100%" border="0">
<tr>
<td width="26%" height="25"><div align="left"><strong>Student Code :</strong><br />
</div></td>
<td width="74%"><div align="left"><?php echo $row_rcsReport['stdcode']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>Name of Student :</strong></div></td>
<td><div align="left"><?php echo $row_rscMember['Prefix_Name_E']; ?> <?php echo $row_rscMember['FirstName']; ?> <?php echo $row_rscMember['LastName']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>Name of Supervisor :</strong></div></td>
<td><div align="left"><?php echo $row_rscMember['Thesis_Advisor']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>Thesis Topic :</strong></div></td>
<td><div align="left"><?php echo $row_rscMember['Thesis_Title']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>Degree :</strong></div></td>
<td><div align="left"><?php echo $row_rscMember['Degree']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>Field of Study :</strong></div></td>
<td><div align="left"><?php echo $row_rscMember['Program']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>University Base :</strong></div></td>
<td><div align="left"><?php echo $row_rscMember['UniBase']; ?></div></td>
</tr>
<tr>
<td><div align="left"><strong>Process Date :</strong></div></td>
<td><div align="left"><?php echo $today ; ?></div> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div align="center" class="style1">
<div align="center" class="style1">
<table width="100%" border="0">
<tr>
<td width="15%"><div align="left"><strong>Semester</strong></div></td>
<td width="17%"> </td>
<td width="41%"><div align="left"><strong>Subject</strong></div></td>
<td width="13%"><div align="center"><strong>Credits</strong></div></td>
<td width="13%"><div align="center"><strong>Grade</strong></div></td>
</tr>
<?php
$i=1;
do {
$credit1 = $row_rcsLinktbl['credit'];
$accum1 = $row_rcsLinktbl['Gvalue'];
$cre1acc1 = number_format($credit1 * $accum1);
?>
<tr>
<td><div align="left"><?php echo $row_rcsLinktbl['semester']; ?> / <?php echo $row_rcsLinktbl['year']; ?></div></td>
<td><div align="left"><?php echo $row_rcsLinktbl['coursecode']; ?></div></td>
<td><div align="left"><?php echo $row_rcsLinktbl['Course_Title']; ?></div></td>
<td><div align="center"><?php echo $row_rcsLinktbl['credit']; ?></div></td>
<td><div align="center"><?php echo $row_rcsLinktbl['grade']; ?></div></td>
</tr>
<?php
$credit = $row_rcsLinktbl['credit']; //เก็บค่าหน่วยกิตเข้าตัวแปร
$accum = $row_rcsLinktbl['Gvalue']; //เก็บค่าของเกรดเข้าตัวแปร
$cre1acc1 = number_format($credit1 * $accum1); //ผลคูณของหน่วยกิตกับค่าของเกรดที่ได้
$total_credit = $total_credit + $credit; //หน่วยกิตรวมที่เรียนทั้งหมด
$total_accum = $total_accum + $accum; // ค่าของเกรดรวมที่ได้
$total_cre1acc1 = $total_cre1acc1 + $cre1acc1; // ผลรวมหน่วยกิตที่ได้ตามค่าของเกรด
$i++;
} while ($row_rcsLinktbl = mysql_fetch_assoc($rcsLinktbl)); ?>
<tr>
<td> </td>
<td colspan="2">Total Registration Credits</td>
<td><?php echo number_format($total_credit); ?></td>
<td> </td>
<td width="1%"> </td>
</tr>
<tr>
<td> </td>
<td colspan="2">Total accumulative Credits</td>
<td><?php echo number_format($total_credit ); ?></td>
<!--td><?php //echo $total_cre1acc1/ $total_credit ?></td-->
<td> </td>
<td> </td>
</tr>
</table>
Date :
2009-08-28 16:19:49
By :
balloonzang
ได้โปรดครับ ผู้รู้ช่วยตอบทีเถิด
Date :
2009-08-30 23:20:11
By :
balloonzang
Load balance : Server 01