K Report
K Report
Project-1
Bachelor in Technology
In
Computer Science & Engineering
Certified that Project work entitled NEWS PORTAL is a bonafide work carried out in the 8th semester by
th
khushal (2121339), Anmol sharma (2121246) for Project-1 as a part of Bachelor of Technology in Computer
Science & Engineering at CGC- College of Engineering, Landran from I.K.Gujral Punjab Technical University,
Jalandhar.
This is to certify that the above statement made by the candidate is correct to best of my knowledge.
1
Acknowlegement
We would like to express our sincere gratitude to the Director-Principal, CGC College of
Engineering, Landran, for providing this opportunity to carry out the present work.
The constant guidance and encouragement received from Head, Department of Computer Science
and Engineering, Landran has been of great help in carrying our present work and helped me in
completing this project with success.
We would like to express a deep sense of gratitude to my Project Supervisor Mr. Pradeep Tiwana
and Mr. Jagbir (CSE department) for the guidance and support in defining the problem and towards
the completion of our project work. Without his/her wise counsel and able guidance, it would have
been impossible to complete the project in this manner.
We are also thankful to all the faculty and staff members of Department of Computer Science and
Engineering for their intellectual support throughout the course of this work.
Khushal (21213339)
2
Abstract
The “News Portal” has been developed to override the problems prevailing in the practicing
manual system. This software is supported to eliminate and in some cases reduce the hardship
faced by this existing system .Moreover this system is designed for the particular need of the
company to carry out operations in a smooth and effective manner.
“It is a dynamic system. It can be maintain and changed easily because it is based on database.
It’s contain web pages that are generated in real-time. These pages include Web scripting
code, such as PHP. It is fully secured from unauthorized access. In a word it can say that our
Online News Portal website is a completely dynamic website.”
3
EXECUTIVE SUMMARY
The “News Portal” has been developed to override the problems prevailing in the practicing
manual system. This software is supported to eliminate and in some cases reduce the hardship
faced by this existing system .Moreover this system is designed for the particular need of the
company to carry out operations in a smooth and effective manner.
News portal plays a key role in educating and informing people with the latest updates,
current happenings around the world. Talking about its development, A news portal
development company handles all the operations that are about to take place in its
development stage. Nowadays, people don’t have sufficient time to read the printed
newspaper which covers yesterday’s happening in general, so they are keen always to follow
web portals or Electronic Media for getting the latest news.
It has three modules User Modules , Admin Modules and Sub-admin.
1.User Module:
Anyone can read the news and also search for particular news. The reader can leave
comments on the particular news.
2.Admin Module:
3.Sub-Admin Module:3
Sub-Admin and Admin features are the same except Sub-Admin creation.
1. HTML: HTML is used to create and save web document. E.g. Notepad/Notepad++
4
Back end: PHP, MySQL
2. MySQL: MySQL is a database, widely used for accessing querying, updating, and
managing data in databases.
1. WAMP Server
2. XAMPP Server
3. MAMP Server
4. LAMP Server
5
Index
Content
Executive Summary
Index
Introduction
Objective
Benefits
Scope
Project Modules
Features of Project
1.Preliminary Investigation
2. System Requirements Analysis
2.1 Purpose
2.2 Identification of need
2.3 Feasibility Study
2.4 System Design of News Portal
2.5 User Interface Desiqn
3. Project planning
3.1 Cost Estimation of the project
3.2 Hardware/ software requirement
3.3 Technology used
3.4 Process design
4. Data base design
5. System Implementation
5.1 Coding
6. Conclusion and Future Scope
6.1 Conclusion
6.2 Future Scope
7.Bibliography
6
INTRODUCTION
The “News Portal” has been developed to override the problems prevailing in the practicing
manual system. This software is supported to eliminate and in some cases reduce the hardship
faced by this existing system .Moreover this system is designed for the particular need of the
company to carry out operations in a smooth and effective manner.
“It is a dynamic system. It can be maintain and changed easily because it is based on database.
It’s contain web pages that are generated in real-time. These pages include Web scripting
code, such as PHP. It is fully secured from unauthorized access. In a word it can say that our
Online News Portal website is a completely dynamic website.”
OBJECTIVE
The main objective of the Project on Online News Portal is to manage the details of News,
Category, Latest News, Weather News, Bollywood News. It manages all the information
about News, News Report, Bollywood News, News. The project is totally built at
administration end and thus only the administrator is guaranteed the acess. The pupose of the
project is to build an application program to reduce the manual work for managing the News,
Category, News Report, Latest News. It tracks all the details about the Latest News, Weather
News, Bollywood News.
The objective of this project is to develop a web application for Online News Management
system that can aware the people.
The objective of this project is to provide the daily news.
The objective of this project is to provide the breaking news.
It makes use of various technologies to get required crime oriented .
7
Benefits Of An News Portal
News Managements System are gaining popularity and almost being used by 70% of the
world population. They are fast, reliable, and, most importantly, updated every time. Here is a
list of benefits of using or keeping up with the online news portals.
o We can read news from any timeline from years back to just a minute back. We don’t need to
remember where we kept the old newspaper. All we have to do is browse the date, and all the
news appears. The online news portal comes handy in this case.
o Online news portals are always up to date. The public doesn’t have to wait for an entire day to
read what happened the previous day around the world. The online news portal provides fresh
news every minute.
o Local newspapers don’t provide all the news in detail. They can’t print each and every news.
But when it comes to the online news portal, they provide the news from all over the world.
o Newspapers only have few pictures, but the online news portal uploads a lot of graphics,
photos, and even videos, which make them more interesting.
o Local newspapers don’t provide all the news in detail. They can’t print each and every news.
But when it comes to the online news portal, they provide the news from all over the world.
o Newspapers only have few pictures, but the online news portal uploads a lot of graphics,
photos, and even videos, which make them more interesting.
o Offers all kind of information to the public about political, social, sports, health,
entertainment, etc.
o Live coverage of National Events, Cricket matches, and other sports, etc
8
Project Module:
1.User Module
2.Admin Module
3.Sub-Admin
1.User Module:
Anyone can read the news and also search for particular news. The reader can leave
comments on the particular news.
2.Admin Module:
Admin Dashboard:
In this section admin can view , listed categories and sub categories, total published news
and trashed news.
Sub-admin:
In this section admin can add/edit/delete sub admin.
Category:
o In this section admin can add/edit/delete Subcategory. Admin can also restore deleted
Subcategory.
Post:
Admin can add/edit/delete news posts . Admin can also view deleted news post in trash post
section and restore deleted posts.
Pages:
Admin can manage the contact of about us and contact us page.
3.Sub-Admin Module:
Sub-Admin and Admin features are the same except Sub-Admin creation. Sub-Admin cannot
create the Sub-Admins.
9
Features of the proiect News Portal:
Creating & Changing Issues at ease
Query Issue List to any depth
User Accounts to control the access and maintain security
Targets & Milestones for guiding the programmers
Attachments & Additional Comments for more information
Robust database back-end
Various level of reports available with a lot of filter criteria's
10
PRELIMINARY INVESTIGATION
Investigation basically refers to the collection of information that guides the management of an
organization to evaluate the merits and demerits of the project request and make an informed judgment
about the feasibility of the proposed system. This sort of investigation provides us with a through
picture of the kind of software and hardware requirements which are most feasible for the system, plus
the environment in which the entire project has to be installed and made operational. They were quite
effective in guiding us towards visualizing the features that were needed to be put together in the
system and the required output which had to be generated once the system became functional. Schools
and Colleges have undergone a change for its betterment. The administrations of education sector are
opting IT solutions for the better management and patient care in their School/College campus. Have a
look at some salient features of Student Result management software. The modules of Student Result
management software are user- friendly and easy to access. It has a common user friendly interface
having several modules. The officials can utilize these modules in their processes without any hassle
and make the best possible use of Student Result management system. As per investigation we know
online growth is unstoppable so we need a system that can handle a large amount of crowd. With time
things have changed and people are using more mobile devices than laptops and computers, mobile
shopping is growing. There is evolving role of social media in ecommerce so a review system and
SEO part should be considered too.
Scope Of Investigation
This project is to design, build for students, functions like adding students, deleting students, updating
records of students, etc. The project will be split up into stages and documented thoroughly
throughout. Project management is a key 20 factor of this task to ensure the strict deadlines are
adhered to. It is also of paramount importance that tried and tested practices and techniques from the
field are adhered to ensure that no common development project mistakes are reproduced. We decide
to review existing records, procedures, and forms helps to seek insight into a system which 6 describes
the current system capabilities, its operations, or activities. To gather information from individuals or
groups we tried interviewing. The analyst can be formal, legalistic, playpolitics, or be informal; as the
success of an interview depends on the skill of analystsinterviewer. The main elements of the
investigation were client and the enduser so to make a better project we decide to gather information
from the company regarding the project and also there were multiple surveys given to users to
understand there side of the story. Users were having issues like they could find right medicines or
their requirements can’t be fulfilled. So it is important that users can give review about the system so
we can work on improving the system. In the first phase, the system is investigated.
The objective of this phase is to conduct an initial analysis and findings of the system as follows:
11
System Identification
This phase is used to identify the need for a new System. It is very important step. Everything
performed in future depends on this Phase.
Data Gathering Techniques
Data gathering techniques are used to collect detailed information about system. These techniques are
written documents, interviewing, observations and sampling.
System Scope
The Scope of the system is defined at this stage. The Scope of the system can be reduced due to
political and financial problems.
Feasibility Study
A system must be affordable and acceptable for the organization. A Feasibility studyis used to find
whether the proposed system is feasible. This decisions depends on different issues such as financial
and time limits.
Preliminary Plan
Consist of all findings in written form approval. It preliminary plan is also called feasibility report. It
is normally submitted to the top managers of the organization
Data Analysis
A process of analyzing the data to obtain accurate is analysis data information. Many tools are used for
this purpose such as dataflow diagram and flowchart.
12
2.SYSTEM REQUIREMENT ANALYSIS
The Software Requirements Specification is produced at the culmination of the analysis task.
The function and performance allocated to software as part of system engineering are refined
by establishing a complete information description, a detailed functional and behavioral
description, an indication of performance requirements and design constraints, appropriate
validation criteria, and other data pertinent to requirements.
2.1. Purpose:
System needs store information about new entry of News.
System need to maintain quantity record.
System need to keep the record of Latest News.
System need to update and delete the record.
System also needs a search area.
It also needs a security system to prevent data.
2.2. Identification of need:
The old manual system was suffering from a series of drawbacks. Since whole of the system
was to be maintained with hands the process of keeping, maintaining and retrieving the
information was very tedious and lengthy. The records were never used to be in a systematic
order. there used to be lots of difficulties in associating any particular transaction with a
particular context. If any information was to be found it was required to go through the different
registers, documents there would never exist anything like report generation. There would
always be unnecessary consumption of time while entering records and retrieving records. One
more problem was that it was very difficult to find errors while entering the records. Once the
records were entered it was very difficult to update these records.
13
2.3 Feasibility Study:
After doing the project Online News Portal, study and analyzing all the existing or required
functionalities of the system, the next task is to do the feasibility study for the project. All
projects are feasible - given unlimited resources and infinite time.
Feasibility study includes consideration of all the possible ways to provide a solution to the
given problem. The proposed solution should satisfy all the user requirements and should be
flexible enough so that future changes can be easily done based on the future upcoming
requirements
A. Economical Feasibility
This is a very important aspect to be considered while developing a project. We decided the
technology based on minimum possible cost factor.
All hardware and software cost has to be borne by the organization.
Overall we have estimated that the benefits the organization is going to rece
B. Technical Feasibility
This included the study of function, performance and constraints that may affect the ability to
achieve an acceptable system. For this feasibility study, we studied complete functionality to
be provided in the system, as described in the System Requirement Specification (SRS), and
checked if everything was possible us
C. Operational Feasibility
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.
3 System Design of Online News Portal
In this phase, a logical system is built which fulfils the given requirements. Design phase of
software development deals with transforming the clients 's requirements into a logically
working system. Normally, design is performed in the following in the following two steps
1.Primary Design Phase:
In this phase, the system is designed at block level. The blocks are created on the basis of
analysis done in the problem identification phase. Different blocks are created for different
functions emphasis is put on minimising the information flow between blocks. Thus, all
activities which require more interaction are kept in one block.
2. Secondarv Desian Phase:
In the secondary phase the detailed design of every block is performed.
14
3.The qeneral tasks involved in the desiqn process are the followinq:
1. Design various blocks for overall system processes.
2. Design smaller, compact and workable modules in each block.
3. Design various database structures.
4. Specify details of programs to achieve desired functionality.
5. Design the form of inputs, and outputs of the system.
6. Perform documentation of the design.
The followinq steps are various guidelines for User Interface Design:
1. The system user should always be aware of what to do next.
2. The screen should be formatted so that various types of information, instructions and messages
always appear in the same general display area.
3. Message, instructions or information should be displayed long enough to all
4. Use display attributes sparingly.
5. Default values for fields and answers to be entered by the user should be specified.
6. A user should not be allowed to proceed without correcting an error.
15
Project Planninq:
Software project plan can be viewed as the following:
Within the orqanization: How the project is to be implemented? What are various
constraints (time, cost, staff)? What is market strategy?
1. With respect to the customer: Weekly or timely meetings with the customer with
presentation on status reports. Customers feedback is also taken and further modification and
developments are done. Project milestones and deliverables are also presented to the
customer.
For a successful software project. the followinq steps can be followed:
Select a project
Identifying project's aims and object
Understanding requirements and specification
Methods of analysis, design and implementation
Testing techniques
Documentation
Project milestones and deliverables
Budget allocation
Exceeding limits within control
Project Estimates
Cost
Time
Size of code
Resource Allocation
Hardware
Software
Previous relevant project information
Risk Management
Risk avoidance
Risk detection
16
3.1 Cost estimation of the project:
Software cost comprises a small percentage of overall computer-based system cost. There are
a number of factors, which are considered, that can affect the ultimate cost of the software such
as - human, technical, Hardware and Software availability etc.
The main point that was considered during the cost estimation of project was its sizing. In spite
of complete software sizing, function point and approximate lines of code were also used to
"size" each element of the Software and their costing.
The cost estimation done by me for Project also depend upon the baseline metrics collected
from past projects and these were used in conjunction with estimation variables to develop cost
and effort projections.
We have basically estimated this project mainly on two bases -
We have basically estimated this project mainly on two bases -
1) Effort Estimation - This refers to the total man-hours required for the development of
the project. It even includes the time required for doing documentation and user manual.
2) Hardware Required Estimation - This includes the cost of the PCs and the hardware
cost required for development of this project.
3.2 HARDWARE/SOFTWARE REQUIREMENTS
Software requirements deal with defining software resource requirements and
prerequisites that need to be installed on a computer to provide optimal functioning of an
application. These requirements or prerequisites are generally not included in the software
installation package and need to be installed separately before the software is installed. The
most common set of requirements defined by any operating system or software application is
the physical computer resources, also known as hardware. The following sub-sections discuss
the various aspects of hardware requirements
17
3.2.2SOFTWARE REQUIREMENTS
The software requirement of our project as combination of different software .To starts or run
this website we must have these following software:
(1) XAMPP/WAMP SERVER
(2) Windows 7/8/10.
18
3.4 Process design
DATA FLOW DIAGRAMS (DFD)
LEVEL-0 DFD
19
LEVEL-1 DFD
20
4 DATABASE DESIGN (TABLES)
Databases are the storehouses of data used in the software systems. The data is stored in tables
inside the database. Several tables are created for the manipulation of the data for the system.
Two essential settings for a database are
● FOREIGN KEY- the field that is unique for all the record occurrences.
● PRIMARY KEY -the field used to set relation between tables.
Normalization is a technique to avoid redundancy in the tables.
4.1 DATABASE DESIGN
21
Table 4.3: tbl_comments: This table contains the details of comments.
The table has columns like Id, Post, password, EmailId, supertype, CreationDate AND
UpdationDate.
22
Table 4.5: tbl_posts: This table contains the details of posts.
The table has columns like Id, PostTitle, Category, SubCategoryId, PostDetails,
PostingDate,UpdationDate,is_Active,PostUrl,Postimage,viewCounter,postedBy,lastdate
dby.
23
SYSTEM DEVELOPMENT(CODING)
INDEX PAGE:
<?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 | 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>
25
<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>
</div>
</div>
<?php } ?>
26
</div>
</div>
<!-- /.container -->
</head>
</body>
</html>
ABOUT US:
<?php
include('includes/config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
27
<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="">
</head>
<body>
<?php
$pagetype='aboutus';
$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">
28
<a href="index.php">Home</a>
</li>
<li class="breadcrumb-item active">About</li>
</ol>
<div class="col-lg-12">
</div>
<!-- /.container -->
</body>
</html>
CATEGORY:
<?php
session_start();
error_reporting(0);
include('includes/config.php');
29
?>
<!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="">
</head>
<body>
30
<div class="col-md-8">
if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
}
$no_of_records_per_page = 8;
$offset = ($pageno-1) * $no_of_records_per_page;
31
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>
</div>
</div>
<?php } ?>
32
<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 } ?>
</div>
</div>
<!-- /.container -->
33
</head>
</body>
</html>
CONTACT US:
<?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="">
</head>
<body>
34
<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>
<div class="col-lg-12">
</div>
<!-- /.container -->
35
<?php include('includes/footer.php');?>
</body>
</html>
SEARCH:
<?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="">
36
</head>
<body>
if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
}
$no_of_records_per_page = 8;
$offset = ($pageno-1) * $no_of_records_per_page;
37
$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);
$rowcount=mysqli_num_rows($query);
if($rowcount==0)
{
echo "No record found";
}
else {
while ($row=mysqli_fetch_array($query)) {
?>
38
<div class="card-footer text-muted">
Posted on <?php echo htmlentities($row['postingdate']);?>
</div>
</div>
<?php } ?>
</div>
39
</div>
<!-- /.container -->
</head>
</body>
</html>
<!---------------------------------------ADMIN----------------------------------------- >
INDEX:
<?php
session_start();
//Database Configuration File
include('includes/config.php');
//error_reporting(0);
if(isset($_POST['login']))
{
40
$num=mysqli_fetch_array($sql);
if($num>0)
{
$_SESSION['login']=$_POST['username'];
$_SESSION['utype']=$num['userType'];
echo "<script type='text/javascript'> document.location = 'dashboard.php'; </script>";
}else{
echo "<script>alert('Invalid Details');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="News Portal.">
<meta name="author" content="PHPGurukul">
<script src="assets/js/modernizr.min.js"></script>
41
</head>
<body class="bg-transparent">
<div class="wrapper-page">
42
<input class="form-control" type="password" name="password" required=""
placeholder="Password" autocomplete="off">
</div>
</div>
</form>
<div class="clearfix"></div>
<a href="../index.php"><i class="mdi mdi-home"></i> Back Home</a>
</div>
</div>
<!-- end card-box-->
</div>
<!-- end wrapper -->
</div>
</div>
</div>
</section>
<!-- END HOME -->
<script>
var resizefunc = [];
43
</script>
</body>
</html>
ADD CATEGORY:
<?php
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['submit']))
{
$category=$_POST['category'];
$description=$_POST['description'];
$status=1;
44
$query=mysqli_query($con,"insert into tblcategory(CategoryName,Description,Is_Active)
values('$category','$description','$status')");
if($query)
{
$msg="Category created ";
}
else{
$error="Something went wrong . Please try again.";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body class="fixed-left">
45
<!-- Begin page -->
<div id="wrapper">
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title-box">
<h4 class="page-title">Add Category</h4>
<ol class="breadcrumb p-0 m-0">
<li>
<a href="#">Admin</a>
</li>
<li>
<a href="#">Category </a>
</li>
<li class="active">
Add Category
</li>
</ol>
<div class="clearfix"></div>
</div>
46
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="m-t-0 header-title"><b>Add Category </b></h4>
<hr />
<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>
47
<div class="row">
<div class="col-md-6">
<form class="form-horizontal" name="category" method="post">
<div class="form-group">
<label class="col-md-2 control-label">Category</label>
<div class="col-md-10">
<input type="text" class="form-control" value="" name="category" required>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Category Description</label>
<div class="col-md-10">
<textarea class="form-control" rows="5" name="description" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"> </label>
<div class="col-md-10">
</form>
</div>
</div>
48
</div>
</div>
</div>
<!-- end row -->
<?php include('includes/footer.php');?>
</div>
</div>
<script>
var resizefunc = [];
</script>
49
<script src="../plugins/switchery/switchery.min.js"></script>
</body>
</html>
<?php } ?>
ADD POST:
<?php
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
50
$allowed_extensions = array(".jpg","jpeg",".png",".gif");
// Validation for allowed extensions .in_array() function searches an array for a specific value.
if(!in_array($extension,$allowed_extensions))
{
echo "<script>alert('Invalid format. Only jpg / jpeg/ png /gif format allowed');</script>";
}
else
{
//rename the image file
$imgnewfile=md5($imgfile).$extension;
// Code for move image into directory
move_uploaded_file($_FILES["postimage"]["tmp_name"],"postimages/".$imgnewfile);
$status=1;
$query=mysqli_query($con,"insert into
tblposts(PostTitle,CategoryId,SubCategoryId,PostDetails,PostUrl,Is_Active,PostImage,posted
By)
values('$posttitle','$catid','$subcatid','$postdetails','$url','$status','$imgnewfile','$postedby')");
if($query)
{
$msg="Post successfully added ";
}
else{
$error="Something went wrong . Please try again.";
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A fully featured admin theme which can be used to build
CRM, CMS, etc.">
51
<meta name="author" content="Coderthemes">
52
</head>
<body class="fixed-left">
<!-- Begin page -->
<div id="wrapper">
<!-- Top Bar Start -->
<?php include('includes/topheader.php');?>
<!-- ========== Left Sidebar Start ========== -->
<?php include('includes/leftsidebar.php');?>
<!-- Left Sidebar End -->
<!-- ============================================ -->
<!-- Start right Content here -->
<!-- ============================================================== --
>
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title-box">
<h4 class="page-title">Add Post </h4>
<ol class="breadcrumb p-0 m-0">
<li>
<a href="#">Post</a>
</li>
<li>
<a href="#">Add Post </a>
</li>
<li class="active">
Add Post
</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
53
<!-- end row -->
<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>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="p-6">
<div class="">
<form name="addpost" method="post" enctype="multipart/form-data">
<div class="form-group m-b-20">
<label for="exampleInputEmail1">Post Title</label>
<input type="text" class="form-control" id="posttitle" name="posttitle" placeholder="Enter
title" required>
</div>
<div class="form-group m-b-20">
<label for="exampleInputEmail1">Category</label>
<select class="form-control" name="category" id="category"
onChange="getSubCat(this.value);" required>
<option value="">Select Category </option>
<?php
// Feching active categories
$ret=mysqli_query($con,"select id,CategoryName from tblcategory where Is_Active=1");
54
while($result=mysqli_fetch_array($ret))
{
?>
<option value="<?php echo htmlentities($result['id']);?>"><?php echo
htmlentities($result['CategoryName']);?></option>
<?php } ?>
</select>
</div>
<div class="form-group m-b-20">
<label for="exampleInputEmail1">Sub Category</label>
<select class="form-control" name="subcategory" id="subcategory" required>
</select>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="m-b-30 m-t-0 header-title"><b>Post Details</b></h4>
<textarea class="summernote" name="postdescription" required></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="m-b-30 m-t-0 header-title"><b>Feature Image</b></h4>
<input type="file" class="form-control" id="postimage" name="postimage" required>
</div>
</div>
</div>
<button type="submit" name="submit" class="btn btn-success waves-effect waves-
light">Save and Post</button>
<button type="button" class="btn btn-danger waves-effect waves-light">Discard</button>
</form>
</div>
55
</div> <!-- end p-20 -->
</div> <!-- end col -->
</div>
<!-- end row
</div> <!-- container -->
</div> <!-- content -->
<?php include('includes/footer.php');?>
</div>
<!--Summernote js-->
<script src="../plugins/summernote/summernote.min.js"></script>
<!-- Select 2 -->
<script src="../plugins/select2/js/select2.min.js"></script>
<!-- Jquery filer js -->
<script src="../plugins/jquery.filer/js/jquery.filer.min.js"></script>
56
<!-- page specific js -->
<script src="assets/pages/jquery.blog-add.init.js"></script>
<script>
jQuery(document).ready(function(){
$('.summernote').summernote({
height: 240, // set editor height
minHeight: null, // set minimum height of editor
maxHeight: null, // set maximum height of editor
focus: false // set focus to editable area after initializing summernote
});
// Select2
$(".select2").select2();
$(".select2-limiting").select2({
maximumSelectionLength: 2
});
});
</script>
<script src="../plugins/switchery/switchery.min.js"></script>
<!--Summernote js-->
<script src="../plugins/summernote/summernote.min.js"></script>
</body>
</html>
<?php } ?>
ADD POST:
<?php
57
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
?>
<!DOCTYPE html>
<html lang="en">
<head>
58
<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">
<script src="assets/js/modernizr.min.js"></script>
<script>
function checkAvailability() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'username='+$("#sadminusername").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
</head>
<body class="fixed-left">
59
<!-- ========== Left Sidebar Start ========== -->
<?php include('includes/leftsidebar.php');?>
<!-- Left Sidebar End -->
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title-box">
<h4 class="page-title">Add Subadmin</h4>
<ol class="breadcrumb p-0 m-0">
<li>
<a href="#">Admin</a>
</li>
<li>
<a href="#">Subadmin </a>
</li>
<li class="active">
Add Subadmin
</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="card-box">
60
<h4 class="m-t-0 header-title"><b>Add Subadmin </b></h4>
<hr />
<div class="row">
<div class="col-md-6">
<form class="form-horizontal" name="addsuadmin" method="post">
<div class="form-group">
<label for="exampleInputusername">Username (used for login)</label>
<input type="text" placeholder="Enter Sub-Admin Username" name="sadminusername"
id="sadminusername" class="form-control" pattern="^[a-zA-Z][a-zA-Z0-9-_.]{5,12}$"
title="Username must be alphanumeric 6 to 12 chars" onBlur="checkAvailability()"
required>
<span id="user-availability-status" style="font-size:14px;"></span>
</div>
<div class="form-group">
<label for="emailid">Email Id</label>
<input type="email" class="form-control" id="emailid" name="emailid" placeholder="Enter
email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="Enter
password" required>
</div>
61
<div class="form-group">
<label class="col-md-2 control-label"> </label>
<div class="col-md-10">
<button type="submit" class="btn btn-custom waves-effect waves-light btn-md" id="submit"
name="submit">
Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- end row -->
<?php include('includes/footer.php');?>
</div>
</div>
<script>
var resizefunc = [];
</script>
62
<script src="assets/js/waves.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="../plugins/switchery/switchery.min.js"></script>
</body>
</html>
<?php } ?>
MANAGE CATEGORY:
<?php
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
63
} else {
echo "<script>alert('Something went wrong. Please try again.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
64
});
}
</script>
</head>
<body class="fixed-left">
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title-box">
<h4 class="page-title">Add Subadmin</h4>
<ol class="breadcrumb p-0 m-0">
<li>
<a href="#">Admin</a>
</li>
<li>
<a href="#">Subadmin </a>
65
</li>
<li class="active">
Add Subadmin
</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="m-t-0 header-title"><b>Add Subadmin </b></h4>
<hr />
<div class="row">
<div class="col-md-6">
<form class="form-horizontal" name="addsuadmin" method="post">
<div class="form-group">
<label for="exampleInputusername">Username (used for login)</label>
<input type="text" placeholder="Enter Sub-Admin Username" name="sadminusername"
id="sadminusername" class="form-control" pattern="^[a-zA-Z][a-zA-Z0-9-_.]{5,12}$"
title="Username must be alphanumeric 6 to 12 chars" onBlur="checkAvailability()"
required>
<span id="user-availability-status" style="font-size:14px;"></span>
</div>
<div class="form-group">
<label for="emailid">Email Id</label>
<input type="email" class="form-control" id="emailid" name="emailid" placeholder="Enter
email" required>
</div>
<div class="form-group">
66
<label for="password">Password</label>
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="Enter
password" required>
</div>
<div class="form-group">
<label class="col-md-2 control-label"> </label>
<div class="col-md-10">
<button type="submit" class="btn btn-custom waves-effect waves-light btn-md" id="submit"
name="submit">
Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
</div> <!-- container -->
<?php include('includes/footer.php');?>
</div>
</div>
<script>
var resizefunc = [];
</script>
67
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="../plugins/switchery/switchery.min.js"></script>
</body>
</html>
<?php } ?>
68
if($query){
echo "<script>alert('Sub-admin details added successfully.');</script>";
echo "<script type='text/javascript'> document.location = 'add-subadmins; </script>";
} else {
echo "<script>alert('Something went wrong. Please try again.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
69
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
</head>
<body class="fixed-left">
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title-box">
<h4 class="page-title">Add Subadmin</h4>
<ol class="breadcrumb p-0 m-0">
<li>
<a href="#">Admin</a>
70
</li>
<li>
<a href="#">Subadmin </a>
</li>
<li class="active">
Add Subadmin
</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="m-t-0 header-title"><b>Add Subadmin </b></h4>
<hr />
<div class="row">
<div class="col-md-6">
<form class="form-horizontal" name="addsuadmin" method="post">
<div class="form-group">
<label for="exampleInputusername">Username (used for login)</label>
<input type="text" placeholder="Enter Sub-Admin Username" name="sadminusername"
id="sadminusername" class="form-control" pattern="^[a-zA-Z][a-zA-Z0-9-_.]{5,12}$"
title="Username must be alphanumeric 6 to 12 chars" onBlur="checkAvailability()"
required>
<span id="user-availability-status" style="font-size:14px;"></span>
</div>
<div class="form-group">
<label for="emailid">Email Id</label>
<input type="email" class="form-control" id="emailid" name="emailid" placeholder="Enter
email" required>
</div>
<div class="form-group">
71
<label for="password">Password</label>
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="Enter
password" required>
</div>
<div class="form-group">
<label class="col-md-2 control-label"> </label>
<div class="col-md-10">
<button type="submit" class="btn btn-custom waves-effect waves-light btn-md" id="submit"
name="submit">
Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
</div> <!-- container -->
</div> <!-- content -->
<?php include('includes/footer.php');?>
</div>
</div>
<script>
var resizefunc = [];
</script>
72
<script src="assets/js/waves.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="../plugins/switchery/switchery.min.js"></script>
</body>
</html>
<?php } ?>
if($_GET['action']='del')
{
$postid=intval($_GET['pid']);
$query=mysqli_query($con,"update tblposts set Is_Active=0 where id='$postid'");
if($query)
{
$msg="Post deleted ";
}
else{
$error="Something went wrong . Please try again.";
}
}
73
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A fully featured admin theme which can be used to build
CRM, CMS, etc.">
<meta name="author" content="Coderthemes">
<!-- HTML5 Shiv and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
74
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script src="assets/js/modernizr.min.js"></script>
</head>
<body class="fixed-left">
75
</li>
<li class="active">
Manage Post
</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<div class="table-responsive">
<table class="table table-colored table-centered table-inverse m-0">
<thead>
<tr>
<th>Title</th>
<th>Category</th>
<th>Subcategory</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$query=mysqli_query($con,"select tblposts.id as postid,tblposts.PostTitle as
title,tblcategory.CategoryName as category,tblsubcategory.Subcategory as subcategory from
76
tblposts left join tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on
tblsubcategory.SubCategoryId=tblposts.SubCategoryId where tblposts.Is_Active=1 ");
$rowcount=mysqli_num_rows($query);
if($rowcount==0)
{
?>
<tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
77
</div> <!-- container -->
<!--Morris Chart-->
<script src="../plugins/morris/morris.min.js"></script>
<script src="../plugins/raphael/raphael-min.js"></script>
78
<!-- Load page level scripts-->
<script src="../plugins/jvectormap/jquery-jvectormap-2.0.2.min.js"></script>
<script src="../plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="../plugins/jvectormap/gdp-data.js"></script>
<script src="../plugins/jvectormap/jquery-jvectormap-us-aea-en.js"></script>
</body>
</html>
<?php } ?>
79
echo "<script type='text/javascript'> document.location = 'manage-subadmins.php';
</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body class="fixed-left">
80
<!-- ============================================================== --
>
<!-- Start right Content here -->
<!-- ============================================================== --
>
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title-box">
<h4 class="page-title">Manage Sub-admins</h4>
<ol class="breadcrumb p-0 m-0">
<li>
<a href="#">Sub-admins </a>
</li>
<li class="active">
Manage Sub-admins
</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- end row -->
81
<div class="row">
<div class="col-md-12">
<div class="demo-box m-t-20">
<div class="m-b-30">
<a href="aadd-subadmins.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="table-responsive">
<table class="table m-0 table-colored-bordered table-bordered-primary">
<thead>
<tr>
<th>#</th>
<th> Username</th>
<th>Email</th>
<th>Posting Date</th>
<th>Last updation Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$query=mysqli_query($con,"Select * from tbladmin where userType=0");
$cnt=1;
while($row=mysqli_fetch_array($query))
{
?>
82
<tr>
<th scope="row"><?php echo htmlentities($cnt);?></th>
<td><?php echo htmlentities($row['AdminUserName']);?></td>
<td><?php echo htmlentities($row['AdminEmailId']);?></td>
<td><?php echo htmlentities($row['CreationDate']);?></td>
<td><?php echo htmlentities($row['UpdationDate']);?></td>
<td><a href="edit-subadmin.php?said=<?php echo htmlentities($row['id']);?>"><i class="fa
fa-pencil" style="color: #29b6f6;"></i></a>
<a href="manage-subadmins.php?rid=<?php echo
htmlentities($row['id']);?>&&action=del"> <i class="fa fa-trash-o" style="color:
#f05050"></i></a> </td>
</tr>
<?php
$cnt++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!--- end row -->
83
</div> <!-- container -->
</div>
<!-- END wrapper -->
<script>
var resizefunc = [];
</script>
</body>
</html>
<?php } ?>
<!-------------------------------------------LOGOUT--------------------------------------------------- >
<?php
84
session_start();
include("includes/config.php");
$_SESSION['login']=="";
session_unset();
session_destroy();
?>
<script language="javascript">
document.location="index.php";
</script>
SYSTEMS IMPLEMENTATION
(SCREENSHOT)
INDEX
85
ABOUT:
ADMIN:
86
ALL CATEGORIES
MANAGE CATEGORIES:
SUB-ADMINS:
87
MANAGE POST:
CONTACT US PAGE:
88
6 FUTURE SCOPE
6.1 Future Scope of the Proiect:
In a nutshell, it can be summarized that the future scope of the project circles around
maintaining information regarding:
We can add printer in future.
We can give more advance software for Online News Portal including more
Facilities.
Implement the backup mechanism for taking backup of codebase and database on regular
basis on different servers
The above mentioned points are the enhancements which can be done to increase the
applicability and usage of this project. Here we can maintain the records of News and
Category. Also, as it can be seen that now-a-days the players are versatile, i.e. so there is a
scope for introducing a method to maintain the Online News Portal. Enhancements can be
done to maintain all the News, Category, Latest News, Weather
News, Bollywood News.
The above mentioned points are the enhancements which can be done to increase the
applicability and usage of this project. Here we can maintain the records of News and
Category. Also, as it can be seen that now-a-days the players are versatile, i.e. so there is a
scope for introducing a method to maintain the Online News Portal. Enhancements can be
done to maintain all the News, Category, Latest News, Weather News, Bollywood News.
We have left all the options open so that if there is any other future requirement in
the system by the user for the enhancement of the system then it is possible to implement
them.ln the last we would like to thanks all the persons involved in the development of the
system directly or indirectly. We hope that the project will serve its purpose for which it is
develop there by underlining success of process.
89
BIBLIOGRAPHY
References
● W3School JavaScript Tutorials, References and Examples @ http://www.w3schools.com.
● http://www.w3schools.com/html/defualt.asp,
● http://www.w3schools.com/css/default.asp,
● http://www.w3schools.com/js/default.asp
● PHP mother site @ http://php.net/.
● PHP Manual @ http://php.net/manual/en/.
● PHP Language Reference @ http://php.net/manual/en/langref.php.
● W3School HTML/CSS Tutorials, References and Examples @ http://www.w3schools.com/.
(W3School is not related to W3C).
90
91