Вы находитесь на странице: 1из 114

1.

Introduction and Objectives

1.1 Introduction

Now-a-days we live in age of Information Communication and Technology (ICT). We can’t

think a single moment without technology. From morning to night, we need help of the

technology. This is the revolutionary time of computer technology. Most of the works depends

on web application. For this reason, anytime, anywhere, anyone can access a website by internet

at low cost and we can find our expectable and most update information from website. At

present information is one the most valuable resource of the current world. We have developed

our project so that we can aware the people.

The online news portal has been developed to override the problems prevailing in the practicing

manual system. The main purpose of the project is intended to develop a portal for management

of Web based news. The portal provides a suitable and easy display for which large population

around the world can learn or will have the knowledge about the world. No formal knowledge is

needed to use this portal.

The portal has basically two user parts where one is user who can view, add comment, can

have subscribe the newsletters or games and another is administrator who will manage or

control the website and other user can only view ,search and can add comments if name and

email is given, but with the approval of administrator.

The website consists of basic pages from which the user can view and know the relevant

information according to various categories which administrator given. In other case, the

1
administrator manages all the relevant actions for which the users can view properly and also

make reports.

1.2 Objectives

 The objective of this project is to develop a web application for Online News Paper

website that can aware the people.

 The objective of this project is to provide the daily news.

 Those people who don’t have time to read the news paper and always linked with

internet can get more information.

 Anytime, anywhere, anyone can know about the news or information by internet at low

cost.

 Dynamically provides facility.

 Once a news item is put on the internet, it becomes instantly available for use round

the globe without additional variable cost.

 You don’t have to wait for newspaper in morning.

 Money and time will also save.

2
1.3 Tools/ Platform Hardware & Software Requirements

Hardware:

Processor : Intel core 2 Duo or above

Memory : 2 GB RAM or above

Cache Memory : 128 KB or above

Hard Disk : 30 GB or above [at least 3 MB free space required]

Software:

Language Used : PHP

Database : MySql

User Interface Design : HTML, jquery, javacsript

Web Browser : Google chrome, Mozilla Firefox, Opera

Server : Xamp Server

3
1.4 Project Category

This is an RDBMS web based project which is currently using MySQL for all the transaction

statements and PHP as the front end. This project also uses Javascript and CSS for the user

friendly view.

RDBMS

A Relational DataBase Management System (RDBMS) is a software that −

 Enables you to implement a database with tables, columns and indexes.

 Guarantees the Referential Integrity between rows of various tables.

 Updates the indexes automatically.

 Interprets an SQL query and combines information from various tables.

MySQL

MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. MySQL

is developed, marketed and supported by MySQL AB, which is a Swedish company. MySQL is

becoming so popular because of many good reasons −

 MySQL is released under an open-source license. So you have nothing to pay to use it.

 MySQL is a very powerful program in its own right. It handles a large subset of the

functionality of the most expensive and powerful database packages.

 MySQL uses a standard form of the well-known SQL data language.

4
 MySQL works on many operating systems and with many languages including PHP,

PERL, C, C++, JAVA, etc.

 MySQL works very quickly and works well even with large data sets.

 MySQL is very friendly to PHP, the most appreciated language for web development.

 MySQL supports large databases, up to 50 million rows or more in a table. The default

file size limit for a table is 4GB, but you can increase this (if your operating system can

handle it) to a theoretical limit of 8 million terabytes (TB).

 MySQL is customizable. The open-source GPL license allows programmers to modify

the MySQL software to fit their own specific environments.

PHP

PHP started out as a small open source project that evolved as more and more people found out

how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.

 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".

 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.

 PHP is pleasingly zippy in its execution, especially when compiled as an Apache module

on the Unix side. The MySQL server, once started, executes even very complex queries

with huge result sets in record-setting time.

5
 PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4

added support for Java and distributed object architectures (COM and CORBA), making

n-tier development a possibility for the first time.

 PHP is forgiving: PHP language tries to be as forgiving as possible.

 PHP Syntax is C-Like.

Common uses of PHP are ;

 PHP performs system functions, i.e. from files on a system it can create, open, read,

write, and close them.

 PHP can handle forms, i.e. gather data from files, save data to a file, through email you

can send data, return data to the user.

 You add, delete, modify elements within your database through PHP.

 Access cookies variables and set cookies.

 Using PHP, you can restrict users to access some pages of your website.

 It can encrypt data.

HTML

HTML is the standard markup language for creating Web pages.

 HTML stands for Hyper Text Markup Language

 HTML describes the structure of Web pages using markup

 HTML elements are the building blocks of HTML pages

 HTML elements are represented by tags

6
 HTML tags label pieces of content such as "heading", "paragraph", "table", and so on

 Browsers do not display the HTML tags, but use them to render the content of the page

Javascript

JavaScript is a dynamic computer programming language. It is lightweight and most commonly

used as a part of web pages, whose implementations allow client-side script to interact with the

user and make dynamic pages. It is an interpreted programming language with object-oriented

capabilities.

CSS

Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to

simplify the process of making web pages presentable.

CSS handles the look and feel part of a web page. Using CSS, you can control the color of the

text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out,

what background images or colors are used, layout designs, and variations in display for

different devices and screen sizes as well as a variety of other effects.

CSS is easy to learn and understand but it provides powerful control over the presentation of an

HTML document. Most commonly, CSS is combined with the markup languages HTML or

XHTML.

Jquery

jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to

make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that

7
require many lines of JavaScript code to accomplish, and wraps them into methods that you can

call with a single line of code.

jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM

manipulation. The jQuery library contains the following features:

 HTML/DOM manipulation

 CSS manipulation

 HTML event methods

 Effects and animations

 AJAX

 Utilities

8
2.System Study

2.1 Preliminary Investigation

In this process, the development team visits investigate the need for possible software

automation in the given system. By the end of Preliminary Investigation, the team furnishes a

document that holds the different specific recommendations for the candidate system. It also

includes the personnel assignments, costs, project schedule, and target dates. Main Tasks of the

preliminary investigation phase are:

 Investigate the present system and identify the functions to be performed

 Identify the objectives of the new system. In general, an information system benefits a

business by increasing efficiency, improving effectiveness, or providing a competitive

advantage.

 Identify problems and suggest a few solutions

 Identify constraints, i.e. the limitations placed on the project, usually relating to time,

money and resources

 Evaluate feasibility - whether the proposed system promises sufficient benefit to invest

the additional resources necessary to establish the user requirements in greater detail.

2.2. System Development Life Cycle

System Development Life Cycle (SDLC) is a conceptual model which includes policies and

procedures for developing or altering systems throughout their life cycles.

SDLC is used by analysts to develop an information system. SDLC includes the following

activities −

9
 requirements

 design

 implementation

 testing

 deployment

 operations

 maintenance

Phases of SDLC

Systems Development Life Cycle is a systematic approach which explicitly breaks down the

work into phases that are required to implement either new or modified Information System.

10
2.3. Feasibility Study

A feasibility study aims to objectively and rationally uncover the strengths and weaknesses of an

existing business or proposed venture, opportunities and threats present in the natural

environment, the resources required to carry through, and ultimately the prospects for success. In

its simplest terms, the two criteria to judge feasibility are cost required and value to be attained.

A well-designed feasibility study should provide a historical background of the business or

project, a description of the product or service, accounting statements, details of the operations

and management, marketing research and policies, financial data, legal requirements and tax

obligations. Generally, feasibility studies precede technical development and project

implementation.

A feasibility study evaluates the project's potential for success; therefore, perceived objectivity is

an important factor in the credibility of the study for potential investors and lending institutions.

It must therefore be conducted with an objective, unbiased approach to provide information upon

which decisions can be based.

2.3.1 Technical feasibility

This assessment is based on an outline design of system requirements, to determine whether the

company has the technical expertise to handle completion of the project. When writing a

feasibility report, the following should be taken to consideration:

 A brief description of the business to assess more possible factors which could affect the

study

11
 The part of the business being examined

 The human and economic factor

 The possible solutions to the problem

At this level, the concern is whether the proposal is both technically and legally feasible

(assuming moderate cost).

The technical feasibility assessment is focused on gaining an understanding of the present

technical resources of the organization and their applicability to the expected needs of the

proposed system. It is an evaluation of the hardware and software and how it meets the need of

the proposed system.

The system is developed using XAMPP running on Windows platform. MySQL, which is a

powerful RDBMS is used as backend. So this system is technically feasible. If the budget is a

serious constraint then the project is judged technically feasible.

2.3.2 Operational feasibility

Operational feasibility is the measure of how well a proposed system solves the problems, and

takes advantage of the opportunities identified during scope definition and how it satisfies the

requirements identified in the requirements analysis phase of system development.

The operational feasibility assessment focuses on the degree to which the proposed development

project fits in with the existing business environment and objectives with regard to development

schedule, delivery date, corporate culture and existing business processes.

12
To ensure success, desired operational outcomes must be imparted during design and

development. These include such design-dependent parameters as reliability, maintainability,

supportability, usability, producibility, disposability, sustainability, affordability and others.

These parameters are required to be considered at the early stages of design if desired operational

behaviours are to be realised. A system design and development requires appropriate and timely

application of engineering and management efforts to meet the previously mentioned parameters.

A system may serve its intended purpose most effectively when its technical and operating

characteristics are engineered into the design. Therefore, operational feasibility is a critical

aspect of systems engineering that needs to be an integral part of the early design phases.

No doubt the proposed system is fully GUI based that is very user friendly and all inputs to be

taken all self –explanatory even to a layman. Besides, a proper training has been conducted to let

know the essence of the system to the users so that they feel comfortable with new system.

2.3.3 Economic feasibility

Economic analysis is the most frequently used method for evaluating the effectiveness of a

candidate system. More commonly known as cost/benefit analysis, the procedure is to determine

the benefits and savings that are expected from a candidate system and compare them with cost.

If benefits outweigh cost, then the decision is made to design and implement the system

Otherwise, further justification or alternations in the proposed system will have to be made if it

has a chance of being approved.

The project uses the technology based on minimum possible cost factor. The project is

economically feasible since its benefits exceed the costs.

13
3. System Analysis

Systems development is systematic process which includes phases such as planning, analysis,

design, deployment, and maintenance.

System analysis is a process of collecting and interpreting facts, identifying the problems, and

decomposition of a system into its components.

System analysis is conducted for the purpose of studying a system or its parts in order to

identify its objectives. It is a problem solving technique that improves the system and ensures

that all the components of the system work efficiently to accomplish their purpose. Analysis

specifies what the system should do.

During analysis , data collected on various files, decision points and transactions handled by the

present system. The commonly used tools are data flow diagram, interviews etc. Training

,experience and common sense are required for the collection of relevant information needed to

develop the system. The success of the system depends largely on how clearly the problem is

defined , thoroughly investigated and properly carried out through the choice of solution.

3.1 Existing System

The existing system is fully manual. Each person has to wait for the newspaper to arrive.

There is a payment for each day newspaper. A user will have to spend more time browsing to

find the updates of particular news. This may lead to wastage of time, if the page containing the

information is unknown to the user. The main disadvantage is that there will be lot of difficulties

for the user to find the specified news updates for his/her choice of category.

14
3.2 Proposed System

By computerizing the news, the administrator can easily add the information, edit or even delete

the information if it is irrelevant. By the admin approval of comment facility , it is even scrutiny

of social issue comments.

This project has several advantages :-

 User friendly interface

 Fast access to database

 No extra charge levied

 Less error

 More storage capacity

 Search facility

 Look and feel environment

 Quick transaction

15
4. Systems Design

System design is the phase that bridges the gap between problem domain and the existing

system in a manageable way. This phase focuses on the solution domain, i.e. “how to

implement?”

It is the phase where the SRS document is converted into a format that can be implemented and

decides how the system will operate.

In this phase, the complex activity of system development is divided into several smaller sub-

activities, which coordinate with each other to achieve the main objective of system

development.

System design takes the following inputs −

 Statement of work

 Requirement determination plan

 Current situation analysis

 Proposed system requirements including a conceptual data model, modified DFDs, and

Metadata (data about data).

System design gives the following outputs −

 Infrastructure and organizational changes for the proposed system.

 A data schema, often a relational schema.

 Metadata to define the tables/files and columns/data-items.

16
 A function hierarchy diagram or web page map that graphically describes the program

structure.

 Actual or pseudocode for each module in the program.

 A prototype for the proposed system.

4.1 Entity Relationship Diagram

The ER model defines the conceptual view of a database. It works around real-world entities

and the associations among them. At view level, the ER model is considered a good option for

designing databases.

Entity:-

An entity can be a real-world object, either animate or inanimate, that can be easily identifiable.

For example, in a school database, students, teachers, classes, and courses offered can be

considered as entities. All these entities have some attributes or properties that give them their

identity.

An entity set is a collection of similar types of entities. An entity set may contain entities with

attribute sharing similar values. For example, a Students set may contain all the students of a

school; likewise a Teachers set may contain all the teachers of a school from all faculties. Entity

sets need not be disjoint.

Entities are represented by means of rectangles. Rectangles are named with the entity set they

represent. Eg:

Category

17
Attributes:-

Entities are represented by means of their properties, called attributes. All attributes have

values. For example, a student entity may have name, class, and age as attributes.

There exists a domain or range of values that can be assigned to attributes. For example, a

student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be

negative, etc.

Attributes are represented by means of ellipses. Every ellipse represents one attribute and is

directly connected to its entity (rectangle).

CategoryId
Category CategoryDetails

CategoryName

Types of Attributes

 Simple attribute − Simple attributes are atomic values, which cannot be divided further.

For example, a student's phone number is an atomic value of 10 digits.

 Composite attribute − Composite attributes are made of more than one simple attribute.

For example, a student's complete name may have first_name and last_name.

 Derived attribute − Derived attributes are the attributes that do not exist in the physical

database, but their values are derived from other attributes present in the database. For

18
example, average_salary in a department should not be saved directly in the database,

instead it can be derived. For another example, age can be derived from data_of_birth.

 Single-value attribute − Single-value attributes contain single value. For example −

Social_Security_Number.

 Multi-value attribute − Multi-value attributes may contain more than one values. For

example, a person can have more than one phone number, email_address, etc.

These attribute types can come together in a way like −

 simple single-valued attributes

 simple multi-valued attributes

 composite single-valued attributes

 composite multi-valued attributes

Relationship:-

The association among entities is called a relationship. For example, an employee works_at a

department, a student enrolls in a course. Here, Works_at and Enrolls are called relationships.

Relationships are represented by diamond-shaped box. Name of the relationship is written inside

the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it

by a line.

Category has Sub category

19
Relationship Set:

A set of relationships of similar type is called a relationship set. Like entities, a relationship too

can have attributes. These attributes are called descriptive attributes.

Degree of Relationship:

The number of participating entities in a relationship defines the degree of the relationship.

 Binary = degree 2

 Ternary = degree 3

 n-ary = degree

20
UserId LoginId
Username

User Has Login UserName


Email

Password Password

Manage
CategoryId
PostId CategoryName

Post Category

PostTitle Description

Has CreatedDate
Description

SubId
CreatedDate Subcategory

Description SubName

ER Diagram for Online News Portal

21
4.2 Data flow diagram

Data Flow diagram is a graphical representation of flow of data throughout the information

system. Data flow diagrams illustrate how data is processed by a system in terms of inputs and

outputs.

DFD graphically representing the functions, or processes, which capture, manipulate, store, and

distribute data between a system and its environment and between components of a system. The

visual representation makes it a good communication tool between User and System designer.

Structure of DFD allows starting from a broad overview and expands it to a hierarchy of detailed

diagrams. DFD has often been used due to the following reasons:

 Logical information flow of the system

 Determination of physical system construction requirements

 Simplicity of notation

 Establishment of manual and automated systems requirements

DFD Symbols:-

There are four basic symbols that are used to represent a data-flow diagram.

Name Notation Role

Process Transforms incoming data

flow to output data flow

Data Store Repositories of data in the

system.

22
Dataflow Dataflow are pipelines

through which packets of

information flow.

External Entity External entities are objects

outside the system, with which

the system communicates

1. External Entity

An external entity, which are also known as terminators, sources, sinks, or actors, are an outside

system or process that sends or receives data to and from the diagrammed system. They’re either

the sources or destinations of information, so they’re usually placed on the diagram’s edges.

2. Process

Process is a procedure that manipulates the data and its flow by taking incoming data, changing

it, and producing an output with it. A process can do this by performing computations and using

logic to sort the data or change its flow of direction. Processes usually start from the top left of

the DFD and finish on the bottom right of the diagram.

3. Data Store

Data stores hold information for later use, like a file of documents that’s waiting to be processed.

Data inputs flow through a process and then through a data store while data outputs flow out of a

data store and then through a process.

23
4. Data flow

Data flow is the path the system’s information takes from external entities through processes and

data stores. With arrows and succinct labels, the DFD can show you the direction of the data

flow.

But before starting mapping out data flow diagrams, we need to follow four rules of thumb to

create a valid DFD.

1. Each process should have at least one input and one output.

2. Each data store should have at least one data flow in and data flow out.

3. A system’s stored data must go through a process.

4. All processes in a DFD must link to another process or data store.

DFDs can range from simple overviews to complex, granular representations of a system or

process with multiple levels, numbered from 0 to beyond. But the most common and intuitive

DFDs are Level 0 DFDs, which are called context diagrams. They’re digestible, high-level

overviews of the flow of information through a system or process, so almost anyone can

understand it.

Level 1 DFDs are still broad overviews of a system or process, but they’re also more detailed --

they break down the system’s single process node into subprocesses. Level 2 DFDs dive even

deeper into detail by breaking down each process into granular subprocesses. Any DFD that goes

past level 2 is rare -- there would be too much detail, which defeats its original purpose of being

easy to understand.

24
User Category
Management Management

Posts Online Subcategory


Management Management
News Portal

Comments Login
Management Management

Level 0 : Data Flow Diagram

25
Category Generate Category
Management Report

Login Check User


Management Login Details

Subcategory Generate
Management Subcategory Report
Online News
Portal

Posts Generate Post


Management Report

Comments Generate
Management Comments Report

Level 1 : Data Flow Diagram

26
Admin

Login to Check roles Manage


system of access Category Details

Manage Sub
category Details
Check Manage
credentials modules
Manage Posts
Details

Manage
Comments Details

Level 2 : Admin Data Flow Diagram

27
User

Login to Check roles Manage


system of access Register Details

View News
Check Manage
credentials modules
Search News

Password Change
Recovery Password

Level 2 : User Data Flow Diagram

28
5. Design Document

For the optimum use of practical time it is necessary that every session is planned. Planning of

this project will include the following things:

 Topic Understanding.

 Modular Break – Up of the System.

 Process Logic for Each Module.

 Database Requirements.

5.1.Modules :

The project is modularized on the basis of users who use this portal.

1. Administrator

2. User

Process Logic for Each Module:

1. Administrator

 Administrator can add/ modify/ delete category details

 Administrator can add/ modify/ delete sub category details

 Administrator can add/ modify/ delete post/news details

 Administrator can approve/disapprove the comments entered by the users

 Administrator can add/ modify/ delete the images in the gallery

 Administrator can change his/her password

2. User

 A user can signup for a profile if he/she doesn’t have one already

29
 The user can view the different news.

 The user can read a particular news in detail by clicking on the news link.

 The user has options to post comments

 The user has options to search the news based on subcategory or words in

the search box.

 The user can change his/her password

 The user has the option to get the password if he/she forgets her password.

30
5.1. Tables :

1. user_details

2. category_details

3.subcategory_details

31
4. post_details

5. comment_details

6. gallery_details

32
6. System Development

6.1. Coding :

The objective of coding phase for a given design is to implement the design in best way possible.

In this phase design of the system is translated into code in a programming language. The coding

phase affects the maintenance and testing phase of the system development life cycle process.

Testing and maintenance effort reduces if the code is well written.

Since the testing and maintenance cost of software are much expensive than the coding cost, the

goal of coding should be to reduce the testing and maintenance effort. Hence, during coding the

emphasis must be on developing programs which are easy to write. Simplicity and clarity should

be achieved, during the coding phase.

In this project PHP, HTML, CSS, SQL & javascript codes are used.

index.php

<?php

session_start();

include ('config/dbconnect.php');

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

33
<title>News Portal</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" type="text/css" href="assets/font/font-awesome.min.css" />

<link rel="stylesheet" type="text/css" href="assets/font/font.css" />

<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/style.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/responsive.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/jquery.bxslider.css" media="screen" />

</head>

<body>

<div class="body_wrapper">

<div class="center">

<?php

include ('includes/header.php');

?>

<div class="main_menu_area">

<?php

34
$query=mysqli_query($con,"select * from category_details where Status=1");

while($row=mysqli_fetch_array($query))

$id=$row['CategoryId'];

$query1=mysqli_query($con,"SELECT * FROM subcategory_details WHERE

CategoryId=$id and Status=1");

?>

<ul id="nav">

<li><a href="#"><?php echo htmlentities($row['CategoryName']);?></a> <ul>

<?php

while($row1=mysqli_fetch_array($query1))

?>

<li><a href="search-news.php?subid=<?php echo htmlentities(

$row1['SubcategoryId']);?>"><?php echo htmlentities($row1['SubcategoryName']);?></a></li>

<?php

?> </ul></li></ul>

<?php}?>

35
</div>

<div class="slider_area">

<div class="slider">

<ul class="bxslider">

<?php

$query=mysqli_query($con,"select * from post_details where Status=1");

while($row=mysqli_fetch_array($query))

{?>

<li><img src="admin/postimages/<?php echo htmlentities($row['PostImage']);?>" alt=""

title="" /></li>

<li><img src="images/2.jpg" alt="" title="" /></li>

<li><img src="images/3.jpg" alt="" title="" /></li>

<?php } ?>

</ul> </div></div>

<div class="content_area">

<div class="main_content floatleft">

<div class="left_coloum floatleft">

<div class="single_left_coloum_wrapper">

<h2 class="title">from around the world</h2>


36
<?php

$query=mysqli_query($con,"select * from post_details where Status=1");

while($row=mysqli_fetch_array($query))

$id= $row['PostId'];

$text = substr($row['PostDetails'],0,50);

?>

<div class="single_left_coloum floatleft"> <img src="admin/postimages/<?php echo

htmlentities($row['PostImage']);?>" alt="" />

<h3><?php echo htmlentities($row['PostTitle']);?></h3>

<p><?php echo htmlentities($text);?></p>

<a class="readmore" href="view-postdetails.php?post=<?php echo

htmlentities($id);?>">read more</a> </div>

<?php }?>

</div>

<div class="single_left_coloum_wrapper gallery">

<h2 class="title">gallery</h2>

<a class="more" href="#">more</a>

<?php

37
$query=mysqli_query($con,"select * from post_details where Status=1");

while($row=mysqli_fetch_array($query))

{?>

<img src="admin/postimages/<?php echo htmlentities($row['PostImage']);?>" alt="" />

<?php

?></div></div> </div> </div>

</div>

<div class="single_sidebar"> <img src="" alt="" /> </div>

<div class="single_sidebar">

<img src="" alt="" /> </div>

</div>

</div> <div class="footer_bottom_area">

<div class="copyright_text">

<p>Copyright &copy; 2045 News Portal Inc. All rights reserved | </p>

</div>

</div>

</div>

38
</div>

<script type="text/javascript" src="assets/js/jquery-min.js"></script>

<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>

<script type="text/javascript" src="assets/js/jquery.bxslider.js"></script>

<script type="text/javascript" src="assets/js/selectnav.min.js"></script>

<script type="text/javascript">

selectnav('nav', {

label: '-Navigation-',

nested: true,

indent: '-'

});

selectnav('f_menu', {

label: '-Navigation-',

nested: true,

indent: '-'

});

$('.bxslider').bxSlider({

mode: 'fade',

39
captions: true

});

</script>

</body>

</html>

</body>

</html>

View_postdetails.php

<?php

session_start();

include ('config/dbconnect.php');

//Genrating CSRF Token

if (empty($_SESSION['token'])) {

$_SESSION['token'] = bin2hex(random_bytes(32));

if(isset($_POST['submit']))

//Verifying CSRF Token

40
if (!empty($_POST['csrftoken'])) {

if (hash_equals($_SESSION['token'], $_POST['csrftoken'])) {

if(strlen($_SESSION['login'])!=0)

$name=$_SESSION['login'];

$query=mysqli_query($con,"select * from user_details where UserName=$name and

Status=1");

$row=mysqli_fetch_array($query);

$email=$row['Email'];

else

$name=$_POST['name'];

$email=$_POST['email'];

$comment=$_POST['comment'];

$postid=$_GET['post'];

$st1='0';

41
$query=mysqli_query($con,"insert into comment_details(PostId,Name,Email,Comment,Status)

values('$postid','$name','$email','$comment','$st1')");

if($query)

echo "<script>alert('comment successfully submit. Comment will be display after admin review

');</script>";

unset($_SESSION['token']);

else

echo "<script>alert('Something went wrong. Please try again.');</script>";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

42
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>News Portal</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" type="text/css" href="assets/font/font-awesome.min.css" />

<link rel="stylesheet" type="text/css" href="assets/font/font.css" />

<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/style.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/responsive.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/jquery.bxslider.css" media="screen" />

</head>

<body>

<div class="body_wrapper">

<div class="center">

<?php

include ('includes/header.php');

?>

43
<div class="main_menu_area">

<ul id="nav">

<li><a href="index.php">Back</a></li><ul>

</div>

<div class="slider_area">

</div>

<div class="content_area">

<div class="main_content floatleft">

<?php

$post=$_GET['post'];

$query=mysqli_query($con,"select * from post_details where PostId=$post and

Status=1");

while($row=mysqli_fetch_array($query))

$id= $row['PostId'];

//$text = substr($row['PostDetails'],0,50);

?>

<div class=""> <img src="admin/postimages/<?php echo

htmlentities($row['PostImage']);?>" alt="" />

44
<h3><?php echo htmlentities($row['PostTitle']);?></h3>

<p><?php echo htmlentities($row['PostDetails']);?></p>

<?php }?>

</div>

<div class="single_left_coloum_wrapper gallery">

<h2 class="title">Leave a Comment:</h2>

<form name="Comment" method="post">

<input type="hidden" name="csrftoken" value="<?php echo

htmlentities($_SESSION['token']); ?>" />

<?php

if(!isset($_SESSION['login']))

{ ?>

<input type="text" name="name" class="form-control" placeholder="Name" required >

<input type="email" name="email" class="form-control" placeholder="Email" required >

<?php

?>

<textarea class="form-control" name="comment" rows="3" placeholder="Comment"

required></textarea>

45
<button type="submit" class="btn btn-primary" name="submit">Submit</button>

</form>

</div>

</div>

</div>

<!---Comment Display Section --->

<?php

$sts=1;

$query=mysqli_query($con,"select Name,Comment,PostingDate from comment_details where

PostId='$id' and Status='$sts'");

while ($row=mysqli_fetch_array($query)) {

?>

<div class="media mb-4">

<img class="d-flex mr-3 rounded-circle" src="images/usericon.png" alt="">

<div class="media-body">

<h5 class="mt-0"><?php echo htmlentities($row['Name']);?> <br />

<span style="font-size:11px;"><b>at</b> <?php echo

htmlentities($row['PostingDate']);?></span>

46
</h5>

<?php echo htmlentities($row['Comment']);?> </div>

</div>

<?php } ?>

</div>

</div>

</div>

<div class="footer_bottom_area">

<div class="copyright_text">

<p>Copyright &copy; 2045 News Portal Inc. All rights reserved | </p>

</div>

</div>

</div>

</div>

<script type="text/javascript" src="assets/js/jquery-min.js"></script>

<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>

<script type="text/javascript" src="assets/js/jquery.bxslider.js"></script>

<script type="text/javascript" src="assets/js/selectnav.min.js"></script>

47
<script type="text/javascript">

selectnav('nav', {

label: '-Navigation-',

nested: true,

indent: '-'

});

selectnav('f_menu', {

label: '-Navigation-',

nested: true,

indent: '-'

});

$('.bxslider').bxSlider({

mode: 'fade',

captions: true

});

</script>

</body>

</html>

48
</body>

</html>

Search_news.php

<?php

session_start();

include ('config/dbconnect.php');

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>News Portal</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" type="text/css" href="assets/font/font-awesome.min.css" />

<link rel="stylesheet" type="text/css" href="assets/font/font.css" />

<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/style.css" media="screen" />


49
<link rel="stylesheet" type="text/css" href="assets/css/responsive.css" media="screen" />

<link rel="stylesheet" type="text/css" href="assets/css/jquery.bxslider.css" media="screen" />

</head>

<body>

<div class="body_wrapper">

<div class="center">

<?php

include ('includes/header.php');

?>

<div class="main_menu_area">

<ul id="nav">

<li><a href="index.php">Back</a></li><ul>

</div>

<div class="slider_area">

</div>

<div class="content_area">

<div class="main_content floatleft">

<div class="left_coloum floatleft">

50
<div class="single_left_coloum_wrapper">

<h2 class="title">Search details</h2>

<?php

if(($_GET['subid'])!=NULL)

$id=$_GET['subid'];

$query="select * from post_details where SubcategoryId=$id and Status=1";

$sql= mysqli_query($con, $query);

$row= mysqli_fetch_array($sql);

if($row>0)

while ($row)

?>

<div class="card mb-4">

<div class="card-body">

<h2 class="card-title"><?php echo htmlentities($row['PostTitle']);?></h2>

<a href="view-postdetails.php?post=<?php echo htmlentities($row['PostId'])?>"

class="btn btn-primary">Read More &rarr;</a>


51
</div>

<div class="card-footer text-muted">

Posted on <?php echo htmlentities($row['PostingDate']);?>

</div>

</div>

<?php }

else

echo "No record found";

else

echo "No record found";

?>

</body>

52
</html>

Register.php

<?php

session_start();

include ('config/dbconnect.php');

if(isset($_POST["submit"]))

$user_name=$_POST["UserName"];

$email=$_POST["Email"];

$cpassword=$_POST["CPassword"];

$password=$_POST["Password"];

if($cpassword==$password)

$sts=1;

$query=mysqli_query($con,"insert into user_details(UserName,Password,Status,Email)

values('$user_name','$password','$sts','$email')");

if($query)

$_SESSION["login"]=$user_name;
53
header('Location: index.php');

else{

$error="Something went wrong . Please try again.";

else

echo "Password and confirm password are not same.";

?>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

54
<meta name="description" content="News Portal.">

<!-- App title -->

<title>News Portal </title>

<!-- App css -->

<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

<link href="assets/css/core.css" rel="stylesheet" type="text/css" />

<link href="assets/css/components.css" rel="stylesheet" type="text/css" />

<link href="assets/css/icons.css" rel="stylesheet" type="text/css" />

<link href="assets/css/pages.css" rel="stylesheet" type="text/css" />

<link href="assets/css/menu.css" rel="stylesheet" type="text/css" />

<link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />

<script src="assets/js/modernizr.min.js"></script>

<script type="text/javascript">

function confirmPass() {

var pass = document.getElementById("Password").value

var confPass = document.getElementById("CPassword").value

if(pass != confPass) {

alert('Wrong confirm password !');

55
}

</script>

</head>

<body class="bg-transparent">

<!-- HOME -->

<section>

<div class="container-alt">

<div class="row">

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

<div class="wrapper-page">

<div class="m-t-40 account-pages">

<div class="text-center account-logo-box">

<h2 class="text-uppercase">

<a href="index.html" class="text-success">

<span><img src="admin/assets1/img/brand/download.png"

alt="" height="56"></span>

</a>

</h2>
56
<!--<h4 class="text-uppercase font-bold m-b-0">Sign In</h4>-->

</div>

<div class="account-content">

<form class="form-horizontal" method="post">

<div class="form-group ">

<label>UserName</label>

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

<input class="form-control" type="text" id="UserName"

name="UserName" autocomplete="off" required /></td>

</div>

</div>

<div class="form-group">

<label>Email</label>

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

<input class="form-control" type="text" id="Email"

name="Email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$" required /></td>

</div>

</div>

<div class="form-group">

57
<label>Password</label>

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

<input class="form-control" type="text" id="Password" name="Password"

autocomplete="off" required /></td>

</div>

</div>

<div class="form-group">

<label>Confirm Password</label>

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

<input class="form-control" type="text" id="CPassword"

name="CPassword" required="" autocomplete="off" onblur="confirmPass()" required /></td>

</div>

</div>

<div class="form-group account-btn text-center m-t-10">

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

<button class="btn w-md btn-bordered btn-danger waves-

effect waves-light" type="submit" name="submit">Login</button></td>

</div>

</div>

58
</form>

<div class="clearfix"></div>

</div>

</div>

</div>

</div>

</div>

</div>

</section>

<script>

var resizefunc = [];

</script>

<!-- jQuery -->

<script src="assets/js/jquery.min.js"></script>

<script src="assets/js/bootstrap.min.js"></script>

<script src="assets/js/detect.js"></script>

<script src="assets/js/fastclick.js"></script>

<script src="assets/js/jquery.blockUI.js"></script>

59
<script src="assets/js/waves.js"></script>

<script src="assets/js/jquery.slimscroll.js"></script>

<script src="assets/js/jquery.scrollTo.min.js"></script>

<!-- App js -->

<script src="assets/js/jquery.core.js"></script>

<script src="assets/js/jquery.app.js"></script>

</body>

</html>

Add_category.php

<?php

session_start();

include ('config/dbconnect.php');

error_reporting(0);

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{

60
if(isset($_POST['submit']))

$category=$_POST['category'];

$description=$_POST['description'];

$status=1;

$query=mysqli_query($con,"insert into

category_details(CategoryName,Description,Status) values('$category','$description','$status')");

if($query)

$msg="Category created ";

else{

$error="Something went wrong . Please try again.";

?>

<html lang="en">
61
<head>

<base href="./">

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-

fit=no">

<meta name="description" content="CoreUI - Open Source Bootstrap Admin

Template">

<meta name="author" content="Łukasz Holeczek">

<meta name="keyword"

content="Bootstrap,Admin,Template,Open,Source,jQuery,CSS,HTML,RWD,Dashboard">

<title>Add category</title>

<!-- Icons-->

<link href="assets1/css/coreui-icons.min.css" rel="stylesheet">

<link href="assets1/css/flag-icon.min.css" rel="stylesheet">

<link href="assets1/css/font-awesome.min.css" rel="stylesheet">

<link href="assets1/css/simple-line-icons.css" rel="stylesheet">

<!-- Main styles for this application-->

<link href="assets1/css/style.css" rel="stylesheet">

62
<link href="assets1/css/pace.min.css" rel="stylesheet">

<!-- Global site tag (gtag.js) - Google Analytics-->

<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-118965717-

3"></script>

<script>

window.dataLayer = window.dataLayer || [];

function gtag() {

dataLayer.push(arguments);

gtag('js', new Date());

// Shared ID

gtag('config', 'UA-118965717-3');

// Bootstrap ID

gtag('config', 'UA-118965717-5');

</script>

</head>

<body class="app header-fixed sidebar-fixed aside-menu-fixed sidebar-lg-show">

<?php

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

<div class="app-body">

<?php

include ('includes/sidebar.php');

?>

<main class="main">

<!-- Breadcrumb-->

<ol class="breadcrumb">

<li class="breadcrumb-item">Home</li>

<li class="breadcrumb-item">

Admin

</li>

<li class="breadcrumb-item active">Add Category</li>

<div class="container-fluid">

<div class="animated fadeIn">

<div class="row">

<div class="col-sm-6">

<!---Success Message--->

64
<?php if($msg){ ?>

<div class="alert alert-success" role="alert">

<strong>Well done!</strong> <?php echo htmlentities($msg);?>

</div>

<?php } ?>

<!---Error Message--->

<?php if($error){ ?>

<div class="alert alert-danger" role="alert">

<strong>Oh snap!</strong> <?php echo htmlentities($error);?></div>

<?php } ?>

</div>

</div>

<div class="row">

<div class="col-sm-6">

<div class="card">

<div class="card-header">

<strong>Add Category</strong>

<small>Form</small>

65
</div>

<div class="card-body">

<form class="form-horizontal" name="category" method="post">

<div class="row">

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

<div class="form-group">

<label for="name">Category</label>

<input class="form-control" id="category" type="text" placeholder=""

name="category" required="">

</div>

</div>

</div>

<!-- /.row-->

<div class="row">

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

<div class="form-group">

<label for="ccnumber">Category Description</label>

<textarea class="form-control" id="description" name="description"

rows="9" placeholder="" required=""></textarea>

66
</div>

</div>

</div>

<!-- /.row-->

<div class="row">

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

<div class="form-group">

<button class="btn btn-sm btn-primary" type="submit"

name="submit">

<i class="fa fa-dot-circle-o"></i> Submit</button>

</div>

</div>

</div>

</form>

</div>

</div>

</div>

</div>
67
<!-- end row -->

</body>

</html>

Edit_category.php

<?php

session_start();

include ('config/dbconnect.php');

error_reporting(0);

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{

if(isset($_POST['submit']))

$catid=intval($_GET['cid']);

$category=$_POST['category'];

$description=$_POST['description'];

68
$query=mysqli_query($con,"Update category_details set

CategoryName='$category',Description='$description' where CategoryId='$catid'");

if($query)

$msg="Category Updated successfully ";

header('location:view-category.php?msg1=Category Updated successfully');

else{

$error="Something went wrong . Please try again.";

?>

<html lang="en">

<head>

<base href="./">

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">

<meta name="description" content="CoreUI - Open Source Bootstrap Admin Template">


69
<meta name="author" content="Łukasz Holeczek">

<meta name="keyword"

content="Bootstrap,Admin,Template,Open,Source,jQuery,CSS,HTML,RWD,Dashboard">

<title>Add category</title>

<!-- Icons-->

<link href="assets1/css/coreui-icons.min.css" rel="stylesheet">

<link href="assets1/css/flag-icon.min.css" rel="stylesheet">

<link href="assets1/css/font-awesome.min.css" rel="stylesheet">

<link href="assets1/css/simple-line-icons.css" rel="stylesheet">

<!-- Main styles for this application-->

<link href="assets1/css/style.css" rel="stylesheet">

<link href="assets1/css/pace.min.css" rel="stylesheet">

<!-- Global site tag (gtag.js) - Google Analytics-->

<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-118965717-

3"></script>

<script>

window.dataLayer = window.dataLayer || [];

function gtag() {

dataLayer.push(arguments);

70
}

gtag('js', new Date());

// Shared ID

gtag('config', 'UA-118965717-3');

// Bootstrap ID

gtag('config', 'UA-118965717-5');

</script>

</head>

<body class="app header-fixed sidebar-fixed aside-menu-fixed sidebar-lg-show">

<?php

include ('includes/header.php');

?>

<div class="app-body">

<div class="sidebar">

<nav class="sidebar-nav">

<ul class="nav">

<li class="nav-item">

<a class="nav-link" href="home.php">

71
<i class="nav-icon icon-speedometer"></i> Dashboard

<span class="badge badge-primary">NEW</span>

</a>

</li>

<li class="nav-title">Categories</li>

<li class="nav-item">

<a class="nav-link" href="add-category.php">

<i class="nav-icon icon-drop"></i>Add Category</a>

</li>

<li class="nav-item">

<a class="nav-link" href="view-category.php">

<i class="nav-icon icon-pencil"></i>Manage Category</a>

</li>

<li class="nav-title">Sub Categories</li>

<li class="nav-item">

<a class="nav-link" href="add-subcategory.php">

<i class="nav-icon icon-drop"></i>Add Subcategory</a>

</li>

72
<li class="nav-item">

<a class="nav-link" href="view-subcategory.php">

<i class="nav-icon icon-pencil"></i>Manage Subcategory</a>

</li>

<li class="nav-title">Posts</li>

<li class="nav-item">

<a class="nav-link" href="add-post.php">

<i class="nav-icon icon-drop"></i>Add Posts</a>

</li>

<li class="nav-item">

<a class="nav-link" href="view-posts.php">

<i class="nav-icon icon-pencil"></i>Manage Posts</a>

</li>

<li class="nav-item">

<a class="nav-link" href="trash-post.php">

<i class="nav-icon icon-pencil"></i>Trash Posts</a>

</li>

73
<li class="nav-item ">

<a class="nav-link nav-link-success" href="view-comments.php" target="_top">

<i class="nav-icon icon-cloud-download"></i> View Comments</a>

</li>

</ul>

</nav>

</div>

<main class="main">

<!-- Breadcrumb-->

<ol class="breadcrumb">

<li class="breadcrumb-item">Home</li>

<li class="breadcrumb-item">

Admin

</li>

<li class="breadcrumb-item active">Add Category</li>

<div class="container-fluid">

<div class="animated fadeIn">

74
<div class="row">

<div class="col-sm-6">

<!---Success Message--->

<?php if($msg){ ?>

<div class="alert alert-success" role="alert">

<strong>Well done!</strong> <?php echo htmlentities($msg);?>

</div>

<?php } ?>

<!---Error Message--->

<?php if($error){ ?>

<div class="alert alert-danger" role="alert">

<strong>Oh snap!</strong> <?php echo htmlentities($error);?></div>

<?php } ?>

</div>

</div>

<?php

$catid=intval($_GET['cid']);

75
$query=mysqli_query($con,"Select

CategoryId,CategoryName,Description,CreatedDate,UpdatedDate from category_details where

Status=1 and CategoryId='$catid'");

$cnt=1;

while($row=mysqli_fetch_array($query))

?>

<div class="row">

<div class="col-sm-6">

<div class="card">

<div class="card-header">

<strong>Edit Category</strong>

<small>Form</small>

</div>

<div class="card-body">

<form class="form-horizontal" name="category" method="post">

<div class="row">

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

<div class="form-group">

76
<label for="name">Category</label>

<input class="form-control" id="category" type="text" value="<?php echo

htmlentities($row['CategoryName']);?>" placeholder="" name="category" required="">

</div>

</div>

</div>

<!-- /.row-->

<div class="row">

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

<div class="form-group">

<label for="ccnumber">Category Description</label>

<textarea class="form-control" id="description" name="description" rows="9"

placeholder="" required=""><?php echo htmlentities($row['Description']);?></textarea>

</div>

</div>

</div>

<!-- /.row-->

<div class="row">

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

77
<div class="form-group">

<button class="btn btn-sm btn-primary" type="submit" name="submit">

<i class="fa fa-dot-circle-o"></i> Update</button>

<button class="btn btn-sm btn-danger" type="reset">

<i class="fa fa-ban"></i> Reset</button>

</div>

</div>

</div>

</form>

</div>

</div>

</div>

</div>

<!-- end row -->

</body>

</html>

<?php

78
}

} ?>

Login.php

<?php

session_start();

include ('config/dbconnect.php');

if(isset($_POST["submit"]))

$user_name=$_POST["UserName"];

$password=$_POST["Password"];

$query="select * from user_details where UserName='$user_name'";

$sql= mysqli_query($con, $query);

$user= mysqli_fetch_array($sql);

if($user>0)

$pass=$user["Password"];

if($pass==$password)

79
$_SESSION["login"]=$user_name;

if($user_name=='admin')

header('Location: home.php');

else

header('Location: ../user.php');

else {echo "<script>alert('Wrong Password');</script>";}

else {

echo "<script>alert('User not registered with us');</script>";

?>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

80
<meta name="description" content="News Portal.">

<!-- App title -->

<title>News Portal | Admin Panel</title>

<!-- App css -->

<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

<link href="assets/css/core.css" rel="stylesheet" type="text/css" />

<link href="assets/css/components.css" rel="stylesheet" type="text/css" />

<link href="assets/css/icons.css" rel="stylesheet" type="text/css" />

<link href="assets/css/pages.css" rel="stylesheet" type="text/css" />

<link href="assets/css/menu.css" rel="stylesheet" type="text/css" />

<link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />

<script src="assets/js/modernizr.min.js"></script>

</head>

<body class="bg-transparent">

<!-- HOME -->

<section>

<div class="container-alt">

<div class="row">

81
<div class="col-sm-12">

<div class="wrapper-page">

<div class="m-t-40 account-pages">

<div class="text-center account-logo-box">

<h2 class="text-uppercase">

<a href="index.html" class="text-success">

<span><img src="assets1/img/brand/download.png" alt=""

height="56"></span>

</a>

</h2>

<!--<h4 class="text-uppercase font-bold m-b-0">Sign In</h4>-->

</div>

<div class="account-content">

<form class="form-horizontal" method="post">

<div class="form-group ">

<label>UserName</label>

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

<input class="form-control" type="text" required="" id="UserName"

name="UserName" autocomplete="off"/></td>

82
</div>

</div>

<div class="form-group">

<label>Password</label>

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

<input class="form-control" type="password" id="Password"

name="Password" required="" autocomplete="off"/></td>

</div>

</div>

<div class="form-group account-btn text-center m-t-10">

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

<button class="btn w-md btn-bordered btn-danger waves-

effect waves-light" type="submit" name="submit">Login</button></td>

</div>

</div>

</form>

<div class="clearfix"></div>

<a href="forgot-password.php">Forgot password</a>

83
</div>

</div>

</div>

<!-- end wrapper -->

</div>

</div>

</div>

</section>

<!-- END HOME -->

<script>

var resizefunc = [];

</script>

<!-- jQuery -->

<script src="assets/js/jquery.min.js"></script>

<script src="assets/js/bootstrap.min.js"></script>

<script src="assets/js/detect.js"></script>

<script src="assets/js/fastclick.js"></script>

<script src="assets/js/jquery.blockUI.js"></script>

84
<script src="assets/js/waves.js"></script>

<script src="assets/js/jquery.slimscroll.js"></script>

<script src="assets/js/jquery.scrollTo.min.js"></script>

<!-- App js -->

<script src="assets/js/jquery.core.js"></script>

<script src="assets/js/jquery.app.js"></script>

</body>

</html>

View_category.php

<?php

session_start();

include ('config/dbconnect.php');

error_reporting(0);

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{

85
if($_GET['action']=='del' && $_GET['rid'])

$id=intval($_GET['rid']);

echo $id;

$query=mysqli_query($con,"update category_details set Status='0' where

CategoryId='$id'");

$msg="Category deleted ";

// Code for restore

if($_GET['resid'])

$id=intval($_GET['resid']);

$query=mysqli_query($con,"update category_details set Status='1' where

CategoryId='$id'");

$msg="Category restored successfully";

// Code for Forever deletionparmdel

if($_GET['action']=='parmdel' && $_GET['rid'])

86
{

$id=intval($_GET['rid']);

$query=mysqli_query($con,"delete from category_details where

CategoryId='$id'");

$delmsg="Category deleted forever";

?>

<!DOCTYPE html>

<html lang="en">

<head>

<title> | Manage Categories</title>

<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

<link href="assets/css/core.css" rel="stylesheet" type="text/css" />

<link href="assets/css/components.css" rel="stylesheet" type="text/css" />

<link href="assets/css/icons.css" rel="stylesheet" type="text/css" />

<link href="assets/css/pages.css" rel="stylesheet" type="text/css" />

<link href="assets/css/menu.css" rel="stylesheet" type="text/css" />

<link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="../plugins/switchery/switchery.min.css">


87
<script src="assets/js/modernizr.min.js"></script>

</head>

<body class="fixed-left">

<div class="row">

<div class="col-sm-6">

<?php

$msg1=$_GET['msg1'];

if($msg1){ ?>

<div class="alert alert-success" role="alert">

<strong>Well done!</strong> <?php echo htmlentities($msg1);?>

</div>

<?php }

if($msg){ ?>

<div class="alert alert-success" role="alert">

<strong>Well done!</strong> <?php echo htmlentities($msg);?>

</div>

<?php } ?>

<?php if($delmsg){ ?>

88
<div class="alert alert-danger" role="alert">

<strong>Oh snap!</strong> <?php echo htmlentities($delmsg);?></div>

<?php } ?>

</div>

<div class="row">

<div

class="col-md-12">

<div

class="demo-box m-t-20">

<div class="m-b-30">

<a href="add-category.php">

<button id="addToTable" class="btn btn-success waves-effect waves-light">Add <i

class="mdi mdi-plus-circle-outline" ></i></button>

</a>

</div>

<div class="m-b-30">

<a href="home.php">

Back

</a>

89
</div>

<div class="table-responsive">

<table class="table m-0 table-colored-bordered table-bordered-primary">

<thead>

<tr>

<th>#</th>

<th> Category</th>

<th>Description</th>

<th>Posting Date</th>

<th>Last updation Date</th>

<th>Action</th>

</tr>

</thead>

<tbody>

<?php

$query=mysqli_query($con,"Select

CategoryId,CategoryName,Description,CreatedDate,UpdatedDate from category_details where

Status=1");

90
$cnt=1;

while($row=mysqli_fetch_array($query))

?>

<tr>

<th scope="row"><?php echo htmlentities($cnt);?></th>

<td><?php echo htmlentities($row['CategoryName']);?></td>

<td><?php echo htmlentities($row['Description']);?></td>

<td><?php echo htmlentities($row['CreatedDate']);?></td>

<td><?php echo htmlentities($row['UpdatedDate']);?></td>

<td><a href="edit-category.php?cid=<?php echo htmlentities($row['CategoryId']);?>"><i

class="fa fa-pencil" style="color: #29b6f6;"></i></a>

&nbsp;<a href="view-category.php?rid=<?php echo

htmlentities($row['CategoryId']);?>&&action=del"> <i class="fa fa-trash-o" style="color:

#f05050"></i></a> </td>

</tr>

<?php

$cnt++;

} ?>

91
</tbody>

</table>

</div>

</div>

</div>

</div>

<div class="row">

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

<div class="demo-box m-t-20">

<div class="m-b-30">

<h4><i class="fa fa-trash-o" ></i> Deleted Categories</h4>

</div>

<div class="table-responsive">

<table class="table m-0 table-colored-bordered table-bordered-danger">

<thead>

<tr>

<th>#</th>

<th> Category</th>

92
<th>Description</th>

<th>Posting Date</th>

<th>Last updation Date</th>

<th>Action</th>

</tr>

</thead>

<tbody>

<?php

$query=mysqli_query($con,"Select

CategoryId,CategoryName,Description,CreatedDate,UpdatedDate from category_details where

Status=0");

$cnt=1;

while($row=mysqli_fetch_array($query))

?>

<tr>

<th scope="row"><?php echo htmlentities($cnt);?></th>

<td><?php echo htmlentities($row['CategoryName']);?></td>

93
<td><?php echo htmlentities($row['Description']);?></td>

<td><?php echo htmlentities($row['CreatedDate']);?></td>

<td><?php echo htmlentities($row['UpdatedDate']);?></td>

<td><a href="view-category.php?resid=<?php echo

htmlentities($row['CategoryId']);?>"><i class="ion-arrow-return-right" title="Restore this

category"></i></a>

&nbsp;<a href="view-category.php?rid=<?php echo

htmlentities($row['CategoryId']);?>&&action=parmdel" title="Delete forever"> <i class="fa fa-

trash-o" style="color: #f05050"></i> </td>

</tr>

<?php

$cnt++;

} ?>

</tbody>

</table>

</div> </div>

</div>

94
</div>

</body>

</html>

<?php

} ?>

95
7. Testing

7.1 Testing

System testing is actually a series of different whose primary purpose is to fully exercise the

computer based system. Software testing is critical element of software quality assurance and

represent the ultimate review of the specification, design and coding. System testing makes a

logical assumption that all the part of the system is correct; the goal will be successfully

achieved. Testing is the final verification and validation activity within the organization itself.

During testing the major activities are concerned on the examinations and modification of the

source code.

Testing objectives are:

Testing is a process of executing a program with the intend of finding an error. A good test is one

that uncovers an as yet undiscovered error.

 Unit testing

 Integration testing

 System testing

 Validation testing

 User acceptance testing

Unit Testing

This type of testing is performed by developers before the setup is handed over to the testing

team to formally execute the test cases. Unit testing is performed by the respective developers

96
on the individual units of source code assigned areas. The developers use test data that is

different from the test data of the quality assurance team.

The goal of unit testing is to isolate each part of the program and show that individual parts are

correct in terms of requirements and functionality.

Unit testing enables a programmer to detect error in coding. A unit test focuses verification of

the smallest unit of software design. This testing was carried out during the coding itself. In this

testing step, each module is going to be work satisfactorily as the expected output from the

module.

Limitations of Unit Testing:

 Testing cannot catch each and every bug in an application. It is impossible to evaluate

every execution path in every software application. The same is the case with unit

testing.

 There is a limit to the number of scenarios and test data that a developer can use to

verify a source code. After having exhausted all the options, there is no choice but to

stop unit testing and merge the code segment with other units.

Project aspect: The front-end design consists of various forms. They were tested for data

acceptance. Similarly, the back-end also tested for successful acceptance and retrieval of data.

Integration Testing

Through each program work individually, they should work after linking together. This is

referred to as interfacing. Data may be lost across the interface; one module can have adverse

effect on the other. Subroutines after linking may not do the desired function expected by the

97
main routine. Integration testing is the systematic technique for constructing the program

structure while at the same time conducting test to uncover errors associated with the interface.

Using integrated test plan prepared in the design phase of the system development as a guide, the

integration test was carried out. All the errors found in the system were corrected for the next

testing step.

Integration testing is defined as the testing of combined parts of an application to determine if

they function correctly. Integration testing can be done in two ways: Bottom-up integration

testing and Top-down integration testing.

o Bottom-up integration: This testing begins with unit testing, followed by tests of

progressively higher-level combinations of units called modules or builds.

o Top-down integration: In this testing, the highest-level modules are tested first and

progressively, lower-level modules are tested thereafter.

In a comprehensive software development environment, bottom-up testing is usually done first,

followed by top-down testing. The process concludes with multiple tests of the complete

application, preferably in scenarios designed to mimic actual situations.

Project aspect: After connecting the back-end and the front-end as whole module, the data

entered in the front-end once submitted were successfully entered in the database. On request,

data were successfully retrieved in to forms.

System Testing

After performing the integration testing, the next step is output testing of the proposed system.

No system could be useful if it doesn’t produce the required output in a specified format. The

output generated are displayed by the system under consideration and then tested by comparing
98
with the format require by the user. Here the output format is considered in to two ways, one in

on-screen and other in printed format.

System testing tests the system as a whole. Once all the components are integrated, the

application as a whole is tested rigorously to see that it meets the specified Quality Standards.

This type of testing is performed by a specialized testing team.

System testing is important because of the following reasons −

 System testing is the first step in the Software Development Life Cycle, where the

application is tested as a whole.

 The application is tested thoroughly to verify that it meets the functional and technical

specifications.

 The application is tested in an environment that is very close to the production

environment where the application will be deployed.

 System testing enables us to test, verify, and validate both the business requirements as

well as the application architecture.

Project aspect: The entire project was tested and found successful.

Validation testing

Validation Testing ensures that the product actually meets the client's needs. It can also be

defined as to demonstrate that the product fulfills its intended use when deployed on appropriate

environment. The user has to work with the system and check whether the project meets his

needs. In the validation checking, the user works with the beta version of the software.

Project aspects: User enters the appropriate data and results was checked and validated

99
User Acceptance Testing

User acceptance of a system is a key factor of the success of any system. The system under

consideration was tested for user acceptance by running a prototype of the software.

This is arguably the most important type of testing, as it is conducted by the Quality Assurance Team who

will gauge whether the application meets the intended specifications and satisfies the client’s requirement.

The QA team will have a set of pre-written scenarios and test cases that will be used to test the

application.

More ideas will be shared about the application and more tests can be performed on it to gauge its

accuracy and the reasons why the project was initiated. Acceptance tests are not only intended to point out

simple spelling mistakes, cosmetic errors, or interface gaps, but also to point out any bugs in the

application that will result in system crashes or major errors in the application.

By performing acceptance tests on an application, the testing team will reduce how the application will

perform in production. There are also legal and contractual requirements for acceptance of the system.

Project aspects: An alpha version is demonstrated to the users. Their suggestions are recorded.

7.2 Test Cases

A test case is a document, which has a set of test data, preconditions, expected results and

postconditions, developed for a particular test scenario in order to verify compliance against a

specific requirement.

Test Case acts as the starting point for the test execution, and after applying a set of input

values, the application has a definitive outcome and leaves the system at some end point or also

known as execution postcondition.

100
Test cases involve a set of steps, conditions, and inputs that can be used while performing

testing tasks. The main intent of this activity is to ensure whether a software passes or fails in

terms of its functionality and other aspects. There are many types of test cases such as

functional, negative, error, logical test cases, physical test cases, UI test cases, etc.

Furthermore, test cases are written to keep track of the testing coverage of a software.

Generally, there are no formal templates that can be used during test case writing.

The primary objectives of test case design methods are to derive a set of test that has of highest

likelihood of uncovering the defects. To accomplish this objective, two categories of test case

design techniques are used, Black box testing and White box testing.

White Box Testing

White box testing is a test case design method that uses the control structure of the procedural

design to derive test cases. White-box testing is the detailed investigation of internal logic and

structure of the code. White-box testing is also called glass testing or open-box testing. In order

to perform white-box testing on an application, a tester needs to know the internal workings of

the code.

The tester needs to have a look inside the source code and find out which unit/chunk of the code

is behaving inappropriately. Using white box testing methods, we can derive test cases that;

 Guarantee that all independent paths within a module have been exercised at least once

 Exercise all logical decisions on their true and false sides

 Execute all loops at their boundaries and within their operational bounds

 Exercise internal data structures to ensure their validity.

101
Black Box Testing

The technique of testing without having any knowledge of the interior workings of the

application is called black-box testing. The tester is oblivious to the system architecture and does

not have access to the source code. Typically, while performing a black-box test, a tester will

interact with the system's user interface by providing inputs and examining outputs without

knowing how and where the inputs are worked upon.

Black box testing methods focus on the functional requirements if the software. That is, black

box testing enables us to derive sets of input conditions that will fully exercise all functional

requirements of the program. Black box testing attempts to find errors in the following

categories:

 Incorrect or missing functions

 Interface errors

 Errors in data structure or external database access

 Performance errors

 Initialization and termination errors

7.3 Verification and validation

Verification is intended to check that a product, service, or system (or portion thereof, or set

thereof) meets a set of design specifications. In the development phase, verification procedures

involve performing special tests to model or simulate a portion, or the entirety, of a product,

service or system, then performing a review or analysis of the modeling results. In the post-

development phase, verification procedures involve regularly repeating tests devised specifically

to ensure that the product, service, or system continues to meet the initial design requirements,

102
specifications, and regulations as time progresses. It is a process that is used to evaluate whether

a product, service, or system complies with regulations, specifications, or conditions imposed at

the start of a development phase. Verification can be in development, scale-up, or production.

This is often an internal process.

Validation is intended to ensure a product, service, or system (or portion thereof, or set thereof)

results in a product, service, or system (or portion thereof, or set thereof) that meets the

operational needs of the user. For a new development flow or verification flow, validation

procedures may involve modeling either flow and using simulations to predict faults or gaps that

might lead to invalid or incomplete verification or development of a product, service, or system

(or portion thereof, or set thereof) . A set of validation requirements (as defined by the user),

specifications, and regulations may then be used as a basis for qualifying a development flow or

verification flow for a product, service, or system (or portion thereof, or set thereof). Additional

validation procedures also include those that are designed specifically to ensure that

modifications made to an existing qualified development flow or verification flow will have the

effect of producing a product, service, or system (or portion thereof, or set thereof) that meets the

initial design requirements, specifications, and regulations; these validations help to keep the

flow qualified. It is a process of establishing evidence that provides a high degree of assurance

that a product, service, or system accomplishes its intended requirements. This often involves

acceptance of fitness for purpose with end users and other product stakeholders. This is often an

external process.

This project is undergone all verification and validation procedure so that it can be used by the

end user. This meets all the set of design specifications and is tested properly using the test cases.

103
7.4 Debugging

It is a systematic process of spotting and fixing the number of bugs, or defects, in a piece of

software so that the software is behaving as expected. Debugging is harder for complex systems

in particular when various subsystems are tightly coupled as changes in one system or interface

may cause bugs to emerge in another.

Debugging is a developer activity and effective debugging is very important before testing

begins to increase the quality of the system. Debugging will not give confidence that the system

meets its requirements completely but testing gives confidence.

This project has been undergone all testing and has fix the errors that is reported while testing in

the developing phase itself.

104
8.Input and output Screens

105
106
107
108
109
110
111
9.Implementation of the security for the software developed

Security, as part of the software development process, is an ongoing process involving people

and practices, and ensures application confidentiality, integrity, and availability. Secure software

is the result of security aware software development processes where security is built in and thus

software is developed with security in mind.

Security is most effective if planned and managed throughout every stage of software

development life cycle (SDLC), especially in critical applications or those that process sensitive

information.

This project Online News Portal has two users; User and Administrator. Both are secured with

MD5 secured passwords. The MD5 message-digest algorithm is a very widely used hash

function producing a 128-bit hash value. Each time the user logins to system, it is checked with

the corresponding table detail in the database and verify whether it is the correct user or not.

112
10.Limitations

 This system is not hosted on any internet server.

 The registered user now has only options of searching and viewing the news, change

password and recover forgotten password.

 Game facility is not implemented for registered user.

 Newsletter is not implemented

11. Conclusion and scope of Future Application

After processing through all phases of the system development life cycle, the news portal is

developed. In future it will be hosted on the internet server which will be accessed by all people

in the world and can view the site and learn as much as news and information about the world.

The Administrator or editor who will be assigned for editing or managing or controlling will be

given the secure login information and will change or modify the website as per the

requirements. New facility can also implemented in this system like online games for registered

users, quizzes etc .

113
12. Bibliography

1. Fundamentals of Software Engineering,Rajiv Mall,New Delhi: PHI Learning limited, 2003

2. https://www.tutorialspoint.com/php

3. HTML, and CSS Bible. Bill Karow, Chuck White, Steven M. Schafer Bryan Pfaffenberger,
New York: Wiley 2004

4. http://en.wikipedia.org/wiki/Software_engineering

5. http://www.w3schools.com/html/html_intro.asp

114

Вам также может понравиться