You are on page 1of 29

OBJECT ORIENTED ANALYSIS AND DESIGN REPORT

ON

ONLINE NOTES SHARING SYSTEM USING

PHP

Submitted in partial fulfilment of the requirement for the award of the


degree of

B.TECH
in

COMPUTER SCIENCE AND ENGINEERING

Submitted By
Name: NAVEEN KUMAR R Reg. No: RA1611003040005

SRM Institute of Science & Technology


Vadapalani Campus , Chennai
OCTOBER-2019
DECLARATION

I hereby declare that the report “ONLINE NOTES SHARING SYSTEM USING
PHP” is the authentic work done by NAVEEN KUMAR R
(RA1611003040005), as requirements of 15SE203 – OBJECT ORIENTED
ANALYSIS AND DESIGN during the seventh semester period from July 2019
to November 2019 for the award of B.Tech Computer Science And
Engineering degree under my supervision during the academic year 2018- 2019.

STAFF IN CHARGE SIGNATURE OF THE HOD

Mr.Sabarinathan B.Tech,M.E Dr.S.Prasanna Devi, B.E.,M.E., Ph.D.,

PGDHRM.,PDF(IISc)

Assistant Professor Professor

Department of Computer Science and Department of Computer Science and

Engineering Engineering

SRM Institute of Science & Technology SRM Institute of Science & Technology

Vadapalani Campus Vadapalani Campus


INDEX PAGE

CHAPTER CHAPTER NAME PAGE


NUMBER NUMBER
1 INTRODUCTION
1.1 AIM OF THE PROJECT
2 SYSTEM ANALYSIS
2.1 EXISTING SYSTEM
2.2 PROPOSED SYSTEM
3 SYSTEM REQUIREMENTS
4 SYSTEM DESIGN
4.1 STATIC DIAGRAM
4.1.1 USE CASE DIAGRAM
4.1.2 CLASS DIAGRAM
4.2 DYNAMIC DIAGRAM
4.2.1 INTERACTION DIAGRAM
4.2.1.1 SEQUENCE DIAGRAM
4.2.1.2 COLLABORATION DIAGRAM
4.2.2 ACTIVITY DIAGRAM
4.2.3 STATECHART DIAGRAM
4.2.4 IMPLEMENTATION DIAGRAM
4.2.4.1 COMPONENT DIAGRAM
4.2.4.2 DEPLOYMENT DIAGRAM
5 MODULE DESCRIPTION
5.1 MODULE LIST
5.2 MODULE EXPLANATION
6 SAMPLE CODE
7 CONCLUSION
8 SCREENSHOTS
ABSTRACT

As the world is being developed with the new technologies, discovering and manipulating
new ideas and concepts of taking everything online are rapidly changing. It is difficult for
teacher’s to circulate their notes to each and every student whom is he/she teaching. Online
Notes Sharing provide an easy approach for both students and teachers to circulate the notes
whether of any kind like lecture notes, assignment questions, question papers and all the
important documents. The teachers and students can upload the documents from anywhere
and students can download it. Overall it is managed by the admin. Online notes sharing is a
web based notes sharing and management system which helps students and teachers to share
their notes online effectively. It reduces the wasting of time in manually distributing notes to
each individual. It greatly overcomes the lack of availability and converts the manual old
school paperwork to a fully automated and managed online system. This project intends to
provide the students with an environment where they can upload their notes online. By doing
this, it will allow them to gain the basic knowledge about using any kind of project
management system. This project has only a single agenda, that is, to allow students to
upload their study materials online like Google classroom. Here you have to sign up in order
to upload any kind of files. When you sign up then you can view the uploading dashboard.
From there you can upload your files and later on you can download them. Features such as
Editing site content, user management, and site settings are the most essential feature of a
site. And these all features have made management of site easier as the user can change the
content and setting any time he/she want rather than opening the whole source code and
changing each line of codes. A clean and responsive dashboard is provided in the admin
panel for the easy management of this project.

0
CHAPTER 1

INTRODUCTION

1.1 AIM OF THE PROJECT


This project intends to provide the students with an environment where they can upload their
notes online. As the world is being developed with the new technologies, discovering and
manipulating new ideas and concepts of taking everything online are rapidly changing. It is
difficult for teacher’s to circulate their notes to each and every student whom is he/she
teaching. Online Notes Sharing provide an easy approach for both students and teachers to
circulate the notes whether of any kind like lecture notes, assignment questions, question
papers and all the important documents. The teachers and students can upload the documents
from anywhere and students can download it. Overall it is managed by the admin. Online
notes sharing is a web based notes sharing and management system which helps students and
teachers to share their notes online effectively. It reduces the wasting of time in manually
distributing notes to each individual. It greatly overcomes the lack of availability and
converts the manual old school paperwork to a fully automated and managed online system.
This project intends to provide the students with an environment where they can upload their
notes online. By doing this, it will allow them to gain the basic knowledge about using any
kind of project management system. This project has only a single agenda, that is, to allow
students to upload their study materials online like Google classroom. Here you have to sign
up in order to upload any kind of files. When you sign up then you can view the uploading
dashboard. From there you can upload your files and later on you can download them.
Features such as Editing site content, user management, and site settings are the most
essential feature of a site. And these all features have made management of site easier as the
user can change the content and setting any time he/she want rather than opening the whole
source code and changing each line of codes. A clean and responsive dashboard is provided
in the admin panel for the easy management of this project.

1
CHAPTER 2

2.1 EXISTING SYSTEM

It is difficult for teacher’s to circulate their notes to each and every student whom is he/she
teaching. Online Notes Sharing system provide an easy approach for both students and
teachers to circulate the notes whether of any kind like lecture notes, assignment questions,
question papers and all the important documents. The teachers and students can upload the
documents from anywhere and students can download it. Overall it is managed by the
admin.Mostly the notes are circulated on WhatsApp or any kind so it gets very difficult to
manage the important notes at the time of need. Online notes sharing is a web based notes
sharing and management system which helps students and teachers to share their notes online
effectively. It reduces the wasting of time in manually distributing notes to each individual. It
greatly overcomes the lack of availability and converts the manual old school paperwork to a
fully automated and managed online system.

2.2 PROPOSED SYSTEM

There are many students who face problem in studying at the exam time because either they
don’t have the notes provided by teachers or they must have not been in the college. This
System will provide a platform to easily access the notes. The Objective of Online notes
sharing system is to provide better facility to the students and teachers to bring out the easy
circulation of documents within healthy environment. It will reduce the manual paperwork,
reduced the sharing and distribution time. My system will provide an easy approach to share
the documents for studying purpose. Multiple users can work simultaneously on the system.
It will be easy for the teachers to circulate the notes to each and every student.

DRAWBACKS:

The system is designed to provide an easy approach for both teachers and students to share
notes between each other. But still there are some drawbacks in the proposed system.

 The system does not have any criteria to check whether the student or teacher is of
particular college or not.
 Anyone can register on the system and can access the data.

2
CHAPTER 3

3.1 SYSTEM REQUIREMENTS

 WINDOWS OPERATING SYSTEM


 PHP
 MySQL
 HTML, CSS, JAVASCRIPT,BOOTSTRAP
 XAMP
 APACHE SERVER
 SUBLIME TEXT EDITOR

3
CHAPTER 4

SYSTEM DESIGN
4.1 STATIC DIAGRAM

4.1.1 Use-Case Diagram


To model a system, the most important aspect is to capture the dynamic behaviour. Dynamic
behaviour means the behaviour of the system when it is running/operating. Only static
behaviour is not sufficient to model a system rather dynamic behaviour is more important
than static behaviour. In UML, there are five diagrams available to model the dynamic nature
and use case diagram is one of them. These internal and external agents are known as actors.
Use case diagrams consist of actors, use cases and their relationships. The diagram is used to
model the system/subsystem of an application. A single use case diagram captures a
particular functionality of a system.

4
4.1.2 Class Diagram

Class diagram is a static diagram. It represents the static view of an application. Class
diagram is not only used for visualizing, describing, and documenting different aspects of a
system but also for constructing executable code of the software application. Class diagram
describes the attributes and operations of a class and also the constraints imposed on the
system. The class diagrams are widely used in the modelling of object oriented systems
because they are the only UML diagrams, which can be mapped directly with object-oriented
languages. Class diagram shows a collection of classes, interfaces, associations,
collaborations, and constraints. It is also known as a structural diagram.

5
4.2 DYNAMIC DIAGRAM
4.2.1 INTERACTION DIAGRAM

The purpose of interaction diagrams is to visualize the interactive behaviour of the system.
Visualizing the interaction is a difficult task. Hence, the solution is to use different types of
models to capture the different aspects of the interaction. Sequence and collaboration
diagrams are used to capture the dynamic nature but from a different angle.

4.2.1.1 SEQUENCE DIAGRAM

A sequence diagram simply depicts interaction between objects in a sequential order i.e. the
order in which these interactions take place. We can also use the terms event diagrams or
event scenarios to refer to a sequence diagram. Sequence diagrams describe how and in what
order the objects in a system function.

6
4.2.1.2 COLLABRATION DIAGRAM

A collaboration diagram is required to identify how various objects make up the entire
system. They are used to understand the object architecture within a system rather than the
flow of a message in a sequence diagram. An object an entity that has various attributes
associated with it. It is a concept of object-oriented programming. There are multiple objects
present inside an object-oriented system where each object can be associated with any other
object inside the system. Collaboration or communication diagrams are used to explore the
architecture of objects inside the system. The message flow between the objects can be
represented using a collaboration diagram

7
4.2.2 ACTIVITY DIAGRAM

Activity diagram is another important diagram in UML to describe the dynamic aspects of
the system. Activity diagram is basically a flowchart to represent the flow from one activity
to another activity. It captures the dynamic behaviour of the system. The activity can be
described as an operation of the system. The control flow is drawn from one operation to
another. This flow can be sequential, branched, or concurrent. Activity diagrams deal with
all type of flow control by using different elements such as fork, join, etc. Activity is a
particular operation of the system. Activity diagrams are not only used for visualizing the
dynamic nature of a system, but they are also used to construct the executable system by
using forward and reverse engineering techniques. The only missing thing in the activity
diagram is the message part.

8
4.2.3 STATECHART DIAGRAM

State chart diagram describes the flow of control from one state to another state. States are
defined as a condition in which an object exists and it changes when some event is triggered.
The most important purpose of State chart diagram is to model lifetime of an object from
creation to termination. State chart diagrams provide us an efficient way to model the
interactions or communication that occurs within the external entities and a system. These
diagrams are used to model the event-based system. A state of an object is controlled with the
help of an event.

9
4.2.4 IMPLEMENTATION DIAGRAM

State chart diagrams provide us an efficient way to model the interactions or communication
that occurs within the external entities and a system. These diagrams are used to model the
event-based system. A state of an object is controlled with the help of an event There are two
types of implementation diagrams, component diagrams show the structure of the code itself,
And deployment diagrams show the structure of the runtime system.

4.2.4.1 COMPONENT DIAGRAM


Component diagram is a special kind of diagram in UML. The purpose is also different from
all other diagrams discussed so far. It does not describe the functionality of the system but it
describes the components used to make those functionalities. Thus from that point of view,
component diagrams are used to visualize the physical components in a system. These
components are libraries, packages, files, etc. Component diagrams can also be described as
a static implementation view of a system. Static implementation represents the organization
of the components at a particular moment.

10
4.2.4.2 DEPLOYMENT DIAGRAM
Deployment diagrams are used to visualize the topology of the physical components of a
system, where the software components are deployed. The term Deployment itself describes
the purpose of the diagram. Deployment diagrams are used for describing the hardware
components, where software components are deployed. Component diagrams and
deployment diagrams are closely related.

11
CHAPTER 5

MODULE DESCRITION

5.1 MODULE LIST

 STUDENT
 TEACHER
 ADMIN
 NOTES

5.2 MODULE EXPLANATION

 STUDENT:
Students register on the website and login to access the notes uploaded by teachers
and view them or download it.
 TEACHER:
The teacher has to first register on the website and then login to upload the note.
Teacher can even delete the notes by logging in.
 ADMIN:
The notes are managed by admin. He has rights to approve or disapprove the notes
uploaded by particular user.
 NOTES:
Notes can be uploaded and deleted by teacher and student. It can be downloaded by
every student and teacher.

12
CHAPTER 6

SAMPLE CODE

Index.php

<?php include ('includes/connection.php'); ?>


<?php include('includes/adminheader.php'); ?>
<div id="wrapper">
<?php include 'includes/adminnav.php';?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Welcome
<small><?php echo $_SESSION['name']; ?></small>
</h1>
<?php if($_SESSION['role'] == 'admin') {
?>
<h3 class="page-header">
<center> <marquee width = 70% ><font color="green" > Notes uploaded by various
users</font></marquee></center>
</h3>
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<form action="" method="post">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Type </th>
<th>Uploaded on</th>
<th>Uploaded by </th>
<th>Status</th>
<th>View</th>
<th>Approve</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT * FROM uploads ORDER BY file_uploaded_on DESC";
$run_query = mysqli_query($conn, $query) or die(mysqli_error($conn));
if (mysqli_num_rows($run_query) > 0) {
while ($row = mysqli_fetch_array($run_query)) {
$file_id = $row['file_id'];
13
$file_name = $row['file_name'];
$file_description = $row['file_description'];
$file_type = $row['file_type'];
$file_date = $row['file_uploaded_on'];
$file_uploader = $row['file_uploader'];
$file_status = $row['status'];
$file = $row['file'];
echo "<tr>";
echo "<td>$file_name</td>";
echo "<td>$file_description</td>";
echo "<td>$file_type</td>";
echo "<td>$file_date</td>";
echo "<td><a href='viewprofile.php?name=$file_uploader' target='_blank'> $file_uploader
</a></td>";
echo "<td>$file_status</td>";
echo "<td><a href='allfiles/$file' target='_blank' style='color:green'>View </a></td>";
echo "<td><a onClick=\"javascript: return confirm('Are you sure you want to approve this
note?')\"href='?approve=$file_id'><i class='fa fa-times' style='color:
red;'></i>Approve</a></td>";

echo "<td><a onClick=\"javascript: return confirm('Are you sure you want to delete this
post?')\" href='?del=$file_id'><i class='fa fa-times' style='color: red;'></i>delete</a></td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<?php
if (isset($_GET['del'])) {
$note_del = mysqli_real_escape_string($conn, $_GET['del']);
$file_uploader = $_SESSION['username'];
$del_query = "DELETE FROM uploads WHERE file_id='$note_del'";
$run_del_query = mysqli_query($conn, $del_query) or die (mysqli_error($conn));
if (mysqli_affected_rows($conn) > 0) {
echo "<script>alert('note deleted successfully');
window.location.href='index.php';</script>";
}
else {
echo "<script>alert('error occured.try again!');</script>";
}
}
if (isset($_GET['approve'])) {
$note_approve = mysqli_real_escape_string($conn,$_GET['approve']);
$approve_query = "UPDATE uploads SET status='approved' WHERE
file_id='$note_approve'";
14
$run_approve_query = mysqli_query($conn, $approve_query) or die (mysqli_error($conn));
if (mysqli_affected_rows($conn) > 0) {
echo "<script>alert('note approved successfully');
window.location.href='index.php';</script>";
}
else {
echo "<script>alert('error occured.try again!');</script>";
}
}
?>
<?php
}
else {
?>
<h3 class="page-header">
<center> <marquee width = 70% ><font color="green" ><?php echo $_SESSION['course'];
?> Engineering </font><font color="brown"> notes uploaded by various
users</font></marquee></center>
</h3>

</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<form action="" method="post">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Type </th>
<th>Uploaded by</th>
<th>Uploaded on</th>
<th>Download</th>
</tr>
</thead>
<tbody>
<?php
$currentusercourse = $_SESSION['course'];
$query = "SELECT * FROM uploads WHERE file_uploaded_to = '$currentusercourse' AND
status = 'approved' ORDER BY file_uploaded_on DESC";
$run_query = mysqli_query($conn, $query) or die(mysqli_error($conn));
if (mysqli_num_rows($run_query) > 0) {
while ($row = mysqli_fetch_array($run_query)) {
$file_id = $row['file_id'];
$file_name = $row['file_name'];
$file_description = $row['file_description'];
$file_type = $row['file_type'];
$file_date = $row['file_uploaded_on'];
15
$file = $row['file'];
$file_uploader = $row['file_uploader'];
echo "<tr>";
echo "<td>$file_name</td>";
echo "<td>$file_description</td>";
echo "<td>$file_type</td>";
echo "<td><a href='viewprofile.php?name=$file_uploader' target='_blank'> $file_uploader
</a></td>";
echo "<td>$file_date</td>";
echo "<td><a href='allfiles/$file' target='_blank' style='color:green'>Download </a></td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<?php }
?>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

Login.php

<?php include 'includes/connection.php';?>


<?php include 'includes/header.php';?>
<?php include 'includes/navbar.php';?>
<?php
session_start();
if (isset($_POST['login'])) {
$username = $_POST['user'];
$password = $_POST['pass'];
mysqli_real_escape_string($conn, $username);
mysqli_real_escape_string($conn, $password);
$query = "SELECT * FROM users WHERE username = '$username'";
$result = mysqli_query($conn , $query) or die (mysqli_error($conn));
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
$id = $row['id'];
$user = $row['username'];
$pass = $row['password'];
$name = $row['name'];
$email = $row['email'];
$role= $row['role'];
16
$course = $row['course'];
if (password_verify($password, $pass )) {
$_SESSION['id'] = $id;
$_SESSION['username'] = $username;
$_SESSION['name'] = $name;
$_SESSION['email'] = $email;
$_SESSION['role'] = $role;
$_SESSION['course'] = $course;
header('location: dashboard/');
}
else {
echo "<script>alert('invalid username/password');
window.location.href= 'login.php';</script>";
}
}
}
else {
echo "<script>alert('invalid username/password');
window.location.href= 'login.php';</script>";
}
}
?>
<div class="login-card">
<h1>Log-in</h1><br>
<form method="POST">
<input type="text" name="user" placeholder="Username" required="">
<input type="password" name="pass" placeholder="Password" required="">
<input type="submit" name="login" class="login login-submit" value="login">
</form>
<div class="login-help">
<a href="signup.php">Register</a> • <a href="recoverpassword.php">Forgot Password</a>
</div>
</div>
<script src='css/jquery.min.js'></script>
<script src='css/jquery-ui.min.js'></script>
</body>
</html>

Signup.php

<?php include 'includes/connection.php';?>


<?php include 'includes/header.php';?>
<?php include 'includes/navbar.php';?>
<?php
if (isset($_POST['signup'])) {
require "gump.class.php";
$gump = new GUMP();
$_POST = $gump->sanitize($_POST);
17
$gump->validation_rules(array(
'username' => 'required|alpha_numeric|max_len,20|min_len,4',
'name' => 'required|alpha_space|max_len,30|min_len,5',
'email' => 'required|valid_email',
'password' => 'required|max_len,50|min_len,6',
));
$gump->filter_rules(array(
'username' => 'trim|sanitize_string',
'name' => 'trim|sanitize_string',
'password' => 'trim',
'email' => 'trim|sanitize_email',
));
$validated_data = $gump->run($_POST);
if($validated_data === false) {
?>
<center><font color="red" > <?php echo $gump->get_readable_errors(true); ?>
</font></center>
<?php
}
else if ($_POST['password'] !== $_POST['repassword'])
{
echo "<center><font color='red'>Passwords do not match </font></center>";
}
else {
$username = $validated_data['username'];
$checkusername = "SELECT * FROM users WHERE username = '$username'";
$run_check = mysqli_query($conn , $checkusername) or die(mysqli_error($conn));
$countusername = mysqli_num_rows($run_check);
if ($countusername > 0 ) {
echo "<center><font color='red'>Username is already taken! try a different
one</font></center>";
}
$email = $validated_data['email'];
$checkemail = "SELECT * FROM users WHERE email = '$email'";
$run_check = mysqli_query($conn , $checkemail) or die(mysqli_error($conn));
$countemail = mysqli_num_rows($run_check);
if ($countemail > 0 ) {
echo "<center><font color='red'>Email is already taken! try a different
one</font></center>";
}
else {
$name = $validated_data['name'];
$email = $validated_data['email'];
$pass = $validated_data['password'];
$password = password_hash("$pass" , PASSWORD_DEFAULT);
$role = $_POST['role'];
$course = $_POST['course'];
$gender = $_POST['gender'];
$joindate = date("F j, Y");

18
$query = "INSERT INTO
users(username,name,email,password,role,course,gender,joindate,token) VALUES
('$username' , '$name' , '$email', '$password' , '$role', '$course', '$gender' , '$joindate' , '' )";
$result = mysqli_query($conn , $query) or die(mysqli_error($conn));
if (mysqli_affected_rows($conn) > 0) {
echo "<script>alert('SUCCESSFULLY REGISTERED');
window.location.href='login.php';</script>";
}
else {
echo "<script>alert('Error Occured');</script>";
}
?>
<br>
<div class="container">
<div class="form">
<form id="contactform" method="POST">
<p class="contact"><label for="name">Name</label></p>
<p class="contact"><label for="email">Email</label></p>
<input id="email" name="email" placeholder="example@domain.com" required=""
type="email" value="<?php if(isset($_POST['signup'])) { echo $_POST['email']; } ?>">
<p class="contact"><label for="username">Create a username</label></p>
<input id="username" name="username" placeholder="username" required="" tabindex="2"
type="text" value="<?php if(isset($_POST['signup'])) { echo $_POST['username']; } ?>">
<p class="contact"><label for="password">Create a password</label></p>
<input type="password" id="password" name="password" required="">
<p class="contact"><label for="repassword">Confirm your password</label></p>
<input type="password" id="repassword" name="repassword" required="">
<p class="contact"><label for="gender">Gender </label></p>
<select class="select-style gender" name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select><br><br>
<p class="contact"><label for="role">I am a..</label></p>
<select class="select-style gender" name="role">
<option value="teacher">Teacher</option>
<option value="student">Student</option>
</select><br><br>
<p class="contact"><label for="course">I teach/study..</label></p>
<select class="select-style gender" name="course">
<option value="Computer Science">Computer Sc Engineering</option>
<option value="Electrical">Electrical Engineering</option>
<option value="Mechanical">Mechanical Engineering</option>
</select><br><br>
<input class="buttom" name="signup" id="submit" tabindex="5" value="Sign me up!"
type="submit">
</div>
</div>
</body>
</html>

19
CHAPTER 8

SCREENSHOTS

Homepage:

User Login Page

20
User Signup Page

Teacher Dashboard Page

21
Upload Note Page

Uploaded Note Page

22
View Profile Page

Update Profile Page

23
Admin Dashboard Page

24
CHAPTER 7

CONCLUSION & FUTURE SCOPE

7.1 CONCLUSION

It has been a matter of immense pleasure, honour and challenge to have this opportunity to
take up this project and complete it successfully. It was a nice experience working with the
professors. This will be helpful when we will work in industry & educational field where we
can put all these it in our practice. While developing this system ONLINE NOTES
SHARING USING PHP, I have learnt a lot about the working of system. During the
development process, I have understood the concept of designing and building a system.
While working on my system I have used all the knowledge which was taught us and all that
makes this project complete.

7.2 FUTURE SCOPE

The project has a very vast scope in future. The project can be implemented on
intranet in future. Project can be updated in near future as and when requirement
for the same arises, as it is very flexible in terms of expansion. With the
proposed software of Class Notes Gallery will be ready to use by any
organisation hence run the entire work in a much better, accurate and error free
manner. The following are the future scope for the project.

 Only a particular organisation people can use this system.


 Unique ID of students and teachers will be generated by the system.
 Mailing system will be done with the message alert system.

25

You might also like