Sunteți pe pagina 1din 71

NPICS ONLINE ALUMNI MANAGEMENT SYSTEM (NPICAM)

By Keo Lakhena, Graduate Student Advisor: Oum Saokosal Sikkim Manipal University, Build Bright University

I. INTRODUCTION
Founded in 2005 by the support of 27 million US Dollars from Republic of Korea, NPIC, under the ministry of Labour and Vocational Training of Cambodia, is the chosen one to be center for vocational training and higher education. NPIC was opened officially on May 16, 2005 by the Prime Minister Hun Sen. Standing on a land as big as 10 Hectares, NPIC is the biggest University in size in Cambodia. NPIC is big enough to hold more than 20,000 people. Students come from diverse backgrounds from the city and provinces. They share a culture that respects openness, inclusiveness, collegiality and diversity. I am proud of our talented, motivated and energetic staff - many of whom are foreigners and knowledgeable Cambodians. We provide a real focus on the student experience. Students will learn skills with longtime experienced Khmer lecturers and improve high skills with Korean lecturers within 6 hours a day and 5 days a week. After they graduated, they would have opportunities to study higher grade and to work in Korea. Yet NPIC does not have Alumni System; as for this reason, Online Alumni Management System is being developed to facilitate the management and controlling the information of Alumni. This system is web-based and developed using open source language (PHP) and database (MySQL) running on open source web server (Apache) at the server side. On the client side, JavaScript and JQuery (extension of JavaScript) combined with HTML and CSS to dynamically produce standardized web content. The Alumni System is available and accessible on any modern browsers including smart phone built-in browsers.

II. OBJECTIVES
2.1. Objectives of the Project
The objectives of the project are to create a user-friendly and easy-to-use software application which can tackle the problems of the old system. The project would provide the following advantages: 1. Providing user authentication: A user can access to the system if and only if he/she has a valid paired user name and password. 2. Managing the students and their jobs information Student can view their own profile Student can view/search for their friends profile Student can receive the NPICs latest news and events Student can receive job announcement Student can view their thesis project and their advisers

3. Reporting query Report of the alumni list Report of jobs, news and events Report of batch and department

2.2. Scope of the Project


NPIC Online Alumni Management System (NPICAMs) is indeed a hug sector within the management system. Due to enormous size and the time constraint of the project, this project will cover only five major features which include: Manage Student (Alumni): manage the students who graduate from NPIC on online like student info, department, degree, and batch. Manage Alumnis Job: mange all alumnis job information and announce the recently job to alumni. Manage News and Event: manage record all events and news. Manage Thesis and Advisor: manage the information of students thesis and their Advisor information.

Manage User Authentication: manage users that use the system. Reporting Query: for monthly, quarterly, etc.

2.3. Limitation of the Project


Although this project focuses on a variety of functionality to meet on process on NPIC Online Alumni Management System, it is only used in NPICs intranet yet. This system is built based on the environment and culture of NPIC which differs from other University.

2.4. Hardware and Software Specifications

Software Specifications
This project is built towards making use of Open Source Software both the language, database and web server. The following is the list of software tools use in this project: Programming Languages HTML CSS Javascript (jquery-1.7.1.min.js) PHP Database: Mysql database Web Server Wamp Server Browser Moliza FireFox(Recommand) Internet Explorer Safari Google Chrome Opera Opera mobile UC browser Version 3 or later. Version 7 or later. Version 5 or later. Version 10 or later. Version 11.1 or later. Version 7 or later. Version 7.6 or later. Version 2.0 or later Version 5.5.14 Version 4.0 Version CSS 1 Version 1.7.1 Version 5

Android from Chrome Safari mobile

Version 4.0 or later. Version 5.1 or later.

Hardware Specifications

This project use technology client server so many clients can connect to one server. For best performance, the following are the recommended requirement:

Clients side: Operating System: Hard Disk Ram VGA Server side: Operating System: Hard Disk Ram VGA Microsoft window server 2000, 2003,2008 Linux Microsoft window XP, Window 7 and Vista Minimum free space 5GB Minimum 512 MB Minimum 64 MB

Minimum free space 20GB Minimum 1 GB Minimum 64 MB

III. PROBLEMS STATEMENT


It is so important to understand what the problems are so that the newly-built system will meet users need becoming a favorite and effecting tool. The following problems trigger the need of the Online Alumni Management System.

Could not find Alumni information on internet. Difficult to contact them by phone or email. Could not know about their current information and their jobs. Could not provide accurate info of alumni to Min of lab

IV. REQUIREMENTS OF ANALYSIS AND SRS


4.1. Use case Diagram

4.2. Data Flow Diagram 4.2.1. Context Diagram


It is a diagram which shows the scope of the whole system with one process and all the External Entities of related to the system. My project is about NPIC Online Alumni Management System in a National Polytechnic Institute of Cambodia which NPICAMs in short form. The persons involved in this are student and administrator.

Student :his/her jobs are such as: Comment using Facebook plugin View their own profile View information of their friends alumni

Administrator: is a user who can manage users that use the system such as: Create Users Assign Object to users Add/Remove Object from users Reset Password for user Create, update, delete students information and profile Create, update, delete news and event Post job announcement List of students thesis and advisor.

4.2.2. Data Flow Diagram


It is a level one diagram which shows each primary process and its relations in the system. Data Flow Diagram is shown in the next figure:

4.2.2.1. Data Flow Diagram level 0 of Login Admin/User

4.2.2.2. Data Flow Diagram level 0 of Add User

4.2.2.3. Data Flow Diagram level 0 of Register Students

* Student info :

- Name - ID - Gender - birth date - phone number - email - address

4.2.2.4. Data Flow Diagram level 0 of Update Student Profile

4.2.2.5. Data Flow Diagram level 0 of Add new events

4.2.2.6. Data Flow Diagram level 0 of update events

4.2.2.7. Data Flow Diagram level 0 of Post career/jobs

10

4.2.2.8. Data Flow Diagram level 0 of Search Student by ID and name

4.2.2.9. Data Flow Diagram level 0 of search student by Dept

11

4.2.2.10. Data Flow Diagram level 0 of Facebook comment

4.3. Data Modeling 4.3.1. Normalization 4.3.1.1.The Purpose of Normalization


Normalization is a technique for producing a set of relations with desirable properties, given the data requirements of an enterprise. The process of normalization is a formal method that identifies relations based on their primary or candidate keys and the functional dependencies among their attributes.

4.3.1.2.Update Anomalies
Relations that have redundant data may have problems called update anomalies, which are classified as ,

12

Insertion anomalies Deletion anomalies Modification anomalies

4.3.1.3. Functional Dependencies


Functional dependency describes the relationship between attributes in a relation. Trival functional dependency means that the right-hand side is a subset ( not necessarily a proper subset) of the left-hand side. They do not provide any additional information about possible integrity constraints on the values held by these attributes.We are normally more interested in nontrivial dependencies because they represent integrity constraints for the relation. Main characteristics of functional dependencies in normalization Have a one-to-one relationship between attribute(s) on the left- and right- hand side of a dependency; hold for all time; are nontrivial.

4.3.1.4.1. Identifying the primary key


Functional dependency is a property of the meaning or semantics of the attributes in a relation. When a functional dependency is present, the dependency is specified as a constraint between the attributes. An important integrity constraint to consider first is the identification of candidate keys, one of which is selected to be the primary key for the relation using functional dependency.

4.3.1.4.2.Inference Rules

13

A set of all functional dependencies that are implied by a given set of functional dependencies X is called closure of X, written X+. A set of inference rule is needed to compute X+ from X. Armstrongs axioms 1. Reflexivity: 2. Augmentation: 3. Transitivity: If B is a subset of A, then A B If A B, then A, C B If A B and B C, then A C

4. Self-determination: A A 5. Decomposition: 6. Union: 7. Composition: If A B,C then A B and A C If A B and A C, then A B,C If A B and C B, then A,C B

4.3.1.4.3.Minial Sets of Functional Dependencies


A set of functional dependencies X is minimal if it satisfies following condition: Every dependency in X has a single attribute on its right-hand side We cannot replace any dependency A B in X with dependency C B, where C is a proper subset of A, and still have a set of dependencies that is equivalent to X. We cannot remove any dependency from X and still have a set of dependencies that is equivalent to X. the

4.3.1.5.The Process of Normalization


Normalization is often executed as a series of steps. Each step corresponds to a specific normal form that has known properties. As normalization proceeds, the relations become progressively more restricted in format, and also less vulnerable to update anomalies.

14

For the relational data model, it is important to recognize that it is only first normal form (1NF) that is critical in creating relations. All the subsequent normal forms are optional.

4.3.1.5.1.First Normal Form (1NF)


Unnormalized form (UNF) A table that contains one or more repeating groups. First Normal Form is a relation in which the intersection of each row and column contains one and only one value. There are two approaches to removing repeating groups from unnormalized tables: 1. Removes the repeating groups by entering appropriate data in the empty columns of rows containing the repeating data. 2. Removes the repeating group by placing the repeating data, along with a copy of the original key attribute(s), in a separate relation. A primary key is identified for the new relation. Full functional dependency Full functional dependency indicates that if A and B are attributes of a relation, B is fully functionally dependent on A if B is functionally dependent on A, but not on any proper subset of A. A functional dependency AB is partially dependent if there is some attributes that can be removed from A and the dependency still holds.

4.3.1.5.2.Second Normal Form (2NF)


Second normal form (2NF) is a relation that is in first normal form and every non-primary-key attribute is fully functionally dependent on the primary key. The normalization of 1NF relations to 2NF involves the removal of partial dependencies. If a partial dependency exists, we remove the

15

function dependent attributes from the relation by placing them in a new relation along with a copy of their determinant.

4.3.1.5.3.Third Normal Form (3NF)


A relation that is in first and second normal form, and in which no non-primary-key attribute is transitively dependent on the primary key. The normalization of 2NF relations to 3NF involves the removal of ransitive dependencies by placing the attribute(s) in a new relation along with a copy of the determinant.

4.3.1.5.4. Boyce-Codd Normal Form (BCNF)


A relation is in BCNF, if and only if, every determinant is a candidate key. The difference between 3NF and BCNF is that for a functional dependency A B, 3NF allows this dependency in a relation if B is a primary-key attribute and A is not a candidate key, whereas BCNF insists that for this dependency to remain in a relation, A must be a candidate key.

4.3.1.5.5. Fourth Normal Form (4NF)


Multi-valued dependency (MVD) represents a dependency between attributes (for example, A, B and C) in a relation, such that for each value of A there is a set of values for B and a set of value for C. However, the set of values for B and C are independent of each other. A multi-valued dependency can be further defined as being trivial or nontrivial. A MVD A > B in relation R is defined as being trivial if B is a subset of A or AUB=R A MVD is defined as being nontrivial if neither of the above two conditions is satisfied.

16

A relation that is in Boyce-Codd normal form and contains no nontrivial multi-valued dependencies.

4.3.1.5.6.Fifth Normal Form (5NF)


A relation that has no join dependency. Lossless-join dependency A property of decomposition, which ensures that no spurious tuples are generated when relations are reunited through a natural join operation. Join dependency Describes a type of dependency.

4.3.2. Entities Relationship Diagram


To fine all the entities involved in a system, you need to draw Entities Relationship Diagram. This diagram helps you define all the entities and their relations in a system. It also helps you determine the steps of creating tables for a system. By looking at the ERD you will get to know that how many tables will be created, which table will be create first, what name they will get, and how relationships they have to each other. Entities Relationship Diagram of NPIC Online Alumni Management System is shown in the next figure:

17

18

4.3.3. Table Entities Relationship Diagram

4.3.4. Data Dictionary


Data Dictionary will help you to define the details of each entity of ERD. After having Data Dictionary, you will get the ideas of what data is needed by the system and how to keep the data. Once the Data Dictionary is defined, you will be ready for creating the real tables. The followings are the Data Dictionary for NPICs Online Alumni Management System : 1. tbl_admin No 1 2 3 ID Username Password Fieldname Type int varchar varchar Size 10 20 20 Primary Key yes Foreign key Not Null yes yes yes

19

4 5

Email Role

varchar varchar

50 20

yes yes

2. tbl_student No 1 2 3 4 5 6 7 8 9 10 Fieldname Stu_id Stu_name sex Birth_date email phone address Batch_id Dept_id Project_id Type int varchar varchar datetime varchar number varchar int int int Size 10 20 10 8 20 10 50 10 10 10 yes yes yes Primary Key yes Foreign key Not Null yes yes yes yes yes yes yes yes yes yes

3. tbl_profile No 1 2 3 Fieldname Stu_id current photo Type int varchar photo Size 10 20 Primary Key yes Foreign key Not Null yes yes yes

4. tbl_thesis No 1 2 3 4 5 Fieldname Project_id Project_name Year description Advisor_id Type int varchar number longtext int 10 yes Size 10 20 9 Primary Key yes Foreign key Not Null yes yes yes yes yes

20

5. tbl_advisor No 1 2 3 4 Fieldname Advisor_id Advisor_name position Project_id Type int varchar varchar int Size 10 20 50 10 yes Primary Key yes Foreign key Not Null yes yes yes yes

6. tbl_dept No 1 2 3 Fieldname Dept_id Dept_name Stu_id Type int varchar int Size 10 20 10 yes Primary Key yes Foreign key Not Null yes yes yes

7. tbl_batch No 1 2 3 4 Fieldname Batch_id Batch_name year Stu_id Type int varchar number int Size 10 20 10 10 yes Primary Key yes Foreign key Not Null yes yes yes yes

8. tbl_job No 1 2 3 4 5 6 7 Fieldname Job_id Job_name Job_detail Company Start_date End_date Stu_id Type int varchar Longtext varchar Datetime datetime int 10 yes 20 Size 10 20 Primary Key yes Foreign key Not Null yes yes yes yes yes yes

21

9. tbl_gallary No 1 2 3 4 5 6 7 Fieldname gal_id gal_name gal_url gal_filename gal_cat gal_show gal_date Type int varchar varchar varchar varchar varchar datetime Size 10 20 50 50 20 50 Primary Key yes Foreign key Not Null yes yes yes yes yes yes yes

10. tbl_event No 1 2 3 4 5 Fieldname E_ID E_title E_content E_new E_date Type int varchar longtext varchar datetime 20 Size 10 20 Primary Key yes Foreign key Not Null yes yes yes yes yes

4.4. ALGORITHM FLOW CHART


To show how each process works, you can use flow chart. Each process of NPICs Online Alumni Management System will be as follow:

22

4.4.1. Login System

4.4.2. Create User

23

4.4.3. Register Student

4.4.4. Update Student Profile

24

4.4.5. Post Career/Job

4.4.6. Create Event

25

4.4.7. Update Event

26

4.4.8. Student Search (by name, id , batch , degree)

27

4.4.9. FaceBook Comment

V. ANALYSIS AND DESIGN


5.1. Data Collection Method
The information and data collected after depth study of the available research papers, journals, conferences papers and other standard textbooks related to the Alumni and so on.

28

5.2. Structure Charts

29

5.3. Output Specifications 5.3.1. Main Page


The first page of NPICs Alumni website is show as follow figure:

30

5.3.2. Login Page


Login Page: all users must be login with authenticated user before use the system, the page is show as follow figure:

5.3.3. Admin Page


After logging in to the system, you will see the main page as below. The menu is used to classify the group of process, and show by user privileges:

31

5.3.4. Manage Jobs Announcement


Manage Jobs Announcement Page: Use to add, update and delete job announcement to alumni who has finding job:

32

5.3.5. Manage Student


Manage Student Page: is use to register, update and delete student information who graduate from NPIC :

5.3.5.1. Manage Dept list and batch list


With register student you can manage dept and batch list as add new, update and delete of dept or batch:

33

5.3.5.2. Edit student


Edit student page: is use to edit student info to make profile of each student. Its show as below:

34

5.3.6. Manage News and Events


Manage News and Events page: is use to create new event and update the events in NPIC to who visited the NPICs Alumni Page.

35

5.3.7. Manage gallery


Manage gallery page : is use to upload and delete picture on page gallery:

5.3.8. Manage User setting


Manage User setting Page: is use to create user and authorize their responsible to login to the Admin Page.

36

5.3.9. Alumni List


After register student on Manage Student page, for who visit the website they can find the student page on Alumni List Page as below:

37

5.3.10. Student Profile


Student Profile Page: you can use to search to find student by name or id and this page show after you select the name of student in Alumni Page:

38

5.4. Network Design and Architecture


Network Design To run NPIC Online Alumni Management System, you need to use internet connection to connect in NPIC Campus as below:

39

Architecture

VI. CODING
Login Page:
<?PHP include_once("../insert_general_pages.php"); if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ header("Location: index.php"); // career the last string exit; } mysql_close($server_connection); ?> <!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 profile="http://www.w3.org/2005/10/profile"> <link rel="icon" type="image/png" href="<?PHP echo $row_web['web_url']; ?>/favicon.png">

40

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?PHP echo $row['page_title'];?> - <?PHP echo $row_web['web_title']; ?></title> <meta name="description" content="<?PHP echo $row_web['web_description']; ?>" /> <meta name="keywords" content="<?PHP echo $row_web['web_keywords']; ?>" /> <link rel="stylesheet" type="text/css" media="screen,projection" href="<?PHP echo $row_web['web_url']; ?>/css/style_screen.css" /> <link rel="stylesheet" type="text/css" media="print" href="<?PHP echo $row_web['web_url']; ?>/css/style_print.css" /> </head> <body id="body_admin"> <div class="page-container-2"> <!-- HEADER --> <!-- Navigation Level 1 --> <div class="nav1-container"> <div class="nav1"> <ul> <li><a href="<?PHP echo $row_web['web_url']; ?>">Home</a></li> <li><a href="<?PHP echo $row_web['web_url']; ?>/page/?p=89">sitemap</a></li> <li><a href="<?PHP echo $row_web['web_url']; ?>/page/?p=85">Contact us</a></li> <?PHP if ($admin_zone == "yes"){ ?> <li id="nav_logout"><a href="<?PHP echo $row_web['web_url']; ?>/truly-admin/">admin zone</a></li> <li id="nav_logout"><a href="<?PHP echo $row_web['web_url']; ?>/trulyadmin/logout.php">logout</a></li> <?PHP } ?> </ul> </div></div> <div class="buffer1"> </div> <!-- NAVIGATION --> <!-- Navigation Level 3 --> <!-- CONTENT --> <div class="content1"> <table border="0" height="530" width="100%"><tr><td> <!-- Text container --> <center> <table width="43%" background="../img/log.png" cellspacing="25" cellpadding="0"> <tr><th> <h1>Administrator Security Login</h1> </th></tr>

41

<tr><td> <form name="frm_login" action="logged.php" method="post"> <table width="80%" border="0" cellspacing="5" cellpadding="0"> <tr> <td width="40%" height="30" align="right">Username</td> <td width="10" height="30">&nbsp;</td> <td height="30"><label> <input name="ad_username" type="text" class="text" id="username" /> </label></td> </tr> <tr> <td width="40%" height="30" align="right">Password</td> <td width="10" height="30">&nbsp;</td> <td height="30"><label> <input name="ad_password" type="password" class="text" id="password" /> </label></td> </tr> <tr> <td width="40%" height="30" align="right">&nbsp;</td> <td width="10" height="30">&nbsp;</td> <td height="30"><label> <input name="login" type="submit" class="text" id="login" value="Login" /> </label></td> </tr> </table> </form> </td></tr> <tr><td height="45">&nbsp;</td></tr></table></center> </td></tr></table> </div> </div> <!--Page title --> </body> </html>

-------------------------------------------------------Logout Code :
<?PHP session_start(); // logout session_destroy(); header("Location: ../"); exit; ?>

-------------------------------------------------------Admin Page:
<?PHP error_reporting(E_ERROR);

42

//session_start(); include_once("insert_check_logged_admin.php"); include_once("../insert_general_pages.php"); $query = "SELECT * FROM tbl_job ORDER BY job_id DESC LIMIT 0, 1000"; $result = mysql_query($query) or die('Error in query: $query' . mysql_error()); include_once("../get_list_index.php"); // **** display data ******************************************** $min_record = (($which_page - 1) * $record_in_page) + 1; $max_record = $which_page * $record_in_page; $current_record = 1; $result_display = ""; if (mysql_num_rows($result) > 0){ while ($row = mysql_fetch_assoc($result)){ //retrieve data from recordset by item name if ($current_record >= $min_record && $current_record <= $max_record){ $result_display .= height=20>"; "<tr

$result_display .= "<td align='left' valign='middle' width=150 >" . $row['company'] . "</td>";//data $result_display .= "<td align='left' valign='middle' width=200><a href='job/read.php?s=" . $row['job_id'] . "'>" . $row['job_name'] . "</a></td>"; $result_display .= "<td align='left' valign='middle' width=100>" . $row['job_detail'] . "</td>"; $result_display .= "<td align='left' valign='middle' width=100>" . $row['start_date'] . "</td>"; $result_display .= "<tr>"; } $current_record++; } } mysql_close($server_connection); /****End of Database Stuff *****/ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Admin Zone</title> <link href="../css/style.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="lib/jquery1.7.1.min.js"></script>

43

<script type="text/javascript" src="lib/jquery.slidertron1.0.js"></script> </head> <body> <div id="wrapper"> <div id="logo"> </div> <div id="header"> <div id="menu"> <ul> <li><a href="/alumni/">Home</a></li> <li><a href="../student/">Alumni List</a></li> <li><a href="../notice/">Events</a></li> <li><a href="../gal/">Gallary</a></li> <li><a href="../job/">Career</a></li> <li><a href="#">Contact</a></li> <li><?php include_once("../top.php"); ?></li> </ul> </div> <!-- end #menu --> </div> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <h2 class="title">Job Announcement</h2> <div class="entry"> <p> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <table width="100%"> <tr> <td></td> <td align="left" ></td> </tr> <tr height="25"> <th><p class="meta">Copany Name</p></th> <th><p class="meta">Job Title</p></th> <th><p class="meta">Job Attachment</p></th> <th><p class="meta">Post Date</p></th> </tr> <?php echo $result_display; ?> <tr> <td colspan="4" height="10px" style="bordertop:1px #CCC solid; border-bottom:0px #CCC solid"><div id="list_index"><?PHP echo $list_index;?>&nbsp;</div></td> </tr> </table> <?PHP } ?> </p> </div> </div>

44

</div> <div id="sidebar"> <br/><br/> <h2>Administrator</h2> <ul> <li> <ul> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <li id="nav_qa"><a href="job">Job Announcement</a></li> <li id="nav_faq"><a href="student">Manage Student</a></li> <li id="nav_notice"><a href="notice">Manage News&Events</a></li> <li id="nav_pic"><a href="gallery">Manage Gallary</a></li> <li id="nav_setting"><a href="setting">User Setting</a></li> <?PHP } else if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_user"){ ?> <li id="nav_notice"><a href="notice">News & Events</a></li> <?PHP } ?> </ul> </li> </ul> </div> </div> </div> <div id="footer"> <p>Copyright 2011-2012. National Polytechnic Institute of Cambodia <a href="http://npic.edu.kh/">NPIC</a>. All right reserved.</p> </div> <!-- end #footer --> </body> </html>

-------------------------------------------------------Manage Student Page:


<?PHP error_reporting(E_ERROR); // Show only serious error. Not showing warning, including session_start() error is not shown. session_start(); //check the correct user (*** important ***)

45

if($_SESSION['logged'] != "accessible_admin"){ //This is redirect to a page header("Location: ../login.php"); // career the last string exit; } else if($_SESSION['logged'] == "accessible_admin"){ $admin_zone = "yes"; } //end of check user //Initialize record in a page. Must put it here because it's related to show "all album" where it show only 10. $record_in_page = 50; ////////////////////// /****Database Stuff *****/ include_once("../../mydbcnt.php"); //connectio basis

//$query = "SELECT * FROM tbl_songs ORDER BY song_rating DESC, song_title LIMIT 0, 1000"; $query = "SELECT * FROM tbl_student ORDER BY stu_id DESC LIMIT 0, 1000"; $result = mysql_query($query) or die('Error in query: $query' . mysql_error()); // get page index '''''''''''''''''''''''''''''''''''''''''''''''''''''' //***** Display Ago time ********* function agotime($date) { if(empty($date)) { return "No date provided"; } $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); $lengths = array("60","60","24","7","4.35","12","10"); $now $unix_date = time(); = strtotime($date);

// check validity of date if(empty($unix_date)) { return "Bad date"; } // is it future date or past date if($now > $unix_date) { $difference = $now - $unix_date; $tense = "ago"; } else {

46

$difference $tense

= $unix_date - $now; = "from now";

for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { $difference /= $lengths[$j]; } $difference = round($difference); if($difference != 1) { $periods[$j].= "s"; } return "$difference $periods[$j] {$tense}"; } //***** End of Ago time *********

//return the current url function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER[" REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } //end of current url $which_page = $_REQUEST["page"]; if ($which_page == ""){ $which_page = 1; } $rs_length = mysql_num_rows($result); // max of recordset //Response.Write(rs_length) function numPages($length, $recordinpage){ $numpage = 0; $numpage = ceil($length / $recordinpage); return $numpage; } $num_page = numPages($rs_length, $record_in_page); //'''''''''''''''''''''''''''''''''''''''''''''''''''''' //'''''''' display page |1|2|... menu '''''''''''''''' if ($which_page - 1 > 0){ $list_index .="<a href='" . "?page=" . ($which_page - 1) . "'<span class='page'>Previous</span></a>&nbsp;&nbsp;"; }

47

for ($i= 1; $i<=$num_page; $i++){ if ($which_page == $i){ $list_index .= "<span class='current_page'>" . $i . "</span>"; } else{ if(strpos(curPageURL(),"page") === false){ //if there is no "page" in the URL, add "&page=" $rep_page_num = curPageURL() . "?page=" . $i; } else { // if there is "page" in the URL $rep_page_num = str_replace($which_page, $i, curPageURL()); // replace current page number with $i } $list_index .= " <a href='" . $rep_page_num . "'><span class='page'>" . $i . "</span></a> "; } } //next button if ($which_page + 1 <= $num_page){ $list_index .="&nbsp;&nbsp;<a href='" . "?page=" . ($which_page + 1) . "'<span class='page'>Next</span></a>"; } // end of page index ''''''''''''''''''''''''''''''''''''''''''''''''''''' // **** display data ******************************************** //echo "which page: $which_page"; $min_record = (($which_page - 1) * $record_in_page) + 1; $max_record = $which_page * $record_in_page; $current_record = 1; $result_display; if (mysql_num_rows($result) > 0){ while ($row = mysql_fetch_assoc($result)){ //retrieve data from recordset by item name if ($current_record >= $min_record && $current_record <= $max_record){ if($row['stu_photo'] =='Readed'){ $result_display .= height=20> <td align='left' valign=top align=center style='padding:0 0 10px 0'> <a href='edit.php?q=" . $row['stu_id'] . "'>" . $row['stu_name'] . "</a></td> <td align='center' valign=top align=center>" . $row['gender'] . "</td> <td align='left' valign=top align=center>" . $row['stu_mobile'] . "</td> "<tr

48

<td align='left' valign=top align=center>" . $row['dept'] . " </td> <td align='left' valign=top align=center>" . $row['thesis_name'] . " </td> <td align='left' valign=top align=center>" . $row['job_name'] . " </td> </tr>"; } else{ height=20> $result_display .= "<tr

<td align='left' valign=top align=center style='padding:0 0 10px 0'> <strong><a href='edit.php?q=" . $row['stu_id'] . "'>" . $row['stu_name'] . "</a></strong></td> <td align='left' valign=top align=center>" . $row['gender'] . "</td> <td align='left' valign=top align=center>" . $row['stu_mobile'] . "</td> <td align='left' valign=top align=center>" . $row['dept'] . " </td> <td align='left' valign=top align=center>" . $row['thesis_name'] . " </td> <td align='left' valign=top align=center>" . $row['job_name'] . " </td> </tr>"; } $current_record++; } } //****** end of diplay data ******* mysql_close($server_connection); /****End of Database Stuff *****/ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Admin Zone</title> <link href="../../css/style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> }

49

<div id="wrapper"> <div id="logo"> </div> <div id="header"> <div id="menu"> <ul> <li><a href="/alumni/">Home</a></li> <li><a href="../student/">Alumni List</a></li> <li><a href="../notice/">Events</a></li> <li><a href="../gal/">Gallary</a></li> <li><a href="../job/">Career</a></li> <li><a href="#">Contact</a></li> <?PHP if ($admin_zone == "yes"){ ?> <li><a href="../../admin/">admin zone</a></li> <li><a href="../../admin/logout.php">logout</a></li> <?PHP } ?> </ul> </div> <!-- end #menu --> </div> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <h2 class="title">Admin Zone</h2> <div class="entry"> <p> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <table width="100%" border="0"> <tr height="40"><th><p class="meta">Student Name</th> <th align="center"><p class="meta">gender</p></th> <th align="left"><p class="meta">phone</p></th> <th align="left"><p class="meta">department</p></th> <th align="left"><p class="meta">Project</p></th> <th align="left"><p class="meta">job</p></th> </tr> <?PHP echo $result_display; ?> <tr> <td colspan="6" height="20px" style="border-top:1px #CCC solid; border-bottom:0px #CCC solid"> <div id="list_index"><?PHP echo $list_index;?>&nbsp;</div> </td> </tr> </table> <?PHP

50

} </p> </div> </div> </div> <div id="sidebar"> <br/><br/> <h2>Manage Student</h2> <ul> <li> <ul> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <li id="nav_viewquestions"><a href="../student">View student list</a></li> <li id="nav_postaquestion"><a href="../student/add.php">Register student </a></li> <li id="nav_viewquestions"><a href="../student/edit.php">student profile</a></li> <li id="nav_viewquestions"><a href="../student/dept_list.php">View Dept list</a></li> <li id="nav_viewquestions"><a href="../student/batch_list.php">View Dept list</a></li> <?PHP } else if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_user"){ ?> <?PHP } ?> </ul> </li> </ul> </ul> </div> </div> </div> <div id="footer"> <p>Copyright</p> </div> <!-- end #footer --> </body> </html> ?>

--------------------------------------------------------

51

Register Student Page:


n <?PHP error_reporting(E_ERROR); // Show only serious error. Not showing warning, including session_start() error is not shown. session_start(); //check the correct user (*** important ***) if($_SESSION['logged'] != "accessible_admin"){ //This is redirect to a page header("Location: ../login.php"); // career the last string exit; } else if($_SESSION['logged'] == "accessible_admin"){ $admin_zone = "yes"; } //end of check user /****Database Stuff *****/ include_once("../../mydbcnt.php"); //connectio basis /****select dept*****/ $query_dept = "SELECT * FROM tbl_dept ORDER BY dept_name"; $result_dept = mysql_query($query_dept) or die('Error in query: $query' . mysql_error()); $deptset = "<option value=':::select dept:::'>:::select category:::</option>\n"; if (mysql_num_rows($result_dept) > 0){ while ($row_dept = mysql_fetch_assoc($result_dept)){ $deptset .= "<option value='" . $row_dept['dept_id'] . "'>" . $row_dept['dept_name'] . "</option>\n"; } } /****select batch*****/ $query_batch = "SELECT * FROM tbl_batch ORDER BY batch_year"; $result_batch = mysql_query($query_batch) or die('Error in query: $query' . mysql_error()); $batchset = "<option value=':::select batch:::'>:::select batch:::</option>\n"; if (mysql_num_rows($result_batch) > 0){ while ($row_batch = mysql_fetch_assoc($result_batch)){ $batchset .= "<option value='" . $row_batch['batch_id'] . "'>" . $row_batch['batch_year'] . "</option>\n"; } } mysql_close($server_connection); /****End of Database Stuff *****/ ?>

52

<!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> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Admin Zone</title> <link href="../../css/style.css" rel="stylesheet" type="text/css" media="screen" /> <script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="../../SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="../../SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="logo"> <h1><a href="#">NPIC's ALUMNI </a></h1> <p><a href="http://www.freecsstemplates.org/">Alumni Picture</a></p> </div> <div id="header"> <div id="menu"> <ul> <li class="current_page_item"><a href="/alumni/">Home</a></li> <li><a href="/alumni/">Alumni List</a></li> <li><a href="../notice/">Events</a></li> <li><a href="#">Gallary</a></li> <li><a href="#">Career</a></li> <?PHP if ($admin_zone == "yes"){ ?> <li><a href="../../admin/">admin zone</a></li> <li><a href="../../admin/logout.php">logout</a></li> <?PHP } ?> </ul> </div> <!-- end #menu --> </div> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <h2 class="title">Manage Students</h2> <p class="meta">Register Student</p> <div class="entry"> <p> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?>

53

<form name="frm_question" action="../student/added.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20%" height="30" align="right">student name</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield1"> <label> <input name="stu_name" type="text" class="text" id="name" size="25" maxlength="25" /> </label> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">gender</td> <td width="10">&nbsp;</td> <td width="79%"><label> <select name="gender" id="gender"> <?PHP if ($row['gender'] == "M") {?> <option value="M" selected="selected">M</option> <option value="F">F</option> <?PHP } else { ?> <option value="M">M</option> <option value="F" selected="selected">F</option> <?PHP }?> </select> </label></td> </tr> <tr> <td width="20%" height="30" align="right">date of birth</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield2"> <input name="birth_date" type="text" class="text" id="birth_date" size="20" maxlength="10"/> <span class="textfieldRequiredMsg"></span><span class="textfieldInvalidFormatMsg"></span></span> </tr> <tr> <td width="20%" height="30" align="right">mobile</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield12"> <label> <input name="stu_mobile" type="text" class="text" id="stu_mobile" size="25" maxlength="25"/> </label> <span class="textfieldRequiredMsg"></span></span> *</td> </tr> <tr> <td width="20%" height="30" align="right">Address</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield4">

54

<input name="stu_add" type="text" class="text" id="stu_add" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">E-mail</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield8"> <input name="stu_email" type="text" class="text" id="stu_email" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldInvalidFormatMsg">E-mail Not Correct.</span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">self introduction</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextarea1"> <label> <textarea name="stu_self_intro" cols="50" rows="5" class="text" id="stu_self_intro"></textarea> *<br /><span id="countsprytextarea1">&nbsp;</span></label> <span class="textareaRequiredMsg"></span><span class="textareaMinCharsMsg"></span><span class="textareaMaxCharsMsg"></span></span></td> </tr> <tr> <td width="20%" height="30" align="right">batch</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <label> <select name="batch" id="depatment"> <?PHP print $batchset; ?> </select> </label> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Dept</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <label> <select name="dept" id="depatment"> <?PHP print $deptset; ?> </select> </label> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Project Name</td>

55

<td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield8"> <input name="thesis_name" type="text" class="text" id="thesis_name" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldInvalidFormatMsg">E-mail Not Correct.</span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Advicer name 1</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield8"> <input name="advicer1" type="text" class="text" id="advicer1" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldInvalidFormatMsg">E-mail Not Correct.</span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Advicer name 2</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield8"> <input name="advicer2" type="text" class="text" id="advicer2" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldInvalidFormatMsg">E-mail Not Correct.</span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Degree</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <input name="degree" type="text" class="text" id="degree" size="20" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Job Name</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <input name="job_name" type="text" class="text" id="job_name" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">company</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <input name="company" type="text" class="text" id="major" size="50" maxlength="50"/>

56

<span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">Start date</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <input name="start" type="text" class="text" id="start" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">End date</td> <td width="10">&nbsp;</td> <td width="79%"><span id="sprytextfield3"> <input name="end" type="text" class="text" id="end" size="50" maxlength="50"/> <span class="textfieldRequiredMsg"></span><span class="textfieldMinCharsMsg"></span><span class="textfieldMaxCharsMsg"></span></span>*</td> </tr> <tr> <td width="20%" height="30" align="right">&nbsp;</td> <td width="10">&nbsp;</td> <td width="79%"><input name="submit" type="submit" class="text" id="submit" value="Submit" /></td> </tr> <tr> <td width="20%" height="30" align="right">&nbsp;</td> <td width="10">&nbsp;</td> <td width="79%">* : Required</td> </tr> </table> </form> <?PHP } ?> </p> </div> </div> </div> <div id="sidebar"> <br/><br/> <h2>Manage Student</h2> <ul> <li> <ul> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <li id="nav_viewquestions"><a href="../student">View student list</a></li>

57

<li id="nav_postaquestion"><a href="../student/add.php">Register student </a></li> <li id="nav_viewquestions"><a href="../student/edit.php">student profile</a></li> <?PHP } else if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_user"){ ?> <?PHP } ?> </ul> </li> </ul> <h2>Manage Dept</h2> <ul> <li> <ul> <li id="nav_viewquestions"><a href="../student/dept_list.php">View Dept list</a></li> <li id="nav_postaquestion"><a href="../student/dept_add.php">Add Dept </a></li> </ul> </li> </ul> <h2>Manage Batch</h2> <ul> <li> <ul> <li id="nav_viewquestions"><a href="../student/batch_list.php">View Dept list</a></li> <li id="nav_postaquestion"><a href="../student/batch_add.php">Add Dept </a></li> </ul> </li> </ul> </div> </div> </div> <div id="footer"> <p>Copyright</p> </div> <!-- end #footer --> <script type="text/javascript"> <!-var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {minChars:1, maxChars:25, validateOn:["blur"]}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "integer", {validateOn:["blur"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "integer", {validateOn:["blur"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {validateOn:["blur"], minChars:1, maxChars:50});

58

var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur"], isRequired:false}); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "none", {validateOn:["blur"], minChars:1, maxChars:25}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "none", {validateOn:["blur"], minChars:1, maxChars:50}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "email", {validateOn:["blur"], minChars:1, maxChars:50}); var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "none", {validateOn:["blur"], minChars:1, maxChars:25}); var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "none", {validateOn:["blur"], minChars:1, maxChars:25}); var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {counterId:"countsprytextarea1", counterType:"chars_remaining", validateOn:["blur"], minChars:1, maxChars:500}); var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11"); var sprytextfield12 = new Spry.Widget.ValidationTextField("sprytextfield12", "none", {validateOn:["blur"]}); //--> </script> </body> </html>

-------------------------------------------------------Manage Job Announcement Page:


<?PHP error_reporting(E_ERROR); // Show only serious error. Not showing warning, including session_start() error is not shown. session_start(); include_once("../insert_check_logged_admin.php"); include_once("../../insert_general_pages.php"); $query = "SELECT * FROM tbl_job ORDER BY job_id DESC LIMIT 0, 1000"; $result = mysql_query($query) or die('Error in query: $query' . mysql_error()); include_once("../../get_list_index.php"); // **** display data ******************************************** //echo "which page: $which_page"; $min_record = (($which_page - 1) * $record_in_page) + 1; $max_record = $which_page * $record_in_page; $current_record = 1; $result_display = ""; if (mysql_num_rows($result) > 0){

59

while ($row = mysql_fetch_assoc($result)){ //retrieve data from recordset by item name if ($current_record >= $min_record && $current_record <= $max_record){ if($row['job_new'] == "yes"){ $result_display .= "<tr height=20><td valign=top>" . $current_record . ". </td> align='left' valign=top width=100% > <td <a href='edit.php?q=" . $row['job_id'] . "'>" . $row['job_name'] . "&nbsp;<img src='../../images/icon_new.gif' width='19' height='10' alt='new' border=0 /> </a></td></tr>"; } else{ <td align='left' valign=top width=100% > <a href='edit.php?q=" . $row['job_id'] . "'>" . $row['job_name'] . "</a></td></tr>"; } } $current_record++; } } //****** end of diplay data ************************************ mysql_close($server_connection); /****End of Database Stuff *****/

$result_display .= "<tr height=20><td valign=top>" . $current_record . ". </td>

?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>New & Events</title> <link href="../../css/style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="logo"> </div> <div id="header"> <div id="menu"> <ul> <li class="current_page_item"><a href="/alumni/">Home</a></li>

60

<li><a href="/alumni/">Alumni List</a></li> <li><a href="../notice/">Events</a></li> <li><a href="#">Gallary</a></li> <li><a href="#">Career</a></li> <?PHP if ($admin_zone == "yes"){ ?> <li><a href="../../admin/">admin zone</a></li> <li><a href="../../admin/logout.php">logout</a></li> <?PHP } ?> </ul> </div> <!-- end #menu --> </div> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <h2 class="title">Admin Zone</h2> <p class="meta">Job Announcement</p> <div class="entry"> <p> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <table width="100%"> <tr> <td></td> <td align="left" ></td> </tr> <tr height="25"> </tr> <?PHP //display searching result echo $result_display; ?> <tr> <td colspan="4" height="20px" style="bordertop:1px #CCC solid; border-bottom:0px #CCC solid"> <div id="list_index"><?PHP echo $list_index;?>&nbsp;</div> </td> </tr> </table> <?PHP } ?> </p> </div> </div> </div> <div id="sidebar"> <br/><br/> <h2>Manage Jobs</h2> <ul> <li> <ul> <?PHP

61

if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <li><a href="../job">Jobs List</a></li> <li><a href="../job/add.php">Add New Job</a></li> <?PHP } else if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_user"){ ?> <li id="nav_notice"><a href="../index.php">Jobs List</a></li> <?PHP } ?> </ul> </li> </ul> </div> </div> </div> <div id="footer"> <p>Copyright</p> </div> <!-- end #footer --> </body> </html>

-------------------------------------------------------Manage News and Events Page:


<?PHP error_reporting(E_ERROR); // Show only serious error. Not showing warning, including session_start() error is not shown. session_start(); include_once("../insert_check_logged_admin.php"); include_once("../../insert_general_pages.php"); $query = "SELECT * FROM tbl_notice ORDER BY not_id DESC LIMIT 0, 1000"; $result = mysql_query($query) or die('Error in query: $query' . mysql_error()); include_once("../../get_list_index.php"); // **** display data ******************************************** //echo "which page: $which_page"; $min_record = (($which_page - 1) * $record_in_page) + 1; $max_record = $which_page * $record_in_page; $current_record = 1; $result_display = ""; if (mysql_num_rows($result) > 0){ while ($row = mysql_fetch_assoc($result)){ //retrieve data from recordset by item name

62

if ($current_record >= $min_record && $current_record <= $max_record){ if($row['not_new'] == "yes"){ $result_display .= "<tr height=20><td valign=top>" . $current_record . ". </td> align='left' valign=top width=100% >

<td

<a href='edit.php?q=" . $row['not_id'] . "'>" . $row['not_title'] . "&nbsp;<img src='../../images/icon_new.gif' width='19' height='10' alt='new' border=0 /> </a></td></tr>"; $result_display .= "<tr height=20><td valign=top>" . $current_record . ". </td> align='left' valign=top width=100% > <td <a href='edit.php?q=" . $row['not_id'] . "'>" . $row['not_title'] . "</a></td></tr>"; } } $current_record++; } else{

} } //****** end of diplay data ************************************ mysql_close($server_connection); /****End of Database Stuff *****/ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>New & Events</title> <link href="../../css/style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="logo"> <h1><a href="#">NPIC's ALUMNI </a></h1> <p><a href="http://www.freecsstemplates.org/">Alumni Picture</a></p> </div> <div id="header"> <div id="menu"> <ul>

63

List</a></li>

<li><a href="../alumni/">Home</a></li> <li><a href="../../student/">Alumni

<li><a href="../../notice/">Events</a></li> <li><a href="../../gal/">Gallary</a></li> <li><a href="../../job/">Career</a></li> <li><a href="#">Contact</a></li> <?PHP if ($admin_zone == "yes"){ ?> <li><a href="../../admin/">admin zone</a></li> <li><a href="../../admin/logout.php">logout</a></li> <?PHP } ?> </ul> </div> <!-- end #menu --> </div> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <h2 class="title">Manage News & Events</h2> <p class="meta"> </p> <div class="entry"> <p> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <table width="100%"> <tr> <td></td> <td align="left" ></td> </tr> <tr height="25"> </tr> <?PHP echo $result_display; ?> <tr> <td colspan="4" height="20px" style="bordertop:1px #CCC solid; border-bottom:0px #CCC solid"> <div id="list_index"><?PHP echo $list_index;?>&nbsp;</div> </td> </tr> </table> <?PHP } ?> </p> </div> </div> </div> <div id="sidebar"> <br/><br/>

64

<h2>news & event</h2> <ul> <li> <ul> <?PHP if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_admin"){ ?> <li><a href="../notice"> </a></li> <li><a href="../notice/add.php"></a></li> <?PHP } else if(isset($_SESSION['logged']) && $_SESSION['logged'] == "accessible_user"){ ?> <li id="nav_notice"><a href="notice">News & Events</a></li> <?PHP } ?> </ul> </li> </ul> </div> </div> </div> <div id="footer"> <p>Copyright</p> </div> <!--end #footer --> </body> </html>

-------------------------------------------------------Manage User Setting Page:


<?PHP error_reporting(E_ERROR); // Show only serious error. Not showing warning, including session_start() error is not shown. session_start(); include_once("../insert_check_logged_admin.php"); include_once("../../insert_general_pages.php"); $qa_ans_date = date("Y/m/d"); $query = "SELECT * FROM tbl_admin WHERE ad_username = 'admin'"; $result = mysql_query($query) or die('Error in query: $query' . mysql_error()); $row = mysql_fetch_assoc($result); mysql_close($server_connection); /****End of Database Stuff *****/ ?>

65

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>New & Events</title> <link href="../../css/style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="logo"> </div> <div id="header"> <div id="menu"> <ul> <li><a href="/alumni/">Home</a></li> <li><a href="../student/">Alumni List</a></li> <li><a href="../notice/">Events</a></li> <li><a href="../gal/">Gallary</a></li> <li><a href="../job/">Career</a></li> <li><a href="#">Contact</a></li> <?PHP if ($admin_zone == "yes"){ ?> <li><a href="../../admin/">admin zone</a></li> <li><a href="../../admin/logout.php">logout</a></li> <?PHP } ?> </ul> </div> <!-- end #menu --> </div> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <h2 class="title">Admin Zone</h2> <p class="meta"> </p> <div class="entry"> <p> <form name="frm_password" action="edited.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="40" colspan="3" align="left" valign="middle"><h4><strong> </strong></h4></td> </tr> <tr> <td width="25%" height="40" align="right"><strong> </strong></td> <td width="10">&nbsp;</td> <td width="70%" align="left">

66

<strong><em><?PHP echo $row['ad_username'];?></em></strong> </td> </tr> <tr> <td width="25%" height="40" align="right" valign="middle"><strong> </strong></td> <td>&nbsp;</td> <td align="left"><span id="sCurrent"> <label> <input name="current_password" type="password" class="text" id="current_password4" size="20" maxlength="20" /> </label> <span class="textfieldRequiredMsg"></span></span></td> </tr> <tr> <td width="25%" height="40" align="right" valign="bottom"><strong> </strong></td> <td>&nbsp;</td> <td align="left" valign="bottom"><span id="sNewPwd"> <input name="new_password" type="password" class="text" id="new_password" size="20" maxlength="20" /> <span class="passwordRequiredMsg"></span><span class="passwordMinCharsMsg"> </span><span class="passwordMaxCharsMsg"> </span><span class="passwordInvalidStrengthMsg"> -</span></span></td> </tr> <tr> <td width="25%" height="40" align="right"><strong> </strong></td> <td>&nbsp;</td> <td align="left"><span id="sConfirm"> <input name="confirm_password" type="password" class="text" id="confirm_password" size="20" maxlength="20" /> <span class="confirmRequiredMsg"></span><span class="confirmInvalidMsg"> </span></span></td> </tr> <tr> <td width="25%" height="40">&nbsp;</td> <td width="10">&nbsp;</td> <td width="70%" align="left"><label> <input name="submit" type="submit" class="text" id="submit" value=" Update " /> </label></td> </tr> <tr> <td width="25%" height="40">&nbsp;</td> <td width="10">&nbsp;</td>

67

<td width="82%" align="left"> </td> </tr> </table> </form> </p> </div> </div> </div> <div id="sidebar"> <br/><br/> <h2>admin setting</h2> <ul> <li> <ul> <li><a href="../setting"> </ul> </li> </ul> </div> </div> </div> <div id="footer"> <p>Copyright</p> <script type="text/javascript"> <!-//var sprytextfield2 = new Spry.Widget.ValidationTextField("sName", "none", {validateOn:["blur"], maxChars:150}); var sprypassword1 = new Spry.Widget.ValidationPassword("sNewPwd", {minChars:6, maxChars:20, minAlphaChars:1, minNumbers:1, minUpperAlphaChars:1, validateOn:["blur"]}); var spryconfirm1 = new Spry.Widget.ValidationConfirm("sConfirm", "new_password", {validateOn:["blur"]}); var sprytextfield1 = new Spry.Widget.ValidationTextField("sCurrent", "none", {validateOn:["blur"]}); //--> </script> </div> <!-- end #footer --> </body> </html>

</a></li>

--------------------------------------------------------

68

VII. TESTING PROCEDURES


Case 1 2 3 4 5 6 7 8 Objective Add new records for each process. Update existing records for each process. Delete records for each process. Filter for required data Check validation for adding/updating records. Check the flow of data between some processes. Test the operations between some processes. Check performance.

VIII. TESTING REPORTS


Case-1 Data Add new records for each process. Input Valid Data Input Invalid Data Valid Data: Successfully added Invalid Data: Error message is displayed. Both valid and invalid data are tested.

Result Conclusion Case-2 Data

Update existing records for each process. Modify with valid data Modify with invalid data Valid data: Successful updated. Invalid data: Error message is displayed. Both valid and invalid data are tested.

Result Conclusion Case-3 Result Conclusion

Delete records for each process Successful Deleted. Delete data is OK.

69

Case-4 Data

Filter for required data Provide valid data for filtering. Provide invalid data for filtering. Valid data: required data is shown. Invalid data: no data is shown. Both valid and invalid data are tested. Input valid data. Input invalid data. Valid data: return true. Invalid data: return false. Both valid and invalid data are tested. Input valid data. Input invalid data. Valid data: Expected flow of data is produced. Invalid data: Unexpected result is produced. Both valid and invalid data are tested. Input valid data. Input invalid data. Valid data: work well together. Invalid data: Error message is displayed. Both valid and invalid data are tested. Input valid data. Input invalid data. Valid data: Performance is well done. Invalid data: Could not performance. Both valid and invalid data are tested.

Result Conclusion Case-5 Data

Check validation for adding/updating records.

Result Conclusion Case-6 Data

Check the flow of data between some processes

Result Conclusion Case-7 Data

Test the operations between some processes

Result Conclusion Case-8 Data

Check performance

Result Conclusion

70

IX. FUTURE APPLICATION


The system will be hosted on a domain so that it can be accessible via internet by anybody who is interested.

X. CONCLUSION
NPIC Online Alumni Management System is therefore beneficial for both NPICs management and students. Through this system, student who graduated even for a long time still be hooked up to NPIC and NPIC will always be as home for them to be remembered. Plus the system creates a place that can be useful for job hunters and job finders.

XI. BIBLIOGRAPHY(REFFERNCE)
PHP AND MYSQL 24-HOUR TRAINER, Published by John Wiley and Sons, Inc. PHP and MySQL Web Development, Sams Publishing, 800 East 96th Street, Indianapolis, Indiana 46240 jQuery: Novice to Ninja, by Earle Castledine and Craig Sharkie Copyright 2010 SitePoint Pty. Ltd. http://jquery.com http://www.php.net http:// dev.mysql.com

71

S-ar putea să vă placă și