Professional Documents
Culture Documents
Academic year
2021-22
Address Book
Course: Web based Application Development using PHP Course code: 22619
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Certificate
This is to certify that Mr. /Ms. Pranav Mhatre Roll No. 31 of Sixth Semester of Diploma in
Computer Engineering of Institute, VES POLYTECHNIC (Code: 0004) has completed the Micro
Project satisfactorily in Subject – Web based Application Development using PHP (22619) for the
Seal of
Institution
INDEX
1 Project Proposal 01
2 Action plan 02
3 Resource required 02
4 Introduction 03
5 Actual Procedure 05
6 Output 12
7 Skill developed 16
8 Evaluation sheet 18
Annexure – I
Micro-Project Proposal
Address Book
2 XAMPP, VS CODE -
Micro-Project Report
Address Book
1.0 Rationale
PHP is a server-side scripting language that is embedded in HTML. It is used to manage dynamic
content, databases, session tracking, even build entire data management sites. It is integrated with a
number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and
Microsoft SQL Server. A server-side dynamic web page is a web page whose construction is controlled
by an application server processing server-side script in the back end. A dynamic web page is a web
page that displays different content each time it is viewed while retaining the same layout and design.
To understand and implement PHP for practical purposes, we chose Employee Record Management
System website using PHP as our project.
Address book software enables you to save contact information secure in one place. Various address
book systems store data in multiple formats. Maintaining contact records in one place indicates that
you will always have access to reliable data and be able to share it over your business areas.
2.0 Aim/Benefits of the Micro-Project
This Micro-Project aims at
● To develop a website that maintains names, addresses and other contact information of the
users.
● To develop a user-friendly interface to maintain the records.
● Allows easy access to the user's friends, family, business associates and others by maintaining
their email and other contact details on their computer.
3
4.0 Literature Review
About PHP:
PHP is a server-side scripting language that is embedded in HTML. It is used to manage dynamic
content, databases, session tracking, even build entire e-commerce sites. It is integrated with a number
of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL
Server
About MySQL:
MySQL is an open-source relational database management system. As with other relational databases,
MySQL stores data in tables made up of rows and columns. Users can define, manipulate, control, and
query data using Structured Query Language, more commonly known as SQL.
About databases:
A database is an organized collection of structured information, or data, typically stored electronically
in a computer system. A database is usually controlled by a database management system (DBMS).
We have used a database to store user’s credentials and tasks for our project.
About xampp:
XAMPP is a free and open-source cross-platform web server solution stack package developed by
Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters
for scripts written in the PHP and Perl programming languages.
About functions in PHP:
PHP function is a piece of code that can be reused many times. It can take input as argument list and
return value. There are thousands of built-in functions in PHP. In PHP, we can define Conditional
function, Function within Function and Recursive function also. In our project, we have used functions
to increase our productivity and reduce redundancy and increase the reusability of the code by putting
the piece of code inside the function instead of typing it again and again.
About sessions and session variable in PHP:
A session creates a file in a temporary directory on the server where registered session variables and
their values are stored. This data will be available to all pages on the site during that visit. It is a special
type of variable whose value is maintained across subsequent web pages. With session variables, user-
specific data can be preserved from page to page delivering customized content as the user interacts
with the web application. In our project, we have used to authenticate user on every page after he/she
logs in.
The gadget store management system helps the user in maintaining the user and the device information
in a systematic manner. The records can be retrieve efficiently from the database. The user can also
see the records of the customer with their previous purchases along with the time. The user can change
the information of a product or it’s category with the help of the user-friendly UI.
4
5.0 Actual Procedure Followed
Algorithm
Step 1: Start
Step 2: Display the index page.
Step 3: Information of added users is displayed in the Home page.
Step 3.1: Information includes id, name
Step 3.2: Add new, update and delete buttons are displayed alongside.
Step 4: If the user navigates to Add-New user screen
Step 4.1: Accept all the necessary details.
Step 4.2: Check whether the details are validated or not.
Step 4.3: Show the new user’s data with a toast message.
Step 5: If the user navigates to Update
Step 5.1: Accept all the updated details
Step 5.2: Show the updated user’s information with its respective toast message.
Step 6: If the user clicks on Delete
Step 6.1: Show a confirm box which will recheck if the user wants to delete
Step 6.2: Delete the user
Step 7: Stop
Flowchart
5
Code
index.php:
<?php <div class="nav-wrapper">
require('./includes/functions.inc.php'); <a href="#!" class="brand-logo
?> center">Contact Info</a>
<!DOCTYPE html> <ul class="right hide-on-med-and-
<html> down">
</html>
$error_msg="Something went
$new_image_name="{$row['id']}.$ext"; wrong with the Database";
$image_name=$row['image_name']; }else{
//header('Location
unlink("./images/users/$image_name"); :idex.php?op=add&status=success');
$source=$_FILES['pic']['tmp_name'];
redirect("index.php?op=update&status=succes
$destination="./images/users/$new_image_na s");
me"; }
}
move_uploaded_file($source,$destination); ?>
} <!DOCTYPE html>
// else{ <html>
// //Extracting the Extension
// $image_name=$row['image_name']; <head>
// $data=explode('.',$image_name); <!--Import Google Icon Font-->
// $ext=strtolower(end($data)); <link
// href="https://fonts.googleapis.com/icon?famil
$new_first_name_lower=strtolower($new_firs y=Material+Icons" rel="stylesheet">
t_name); <!--Import materialize.css-->
// <link type="text/css" rel="stylesheet"
$new_last_name_lower=strtolower($new_last href="css/materialize.min.css"
_name); media="screen,projection" />
//
$new_image_name="$new_first_name_lower <!--Import Csutom CSS-->
-$new_last_name_lower.$ext"; <link rel="stylesheet" href="css/style.css"
// type="text/css">
rename("./images/users/$image_name","./ima <!--Let browser know website is optimized
ges/users/$new_image_name"); for mobile-->
// } <meta name="viewport"
$query="UPDATE contacts SET content="width=device-width, initial-
first_name='$new_first_name',last_name='$ne scale=1.0" />
w_last_name',email='$new_email',birthdate='
$new_birthdate',telephone='$new_telephone',a <title>Update Contact</title>
ddress='$new_address',image_name='$new_i </head>
mage_name' WHERE id=$id";
$result=db_query($query); <body>
if(!$result){ <!--NAVIGATION BAR-->
$error_flag=true; <nav>
<div class="nav-wrapper">
<!-- Dropdown Structure --> <input id="first_name"
<ul id="dropdown1" class="dropdown- name="first_name" type="text"
content"> class="validate" data-
<li><a href="#!">Profile</a></li> error=".first_name_error"
<li><a href="#!">Signout</a></li> value="<?=getOldValue($row,"first_name");?
</ul> >">
<nav> <label for="first_name">First
<div class="nav-wrapper"> Name</label>
<a href="#!" class="brand-logo <div class="first_name_error
center">Contact Info</a> "></div>
<ul class="right hide-on-med-and- </div>
down"> <div class="input-field col s6">
<input id="last_name"
<!-- Dropdown Trigger --> name="last_name" type="text"
<li><a class="dropdown- class="validate" data-
trigger" href="#!" data- error=".last_name_error"value="<?=getOldVa
target="dropdown1"><i lue($row,"last_name");?>">
class="material-icons <label for="last_name">Last
right">more_vert</i></a></li> Name</label>
</ul> <div class="last_name_error
</div> "></div>
</nav> </div>
<a href="#" data-target="nav-mobile" </div>
class="sidenav-trigger"><i class="material- <div class="row mb10">
icons">menu</i></a> <div class="input-field col s6">
</div> <input id="email"
</nav> name="email" type="email" class="validate"
<!--/NAVIGATION BAR--> data-
<div class="container"> error=".email_error"value="<?=getOldValue(
<div class="row mt50"> $row,"email");?>">
<h2>Update Contact</h2> <label
</div> for="email">Email</label>
<div class="row"> <div class="email_error
<form class="col s12 formValidate" "></div>
action="" id="update-contact-form" </div>
method="POST" enctype="multipart/form- <div class="input-field col s6">
data"> <input id="birthdate"
<div class="row mb10"> name="birthdate" type="text"
<div class="input-field col s6"> class="datepicker" data-
error=".birthday_error"value="<?=myDate(ge <div class="file-field input-field
tOldValue($row,"birthdate"),"M d, Y") ;?>"> col s9">
<label <div class="btn">
for="birthdate">Birthdate</label> <span>Image</span>
<div class="birthday_error <input type="file"
"></div> name="pic" id="pic" data-error=".pic_error">
</div> </div>
</div> <div class="file-path-
<div class="row mb10"> wrapper">
<div class="input-field col s12"> <input class="file-path
<input id="telephone" validate" type="text" placeholder="Upload
name="telephone" type="tel" class="validate" Your Image">
data- </div>
error=".telephone_error"value="<?=getOldVa <div class="pic_error "></div>
lue($row,"telephone");?>"> </div>
<label </div>
for="telephone">Telephone</label> <button class="btn waves-effect
<div class="telephone_error waves-light right" type="submit"
"></div> name="action">Submit
</div> <i class="material-icons
</div> right">send</i>
<div class="row mb10"> </button>
<div class="input-field col s12"> </form>
<textarea id="address" </div>
name="address" class="materialize-textarea" </div>
data- <footer class="page-footer p0">
error=".address_error"><?=getOldValue($row <div class="footer-copyright ">
,"email");?></textarea> <div class="container">
<label <p class="center-align">CO6IA-
for="address">Addess</label> Group11</p>
<div class="address_error </div>
"></div> </div>
</div> </footer>
</div> <!--JQuery Library-->
<div class="row mb10"> <script src="js/jquery.min.js"
<div class="col s3"> type="text/javascript"></script>
<img <!--JavaScript at end of body for optimized
src="images/users/<?=$row['image_name']; loading-->
?>" alt="" id="temp_image" width="100%"> <script type="text/javascript"
</div> src="js/materialize.min.js"></script>
<!--JQuery Validation Plugin-->
<script src="vendors/jquery- if($result) {
validation/validation.min.js" unlink("images/users/$image_name");
type="text/javascript"></script>
<script src="vendors/jquery- redirect('index.php?op=delete&status=success'
validation/additional-methods.min.js" );
type="text/javascript"></script> } else {
<!--Include Page Level Scripts-->
<script src="js/pages/update- redirect('index.php?op=delete&status=error');
contact.js"></script> }
<!--Custom JS--> ?>
<script src="js/custom.js"
type="text/javascript"></script>
</body>
</html>
delete.php
<?php
require_once('./includes/functions.inc.php');
if(!isset($_GET['id'])) {
echo " How the hell you came here????";
die();
}
$id = $_GET['id'];
$image_name = $rows[0]['image_name'];
$query = "DELETE FROM contacts WHERE
id = $id";
$result = db_query($query);
11
6.0 Actual Resources Used
Sr.No. Equipment Name with Broad Specification Remark if any
1 Laptop – Windows 10
2 Xampp, VS Code
15
8.0 Skill Developed / learning out of this Micro-Project
• We learnt how to use PHP for client side scripting.
• We learnt how to use functions in PHP.
• We learnt how to use sessions and session vaiables for practical usage in python.
• We learnt how to design a database using MySQL.
• We understood and implemented the connection of database with webpages via PHP.
• We understood the importance of working in team and listening to each other's ideas and views
to further improve our project and our knowledge.
• We have also learnt to coordinate with the team members and support each other for successful
completion of the project.
• We learnt to follow the deadlines and complete our work within specified time frame.
16
Annexure – III
17
Annexure – IV
Poor
Sr. Characteristic to be Average Good Excellent
( Marks1-3 Sub Total
No assessed ) (Marks 4-5 ) (Marks 6-8) ( Marks9-10)
(A) Process and Product Assessment (Convert Above Total marks out of 6 Marks)
Quality of
5
Prototype/Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 marks)
7 Presentation
8 Defense/Viva
Process and Product Assessment (6 Individual Presentation / Viva (4 Total Marks 18
Roll No.
Marks) Marks) 10
31
Dated Signature:
19