Professional Documents
Culture Documents
INTRODUCTION
1.1 Background of Study
Times are changing, and along with it is the technology as well. Technology
has been growing at a rapid rate to accommodate the current needs and the desires of
the people. Unarguably, one of the greatest technologies of the modern era is the cell
phone. It has become a phenomenon and an addiction to own at least one cell phone.
Cell phones have now become a part of our daily life and without cell phones we
would be lost in this high tech world. Cell phone use is getting more popular.
According to Heeks (2010) a mobile phone (also known as a cellular phone, cell
phone and a hand phone) is a device that can make and receive telephone calls over a
radio link whilst moving around a wide geographic area. It does so by connecting to a
cellular network provided by a mobile phone operator, allowing access to the public
telephone network. By contrast, a cordless telephone is used only within the short
range of a single, private base station. Mobile phones are used for a variety of
purposes, including keeping in touch with family members, conducting business, and
having access to a telephone in the event of an emergency. Some people carry more
than one cell phone for different purposes, such as for business and personal use.
Scoot (2004) revealed that the demand for mobile phones in Africa in the last few
years has been more than most people expected and continues to expand. Operators
have traditionally target urban areas, but it is the demand from rural and low income
areas that have exceeded all expectations. The use of phones has already become part
of African culture. As urban markets become saturated, the next generation of phone
users will be rural based, and they will be using mobile phones.
1
Demand is driven by voice as opposed to data. Social uses such as keeping in
touch with family and friends feature strongly. Benefits include a sense of wellbeing,
improved income (e.g. arranging cash transfers from family members), and reduced
risk (e.g. call for assistance). There is a growing body of evidence of the indirect
impact on the poor arising from improvements in the delivery of pro-poor services
that can be achieved through mobile phone based applications (Scoot, 2004). A great
number of mobile users are increasingly relying on their smart phones for all their
personal and professional needs. Such devices act as key stores for a broad range of
applications, messages, videos, photos, music and especially contacts. Given the
dependence on these devices, the loss of them can be quite traumatic. In a survey on
the MobileSyncPro website, 30% of mobile phone user’s delay to upgrade their
phones because of the difficulty and inconvenience involved in moving their contacts
over 70% of those surveyed, confessed to their mobile phones to be the primary
source for all of their contacts. The survey revealed that this is not just a material loss
but also a great loss of personal data. Both the issues are serious to the user. Thus, by
offering a simple backup solution for mobile phones we can provide peace of mind to
the users, knowing that their digital life – valuable data and contact information – is
safe and easily accessible even when their mobile is lost or damaged.
Now these contacts are stored in their hundreds on mobile handsets. However, if the
handset gets missing or the SIM card is damaged, then all the contacts, which were
gathered during the course of years, would be lost and the damage done would be
2
irreparable. The problems associated with storing all the phone contacts on the mobile
i. SIM Card Loss/Damage: When the mobile operator SIM card is lost or
iii. Erroneous Removal: During phone software upgrade or file/data clean up, the
iv. Backup Recovery Expenses: Mobile phone operators provide their customers
with phone contact backup solutions in the event of phone contact loss which is
i. Provide a system that will have a Graphical User Interface (GUI) friendly tool
that is easy to use, for the storage of mobile phone contact details online.
ii. Provide a system that will cut down the cost of retrieving lost handsets or
iii. Provide a system that will enable users to go online and retrieve their stored
mobile contact numbers in the event that they lose their phones.
iv. Provide a system that will enable the users of the system to recover their
3
1.4 Significance of the Study
The significance of this project paper is outlined below:
ii. Reduce the costs suffered during the replacement of a lost handset or phone
line by allowing the user to acquire only the physical infrastructure (mobile
handset/SIM Card) and not pay for phone contact data loss.
iii. The continuous and smooth running of communication even during the event
Based Phone Contact Backup and Recovery System for the storage of phone contact
details on a computer to prevent loss of contact data in the event of handset loss.
The data to be backed up will be limited only to the mobile phone contact information.
Other forms of data on the phone such as SMS text messages and notes will not be
considered.
1.6 Limitation
The limitations that will be faced by the researcher during the course of this project
experienced during the course of sourcing for materials via the web which will
4
ii. Lack of power supply: Poor power supply will be a challenge as using the
laptop or personal computer to type the research document will require that a
iii. Limited time: The time allotted for the submission of the project will be too
short for the completion of the research as the student will have to make
findings, study the current system, ask questions, wait for answers, submit
reports drafts and do corrections as well as develop the software and make
an integrated circuit that securely stores the International Mobile Subscriber Identity
(IMSI) and the related key used to identify and authenticate subscribers on mobile
or e-mail program or online game or mobile phone. It has various trademarked and
proprietary names in different contexts. The contact lists just a list: generally a
window that has a list of screen names that represent actual other people.
SMS: SMS stands for Short Message Service and is also commonly referred to as a
"text message". With a SMS, you can send a message of up to 160 characters to
5
another device. Longer messages will automatically be split up into several parts.
Android Device: An Android device is a device that runs on the Android operating
system. Android is an array of software intended for mobile devices that features an
smartphone, tablet PC, e-book reader or any type of mobile device that requires an
OS.
method was employed. Rapid Application Development process allows usable system
to be built within a short time (60 – 90 days). In certain situations, the acceptability of
a system can be accessed against the agreed minimum set or requirements rather than
all requirements.
ii. User design: this step is designed to eliminate ideas that work in theory but are
iv. Implementation: in this stage, users are trained in the operation of the finished
6
CHAPTER TWO
LITERATURE REVIEW
2.1 Review of Related Literature
Today, mobile phones have become popular to everyone since it is very
convenient. The most advantage of having a mobile phone is that one can
communicate with the family and friends no matter what where they are. For instance,
one can contact friends easily by calling or sending messages without electricity. This
might be the main reason why almost everyone today chooses to own a mobile phone.
From the customer’s point of view, it is obvious that mobile phones assist in business
a lot, such as, make schedule of working, surf the internet, and keep in touch with
other services such as text messaging, MMS, email, Internet access, short-range
photography. Mobile phones that offer these and more general computing capabilities
Motorola in 1973, using a handset weighing around 1 kg. In 1983, the DynaTAC
8000x was the first to be commercially available. In the twenty years from 1990 to
2011, worldwide mobile phone subscriptions grew from 12.4 million to over 5.6
billion, penetrating the developing economies and reaching the bottom of the
7
2.2 Backup and Recovery
Backup and recovery refers to the process of backing up data in case of a loss
and setting up systems that allow that data recovery due to data loss. Backing up data
requires copying and archiving computer data, so that it is accessible in case of data
deletion or corruption. Data from an earlier time may only be recovered if it has been
backed up.
backup. As the name implies, this type of backup makes a copy of all data to
another set of media, which can be tape, disk or a DVD or CD. The primary
complete copy of all data is available with a single set of media. This results in
(RTO). However, the disadvantages are that it takes longer to perform a full
more storage space.Thus, full backups are typically run only periodically. Data
centers that have a small amount of data (or critical applications) may choose
to run a full backup daily, or even more often in some cases. Typically, backup
differential backups.
only the data that has changed since the last backup operation of any type. The
modified time stamp on files is typically used and compared to the time stamp
of the last backup. Backup applications track and record the date and time that
8
backup operations occur in order to track files modified since these operations.
Because an incremental backup will only copy data since the last backup of any
type, it may be run as often as desired, with only the most recent changes
stored. The benefit of an incremental backup is that they copy a smaller amount
of data than a full. Thus, these operations will complete faster, and require
incremental the first time it is performed, in that it will copy all data changed
from the previous backup. However, each time it is run afterwards, it will
continue to copy all data changed since the previous full backup. Thus, it will
typically far less than a full backup. Moreover, differential backups require
more space and time to complete than incremental backups, although less than
full backups.
external hard drives or flash drives, even they require manual, physical
do not have to proactively save, label and track information. Rather, the
9
ii. Safety: As your data is stored in the Cloud, you are not subject to the typical
threats of fire, flooding or theft. In fact, data that is stored in the Cloud is
generally stored on secure, encrypted servers and systems, which minimizes the
risks your data can incur. However, it must be noted that while some cloud
storages do tout encryption services, you can never be too secure – and
depending on the type of data that you’re looking to store, you may want to
deleted, most likely through individual user error or deletion, backups are
available and easily located. Multiple levels of redundancy means that your
independent of each other. The more levels you have stored, the better as each
ensures that your data is safeguarded against loss as much as possible, allowing
you to access a backed up version of your data should it ever get lost.
iv. Ease of Access: As the Cloud has no singular physical location, remote access
is also a simple and feasible benefit to online backup. So long as you can
connect to the remote server, you have access to all the data that you have
your contact point is, gaining access to your information backed up online from
your remote device is done the same way, ensuring consistency and an easy
v. Affordability: Cloud-based back up can be less expensive than the cost of tape
10
the back up; the media on which the backups are stored; the transportation of
in your mobile phone. It is a fact of life that mobile phones are frequently lost or
damaged. While the phone may be easy to replace, what is often lost for good is the
contact information stored on the lost phone (Stella, 2011). Several Mobile backup
have existed to solve this problem by backing up the contact data. These are discussed
below.
Remo backup: Remo backup wireless applications turn everyday mobile phones into
on your desktop PC while you are away from the office. Without having to leave your
computer on, you can access the information you need while traveling. Important
information, such as business or personal Email, contacts and calendar can be viewed
and managed via the mobile phone. Whether you are a mobile professional looking for
ways to be more productive when away from the office, an individual responsible for
wireless projects in your organization, or someone who just likes to stay connected to
friends and family, there is a Remo backup application for you (Stella, 2011).
Vufone: Vufone is web service with mobile client which gives you the ability to
manage your mobile phone online (Makeuseof.com). With Vufone you can backup
mobile data (contacts, messages, calendar and media) and easily control it from
provided web account. It allows you to use Microsoft Outlook or Google to manage
your meetings, events and contacts from your mobile phone. You can even upload and
11
share your mobile media with friends on social networking sites like Facebook, Flickr,
Youtube etc.
music, video and documents with a password-protected online portal where users can
access and manage their information. The service also enables photo sharing and, in
some markets, a set of features for dealing with a lost phone that are sold as a
range of mobile devices, including USB flash drives, memory cards, external hard
disk drives, MP3 players, embedded phone memories, SIM cards and flash-based
memory cards for mobile phones. Dmailer’s data backup software supports both local
and online backup. On March 23, 2010, Dmailer launched a free version of its backup
software (Dmailer Backup v3) (Fileslinger). The software application allows users to
perform live backup and online backup of any storage device, as well as to back up
PC and Mac platforms locally, via USB drive, CD, mobile device or external hard
Zyb: Zyb allows you to backup all your mobile phone numbers online for free. Zyb is
an international mobile phone backup service and chances are fairly high that it
supports your phone model and your phone operator (techcrunch.com).You create an
12
account on Zyb website by typing your phone number, selecting your phone model
and your cellular operator. You will soon receive an SMS confirmation code and
you're all set to store your mobile content on Zyb website. Zyb can store unlimited
cell phone contact numbers, calendar and SMS text messages without asking you to
download any software on your cell phone. It can even sync your data online when
you add or update contact information. Support for iPod and Outlook sync in expected
soon.
ii. Through getting the details from a SMS text message sent from another mobile
phone.
iii. Through typing the details directly into the mobile handset via the keypads.
following problems;
i. When the mobile operator SIM card is lost or damaged, the phone contact data
is lost.
ii. When the mobile handset is misplaced, stolen or damaged, the phone contact
data is lost
iii. During phone software upgrade or file/data clean up, the phone contacts could
be mistakenly erased.
13
iv. Mobile phone operators provide their customers with phone contact backup
solutions in the event of phone contact loss which is usually quite expensive to
utilize.
restore system. The system will only grant access to those that registers or create
the over-reliance on the GSM operator services by providing more options for phone
contacts storage. Also, it will reduce the costs incurred during the replacement of a
lost handset or phone line by allowing the user to acquire only the physical
infrastructure (mobile handset/SIM Card) and not pay for phone contact data loss.
encompass the cost and time taken to complete this work is not much but the
development of this system will reduce the cost of retrieving your phone contact when
loss.
14
CHAPTER THREE
SYSTEM DESIGN
3.1 Objectives of the Design
System design is the process of defining the architecture, component, modules,
interface and data for the system to satisfy specified requirement one could see it as
The objectives of this are to be able to demonstrate the process involves in the design
and implementation of an android based phone backup and restore system. System
design moves the concentration of the project from problem domain to solution
domain.
15
3.3 Input Design
The input design specifies how data are entered and accepted by the system for
processing. The design specifies how the user interact with the system to direct the
action to be taken.
16
Fig 3.3 Registration page
17
3.3.4 Edit Contact Page
This form enables the users to update any contact store in the database
18
3.4 Output Design
This refers to the result that are generated by the system
19
Fig 3.6 Edit and Delete contact page
a set of actions (use cases) that some system or systems (subject) should or can
perform in collaboration with one or more external users of the system (actors).
Below is the use case diagram of the Mobile Phone Contact Back-Up Solution.
20
Figure 3.7 Use case Diagram
Below are the descriptions and structure of the database files to be used by the system:
Login file: This database file will contain the information used to store authentication
21
Table1: Login table
Contact file: This database file will contain the information about the phone contact
details.
process, showing the steps as boxes of various kinds, and their order by connecting
22
them with arrows. This diagrammatic representation illustrates a solution model to a
given problem.
Below is the diagram showing the flowchart of the Android Based Phone Contact
DISPLAY ADD
CONTACT FORM
DISPLAY UPDATE
CONTACT FORM
DISPLAY VIEW
CONTACT FORM
Fig 3.8 Flowchart of Android Based Phone Contact Backup and Recovery
System
23
3.8 Data Flow Diagram
A data flow diagram (DFD) maps out the flow of information for any process
or system. It uses defined symbols like rectangles, circles and arrows, plus short text
labels, to show data inputs, outputs, storage points and the routes between each
destination.
The dataflow diagram for the proposed system is illustrated in the figure below.
bend ability and very easy deploying site. PHP MYSQL was used for designing the
database that served as the backend for storing information because of its high
24
maintenance and security tool. Android Studio was used to integrate the restoring part
of the system (printing or saving as PDF) and also for building the app to a dot Apk
file.
25
CHAPTER FOUR
SYSTEM IMPLEMENTATION
4.1 Overview of System Implementation
The Android Based Phone Contact Backup and Recovery System was
implemented using HTML version 5, PHP server side scripting language, JavaScript
System implementation follows the approval of the system proposals and its
ii. Out of the box, Android is incompatible with ARMv4 or lower, ARMv5 or
26
4.3 Procedure for Installing Android Application
Before attempting a manual installation of apps using the .apk files, you must
first allow your phone to install from “unknown source” (i.e. non-market apps).
To do this, navigate to Menu-> Settings -> Applications and check the box marked
“unknown source”.
Some Android phones does not natively come with any method of browsing the
data on your SD card, so you will need to install a file manager from a market. There
is a large variety of file manager available on Android. Then if your Android phone
comes with one or has a file manager then you don’t need to perform this step.
Connect your Android device to the PC using your USB cable. Mount the SD card and
On your Android device, navigate to the .apk file using the file manager and select it.
This will open a dialog box allowing you to install the app. select “open app
manager”. One the next page, select “install” to install the apk.
allows both the old system and the new system to run concurrently together. This is
necessary in the event of failure of the new system due to unavoidable technical
inefficiencies.
27
4.5 Android Testing
Android Studio is designed to make testing simple with just a few clicks, you
can set up a Junit that test on the local JVM or an instrumented test that runs on a
device. Of course you also extends your test capabilities by integrating test
interaction in your instrumented tests. You can generate Espresso tests automatically
These are test that run on your machines local java Virtual Machines (JVM).
Use these to minimize execution time when your test have no Android framework
runtime, these test are executed against a modified version of android.java where all
final modifiers have been stripped off. This let you use popular mocking libraries like
mockito.
These are test that run on hardware device or emulator. These test have access
to instrumentation APIs, give you access to information. Such as the context of the
app you are testing and let you control the app under test from your test code. Use
these tests when writing integration and functional UI test to automate user
interaction, or when your test have Android dependencies that mock objects cannot
satisfy. Because instrumented test are built into a APK (separate from your app APK),
that must have their own AndroidManifest.xml file. However, Gradle automatically
28
generate this file during the build so it is not visible in your project source set. You
‘minSdkVersion’ or register run listeners just for your test. When building your app
29
Fig 4.2 Registering new user
Fig 4.3 Showing user existed when trying to register with existing username
30
Fig 4.4 Showing success when you register with none existing username
31
Fig 4.6 showing no such file when you enter with wrong username and password
Fig 4.7 telling you that some fields are empty when filling form or entering data.
32
Fig 4.8 showing user adding contact to the database
33
Fig 4.10 showing no record when user search for contact that is not stored
Fig 4.11 showing a particular stored contact when the users search for it
34
4.6 Training of the Operator
i. Open the app.
iii. Type in your login details to login to the app main page.
iv. If you don’t have any login details, then click on ‘register’ to register your new
details.
v. If you login the first page you will see allow you to add contact to the database.
vi. At the left side of the page lies the side navigation button which when click it
vii. On top of the page is the action-bar, the left and right arrows help you to move
back and front and the down arrow is use to download the contact you store in
In other words maintenance involves updating and upgrading the system to keep pace
with new product, service, customers, demand government regulation and other
imperative for system changes as they become necessary. For any software to stand
the test of time, regular maintenance must be carried out on the software.
the researcher at the start of this computer science research. All input and output
modules functions as was required. It was possible to recover the contacts after
35
4.9 Findings/Achievement
In the course of this project, I found out that the existing system only works
with e-mail and without it you cannot backup your data and my achievement is that I
was able to build a new system which allow the user to enter a username and
password (name and password that won’t be shared with anyone) that he/she will be
using to login to his account and backup their contact. Also I added a way whereby
the user can have a soft copy of the contact him /her backup.
36
CHAPTER FIVE
SUMMARY AND CONCLUSION
5.1 Summary
Times are changing, and along with it is the technology as well. Technology
has been growing at a rapid rate to accommodate the current needs and the desires of
the people. Unarguably, one of the greatest technologies of the modern era is the cell
phone. It has become a phenomenon and an addiction to own at least one cell phone.
Cell phones have now become a part of our daily life and without cell phones we
would be lost in this high tech world. Cell phone use is getting more popular. Gone
are the days when phone contacts were stored in diaries and scratch pads. Now these
contacts are stored in their hundreds on mobile handsets. However if the handset gets
missing or the SIM card is damaged, then all the contacts, which were gathered during
the course of years, would be lost and the damage done would be irreparable. This has
Backup and Recovery System for the prevention of phone contact data loss.
funds at my disposal were too meager to support the project. In other to address
this, effort were geared towards increasing personal serving to meet the needs
37
iv. Insufficient time: time allowed to this project work was too short hence most of
the work done in a rush thereby not affording the students the ample
However, sleepless nights were spent to ensure that the work was complete as
at when due.
5.3 Recommendations
Based on the thorough study on this project work, the following recommendations
i. Future researches should improve on the Android Based Phone Contact Backup
ii. Phone contacts put into the database should be stored in an encrypted format so
iii. The solution is suitable for use by any individual owning a mobile handset for
5.4 Conclusion
A great number of mobile users are increasingly relying on their smart phones
for all their personal and professional needs. Such devices act as key stores for a broad
range of applications, messages, videos, photos, music and especially contacts. Given
the dependence on these devices, the loss of them can be quite traumatic. Surveys
have revealed that the loss of mobile phone contacts is not only viewed just as a
material loss but also a great loss of personal data. Both the issues are serious to the
user.
38
Thus, by offering a simple backup solution for mobile phones we can provide peace of
mind to the users, knowing that their digital life – valuable data and contact
information – is safe and easily accessible even when their mobile is lost or damaged.
It is hoped that the positive results achieved during the course of this research
work will go a long way in providing phone owners with a viable solution to their
39
REFERENCES
Agar, J. (2004). Constant Touch: A Global History of the Mobile Phone, ISBN 1-
84046-541-7.
Donner, J. and Steenson, M. W (2008). Beyond the Personal and Private: Modes of
Mobile Phone Sharing in Urban India. In The Reconstruction of Space and
Time: Mobile Communication Practices, edited by Scott Campbell and Rich
Ling, 231–250. Piscatawy, NJ: Transaction Publishers.
Gartner, D. (2010). Gartner Says Worldwide Mobile Connections Will Reach 5.6
Billion in 2011 as Mobile Data Services Revenue Totals $314.7 Billion (PDF).
Heeks, R. (2008). Meet Marty Cooper – the inventor of the mobile phone. BBC 41
(6): 26–33. doi:10.1109/MC.2008.192
Miller, J. (2009). Cell Phone Tracking Can Locate Terrorists — But Only Where It's
Legal. FOX News. Retrieved 14 March 2009.
Odell, M. (2005). Use of mobile helped police keep tabs on suspect. Financial Times.
Retrieved 14 March 2009.
Poulter, S. (2011). End of the credit card? With one swipe of an iPhone you'll be able
to pay for your shopping. London. Retrieved 29 January 2011
40
APPENDIX
SOURCE CODE
<?php
require_once 'mobile/Mobile_Detect.php';
$detect = new Mobile_Detect;
if ( $detect->isMobile() ) {
}
else
{
//die("Not Mobile Device.");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Mobile Contact System</title>
<!--
This template can be used for creating apps that require user login and user
registration before starting actual app.
-->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-
scale=1.0, user-scalable=0;" />
<link rel="stylesheet" type="text/css" href="appframework/af.ui.css" />
<link rel="stylesheet" type="text/css" href="appframework/icons.css" />
<script type="text/javascript" charset="utf-8"
src="appframework/appframework.ui.min.js"></script>
$(document).ready(function(){
$.ui.launch();
// setup signin and signup button events
41
$("#login").on("click", function(){
signIn();
});
$("#register").on("click", function(){
signUp();
});
});
functionsignIn(){
// sigin code here
42
</div>
<!-- Login View -->
<div class="panel" title="Login" id="signin" data-footer="none">
<form action="#main" id=my_form>
<div style="text-align:center">
<br>
<br>
<p>Login to add contact details</p>
<br>
<br>
</div>
<input name="uname" type="text" placeholder="username" />
<input name="pword" type="password" placeholder="password" />
<a href="javascript:{}" class="button block green"
onClick="document.getElementById('my_form').submit();">Login</a>
</form>
</div>
<!-- Register View -->
<div class="panel" title="Select Location" id="signup" data-footer="none">
<div style="text-align:center">
<br>
<br>
<p>Hi, select your location.</p>
<br>
<br>
</div>
<form action="book.php" method="get" id="my_form2" >
<select name="from1" >
<option value="">--LOCATION--</option>
<?php
include('db.php');
$n=0;
$result= @mysql_query("select * from mechanic group by location");
while(@$row=mysql_fetch_array($result))
{
$n++;
$id=$row['location'];
43
<div class="panel" title="Mobile Contact App" id="main" data-load="startApp">
<?php
include('db.php');
$uname=($_REQUEST['uname']);
$pword=($_REQUEST['pword']);
$result=mysql_query("select uname from user where uname='$uname' and pword =
'$pword'");
@$chk= mysql_result($result,0);
//echo "username: $uname and password: $pword";
if ($chk=='')
{
echo "
<center><br/>
<font color= red >
Wrong Username and Password!
<br>
<br>
<form action='#signin' method=post target=_self enctype=multipart/form-data>
<input type = submit value='Back' name=tour class='button block green'>
</FORM>";
mysql_close($con);
die();
}
//header("Location:hod.php?uname=$uname");
//header("Location:http://google.com");
echo '<script type="text/javascript">
window.location="hod.php";
</script>';
}
?>
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Admin Portal</title>
<!--
This template can be used for simple app with left side menu that can be opened to
switch views, for applications like Youtube App or Gmail app.
-->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-
scale=1.0, user-scalable=0;" />
<link rel="stylesheet" type="text/css" href="appframework/af.ui.css" />
44
<link rel="stylesheet" type="text/css" href="appframework/icons.css" />
<script type="text/javascript" charset="utf-8"
src="appframework/appframework.ui.min.js"></script>
<!--AppFramework plugin for sliding side menu-->
<script type="text/javascript" charset="utf-8"
src="appframework/plugins/af.slidemenu.js"></script>
<!-- Required if packaging to native app using Intel XDK -->
<script src="intelxdk.js"></script>
<script src="xhr.js"></script>
<script>
$.feat.nativeTouchScroll=true;
</script>
<script>
functiononDeviceReady(){
$.ui.launch();
intel.xdk.device.hideSplashScreen();
}
document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);
</script>
<!-- end Intel XDK code -->
<script>
$.ui.autoLaunch = false;
$.ui.animateHeaders = false;
$(document).ready(function(){
$.ui.setSideMenuWidth('260px');
$.ui.launch();
});
</script>
</head>
<body>
<div id="afui">
<!--Left Side Menu Navigation bar -->
<nav>
<ul class="list">
<li><a href="#page1" class="icon pencil">Add Contact</a></li>
<li><a href="#page2" class="icon magnifier">Search Contact</a></li>
<li><a href="#page3" class="icon magnifier">View Contacts</a></li>
<li><a href="javascript:window.location='index.php';" class="icon
user">Logout</a></li>
</ul>
</nav>
<div id="content" style="">
<!--------------------------------------------------------Page 1-->
<div class="panel" title="Add Contact" id="page1" data-footer="none" >
<header>
45
<a id="menubadge" onclick='$.ui.toggleSideMenu()' class='menuButton'
style="float:left !important"></a>
<h1>Add Contact</h1>
</header>
<p>Enter Contact details below:</p>
<form action="#submit" id="my_form" method="post">
<input name="name" type="text" placeholder="Contact Name" />
<input name="phone" type="text" placeholder="Mobile Phone" />
<input name="email" type="text" placeholder="Email" />
<textarea name="addr" placeholder="Contact Address" ></textarea>
<input name="form" type="hidden" value='1' />
<a href="javascript:{}" class="button block green"
onClick="document.getElementById('my_form').submit();">Submit</a>
</form>
<div class="panel" title="Favorites" id="page2" data-footer="none">
<header>
<a id="menubadge" onclick='$.ui.toggleSideMenu()' class='menuButton'
style="float:left !important"></a>
<h1>Search Contact</h1>
</header>
<p>Search for a contact below</p>
<form action="#submit" id='my_form2' method="post" >
<select name="name" id="select2">
<option value="">--SELECT CONTACT--</option>
<?php
include('db.php');
$n=0;
$result= @mysql_query("select * from mobile_contacts");
while(@$row=mysql_fetch_array($result))
{
$n++;
$id=$row['id'];
$name=$row['name'];
echo"<option value='$name' >".strtoupper($name)."</option>";
</select>
<input name="form" type="hidden" value='2' />
<a href="javascript:{}" class="button block green"
onClick="document.getElementById('my_form2').submit();">Search</a>
</form>
<div class="panel" title="View Bookings" id="page3" data-footer="none">
<header>
<a id="menubadge" onclick='$.ui.toggleSideMenu()' class='menuButton'
style="float:left !important"></a>
<h1>View Contacts</h1>
</header>
<p>View your mobile contacts</p>
46
<?php
include('db.php');
$n=0;
$result= @mysql_query("select * from mobile_contacts");
while(@$row=mysql_fetch_array($result))
{
$n++;
$id=$row[0];
$a=$row[1];
$b=$row[2];
$c=$row[3];
$d=$row[4];
$e=$row[5];
; $f="<a href=javascript:window.location='delete.php?id=$id' class='button' >Delete
Contact</a>";
echo"
<font color=blue><i><b>------ Record #$n ------<b></i><br/></font>
Contact: $a <br/><br/>
Phone: $b <br/><br/>
Email: $c <br/><br/>
Address: $d <br/><br/>
Date Added: $e <br/>
$f
<hr>
}
?>
</table>
<?php
if ($n==0)
{echo"<CENTER>
No contacts available!
";}
?>
</div>
<div class="panel" title="Logout" id="page4" data-footer="none">
<header>
<a id="menubadge" onclick='index.php' class='menuButton' style="float:left !
important"></a>
<h1>Logout</h1>
</header>
</div>
<!-- /////////////////////////////////////////////////// submit code -->
<!--Route Submit-->
<div class="panel" title="Processing..." id="submit" data-load="startApp">
<?php
if ($_REQUEST['form']=="1")
47
{
include('db.php');
$a=$_REQUEST['form'];
$a=($_REQUEST['name']);
$b=($_REQUEST['phone']);
$c=($_REQUEST['email']);
$d=($_REQUEST['addr']);
$e = date("M j, Y");
if (($a=='') or ($b=='') or ($c==''))
{
echo "
<br/>
<center>
Please fill all fields!
<br/>
<a href='hod.php?#page1' class='button block green' style='text-
align:center'>Back</a> ";
die('');
}
//echo $plate.$weigh.$color.$man.$model.$chasis.$type.$owner;
$sql="insert into mobile_contacts
values
(
'',
'$a',
'$b',
'$c',
'$d',
'$e'
)";
if (mysql_query($sql))
{
echo "<br/>
<center>
Contact added!
<br/><br/>
<a href=#page1 class='button block green' style='text-align:center'>Back</a> ";
}
else
{
echo "
<br/>
<center><FONT FACE=VERDANA >
<h4>PLEASE TRY AGAIN!</h4>
<br/>
<a href='javascript:history.back(1);'> Back</a>";
48
die();
}
;
}
//exit;
///////////////////////////////////////////
?>
<?php
if ($_REQUEST['form']=="2")
{
include('db.php');
$name=($_REQUEST['name']);
//$date = date("M j, Y");
if (($name==''))
{
echo "
<br/>
<center>
Please fill all fields!
<br/>
<a href=#page2 class='button block green' style='text-align:center'>Back</a> ";
die();
}
//echo $plate.$weigh.$color.$man.$model.$chasis.$type.$owner;
$n=0;
//echo "name=$name";
$result= @mysql_query("select * from mobile_contacts where name='$name'");
while(@$row=mysql_fetch_array($result))
{
$n++;
$id=$row[0];
$a=$row[1];
$b=$row[2];
$c=$row[3];
$d=$row[4];
$e=$row[5];
$f="<a href=javascript:window.location='delete.php?id=$id' class='button' >Delete
Contact</a>";
echo"
<font color=blue><i><b>------ Result #$n ------<b></i><br/></font>
Contact: $a <br/><br/>
Phone: $b <br/><br/>
Email: $c <br/><br/>
Address: $d <br/><br/>
Date Added: $e <br/>
$f
49
<hr>
}
echo"
</table>";
if ($n==0)
{echo"<CENTER>
No contacts available!";}
}
echo"<a href=#page2 class='button block green' style='text-align:center'>Back</a> ";
?>
<br/>
<!-- /////////////////////////////////////////////////// submit code end -->
</div>
</div>
</body>
</html>
OUTPUT SAMPLE
50