CAPÍTULO 1. MARCO TEÓRICO
1.3 MARCO CONCEPTUAL
On the homepage, click “Accounts” link
The site will direct you to the administrator‟s page. On the left panel, click “Update Events”
Below the “News and Updates” header title, click “Add NEWS”
Fill in the event title, date, body and picture. Click “Choose File” button to choose a picture.
When done, click “Create New Event”
To edit news:
On the homepage, click “Accounts” link
The site will direct you to the administrator‟s page. On the left panel, click “Update Events”
Below the “News and Updates” header title, click “Edit NEWS” When done, click “Update Event”
To delete news:
On the homepage, click “Accounts” link
The site will direct you to the administrator‟s page. On the left panel, click “Delete Events”
Select a row from the list of events
Below the “News and Updates” header title, click “Delete NEWS”. Click “OK” to delete or “Cancel” to abort.
Moderate Forum To moderate forum:
On the homepage, click “Accounts” link
The site will direct you to the administrator‟s page. On the left panel, click “Moderate Forum”
Click “Delete” to delete report or “Ignore” to ignore the report.
Unblock Members To unblock members:
On the homepage, click “Accounts” link
The site will direct you to the administrator‟s page. On the left panel, click “Unblock Members” The “Unblock Form” will appear.
Select a member to unblock.
Web-Based Student Guidance Information System For Marcelo H. Del Pilar National High School
$(document).ready(function (){ $("#btncancel").click(function (){
$("#sign").dialog('close'); });
$("#btadd").click(function (){ var section = $("#section"); var username = $("#uname"); var password = $("#password"); var cpassword = $("#cpassword"); var email = $("#email");
var pass = password.val().length; if( section.val() == "" || section.val() == " "){
$("#amsg1").text("* Please enter section");
$("#amsg2").text("* Complete all the fields to save student records!"); section.focus();}
else if( email.val() == "" || email.val() == " "){
$("#amsg1").text("* Please enter an email address");
$("#amsg2").text("* Complete all the fields to save student records!"); email.focus();}
else if(!isValidEmail( email.val() ) ){
$("#amsg1").text("* Please enter a valid email address");
$("#amsg2").text("* Complete all the fields to save student records!"); email.focus();} else{ isExistemail(section,email,username,password,cpassword); }});}); function isExistemail(section,email,username,password,cpassword){ $.ajax ({ url:"templates/isemail_exist.php?email="+email.val(), success:function(data){ if(data == 1){
$("#amsg1").text("* Email address already exists");
$("#amsg2").text("* Complete all the fields to save student records!"); email.focus();}
else{
checkusername(section,email,username,password,cpassword);} }});}//end of function isexistemail
function checkusername(section,email,username,password,cpassword){ if(username.val() == "" || username.val() ==" "){
$("#amsg1").text("* Please enter a username");
$("#amsg2").text("* Complete all the fields to save student records!"); username.focus();}
else{
$.ajax ({
url:"templates/S_checkuname.php?uname="+username.val(), success:function(data){
if(data == 11){
$("#amsg1").text("* Username already exists");
$("#amsg2").text("* Complete all the fields to save student records!"); username.focus();}
else if(data == 10 || data == 01 ){
$("#amsg1").text("* Username already exists");
$("#amsg2").text("* Complete all the fields to save student records!"); username.focus();}
else if(password.val() == "" || password.val() == " "){ $("#amsg1").text("* Please enter password");
$("#amsg2").text("* Complete all the fields to save student records!"); password.focus();}
else if(password.val().length <= 6){
$("#amsg1").text("* Password too short.Please enter at least 7 characters."); $("#amsg2").text("* Complete all the fields to save student records!"); password.focus();}
else if(cpassword.val() != password.val()){
$("#amsg1").text("* Password did not match.");
$("#amsg2").text("* Complete all the fields to save student records!"); password.focus();} else{exist(section,username,password,email) } }});}}//end of checkusername function exist(section,username,password,email) { $.ajax({
url: "templates/S_stud.php?section="+section.val() + "&username="+username.val() +"&password="+password.val()+ "&email="+email .val(),
success: function(data) {
if (data == 0) {
$("#disapprove").dialog({
modal:true, width:350, height: 200, show: "fade",hide: "fade", buttons: {OK: function() {
$( this ).dialog( "close" );
$("#sign").dialog( "close" ); }},}); $("#disapprove").load();}
else {
$("#add").dialog({
$("#add").load();}}}); } function sendemail(email,username,password){
var url = "templates/sendemail.php";
$.post(url,{username:username.val(), password:password.val(),email:email.val()}, function(data){}); }
function isValidEmail(strEmail){ var validRegExp;
validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; // search email text for regular exp matches if (strEmail.search(validRegExp) == -1){
return false; } return true; }
</script>
<div id="add" title="" style="display:none">Your account details has been saved. <br>Please wait for the approval of the administrator!</div>
<div id="disapprove" title="" style="display:none">This account details is not accepted! <br> Please make sure that you are a enrolled student of MHPNHS.</div>
<div id="signup_table" align="center"> <div id="dialogbox"></div>
<i><label id="amsg1" style="border:hidden; font-size: 12px; color:#F00;"></label></i><br/>
<i><label id="amsg2" style="border:hidden; font-size: 12px; color:#F00;"></label></i> <table>
<tr>
<td align="right">Student No.:</td>
<td><input type="text" name="section" id="section"style="width:190px;"/></td> </tr> <tr>
<td align="right">Email Address:</td>
<td> <input type="text" name="email" id="email"style="width:190px;"/></td> </tr> <tr>
<td align="right">Username:</td>
<td><input type="text" name="username" id="uname"style="width:190px;"/></td> </tr> <tr>
<td align="right">Password:</td>
<td><input type="password" name="password" id="password" style="width:190px;" /> </td>
</tr> <tr>
<td align="right">Confirm Password:</td>
<td><input type="password" name="cpassword" id="cpassword" style="width:190px;"/> </td>
</tr> <tr>
<input type="button" name="submit" value="Sign up" id="btadd"> <input type="button" name="cancel" value="Cancel" id="btncancel"> </td> </tr> </table> </div> Login Module <?php session_start(); include_once ("db_connect.php");
if(mysql_real_escape_string($_POST['username']) == "Enter Username") { echo "<script language='JavaScript'>";
echo "window.alert('Enter Username!')"; echo "</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=../index.php\">"; } else if(mysql_real_escape_string($_POST['password']) == "Enter Pasword")
{ echo "<script language='JavaScript'>"; echo "window.alert('Enter Password!')"; echo "</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=../index.php\">"; } else
{ $username = mysql_real_escape_string($_POST['username']); $pass = mysql_real_escape_string($_POST['password']);
$password = md5($pass);
$sql = mysql_query("SELECT * FROM login WHERE Username = '$username'") or die(mysql_error());
$numrows = mysql_num_rows($sql); if($numrows < 1)
{ echo "<script language='JavaScript'>"; echo "window.alert('Invalid Username!')"; echo "</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=../index.php\">"; } else
{ $sql1 = mysql_query("SELECT * FROM login WHERE Username = '$username'") or die(mysql_error());
while($row1 = mysql_fetch_array($sql1)) { $rownum = $row1['Password'];
$isblock = $row1['isblock']; $blockid = $row1['ID']; } if( $rownum != $password) { $pageblock++;
$isblock++;
mysql_query("UPDATE login set isblock=".$isblock." WHERE ID=".$blockid." "); echo "<script language='JavaScript'>";
echo "window.alert('You have been block in the system please contact your administrator')";
echo "</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=../index.php\">"; } else if ($isblock !=3)
{ $sql = mysql_query("SELECT * FROM login WHERE Username = '$username' AND Password='$password'") or die(mysql_error()); while($row = mysql_fetch_array($sql)) { $name = $row['name']; $id = $row['ID']; $cid = $row['stud_id']; $password = $row['Password']; $type = $row['type']; $year = $row['year_level']; }
mysql_query("UPDATE login set isblock='0' WHERE ID=".$id." "); $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $password; $_SESSION['id'] = $id; $_SESSION['cid'] = $cid; $_SESSION['name'] = $name; $_SESSION['year'] = $year; if($type == "a") { $_SESSION['type'] = $type; header("location:Home_Admin.php?name=$name"); } else if($type == "b") { $_SESSION['type'] = $type; header("location:Home_User.php?name=$name"); } else if($type == "c") { $_SESSION['type'] = $type; header("location:Home_Counselor.php?name=$name"); } else if($type == "d") { $_SESSION['type'] = $type; header("location:Home_Adviser.php?name=$name"); }}} } ?> Index Module <html> <head> <title>mhpnhs-guidance</title>
<link rel="shortcut icon" href="images/favcon.ico" />
<meta name="description" content="Web Base Student Guidance Information System" />
<meta name="keywords" content="Student Info, Online Counseling, ,Career Review, IQ and Personal Test" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/maincss_and_slide.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/pro_left_right.css">
<link type="text/css" rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css"/> <link type="text/css" rel="stylesheet" href="css/demos.css"/>
<script src="js/jquery-1.6.2.min.js" type="text/javascript" ></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script> <script language="JavaScript">
function validated(username,password){ var username = new String();
var password = new String(); username = $("#log").val(); password = $("#pwd").val();
var is_protocol_ok= username.indexOf("'"); var is_protocol_ok1= password.indexOf("'"); if (is_protocol_ok!=-1) { alert('Invalid Username'); return false; } if (is_protocol_ok1!=-1) { alert('Invalid Password'); return false; }
if(password =="Enter Pasword")
{ window.alert("Please enter your password!"); return false; }
if(username=="Enter Username"){
window.alert("Please enter your username!"); return false; } }
</script> <script src="js/slide.js" type="text/javascript"></script>
<style> .text-label {font-style:italic; color: #FFF; font-family:Verdana, Geneva, sans- serif;} </style> <script> $(document).ready(function() { $( "#signup" ).click(function(){ $("#close").click(); }); $( "#contact" ).click(function(){ $("#close").click(); }); $( "#signup" ).click(function(){
height: 300, show: "fade", hide: "explode" }); $("#sign").load("templates/signup.php"); }); $("#contact").click(function(){ $("#contactd").dialog({ modal:true, width:400, height: 260, show: "explode", hide: "explode" }); $("#contactd").load("templates/contact_admin.php"); }); $('input[type="text"]').each(function(){ this.value = $(this).attr('title'); $(this).addClass('text-label'); $(this).focus(function(){ if(this.value == $(this).attr('title')) { this.value = ''; $(this).removeClass('text-label'); } }); $(this).blur(function(){ if(this.value == '') { this.value = $(this).attr('title'); $(this).addClass('text-label'); } }); }); $('input[type="password"]').each(function(){ this.value = $(this).attr('title'); $(this).addClass('text-label'); $(this).focus(function(){ if(this.value == $(this).attr('title')) { this.value = ''; $(this).removeClass('text-label'); } }); $(this).blur(function(){ if(this.value == '') { this.value = $(this).attr('title'); $(this).addClass('text-label'); } }); }); }); </script> </head> <body>
<!--setting the msgbox div-->
<div id="sign" title="Sign Up"></div> <div id="contactd" title="Unblocked"></div> <!-- end-->
<!-- Panel -->
<div id="toppanel">
<div id="panel">
<div class="content clearfix"> <div class="left">
<!-- Login Form -->
<form class="clearfix" action="templates/Login2.php" method="post">
<h1>Welcome to Mhpnhs</h1>
<p style="font-size:9px; font-family:verdana, Geneva, sans-serif; text-align:justify;line- height:200%;" >
This site will establish an efficient and effective way of communication between the guidance office and students through online counseling and forums. It includes some features that are essential to students development such as personality test and IQ test, virtual bulletin board, career guidance, online counseling and forums.</p>
</form> </div>
<div class="left" style="text-align:center"> <!-- Login Form -->
<form class="clearfix" action="templates/Login2.php" method="post"> <h1>Member Login</h1>
<label class="grey" for="log" style="font-size:12px; font-family:verdana, Geneva, sans-serif; ">Username:</label>
<input class="field" type="text" name="username" title="Enter Username" id="log" value="" size="23"/>
<label class="grey" for="pwd" style="font-size:12px; font- family:verdana, Geneva, sans-serif; ">Password:</label>
<input class="field" type="password" name="password" title="Enter Password" id="pwd" size="23" /><br>
<center><input type="submit" name="submit" value="Login" class="bt_login" onClick="return validated(username,password)" style="margin- top:10px;"/></center></form>
</div>
<div class="left right"> <!-- Register Form -->
exclusively made for MHPNHS students.</p> <br>
<a href="#" id="contact" style="font-size:11px; font-family:verdana, Geneva, sans-serif; ">Request to unblock?</a> <br>
<a href="#" id="signup" style="font-size:11px; font-family:verdana, Geneva, sans-serif; ">Sign Up?</a> </center>
</form> </div> </div> </div> <!-- /login -->
<!-- The tab on top -->
<div class="tab"> <ul class="login"> <li class="left"> </li> <li>Hello Guest!</li> <li class="sep">|</li> <li id="toggle">
<a id="open" class="open" style="font-family:Tahoma, Geneva, sans-serif" href="#">Login</a>
<a id="close" style="display: none; font-family:Tahoma, Geneva, sans-serif" class="close" href="#">Close</a> </li>
<li class="right"></li> </ul>
</div> <!-- / top --> </div> <!--panel --> <div id="maintable" > <table id="innertable" width="100%" align="center" >
<tbody> <tr> <td id="tdheader"><div id="header"></div></td> </tr> <tr> <td align="center" id="tdcontaintent">
<div id="pro_linedrop"> <ul class="select">
<li><a href="templates/Homepage.php"
target="targetiframe1"><span style="margin-left:63px;">Home</span></a></li>
<li class="line"><a style="cursor:default;"><span>About Us</span></a> <ul class="sub">
<li><a href="templates/aboutus/History.php" target="targetiframe1">History</a></li> <li><a href="templates/aboutus/Goals&obj.php" target="targetiframe1">Goals and Objective</a></li>
<li><a href="templates/aboutus/Academic_information.php" target="targetiframe1">Academic Information</a></li>
<li><a href="templates/aboutus/School_service.php" target="targetiframe1">Service Information</a></li>
<li><a href="templates/aboutus/Rules_and_regulations.php" target="targetiframe1">Rules and Regulations</a></li>
</ul> </li>
<li class="line"><a href="templates/aboutus/Contact_us.php" target="targetiframe1"><span>Contact Us</span></a>
<li class="line"><a href="templates/aboutus/Helphome.php" target="targetiframe1"><span>Help</span></a>
</ul> </div> </td></tr> <tr> <td>
<iframe name="targetiframe1" style="border:thin; border:#F00; width:100%; height:462px" src="templates/Homepage.php"></iframe>
</td></tr>
<tr> <td valign="buttom"> <div id="footer" align="center"> <div align="center">
<font style="font-size:11px">Copyright 2012 © MHPNHS All rights reserved. <a href="#">mhpnhs-guidance.com</a></font>
<font style="font-size:11px">Developed by Zettabytes</font>
</div> </div> </td> </tr> </tbody> </table> </div> </div> </body> </html>
Adding an Account Module
<?php $attri = $_GET['attri']; include("../db_connect.php"); $sql="SELECT * FROM sy "; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) {$sy3 = $row['description'];}
$data = explode("-", $sy3);
$sql="SELECT * FROM student_info "; $result = mysql_query($sql);
while($row = mysql_fetch_array($result)) { $num = $row['stud_id'] + 1; }
$stunum= $data[0] . $num ; ?>
<html> <head> <title>Add Student</title> <script type="text/javascript">
function getvalue(year)
{ if (year=="") { year=0; } if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest(); }
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} xmlhttp.onreadystatechange=function()
{if (xmlhttp.readyState==4 && xmlhttp.status==200)
{document.getElementById("section").innerHTML=xmlhttp.responseText;}} xmlhttp.open("GET","add/getdata.php?year="+year,true); xmlhttp.send(); } </script> <script type="text/javascript"> $(document).ready(function () { $("#btadd").click(function () {
var sy = new String();var snum = new String();var fname = new String(); var mname = new String();var lname = new String();var year = new String(); var section = new String();var gname = new String();var gaddress = new String(); var gcontact = new String();var goccupation = new String();
sy = $("#sy").val(); snum = $("#snum").val();fname = $("#fname").val(); mname = $("#mname").val(); lname = $("#lname").val();year = $("#year").val(); section = $("#section").val();gname = $("#gname").val();
gaddress = $("#gaddress").val();gcontact = $("#gcontact").val(); if(sy ==0 )
{$("#amsg1").text("* Please select year level");
$("#amsg2").text("* Complete all the fields to save student records!"); } else if (section =="" || section == " " || section == "Enter Section") {$("#amsg1").text("* Please enter section");
$("#amsg2").text("* Complete all the fields to save student records!");} else if (gname == "" || gname == " " || gname == "Enter Full Name") { $("#amsg1").text("* Please enter guardian name");
$("#amsg2").text("* Complete all the fields to save student records!"); } else if (gaddress == "" || gaddress== " " || gaddress == "Address") {$("#amsg1").text("* Please enter address");
$("#amsg2").text("* Complete all the fields to save student records!");} else
{add(sy,snum,fname,mname,lname, year, section,gname,gaddress,gcontact);}}); function add(sy,snum,fname,mname,lname, year, section,gname,gaddress,gcontact)
{url: "add/A_stud.php?sy="+sy +"&snum="+snum +"&fname="+fname +"&mname="+ mname +"&lname="+lname +"&year="+year +"§ion="+section
+"&gname="+gname +"&gaddress="+gaddress +"&gcontact="+gcontact, success: function(data){
if (data == 1) { $("#add").dialog({
modal:true, width:350, height: 200, show: "fade",hide: "fade", buttons: {OK: function() {
$( this ).dialog( "close" );
$("#right_table").load("add/Add_student.php"); }},}); $("#add").load();} else {alert("dinasave"); }}}); </script> </head> <body>
<div id="add" title="ADD STUDENT" style="display:none"> New Student Record has been saved!</div>
<div id="addload" style="display:none"><img src="../images/load.gif" style="margin: 0px"></div>
<table align="center" style="font-size:15px background-color:#666"> <tr><td> <table style="margin-left:160px; margin-top:20px;" >
<tr> <td height="23px" colspan="2">
<i><label id="amsg1" style="border:hidden; font-size: 12px; color:#F00;"></label> </i><br>
<i><label id="amsg2" style="border:hidden; font-size: 12px; color:#F00;"></label></i> </td> </tr>
<tr> <td style="font-size:18px; font-family:verdana">
Student NO.: </td> <td><input type="label" name="snum" id="snum" size="39" style="height:23px" disabled value="<?php echo $stunum ; ?>"/> </td></tr>
<tr>
<td style="font-size:18px; font-family:verdana">
School Year: </td> <td><input type="label" name="sy" id="sy" size="39" style="height:23px" disabled value="<?php echo $sy3; ?>"/> </td></tr>
<tr><td style="font-size:18px; font-family:verdana"> First Name: </td>
<td><input type="text" name="fname" title="Enter First Name" id="fname" size="35" style="height:23px"/> </td></tr>
<tr><td style="font-size:18px; font-family:verdana"> Middle Name: </td>
<td><input type="text" name="mname" title="Enter Middle Name" id="mname" size="35" style="height:23px"/> </td></tr>
<tr> <td style="font-size:18px; font-family:verdana"> Last Name: </td>
<td> <Select name ="year" style="width:270PX; height:23px" id="year" onchange="getvalue(this.value)">
<option value="0">Select Year Level</option> <option value="1st year"> 1st year</option> <option value="2nd year"> 2nd year </option> <option value="3rd year"> 3rd year </option> <option value="4th year"> 4th year </option> </select></td> </td></tr>
<tr> <td style="font-size:18px; font-family:verdana"> Section: </td>
<td> <Select name ="section" style="width:270PX" id="section" style="width:270PX; height:23px">
<option value="0">Select a section</option> </select> </td></tr> <tr> <td colspan="2" style="font-size:18px; font-family:verdana"><br> Person to be contact in case of emergency<br><br> </td></tr>
<tr> <td style="font-size:18px; font-family:verdana"> Full Name: </td>
<td> <input type="text" name="gfname" title="Enter Full Name" id="gname" size="35" style="height:23px"/> </td></tr>
<tr> <td style="font-size:18px; font-family:verdana"> Address: </td>
<td> <input type="text" name="gaddress" title="Address" id="gaddress" size="35" style="height:23px"/> </td></tr>
<tr> <td style="font-size:18px; font-family:verdana"> Contact no.: </td>
<td> <input type="text" name="gcontact" title="NONE" id="gcontact" size="35" style="height:23px"/> </td></tr>
<tr> <td align="right"> <br>