Most of my career as programmer spend developing programs using PHP and MySQL. In this article I would like to share my program that I wrote a long time ago I called this program Student Grading System in PHP and MySQL. This program will compute and store the grades of the student in MySQL.
People here in the Philippines can reach me at my mobile number 09173084360.
Thank you very much and Happy Programming.
Sample Program Output
Program Listing
grade.php
<?php
/* Student Grade System
Author : Jake R. Pomperada
Date : October 5, 2011 Wednesday
Tool : PHP/MySQL
*/
// Block any possible error from the browser
error_reporting(0);
?>
<?php
$name =$_REQUEST['name'];
$course = $_REQUEST['course'];
$sex = $_REQUEST['sex'];
$department = $_REQUEST['department'];
$subject =$_REQUEST['subject'];
$contact = $_REQUEST['contact'];
if (isset($_REQUEST['solve']))
{
$prelim = $_REQUEST['prelim'];
$midterm = $_REQUEST['midterm'];
$final = $_REQUEST['final'];
$solve1 = ($_REQUEST['prelim'] * 0.2);
$solve2 = ($_REQUEST['midterm'] * 0.3);
$solve3 = ($_REQUEST['final'] * 0.5);
$add = ($solve1 + $solve2 + $solve3);
$endterm = round($add);
if ($add >= 75)
{
$remarks = "PASSED";
}
else {
$remarks = "FAILED";
}
}
if (isset($_REQUEST['clear']))
{
$name = "";
$course = "";
$subject="";
$department = "";
$contact = "";
$prelim = "";
$midterm = "";
$final = "";
$endterm = "";
$remarks = "";
}
if (isset($_REQUEST['save']))
{
$name = strtoupper($_REQUEST['course']);
$course = strtoupper($_REQUEST['course']);
$deparment = strtoupper($_REQUEST['department']);
$sex = strtoupper($_REQUEST['sex']);
$contact = $_REQUEST['contact'];
$prelim = $_REQUEST['prelim'];
$midterm = $_REQUEST['midterm'];
$final = $_REQUEST['final'];
$endterm = $_REQUEST['endterm'];
$remarks = strtoupper($_REQUEST['remarks']);
//CONNECT TO DATABASE--------------------
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("grade", $con);
/*
* Specify the field names that are in the form. This is meant
* for security so that someone can't send whatever they want
* to the form.
*/
$allowedFields = array(
'name',
'course',
'subject',
'department',
'contact',
'prelim',
'midterm',
'final',
'endterm',
'remarks'
);
// Specify the field names that you want to require...
$requiredFields = array(
'name',
'course',
'subject',
'department',
'contact',
'prelim',
'midterm',
'final'
);
$errors = array();
foreach($_POST AS $key => $value)
{
// first need to make sure this is an allowed field
if(in_array($key, $allowedFields))
{
$$key = $value;
// is this a required field?
if(in_array($key, $requiredFields) && $value == '')
{
$errors[] = "The field $key is required.";
}
}
}
// were there any errors?
if(count($errors) > 0)
{
$errorString = '<p>There was an error processing the form.</p>';
$errorString .= '<ul>';
foreach($errors as $error)
{
$errorString .= "<li>$error</li>";
}
$errorString .= '</ul>';
echo $errorString;
}
else {
$sql = "INSERT INTO info ";
$sql .= " (name,course,subject,department,gender,contact,prelim";
$sql .= " ,midterm,final,endterm,remarks)";
$sql .= "VALUES";
$sql .= "('$name', '$course', '$subject', '$department', '$sex'";
$sql .= " ,'$contact','$prelim','$midterm','$final','$endterm','$remarks')";
if(!$b=mysql_query($sql)){
echo mysql_error();
}
else {
echo "<center>";
echo "<h4> Record is Successfully added in the Database.</h4>";
echo "</center>";
}
}
}
?>
<html>
<head>
<STYLE type="text/css">
h2 {
text-align:center;
color: white; /* text color is white */
background: green; /* Content, padding will be blue */
margin: 12px 12px 12px 30px;
padding: 12px 0px 12px 12px; /* Note 0px padding right */
list-style: none /* no glyphs before a list item */
/* No borders set */
}
</STYLE>
</head>
<body>
<h2> <marquee direction=left behavior=alternate>
ABC College Student Grading System </marquee> </h2>
<br>
<FORM NAME="form1" METHOD="POST" ACTION="">
<TABLE BORDER="0">
<tr> </tr> <tr> </tr>
<TR>
<TD>Student Name</TD>
<TD>
<INPUT TYPE="TEXT" NAME="name" SIZE="30"MAXLENGTH=30
value="<?php echo $name; ?>">
<TD> Course</TD>
<TD>
<INPUT TYPE="TEXT" NAME="course" SIZE="33" MAXLENGTH=35
value="<?php echo $course; ?>">
</TD>
</TR>
<tr> </tr> <tr> </tr>
<tr> </tr> <tr> </tr>
<TR>
<TD>Prelim Grade</TD>
<TD><INPUT TYPE="TEXT" NAME="prelim" SIZE="1" MAXLENGTH=3
value="<?php echo $prelim; ?>">
</TD>
<TD>Subject</TD>
<TD>
<INPUT TYPE="TEXT" NAME="subject" SIZE="35" MAXLENGTH=35
value="<?php echo $subject; ?>">
</TD>
</TR>
<tr> </tr> <tr> </tr>
<tr> </tr> <tr> </tr>
<TR>
<TD>Midterm Grade</TD>
<TD><INPUT TYPE="TEXT" NAME="midterm" SIZE="1" MAXLENGTH=3
value="<?php echo $midterm; ?>">
</TD>
<TD>Department</TD>
<TD>
<INPUT TYPE="TEXT" NAME="department" SIZE="40" MAXLENGTH=40
value="<?php echo $department; ?>">
</TD>
</TR>
<tr> </tr> <tr> </tr>
<tr> </tr> <tr> </tr>
<TR>
<TD>Final Grade</TD>
<TD><INPUT TYPE="TEXT" NAME="final" SIZE="1" MAXLENGTH=3
value="<?php echo $final; ?>">
</TD>
<TD>Gender</TD>
<td> <select name="sex">
<option>Male</option>
<option>Female</option>
</select>
</td>
</tr>
<tr> </tr> <tr> </tr>
<tr> </tr> <tr> </tr>
<tr>
<TD>Endterm Grade</TD>
<TD><INPUT TYPE="TEXT" NAME="endterm" SIZE="1" MAXLENGTH=3
value="<?php echo $endterm; ?>" READONLY>
</TD>
<TD>Contact Number</TD>
<TD>
<INPUT TYPE="TEXT" NAME="contact" SIZE="15" MAXLENGTH=15
value="<?php echo $contact; ?>">
</TD>
</tr>
<tr> </tr> <tr> </tr>
<tr> </tr> <tr> </tr>
<tr>
<TD>Remarks</TD>
<TD>
<INPUT TYPE="TEXT" NAME="remarks" SIZE="10"
value="<?php echo $remarks; ?>" READONLY>
</TD>
</TR>
</TABLE>
<!-- End of the Table -->
<P><input type="submit" name="solve" value="Compute">
<input type="submit" name="clear" value=" Clear ">
<input type="submit" name="save" value=" Save ">
</P>
</FORM>
</body>
</html>
grade.sql
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 05, 2011 at 12:11 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `grade`
--
-- --------------------------------------------------------
--
-- Table structure for table `info`
--
CREATE TABLE IF NOT EXISTS `info` (
`name` varchar(100) NOT NULL,
`course` varchar(100) NOT NULL,
`subject` varchar(100) NOT NULL,
`department` varchar(100) NOT NULL,
`gender` varchar(100) NOT NULL,
`contact` int(15) NOT NULL,
`prelim` int(3) NOT NULL,
`midterm` int(3) NOT NULL,
`final` int(3) NOT NULL,
`endterm` int(3) NOT NULL,
`remarks` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `info`
--
INSERT INTO `info` (`name`, `course`, `subject`, `department`, `gender`, `contact`, `prelim`, `midterm`, `final`, `endterm`, `remarks`) VALUES
('Jake Pomperada', 'BS Computer Science', 'Pascal Programming', 'Commerce', 'MALE', 4335081, 78, 89, 95, 90, 'PASSED'),
('Ma. Junallie Fuentebella', 'BS Chemical Engineering', 'Chemistry 1', 'Engineering', 'FEMALE', 4335675, 89, 78, 100, 91, 'PASSED'),
('Ana Tan', 'BS Accountancy', 'Financial Management', 'Commerce', 'FEMALE', 7078423, 78, 78, 79, 79, 'PASSED'),
('Tita Swarding', 'Mass Communication', 'Basic Journalism', 'Arts and Sciences', 'FEMALE', 7546348, 87, 89, 94, 91, 'PASSED'),
('Vincent Qui', 'BS Business Management', 'Accouting 101', 'Commerce', 'MALE', 999237563, 74, 83, 84, 82, 'PASSED'),
('Boy Cruz', 'BS Mathematics', 'Calculus', 'Education', 'MALE', 4567812, 65, 72, 76, 73, 'FAILED'),
('Juan Tamad', 'BS Secondary Education', 'Physical Education', 'Education', 'MALE', 4235562, 73, 65, 71, 70, 'FAILED');
Wooow, i like the way it works, but i was expecting more...
ReplyDeleteProgramming Source Codes And Computer Programming Tutorials: Student Grading System In Php And Mysql >>>>> Download Now
Delete>>>>> Download Full
Programming Source Codes And Computer Programming Tutorials: Student Grading System In Php And Mysql >>>>> Download LINK
>>>>> Download Now
Programming Source Codes And Computer Programming Tutorials: Student Grading System In Php And Mysql >>>>> Download Full
>>>>> Download LINK 6h
After this step they should implement their design at the backend of their system using MySql or MS SQL server, whichever they find convenient and then insert data in the tables of the software and run test queries to retrieve data and see for themselves if they are getting correct results.apdm
ReplyDeleteThank you. God bless.
ReplyDeleteZiyyara tutors encourage the students to get more comfortable with digital technology, which can be a perfect solution to get detailed understanding about new concepts. Choosing online tuition in UAE for the students becomes quite a confusing task for the parents who want to improve the academic performance of their children significantly. So, now getting the best and reliable tutor for Arab Emirates Online Classes online learning experience.
ReplyDeleteContact Us - +91-9654279131
Programming Source Codes And Computer Programming Tutorials: Student Grading System In Php And Mysql >>>>> Download Now
ReplyDelete>>>>> Download Full
Programming Source Codes And Computer Programming Tutorials: Student Grading System In Php And Mysql >>>>> Download LINK
>>>>> Download Now
Programming Source Codes And Computer Programming Tutorials: Student Grading System In Php And Mysql >>>>> Download Full
>>>>> Download LINK
Antalya
ReplyDeleteTrabzon
Niğde
Maraş
Antep
DYMN
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
1HU
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
BQ0
0FE0B
ReplyDeleteoxandrolone anavar for sale
sarms
oxandrolone anavar
Bartın Evden Eve Nakliyat
order fat burner
Çerkezköy Parke Ustası
Muğla Evden Eve Nakliyat
buy trenbolone enanthate
Antalya Evden Eve Nakliyat
5F730
ReplyDeleteÜnye Kurtarıcı
Kırşehir Lojistik
Bilecik Parça Eşya Taşıma
Yenimahalle Fayans Ustası
Urfa Evden Eve Nakliyat
Muş Evden Eve Nakliyat
Samsun Evden Eve Nakliyat
Pancakeswap Güvenilir mi
Rize Şehir İçi Nakliyat
D56A9
ReplyDeleteSamsun Lojistik
Ardahan Lojistik
Urfa Parça Eşya Taşıma
Sinop Evden Eve Nakliyat
Elazığ Parça Eşya Taşıma
Eskişehir Şehir İçi Nakliyat
Maraş Şehir İçi Nakliyat
Kars Parça Eşya Taşıma
Amasya Parça Eşya Taşıma
82679
ReplyDeleteÇerkezköy Oto Boya
Antep Parça Eşya Taşıma
Bursa Şehirler Arası Nakliyat
Iğdır Lojistik
Maraş Şehir İçi Nakliyat
Kocaeli Evden Eve Nakliyat
Bilecik Parça Eşya Taşıma
Sakarya Şehir İçi Nakliyat
Elazığ Parça Eşya Taşıma
C1FF3
ReplyDeleteIğdır Evden Eve Nakliyat
Uşak Şehirler Arası Nakliyat
Sincan Parke Ustası
Yozgat Parça Eşya Taşıma
Samsun Lojistik
Ünye Koltuk Kaplama
Zonguldak Şehir İçi Nakliyat
Ünye Halı Yıkama
Yalova Lojistik
8425A
ReplyDeleteKripto Para Nasıl Oynanır
Bitcoin Madenciliği Siteleri
Binance Neden Tercih Edilir
Gate io Borsası Güvenilir mi
Periscope Beğeni Satın Al
Bitcoin Nasıl Çıkarılır
Spotify Dinlenme Satın Al
Big Wolf Coin Hangi Borsada
Spotify Dinlenme Hilesi
24EE9
ReplyDeleteLikee App Beğeni Satın Al
Kripto Para Nedir
Coin Çıkarma
Bitcoin Nasıl Para Kazanılır
Linkedin Beğeni Satın Al
Facebook Takipçi Hilesi
Gate io Borsası Güvenilir mi
Binance Referans Kodu
Coin Madenciliği Nasıl Yapılır
41096
ReplyDeleteMEME Coin Hangi Borsada
Twitch İzlenme Satın Al
Soundcloud Takipçi Hilesi
Binance Referans Kodu
Binance Borsası Güvenilir mi
Kwai Beğeni Satın Al
Binance Kaldıraçlı İşlem Nasıl Yapılır
Coin Nasıl Üretilir
Kaspa Coin Hangi Borsada
E4D11
ReplyDeletezkswap
raydium
safepal
arbitrum
avax
poocoin
phantom
poocoin
galagames
fggvfhbghnghjjh
ReplyDeleteشركة رش مبيدات بالاحساء