You are on page 1of 54

TABLE OF CONTENT

ACKNOWLEDGEMENT....................................................................................i

ABSTRACT........................................................................................................ii

TABLE OF CONTENT.....................................................................................iii

LIST OF FIGURES............................................................................................iv

LIST SCREEN SHOT.........................................................................................v

LISTOFSOURCE CODE...................................................................................vi

CHAPTER1.....................................................................................................1

INTRODUCTION...............................................................................................1

1.1. Background............................................................................................1

1.2. ProblemStatement..................................................................................1

1.3. Objectives..............................................................................................1

1.4. ScopesandLimitations............................................................................2

CHAPTER2.....................................................................................................3

SYSTEMANALYSIS..........................................................................................3

2.1. Analysis ofExistingSystem....................................................................3

2.2. Requirementcollection...........................................................................4

2.3. FeasibilityStudy.....................................................................................5

CHAPTER3...................................................................................................12

SYSTEMDESIGN.............................................................................................13

3.1. Use CaseModeling...............................................................................24

1
3.2. Sequence Diagram...............................................................................28

CHAPTER4...................................................................................................29
SYSTEM IMPLEMENTATIONANDTESTING.................................................

4.1. UserInterface............................................................................................

4.2. Tools........................................................................................................

4.3. TestCase...................................................................................................

CHAPTER5.......................................................................................................

MAINTENANCEANDSUPPORT........................................................................

CHAPTER6...........................................................................................................

SCREEN SHOT

CHAPTER7...........................................................................................................

SOURCE CODE

CHAPTER8.......................................................................................................

CONCLUSION ANDENHANCEMENTS...........................................................

REFERENCE.......................................................................................................

2
LIST OF FIGURES

Fig 3. 1 Use caseDiagram....................................................................................7

Fig 3. 2SequenceDiagram....................................................................................8

Fig 4. 1Frontend...................................................................................................9

Fig 4. 2 LoginandRegistration...........................................................................10

Fig 4. 3AdminDashboard...................................................................................10

Fig 4. 4 ManageProduct.....................................................................................10

Fig 4. 5AddProduct............................................................................................11

3
LIST OF ABBREVIATION

Abbreviation StandsFor

CSS Cascading StyleSheet

HTML Hyper Text MarkupLanguage

PHP PHP: HypertextPreprocessor

UML Unified ModelingLanguage

4
ABSTRACT :

The purpose of Online News Portal is to automate the existing manual system by the help

of computerized equipments and full-fledged computer software, fulfilling their

requirements, so that their valuable data/information can be stored for a longer period with

easy accessing and manipulation of the same. The required software and hardware are

easily available and easy to work with. Online News Portal, as described above, can lead

to error free, secure, reliable and fast management system. It can assist the user to

concentrate on their other activities rather to concentrate on the record keeping. Thus it

will help organization in better utilization of resources. The organization can maintain

computerized records without redundant entries. That means that one need not be

distracted by information that is not relevant, while being able to reach the information.

The aim is to automate its existing manual system by the help of computerized equipments

and full-fledged computer software, fulfilling their requirements, so that their valuable

data/information can be stored for a longer period with easy accessing and manipulation of

the same. Basically the project describes how to manage for good performance and better

services for the clients.

5
CHAPTER 1

INTRODUCTION
1.1. Background

The clothes is used by every person in the world. Clothes provides benefits to the
People from different environmental elements. Clothes provide warmness in the winter
season and provides protection from harmful sun raise in the summer. Although Clothes
being an important part of people life the quality are decreasing year by year and the
price of clothes is increasing due to the involvement of middle man in the clothing
industry.

Today mobile and web based applications have become a part of our day to day life.
With the revolution in mobile computing many great features are added to the field and
the mobiles are getting smaller, faster and better as the decade passes. Considering this
we have developed an efficient and reliable online clothes buying web application.
Online News Portal simply list the clothes that the user can buy and user canprovide
the location to deliver it.

1.2. Problem Statement

Clothes being an important part of people are forced to buy a less quality clothes and
also in a high price. This problem has arrived due to the involvement of middleman in
this industry who buy the clothes in cheap price from low quality manufactures and sold
it to consumers in a high price. There are no any government organization that
constantly monitoring the clothing market so it is very difficult to control the price of
clothes.

1.3. Objectives

Online News Portalis a web application which provide user to buy the clothesfrom
the comfort of their home. As there are no any particular clothing market in Nepal
beside Ason market, customer who wants to buy clothes of less quantity doesn't prefer
to go there. So we came up with the idea to deliver the fresh design clothes of any
6
quantity to the customer to their location. Also the seller in the

Clothing market buy the clothes from the middleman so the price of their clothes is high
we try to solve the problem of high price by directly buying the clothes from the
producer and selling it to the customer without the involvement of middleman. So that
the price of clothes can be low. Some basic objective of Online News Portalare:

i. Make the easy availability of clothes basically in urban area.


ii. Low price compare to clothes shop.
iii. Helps to uplift the living standard of local manufactures by involving them.

1.4. Scopes and Limitations

The scope of this project is that it helps user to buy their clothes from the comfort of
their home. It helps to remove the problem of visiting the clothes shop every 2-3
months and spend around 1 day every time to buy the clothes. Online News
Portaldirectly buys clothes from the manufactures so the selling cost to the consumer
will be low as compared to the other clothes shop.

As we are trying to remove the middleman from the clothing industry and try to remove
the problem of low quality products we might face various obstacle doing that. Also we
are directly buy goods from producers we also may face obstacle during the time of
convincing the producer. Also future maintenance should be done in the software to add
different features in the software.

CHAPTER 2

SYSTEM ANALYSIS

Online News Portalinvolves the problem-solving technique of easy availability of


clothes to the consumer at a reasonable price. There are few web and application portal

7
like (daraz.com) who deals with the selling of clothes to the consumer but what makes
Online News Portalunique is that we buy clothes directly from the producer which gives
us the competitive advantage than others.

2.1. Analysis of Existing System

Nepal’s First Largest and Trusted Online News Portaldaraz.com. Busy routine, rush-
hours and hectic markets are unsettling people from trouble free reach to quality and
new design clothes. Daraz.com provides a highly managed hassle-free online market
where you can get items be it clothes, electronic, dairy products, sprouts or any other
items you name within your clicks. It is place to your need of item delivered to you with
proper quality in desired time frame adding value to your life, supplying the best out of
fresh items and products. Daraz.com is an enterprise of Chinese-owned online
marketplace and Logistics Company which operates in South Asian markets an
endeavor to combine city lifestyle with information technology.

There are some of the weakness of Daraz.com which might give us a slight competitive
advantage then them. Some of the weakness are

 Inadequate research on market and customer satisfaction


 Lack of adequate facilities
 No precise delivery timing
 Compromise in product quality

Besides having some weakness Daraz.com also have a numerous strength. Some of the
strength of Daraz.com are:

 Ordered item distribution system


 Free delivery strategy
 Product varieties-more items which is not available in local market easily

8
9
 Increasing number of customersin B2Bmodel

2.2. Requirementcollection

There are basically functional and non-functional requirements. Functional requirements


are servicing the system should provide. In this project, the user interacts
withtheapplicationtogetinformationaboutherb.Userfirstloginsandthesystem validates the
login credentials. The user will be able to view the list of herbs and
theirdetails.Eachuserwillhavetheirownlistoftheirorderproductandthesecurityis maintained.
In the other hand, non-functional requirements are the constraints on the
servicesorfunctionsofferedbythesystem.Theyincludetimingconstraints,constraints on the
development process and standards. This project hugely emphasizes on performance of
the project. It is reliable, portable, andusable.

2.2.1. FunctionalRequirement

The users can register and login into the system by proving necessary details.
After successful registration and login, user can view product, product details and latest
newsfeed regarding sale. The users of the system information via admin about their
order. Some of the functional requirements of the system are listed below:

 Users Login andRegistration


 UsersLogout
 Admin panel for uploading new product and editing the productdetails
 Track theorder
 Edit the credential of user

2.2.2. Non-FunctionalRequirement

Quality attributes, constraints, goals and non- behavioral requirements of Okhati-


Online herbsystemreferstonon-functionalrequirements.Theserequirements
areimposedinthesystemdealswiththeissueslikeusability,extendibility,scalability,
Performance andmaintainability.
2.3. Feasibility Study
2.3.1. TechnicalFeasibility

Technical feasibility involves determining whether a system can actually


be constructed to solve the problem at hand. The following points were
considered for the project’s technical feasibility.

 The required technologies (PHP)existed.


 The database management tool (MySQL) was found technically
capable to hold data required to install and use thesystem.

2.3.2. OperationalFeasibility

Operational feasibility asks if the system will work when developed and
installed. The following points were taken into account for operational
feasibility of the proposed system.

 The proposed system causes no harm because it only provides


service to the users.
 The system is user friendly so the user can use this system more
enthusiastically.
 The system is affordable and has low operational cost becauseit
requires lowbandwidth.

2.3.3. Economic Feasibility

The economic feasibility of the project can be shown through the following
points.

 The tools and technologies used for the system are free for
noncommercial developmentpurposes
 Sincethesystemisdevelopedaspartofprojectwork,thereisno manual
cost to spend for the proposed system. It can be assured that the
project proves economically feasible because all the resources are
alreadyavailable.
2.3.4. ScheduleFeasibility

Typically, Schedule feasibility means estimating how long the system will
take to develop, and if it can be completed in a given time period using some methods
like payback period. Schedule feasibility is a measure of how reasonable the
projecttimetableis.Sincetheprojectwasconductedaccordingtotheprojecttimetable, it was
developed and implemented at the giventime.
CHAPTER 3

SYSTEM DESIGN

3.1 HARDWARESPECIFICATIONS:
Operating System: windows 10

HardDisk:4GB
RAM: 64-bit
Keyboard: Standard
Mouse:Standard
3.2 SOFTWARESPECIFICATIONS:
LanguageUsed:PHP5.6

Data base: MYSQL5.x,


User InterfaceDesign: HTML,AJAX,query,JavaScript
Software:XAMPP
3.3.1 PHPTRIAD
PHP Triadinstalls a complete working PHP/MYSQL server environment on
Window splatforms(9x/NT).InstallPHP,MYSQL,Apache, and PHPMYAdmin.
3.3.1.1 PHP
PHP is a scripting language originally designed for producing dynamic web pages.
It hasevolved to include a command line interface capability and can be used in standalone
graphicalapplications.WhilePHPwascreatedbyResumesLeadoffin1995,themainimplementa
tion of PHP is now produced by The PHP Group and serves as the de facto standard
forPHP as there is no formal specification. PHP is free software released under the PHP
License;however, it is incompatible with the GNU General Public License (GPL), due to
restrictions on theusage of the term PHP. It is a widely-used general-purpose scripting
language that is especiallysuited for web development and can be embedded into HTML.
It generally runs on a web server,taking PHP code as its input and creating web pages as
output. It can be deployed on most webservers and on almost every operating system and
platform free of charge. PHP is installed on
morethan20millionwebsitesand1millionwebservers.PHPoriginallystoodforPersonalHomeP
age.It began in 1994 as a set of Common Gateway Interface binaries written in the C
programminglanguage by the Danish/Greenlandic programmer Resumes Leadoff. Leadoff
initially created thesePersonal Home Page Tools to replace a small set of Perl scripts he
had been using to maintain hispersonalhomepage. The toolswere used toperformtaskssuch
asdisplaying hisrésuméandrecordinghow much traffic his pagewasreceiving.

He combined these binaries with his Form Interpreter to create PHP/FI, which had
morefunctionaliPHP/FI included a larger implementation for the C programming language
and couldcommunicate with databases, enabling the building of simple, dynamic web
applications. LeadoffreleasedPHPpubliclyonJune8, 1995to acceleratebuglocation
andimprovethe code.Thisreleasewas named PHP version 2 and already had the basic
functionality that PHP has today. This includedPerl-like variables, form handling, and the
ability to embed HTML. The syntax was similar to Perlbut was more limited, simpler, and
less consistent .Zee Sarasin and Guttmann‘s, two IsraelidevelopersattheTeknion IIT,
rewrotetheparserin1997andformedthebaseofPHP3,changing
thelanguage‘snametotherecursiveinitializePHP:HypertextPre-processor.
The development team officially released PHP/FI 2 in November 1997 after months
of betatesting. Afterwards, public testing of PHP 3 began, and the official launch came in
June 1998.Sarasin and Guttmann‘s then started a new rewrite of PHP‘s core, producing the
Zen Engine in1999. They alsofoundedZen TechnologiesinRamatGin,Israel.OnMay 22,
2000,PHP 4,powered by the Zen Engine 1.0, was released. On July 13, 2004, PHP 5 was
released, powered bythe new Zen Engine II. PHP 5 included new features such as
improved support for object-orientedprogramming, the PHP Data Objects extension
(which defines a lightweight and consistent
interfaceforaccessingdatabases),andnumerousperformanceenhancements.Themostrecentup
datereleased byThePHPGroup is forthe older PHPversion 4 codebranch.
In 2008, PHP 5 became the only stable version under development. Late static binding
hasbeen missing from PHP and will be added in version 5.3. PHP 6 is under
development alongsidePHP 5. Major changes include the removal of register _global,
magic quotes, and safe mode. Thereason for the removals was because register _global
had given way to security holes, and magicquotes had an unpredictable nature, and was
best avoided. Instead, to escape characters,
Magicquotesmaybesubstitutedwiththeaddslashes()function,ormoreappropriatelyanescape
mechanism specific to the database vendor itself like MYSQL _real _escape _string ()
for MYSQL.PHP does not have complete native support for Unicode or multi byte
strings; Unicode support willbe included in PHP 6. Many high profile open source
projects ceased to support PHP 4 in new codeas of February 5, 2008, due to the GoPHP5
initiative, provided by a consortium of PHP
developerspromotingthetransitionfromPHP4toPHP5.Itrunsinboth32-bitand64-
bitenvironments,buton Windows the only official distribution is 32-bit, requiring
Windows 32-bit compatibility mode tobe enabled while using IIS in a 64-bit Windows
environment. There is a third-party distributionavailable for 64-bit Windows. Usage
PHP is a general-purpose scripting language that is especiallysuited for web
development. PHP generally runs on a web server, taking PHP code as its input
andcreatingweb pagesas output.
8
It can also be used for command-line scripting and client-side GUI applications.
PHP can bedeployed on most web servers, many operating systems and platforms, and can
be used with manyrelational database management systems. It is available free of charge,
and the PHP Group providesthe complete source code for users to build, customize and
extend for their own use. PHP primarilyactsasa
filter,takinginputfromafileorstreamcontainingtextand/orPHPinstructionsand outputsanother
stream of data; most commonly the output will be HTML. It can automatically detect
thelanguageoftheuser.FromPHP 4,thePHP
parsercompilesinputtoproducebytecodeforprocessingbytheZenEngine,givingimprovedperf
ormanceoveritsinterpreterpredecessor.Originally designed to create dynamic web pages,
PHP ‘sprincipal focus is server-side scripting,and it is similar to other server-side scripting
languages that provide dynamic content from a webserver to a Perl. PHP has also attracted
the development of many frameworks that provide buildingblocks and a design structure
to promote rapid application development (RAD). Some of theseinclude Cake PHP, Sym
font, Code igniters, and Zen Framework, offering features similar to otherwebapplication
frameworks.
The LAMP architecture has become popular in the web industry as a way of
deploying webapplications. PHP is commonly used as the P in this bundle alongside
Linux, Apache and MYSQL,although the P may also refer to Python or Perl. As of April
2007, over 20 million Internet domainswere hosted on servers with PHP installed, and
PHP was recorded as the most popular Apachemodule. Significant websites are written in
PHP including the user facing portion of Face book,Wikipedia (Media Wiki),
Yahoo!, MY Yearbook, Dig, Word press and Tagged. In addition to server-side scripting,
PHP can be used to create stand-alone, compiled applications and libraries, it can
beusedforshell scripting, andthe PHPbinaries canbecalled from thecommand line.
3.3.1.1.1 SPEEDOPTIMIZATION

As with many scripting languages, PHP scripts are normally kept as human-
readable sourcecode, even on production web servers. In this case, PHP scripts will be
compiled at runtime by thePHP engine, which increases their execution time. PHP scripts
are able to be compiled beforeruntime using PHP compilers as with other programming
languages such as C (the language PHPand its extensions are written in). Code optimizers
aim to reduce the computational complexity ofthe compiled code by reducing its size and
making other changes that can reduce the execution timewith the overall goal of
improving performance. The nature of the PHP compiler is such that thereare often
opportunities for code optimization, and an exampleof a code optimizer is the
ZenOptimizer PHP extension. Another approach for reducing overhead for high load PHP
servers isusing PHP accelerators. These can offer significantperformancegainsby caching
thecompiledform of a PHP script in shared memory to avoid the overhead of parsing and
compiling the codeeverytime the script runs. 9
3.3.1.1.2 SECURITY
The National Vulnerability Database stores all vulnerabilities found in computer
software.The overall proportion of PHP-related vulnerabilities on the database amounted
to: 12% in 2003,20% in 2004, 28% in 2005, 43% in 2006, 36% in 2007, and 35% in 2008.
Most of these PHP-related vulnerabilities can be exploited remotely: they allow hackers to
steal or destroy data fromdata sources linked to the web server (such as an SQL database),
send spam or contribute to DOSattacks using malware, which itself can be installed on the
vulnerable servers. These vulnerabilitiesare caused mostly by not following best practice
programming rules: technical security flaws of thelanguage itself or of its core libraries are
not frequent. Recognizing that programmers cannot betrusted, some languages include
taint checking to detect automatically the lack of input validationwhich induces many
issues. However, such a feature is being developed for PHP Hosting PHPApplications on a
server requires a careful and constant attention to deal with these security risks.There are
advanced protection patches such as Showing and Hardening-Patch, especially
designedfor web hosting environments. Installing PHP as a CGI binary rather than as an
Apache module isthe preferred method for added security. With respect to securing the
code itself, PHP code can beobfuscatedto makeit difficult toread while
remainingfunctional.
3.3.1.1.3 SYNTAX

Note:-Codein boldletters shows thePHPcodeembedded within HTML


PHP only parses code within its delimiters. Anything outside its delimiters is sent
10
directly tothe output and is not parsed by PHP. The most common delimiters are , which
are open and closedelimiters respectively. Delimiters are also available. Short tags can be
used to start PHP code, .These tags are commonly used, but like ASP-style tags (), they are

less portable as they can bedisabled in the PHP configuration. For this reason, the
use of short tags and ASP-style tags isdiscouraged. The purpose of these delimiters is to
separate PHP code from non-PHP code, includingHTML. Variables are prefixed with a
dollar symbol and a type does not need to be specified inadvance.Unlike functionand class
names, variablenamesarecasesensitive.

11
Both double-quoted (―‖) and heredoc stringsallow the abilityto embed avariable‘svalue
into the string.PHPtreatsnewlines aswhitespacein themannerofafree-
formlanguage(exceptwheninsidestring quotes), and statements are terminated by a
semicolon. PHP has three types of commentsyntax: /* */ serves as block comments, and //
as well as # are used for inline comments. The echostatement is one of several facilities
PHP provides to output text (e.g. to a web browser). In terms ofkeywords and language
syntax, PHP is similar to most high level languages that follow the C stylesyntax. If
conditions, for and while loops, and function returns are similar in syntax to
languagessuchas C, C++, JavaandPerl.

3.3.1.1.4 DATATYPES

PHP stores whole numbers in a platform-dependent range. This range is typically


that of 32-bit signed integers. Unsigned integers are converted to signed values in certain
situations; thisbehavior is different from other programming languages. Integer variables
can be assigned usingdecimal (positive and negative), octal, and hexadecimal notations.
Floating point numbers are alsostoredinaplatform-
specificrange.Theycanbespecifiedusingfloatingpointnotation,ortwoforms of scientific
notation. PHP has a native Boolean type that is similar to the native Booleantypes in Java
and C++.Using the Boolean type conversion rules, non-zero values are interpreted astrue
and zero as false, as in Perl and C++. The null data type represents a variable that has no
value.TheonlyvalueinthenulldatatypeisNULL.Variablesofthe―resource‖typerepresentrefere
nces to resources from external sources. These are typically created by functions from a
particularextension, and can only be processed by functions from the same extension;
examples include file,image, and database resources. Arrays can contain elements of any
type that PHP can handle,including resources, objects, and even other arrays. Order is
preserved in lists of values and
inhasheswithbothkeysandvalues,andthetwocanbeintermingled.PHPalsosupportsstrings,whi
ch can be used with single quotes, double quotes, or here doc syntax. The Standard PHP
12
Library(SPL) attempts to solve standard problems and implements efficient data
access interfaces andclasses.

3.3.1.1.5 FUNCTIONS

PHP has hundreds of base functions and thousands more from extensions. These
functionsare well documented on the PHP site, but unfortunately, the built-in library has a
wide variety ofnaming conventions and inconsistencies. PHP currently has no functions
for thread programming.Version 5.2 and earlier Functions are not first-class functions and
can only be referenced by theirname—directlyor dynamicallybya variablecontainingthe
name of thefunction.

13
User-defined functions can be created at any time without being prototyped.
Functions can bedefined inside code blocks, permitting a run-time decision as to whether
or not a function should bedefined. Function calls must use parentheses, with the
exception of zero argument class constructorfunctions called with the PHP new operator,
where parentheses are optional. PHP supports quasi-anonymous functions through the
create _function () function, although they are not trueanonymous functions because
anonymous functions are nameless, but functions can only bereferencedbyname,
orindirectlythroughavariable $function_name();inPHP.

VERSION5.3ANDNEWER

PHPgainedsupportforfirst-
classfunctionsandclosures.TrueanonymousfunctionssupportedfunctiongetAdder ($x)
usingthefollowingsyntax:

Here, get Adder () function creates a closure using parameter $x (keyword


―use‖forces getting variable from context), which takes additional argument $y and returns
it to the caller. Sucha function can be stored, given as the parameter to another functions,
etc. For more details seeLambdafunctions andclosures RFC.
3.3.1.1.6 OBJECTS
Basic object-oriented programming functionality was added in PHP 3. Object
handling wascompletely rewritten for PHP 5, expanding the feature set and enhancing
performance. In previousversions of PHP, objects were handled like primitive types. The
drawback of this method was thatthe whole object was copied when a variable was
assigned or passed as a parameter to a method. Inthe new approach, objects are referenced
by handle, and not by value. PHP 5 introduced private andprotected member variables and
methods, along with abstract classes and final classes as well asabstract methods and final
methods. It also introduced a standard way of declaring constructors anddestructors,
similar to that of other object-oriented languages such as C++, and a standard
exceptionhandlingmodel.Furthermore
12,
PHP 5 added interfaces and allowed for multiple interfaces to be implemented.
There arespecial interfaces that allow objects to interactwith the runtime system. Objects
implementingArrayAccesscanbeusedwitharraysyntaxandobjectsimplementingIterateorInte
gratorAggregate can be used with the for each language construct. There is no virtual table
feature in theengine, so static variables are bound with a name instead of a reference at
compile time. If
thedevelopercreatesacopyofanobjectusingthereservedwordclone,theZenenginewillcheckifa
clone () method has been defined or not.If not, it will call a defaultclone() which will
copythe object‘s properties. If aclone () method is defined, then it will be responsible for
setting thenecessary properties in the created object. For convenience, the engine will
supply a function thatimports the properties of the source object, so that the programmer
can start with a by-value replicaofthe sourceobject andonlyoverrideproperties that needto
bechanged.
3.3.1.1.7 RESOURCES
PHP includes free and open source libraries with the core build. PHP is a
fundamentallyInternet aware system with modules built in for accessing FTP servers,
many database servers,embedded SQL libraries such as embedded Post SQL, MYSQL and
SQ Light, LDAP servers, andothers. Many functions familiar to C programmers such as
those in the studio family are available inthe standard PHP build. PHP has traditionally
used features such as ―magic _quotes _gpc and
―magic_quotes_runtime‖whichattempttoescapeapostrophes(‗)andquotes(―)instringsinthe
assumption that they will be used in databases, to prevent SQL injection attacks. This
leads toconfusion over which data is escaped and which is not and to problems when data
is not in fact usedas input to a database and when the escaping used is not completely
correct. To make code portablebetween servers which do and do not use magic quotes,
developers can preface their code with ascript to reverse the effect of magic quotes when it
is applied. PHP allows developers to writeextensions in C to add functionality to the PHP
language. These can then be compiled into PHP orloaded dynamically at runtime.
Extensions have been written to add support for the Windows API,process management on
Unix-like operating systems, multi byte strings (Unicode), curl, and severalpopular
compression formats. Some more unusual features include integration with Internet
RelayChat, dynamic generation of images and Adobe Flash content, and even speech
synthesis. The PHPExtension Community Library (PECL) project is a repository for
extensions to the PHP language.Zenprovidesacertificationexam forprogrammers
tobecomecertified PHPdevelopers.
3.3.1.2 MYSQL
Whatisadatabase?
Quitesimply,it‘sanorganizedcollectionofdata.Adatabasemanagement system (DBMS) such
as Access, FileMaker Pro, Oracle or SQL Server provides youwiththesoftwaretoolsyou
needto organizethatdatainaflexiblemanner.
It includes facilities to add, modify or delete data from the database, ask questions
(orqueries) about the data stored in the database and produce reports summarizing selected
contents.MYSQL is a multi threaded, multi-user SQL database management system
(DBMS). The basicprogram runs as a server providing multi-user access to a number of
data bases. Originally financedin a similar fashion to the Boss model, MYSQL was owned
and sponsored by a single for-profitfirm, the Swedish company MYSQLAB now a
subsidiary of Sun Micro system , which holds thecopyright to most of the codebase. The
project‘s source code is available under terms of the
GNUGeneralPublicLicence,aswellasunderavarietyofproprietaryagreements.MYSQLisadat
abase. The data in MYSQL is stored in database objects called tables. A table is a
collectionofrelateddataentriesanditconsistsofcolumnsandrows.Databasesareusefulwhenstor
inginformationcategorically.Acompanymayhaveadatabasewiththefollowingtables:―Emplo
yees‖,
―Products‖,―Customers‖and ―Orders‖.
3.3.1.2.1 DATABASETABLES
Adatabasemostoftencontainsoneormoretables.Eachtableisidentifiedbyaname(e.g.
―Customers‖or ―Orders‖).Tables contain records(rows) withdata.
3.3.1.2.2 QUERIES
A query is a question or a request. With MYSQL, we can query a database for
specificinformationand havearecordset returned.
3.3.1.2.2.1 CREATEACONNECTIONTOADATABASE
Before you can access data in a database, you must create a connection to the
database. InPHP,this isdonewith theMYSQL_connect ()function.
3.1.2.2.2 CLOSINGACONNECTION
Theconnectionwillbeclosedautomaticallywhen
thescriptends.Toclosetheconnectionbefore,usethe MYSQL_close ()function
3.3.1.2.2.3 CREATEADATABASE
The CREATE DATABASE statement isused to create a database in MYSQL.
SyntaxCREATEDATABASEdatabase_nameTogetPHPtoexecutethestatementabovewemus
tusetheMYSQL _query () function. This function is used to send a query or command to a
MYSQLconnection.
3.3.1.2.2.4 CREATEATABLE
The CREATE TABLE statement is used to create a table in MYSQL Syntax
CREATETABLEname(column_name1datatype, column_name2data type,
column_name3datatype...)

3.3.1.2.3 MYSQLFUNCTION
MYSQL_affected_rows— Get numberofaffected rows in previous
MYSQLoperationMYSQL_change_user— Changelogged in
useroftheactiveconnection
MYSQL_client_encoding— Returns the nameofthe
character setMYSQL_close — CloseMYSQLconnection
MYSQL_connect —Open a connectionto
aMYSQLServerMYSQL_create _db —Create
aMYSQLdatabase
MYSQL_data_seek —Move internalresult
pointerMYSQL_db _name—Get result data
MYSQL_db_query—SendaMYSQLquery
MYSQL_drop_db —Drop (delete) aMYSQLdatabase
MYSQL _error — Returns the numerical value of the error message from
previousMYSQLoperation MYSQL_error— Returns thetextof
theerrormessagefrom previous
MYSQL operation MYSQL _escape _string — Escapes a string for use in a MYSQL
_queryMYSQL_fetch_array—
Fetcharesultrowasanassociativearray,anumericarray,orbothMYSQL_fetch_assoc—
Fetcharesult rowas an associativearray
MYSQL_fetch_field—Getcolumninformationfromaresultandreturnasan
objectMYSQL_fetch _lengths— getthe length ofeachoutput in aresult
MYSQL_fetch_object— Fetch aresult row
asanobjectMYSQL_query— Senda MYSQLquery
MYSQL_result—Get result data
MYSQL _select _db — Select a MYSQL
databaseMYSQL_set_charset—
setstheclientcharactersetMYSQL_stat — Get
currentsystem status
MYSQL _table name — Get table name of
fieldMYSQL_thread _id —Return the current
threadID
MYSQL_unbuffered_query—
SendanSQLquerytoMYSQL,withoutfetchingandbufferingtheresult
3.3.1.3.1 DREAMWEAVERANDACCESSIBILITY
Accessibility refers to making websites and web products usable for people with
visual,auditory, motor, and other disabilities. Examples of accessibility features for
software products andwebsites include screen reader support, text equivalents for graphics,
keyboard shortcuts, change ofdisplay colours to high contrast, and so on. Dreamweaver
provides tools that make the productaccessible and tools that help you author accessible
content: Using Dreamweaver accessibilityfeatures For Dreamweaver web designers who
need to use accessibility features, Dreamweaveroffers screen reader support, keyboard
navigation, and operating system accessibility support .Formore information, see Using
Dreamweaver accessibility features. Authoring for accessibility ForDreamweaver web
designers who need to create accessible content, Dreamweaver assists you
increatingaccessiblepagesthatcontainusefulcontentforscreenreadersandcomplywithgovern
mentguidelines.
Dreamweaver provides dialog boxes that prompt you to enter accessibility attributes
whenyou insert page elements (see Optimizing the workspace for accessible page
design).For example,the accessibility dialog box for images remindsyou to add text
equivalents forgraphics. Then,when the image appears on a page for a user with visual
disabilities, the screen reader reads thedescription.
3.3.1.3.2 LAYINGOUTPAGESWITHCSS
In Macromedia Dreamweaver 8, you can use CSS styles to lay out your page. You
can bothinsert div tags manually and apply CSS positioning styles to them, or you can use
Dreamweaverlayers to create your layout. A layer in Dreamweaver is an HTML page
element—specifically, a divtag, or any other tag—that has an absolute position assigned to
it. Whether you use CSS, tables, orframes to lay out your pages, Dreamweaver has rulers
and grids for visual guidance in your layout.Dreamweaver alsohasa tracing image
feature,whichyou can use tore-create a page design thatwas created in a graphics
application. Client-side role of forms support the client side of the client-server
relationship. When a visitor enters information into a form displayed in a web browser
(theclient) and clicks the submit button, the information is sent to the server where aserver-
side scriptor application processes it. Common server-side technologies used for
processing form data includeMacromedia ColdFusion, Microsoft Active Server Pages
(ASP), and PHP. The server responds bysending requested information back to the user (or
client), or performing so action based on theform‘s contents. ( Note : - See Appendix 1 for
more about Macromedia Dreamweaver 8 and PHPMYAdmin)
3.3.1.4 PHPMYADMIN
PHP MY Admin is an open source tool written in PHP intended to handle the
administrationof MYSQL over the World Wide Web. PHP MY Admin supports a wide
range of operations withMYSQL. Currently it can create and drop databases,
create/drop/alter tables, and
delete/edit/addfields,executeanySQLstatement,manageusersandpermissions,andmanageke
ysonfields.While you still have the ability to directly execute any SQL statement. PHP
MY Admin can managea whole MYSQL server (needs a super-u ser)as well as a single
database.To accomplish the latteryou‘ll need a properly set up MYSQL user who can
read/write only the desired database. It‘s up toyouto look up the appropriatepart in
theMYSQLmanual.
3.3.1.5 APACHEWEBSERVER
Often referred to as simply Apache,A public-domain open source Web server
developed bya loosely knit group of programmers. The first version of Apache, based on
the NCSA http Webserver, was developed in 1995. Core development of the Apache Web
server is performed by agroup of about 20 volunteer programmers, called the Apache
Group. However, because the sourcecode is freely available, anyone can adapt the server
for specific needs, and there is a large publiclibrary of Apache add-ons. In many respects,
development of Apache is similar to development
oftheLinuxoperatingsystem.TheoriginalversionofApachewaswrittenforUNIX,buttherearen
ow versions that run under OS/ 2, Windows and other platforms. The name is a tribute to
theNative American Apache Indian tribe, a tribe well known for its endurance and
skill in warfare. Acommon misunderstanding is that it was called Apache because it was
developed from existingNCSA code plus various patches, hence the name a patchy server,
or Apache server. Apacheconsistently rates as the world‘s most popular Web server
according to analyst surveys. Apache hasattracted so much interest because it is full-
featured, reliable, and free. Originally developed
forUNIX™operatingsystems,ApachehasbeenupdatedtorunonWindows,OS/2,andotherplatf
orms.One aspect of Apache that some site administrators find confusing — especially
thoseunfamiliar it UNIX-style software — is its configuration scheme. Instead of using a
point-and-clickgraphic user interface (GUI) or Windows Registry keys as most other
modern software packages,Apache generallyrelies on simpletext files foritsconfiguration
settings
CONFIGURATIONFILES
Apache uses a system of three text files for managing its configuration data. All
three ofthese files (almost always) appear in Apache‘s. /conf directory and are designed to
be edited bysystem administrators: 1. http conf for general settings 2. Srm conf for
resource setting3. Accessconf for security settings When Apache first starts, these files are
processed in the order shownabove.
Originally, the initial installation of Apache included default entries within each of
the threefiles. InthemostrecentversionsofApache,however,the defaultinstallationhas
changed.Nowhttp
.confistreatedasthe―master‖configurationfileanditcontainsallofthesettings.Bothsrmconf and
access conf still exist in the installation, but they contain no settings and are empty except
forsome comments. We use this technology to keep the data more secure and easy to
handle which isuserfriendlyand also makes goodresponsiveness.

3.1. Use CaseModeling

A use case identifies the actors involved in an interaction and names the type of
interaction. This is then supplemented by additional information describing the
interaction with the system. The additional information may be a textual descriptionor
one or more graphical models such as UML sequence or statecharts.

Fig 3. 1 Use case Diagram


3.2. SequenceDiagram

UML Sequence diagrams are interaction diagrams that detail how operations are
carried out. As sequence diagrams can be used to capture the interaction between objects
in the context of a collaboration, one of the primaries uses of sequence diagrams
isinthetransitionfromrequirementsexpressedasusecasestothenextandmoreformal level of
refinement. Use cases are often refined into one or more sequencediagrams.

Fig 3. 2 Sequence Diagram


CHAPTER 4

SYSTEM IMPLEMENTATION AND TESTING

The system components as identified in the design specification from the design phase
and the software requirements specification from the analysis phase are built either from
scratch or by composition in the implementation phase. This section documents the
issues that arose during the implementation phase together with the adopted solutions.
Every task identified in the design specification has been carried out in this phase. So far,
no such issues rose that could critically affect the project schedule. All the tasks were
completed within the project schedule according to the Gantt chart.

4.1. UserInterface

4.1.1 Clientpart

User interface in the client part is designed using CSS and html. All other
remaining screen shots are listed in appendices.
Project Screenshots
Home Page
Manage Categories
Add News
Source Code
Index.PHP

<?php
session_start();
include('includes/config.php');

?>

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>NEWS PORTAL ADMINISTRATIVE SERVICES SYSTEM | Home Page</title>

<!-- Bootstrap core CSS -->


<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->


<link href="css/modern-business.css" rel="stylesheet">

</head>

<body>

<!-- Navigation -->


<?php include('includes/header.php');?>
<!-- Page Content -->
<div class="container">

<div class="row" style="margin-top: 4%">


<!-- Blog Entries Column -->
<div class="col-md-8">

<!-- Blog Post -->


<?php
if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
}
$no_of_records_per_page = 8;
$offset = ($pageno-1) * $no_of_records_per_page;

$total_pages_sql = "SELECT COUNT(*) FROM tblposts";


$result = mysqli_query($con,$total_pages_sql);
$total_rows = mysqli_fetch_array($result)[0];
$total_pages = ceil($total_rows / $no_of_records_per_page);

$query=mysqli_query($con,"select tblposts.id as pid,tblposts.PostTitle as


posttitle,tblposts.PostImage,tblcategory.CategoryName as category,tblcategory.id as
cid,tblsubcategory.Subcategory as subcategory,tblposts.PostDetails as
postdetails,tblposts.PostingDate as postingdate,tblposts.PostUrl as url from tblposts left join
tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on
tblsubcategory.SubCategoryId=tblposts.SubCategoryId where tblposts.Is_Active=1 order by
tblposts.id desc LIMIT $offset, $no_of_records_per_page");
while ($row=mysqli_fetch_array($query)) {
?>

<div class="card mb-4">


<div class="card-body">
<h2 class="card-title"><?php echo htmlentities($row['posttitle']);?><img class="card-
img-top" src="admin/postimages/<?php echo htmlentities($row['PostImage']);?>" alt="<?php
echo htmlentities($row['posttitle']);?>"></h2>
<p><!--category-->
<a class="badge bg-secondary text-decoration-none link-light" href="category.php?catid=<?
php echo htmlentities($row['cid'])?>" style="color:#fff"><?php echo
htmlentities($row['category']);?></a>
<!--Subcategory--->
<a class="badge bg-secondary text-decoration-none link-light" style="color:#fff"><?php
echo htmlentities($row['subcategory']);?></a></p>

<a href="news-details.php?nid=<?php echo htmlentities($row['pid'])?>" class="btn


btn-primary">Read More &rarr;</a>
</div>
<div class="card-footer text-muted">
Posted on <?php echo htmlentities($row['postingdate']);?>

</div>
</div>
<?php } ?>

<!-- Pagination -->

<ul class="pagination justify-content-center mb-4">


<li class="page-item"><a href="?pageno=1" class="page-link">First</a></li>
<li class="<?php if($pageno <= 1){ echo 'disabled'; } ?> page-item">
<a href="<?php if($pageno <= 1){ echo '#'; } else { echo "?pageno=".($pageno - 1); } ?
>" class="page-link">Prev</a>
</li>
<li class="<?php if($pageno >= $total_pages){ echo 'disabled'; } ?> page-item">
<a href="<?php if($pageno >= $total_pages){ echo '#'; } else { echo "?pageno=".
($pageno + 1); } ?> " class="page-link">Next</a>
</li>
<li class="page-item"><a href="?pageno=<?php echo $total_pages; ?>" class="page-
link">Last</a></li>
</ul>

</div>

<!-- Sidebar Widgets Column -->


<?php include('includes/sidebar.php');?>
</div>
<!-- /.row -->

</div>
<!-- /.container -->

<!-- Footer -->


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

<!-- Bootstrap core JavaScript -->


<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</head>
</body>

</html>

Header.PHP:

<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark fixed-top">


<div class="container">
<a class="navbar-brand" href="index.php"><img src="images/logo.png"
height="50"></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-
toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-
expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about-us.php">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php">News</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact-us.php">Contact us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin/">Admin</a>
</li>
</ul>
</div> </div> </nav>
Footer.PHP:

<footer class="py-5 bg-dark">


<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; NewPortal <?php echo
date('Y');?></p>
</div>
<!-- /.container -->
</footer>
CONTENT.PHP:

<?php
include('includes/config.php');

?>
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-
fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>News Portal | Contact us</title>

<!-- Bootstrap core CSS -->


<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->


<link href="css/modern-business.css" rel="stylesheet">

</head>

<body>

<!-- Navigation -->


<?php include('includes/header.php');?>
<!-- Page Content -->
<div class="container">

<?php
$pagetype='contactus';
$query=mysqli_query($con,"select PageTitle,Description from tblpages where
PageName='$pagetype'");
while($row=mysqli_fetch_array($query))
{

?>
<h1 class="mt-4 mb-3"><?php echo htmlentities($row['PageTitle'])?>

</h1>

<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.php">Home</a>
</li>
<li class="breadcrumb-item active">Contact</li>
</ol>

<!-- Intro Content -->


<div class="row">

<div class="col-lg-12">

<p><?php echo $row['Description'];?></p>


</div>
</div>
<!-- /.row -->
<?php } ?>

</div>
<!-- /.container -->

<!-- Footer -->


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

<!-- Bootstrap core JavaScript -->


<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

</body>

</html>
CATEGORY.PHP:
<?php
session_start();
error_reporting(0);
include('includes/config.php');

?>

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-
fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>News Portal | Category Page</title>

<!-- Bootstrap core CSS -->


<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->


<link href="css/modern-business.css" rel="stylesheet">

</head>

<body>

<!-- Navigation -->


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

<!-- Page Content -->


<div class="container">

<div class="row" style="margin-top: 4%">


<!-- Blog Entries Column -->
<div class="col-md-8">

<!-- Blog Post -->


<?php
if($_GET['catid']!=''){
$_SESSION['catid']=intval($_GET['catid']);
}

if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
}
$no_of_records_per_page = 8;
$offset = ($pageno-1) * $no_of_records_per_page;

$total_pages_sql = "SELECT COUNT(*) FROM tblposts";


$result = mysqli_query($con,$total_pages_sql);
$total_rows = mysqli_fetch_array($result)[0];
$total_pages = ceil($total_rows / $no_of_records_per_page);

$query=mysqli_query($con,"select tblposts.id as pid,tblposts.PostTitle as


posttitle,tblposts.PostImage,tblcategory.CategoryName as
category,tblsubcategory.Subcategory as subcategory,tblposts.PostDetails as
postdetails,tblposts.PostingDate as postingdate,tblposts.PostUrl as url from tblposts left
join tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on
tblsubcategory.SubCategoryId=tblposts.SubCategoryId where tblposts.CategoryId='".
$_SESSION['catid']."' and tblposts.Is_Active=1 order by tblposts.id desc LIMIT $offset,
$no_of_records_per_page");

$rowcount=mysqli_num_rows($query);
if($rowcount==0)
{
echo "No record found";
}
else {
while ($row=mysqli_fetch_array($query)) {
?>
<h1><?php echo htmlentities($row['category']);?> News</h1>
<div class="card mb-4">
<img class="card-img-top" src="admin/postimages/<?php echo
htmlentities($row['PostImage']);?>" alt="<?php echo htmlentities($row['posttitle']);?
>">
<div class="card-body">
<h2 class="card-title"><?php echo htmlentities($row['posttitle']);?></h2>

<a href="news-details.php?nid=<?php echo htmlentities($row['pid'])?>"


class="btn btn-primary">Read More &rarr;</a>
</div>
<div class="card-footer text-muted">
Posted on <?php echo htmlentities($row['postingdate']);?>

</div>
</div>
<?php } ?>

<ul class="pagination justify-content-center mb-4">


<li class="page-item"><a href="?pageno=1" class="page-link">First</a></li>
<li class="<?php if($pageno <= 1){ echo 'disabled'; } ?> page-item">
<a href="<?php if($pageno <= 1){ echo '#'; } else { echo "?pageno=".($pageno -
1); } ?>" class="page-link">Prev</a>
</li>
<li class="<?php if($pageno >= $total_pages){ echo 'disabled'; } ?> page-item">
<a href="<?php if($pageno >= $total_pages){ echo '#'; } else { echo "?pageno=".
($pageno + 1); } ?> " class="page-link">Next</a>
</li>
<li class="page-item"><a href="?pageno=<?php echo $total_pages; ?>"
class="page-link">Last</a></li>
</ul>
<?php } ?>

<!-- Pagination -->

</div>
<!-- Sidebar Widgets Column -->
<?php include('includes/sidebar.php');?>
</div>
<!-- /.row -->

</div>
<!-- /.container -->

<!-- Footer -->


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

<!-- Bootstrap core JavaScript -->


<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

</head>
</body>

</html>
4.2. Tools

4.2.1. DesignTools

 Draw.io

4.2.2. ImplementationTools

 VisualStudio
 Sublime TextEditor
 XamppServer
 SQLyog
4.3. TestCase
CHAPTER 5

MAINTENANCE AND SUPPORT

Due to the various problem that may arise in the Xampp server and PHP, the system
should be provided with the maintenance and support in the future.
CHAPTER 6

CONCLUSION AND ENHANCEMENTS

The sole purpose of this project is to develop a web-based system that helps userto
buy the minimum quantity of herb from the comfort of their home without visiting
the herb market and waste time with bargaining with the shopkeeper. The system
helps user to order herb and provide latest offers. User will be able to register and
thus receive and Phone call when they order some product for conformation.

FutureworkwillbefocusedondevelopmentofMobilebasedsystemalongwithfuture
enhancement of Web basedsystem.
REFERENCE

[1] Software Engineering Ninth Edition Ian Sommerville.

43

You might also like