Download Content Management System PHP source code

Download Content Management System PHP source code

I create this Content Management System as my Final year Project.
Content management system is a web based application which help individual, company,web designer and administrators to create and manage website easily. This project aim to simplify web development by giving people a tools to simplify creation of beautiful website or blog and management of that website. Some features of the software will be:
  • Creating a website or blog.
  • Change theme of that website.
  • Managing that website.
First on thing tou need to do is to install this system in your Web server Directory if you are using WAMP SERVER just copy system files and paste in www folder.

After that open your web-browser such as Google Chrome or Mozilla Firefox then in URL bar write localhost Or 127.0.0.1

When you open that link the following display will appear
Installation Picha namba moja


You need to follow the instruction in order to install this system succesifull
  1. Go to your Database and create a database.
  2. Go in config file available in controller Folder and edit it by providing your database name, hostname and the password
  3. Fill the form by providing
    • Site Type
    • Site Name
    • Admin Email
    • Admin Username
    • Admin Password
    • Re-enter Admin Password
  4. Note: The following button used to change language just click it to change language

    Language changer

    After filling all the input required then click Create

    Tables will be created in the database you specified then login to your account by using Admin Username and Password

    Login Page

    After that click Login then if the provided username and password is correct to the one in the database then you will be logged in else if the provided username and password is incorrect to the one in the database then you will need to repeate logging in.

    This is the page that you will see when logging in

    Login Page


Pages

Pages is the part our system where we can put a description of a particular issue.

How to create Page

You can create a page by clicking the Page link in the Navigation bar the click on create new page
The follwing interface will appear
Create new Page

After that Fill the inputs by providing your page name , Page contents and the status of the page if it is Published or saved :: The saved page will not be displayed on the menu until they are Published
You can view all Pages you created by click All Pages link above... and the following interface will appear
All pages

You can view ,edit and Delete Pages as you want.


Categories

In our system we use Category to categorize our Posts.You can create a Category by clicking the Category link in the Navigation bar the click on create new Category
The follwing interface will appear
Create new Category

After that Fill the input by providing your Category name .
You can view all Categories you created by click All Categories link above... and the following interface will appear
All Categories

You can view ,edit and Delete Categories as you want.


Menu

To create menu in our system is Simple as creating pages and categories You can create menu by clicking Menu on the navigation menu of your admin panel and click Create new menu Create new Menu

There you can enter menu name and position of your menu.

:: Position of menu depends on the theme.

You can add menu pages and categories by click all menus and edit a menu yo want to add pages and categories
The following page will open then you can click add to add that page or category.

Add pages and categories to menu



Themes

You can add new theme of your website by uploading it.
Click in themes then add new theme there you can upload that theme and the theme must be in Zip format.

How to Create your own theme?

It is simple but you need to know Html, Css and Php
Because we are sing Object Orinted Programming so you need to have a basics knowledge of that.

Only you need to do is to create an html interface with css stylesheet and Calling php methods that can be used to call specific function.

The following are methods we are using:
In Categories Fist include models/categories.php
  1. $profile->posts -------------- View specific category Posts

In Header Fist include models/header.php
  1. $header->head -------------- Show site title
  2. $header->topmenu -------------- Show Top menu
  3. $header->navmenu -------------- Show Navigation Menu
  4. $header->bottommenu -------------- Show Bottom menu

In Pages Fist include models/pages.php
  1. $profile->pageyenyewe -------------- View Page on the menu


Media

To add media in this sytem just go to the navigation menu and click Media there you can see all the photos you add.

To add new photo just click Add new Media and the following page will open
Add new Media

Then browse your photo and click add.


Posts

To add Post in your website click Posts in the navigation menu then click Create new Post
Create new Post

There you can add post title,post contents and choose category where your post will be displayed.

You can edit your Posts contents by using small buttons above. Also you can add photo by clicking on the photo button and provide photo URL adding from the Media Gallery.


Users

In Users page you can add, edit and delete users of the system and also you can provide authority for users this authority will be either Admin or Author

To add new user click in Users then Add new User
Add new User

And to view all users just click in All user link above.
All Users 
 

Download Code Here: http://www.mediafire.com/download/xblar4f60xjzlha/our_project.zip 

Download Sales Management System PHP Source code

I develop this Sales Management system to use in my sister shop for managing sales and product on the shop,
This system have two users which are:
  1. Admin
  2. Saler

 Saler Functions

The following are functions of saler on the system:
  1. Add Sales
  2. Edit Sales
  3. View Products
  4. Change your Account Password
Sales Management System

  • Admin Functions 

    The following are functions of admini on the system:

    1. View Sales Statistics
    2. Generate Daily, Monthly and year report.
    3. Add, edit and delete system Users
    4.  Add Product, Product Price,and Quantity

    To login Enter the following details:

    Admin Panel:
    Username: Admin
    Password: admin 

    Saler Panel:
    Username: Saler
    Password: saler


    Sales Management System


    I really love comment

Download Music Sharing System PHP Source code



Hello welcome again to my blog, today i`m happy to share my first project that I develop by using codeigniter (MVC based php framework) as a backend framework and Bootstrap as the frontend framework.

This project is Online Music sharing website which allow the owner of the site to share songs/music and any audio.










This system has the following features for client
  1.  View songs
  2.  View artists
  3.  View genres
  4.  Search artist
  5.  View artist bio and songs
  6.  Download unlimited songs
  7.  Share song to other website
  8.   View popular downloaded songs 


This system has the following features for Administrator
  1. Add and delete songs
  2.  Add , edit and delete Artists
  3.  Add artist bio
  4.  Add and Update Genre
  5. View statistics
  6.  Change website name 
  7.  Add advertisement on the web (Adsense)
  8.  Add and delete users
  9.  View Top Ten Downloaded Songs

To login to admin panel use the following:
 
Link:               /admin


Username: Florian


Password:   thefleva





For any problem just write the comment I will be happy to answer you.

Download Hospital Management System PHP Source code


The assignment is to design and develop hospital management system. Below is the description of how the system works:

  1.  Patient attends the hospital and meets the Receptionist at the front counter.
  2.  The Receptionist asks about the patient’s details e.g. Name, what doctor they want to see etc. and assigns the patient to the relevant doctor as he/she sends the patient’s information to that doctor.
  3.  When the patient visits the doctor, the doctor asks about what he/she is suffering from. The doctor may assign the patient to the lab to undergo various tests / scans or he may prescribe medicine and assign the patient to the pharmacist.
  4.  The laboratory department will receive the patient’s information from the doctor and perform certain scans / tests as indicated by the doctor and will send the results back to the doctor.
  5.  The doctor will prescribe the medicine and send the prescription to the pharmacist.
  6.  The Pharmacist shall give the patient medicine and then will calculate the total cost of the medicine and send the report to the bursar.
  7.   The Bursar shall demand payment for the purchased medicine.

§ 


Note: The users can update/change their information e.g username / password once they log into the system.
https://app.box.com/s/p6x4gw2e659ul1fxx0kcgtwtd0pyzqej



USER INTERFACE


The requirement of this assignment is to create a user interface which cooperates with the database to access the Hospital Management System.

For user interface, we have used MySQL, PHP, and HTML

Logging in:


This is an interface for Administrator to Log in to the system. The administrator is responsible to for creating other users of the hospital from different departments including doctors, receptionist, pharmacist, laboratorist, bursar.

The following php code was used for log in:

<?php
$con = mysql_connect('localhost', 'root','');
if (empty($con)) {
    echo mysql_error();
 }
 $data = mysql_select_db("Hospital");
 if (empty($data)) {
    echo mysql_error();
 }
?>

The above code performs the following functions, whereby the user enters the username and password and upon clicking the login button it takes the user to the index page provided the credentials are correct.
Hospital Login Page
Login Page


ADMINISTRATOR FUNCTIONS

Staff account management:

The administrator is responsible for adding users, adding rooms and updating. The users refered here are Receptionist, Doctors, Pharmacists, lab etc. Below is the Php script to add users to the database whereby I have used the function to describe the parameters to add the users.

Script to Add user to the system.


function adduser()
{
    $username = trim(htmlspecialchars($_POST['username']));
    $fname = trim(htmlspecialchars($_POST['fname']));
    $sname = trim(htmlspecialchars($_POST['sname']));
    $type = trim(htmlspecialchars($_POST['type']));
    $password = trim(htmlspecialchars($_POST['password']));
    $pass = sha1($password);

    $sql1 = "SELECT * FROM `users` WHERE `username`='$username'";
    $query1 = mysql_query($sql1);
    if (mysql_num_rows($query1)==0) {
        $sql = "INSERT INTO `users` VALUES ('$username','$pass','$fname','$sname','$type')";
        $query = mysql_query($sql);
        if (!empty($query)) {
            echo "<br><b style='color:#008080;font-size:14px;font-family:Arial;'>User is Succesifully Added</b>";
        }
    }
    else{
        echo "<br><b style='color:#008080;font-size:14px;font-family:Arial;'>Choose Unique Name</b>";
    }
Add Users
Add Users



The total number of users is displayed on the Admin dashboard

Statistics
Home Page - Statistics


The next step which is most important is because the system comes into function now:


RECEPTIONIST FUNCTIONS


The receptionist logs into the system from the username and password created by the Admin:
Below is the receptionist dashboard and the functions that he / she can perform:
Receptionist Page
Receptionist Homepage

Below is the form the receptionist uses to add patient’s details and underneath the php code:
Add Patient
Add Patient Page
 function addpatient()
{
    $fname = trim(htmlspecialchars($_POST['fname']));
    $sname = trim(htmlspecialchars($_POST['sname']));
    $email = trim(htmlspecialchars($_POST['email']));
    $phone = trim(htmlspecialchars($_POST['phone']));
    $address = trim(htmlspecialchars($_POST['address']));
    $gender = trim(htmlspecialchars($_POST['gender']));
    $birthyear = trim(htmlspecialchars($_POST['birthyear']));
    $bloodgroup = trim(htmlspecialchars($_POST['bloodgroup']));

    require_once "connect.php";

    $sql = "INSERT INTO `patient` VALUES ('','$fname','$sname','$email','$address','$phone','$gender','$bloodgroup','$birthyear')";
    $query = mysql_query($sql);
    if (!empty($query)) {
        echo "<br><b style='color:#008080;font-size:14px;font-family:Arial;'>Patient is Succesifully Added</b><br><br>";
    }
    else{
        echo mysql_error();
    }}

The receptionist can update his / her information after logging in for the first time:
Update Receptionist
Update Receptionist


DOCTOR FUNCTIONS


The patient has now been assigned to the doctor and the doctor has received the patient details.


Below is the php script which takes input from the form that the doctor uses to add symptoms from the patient and and then sends the result to the lab for the patient to undergo scans and tests:
function addsymptoms()
{
    $symptoms = trim(htmlspecialchars($_POST['symptoms']));
    $test = trim(htmlspecialchars($_POST['test']));
    if (!empty($symptoms)) {
        $id = $_GET['id'];
        @require_once "connect.php";

        $sql = "UPDATE `medication` SET `status`='laboratory',`symptoms`='$symptoms',`tests`='$test' WHERE `id`='$id'";
        $query = mysql_query($sql);
        if (!empty($query)) {
            echo "<br><b style='color:#008080;font-size:14px;font-family:Arial;'>Succesifully Sent</b>";
        }
    }
}

 

PHP Login System with PDO Connection.

Today, we are providing you an easy registration and login process using PDO connection with better password encryption, which has an advantage of working on different database systems. PDO is a PHP extension that allow us to implement code which is portable across many databases and platforms.

Users Table
User table contains all the users registration details.


CREATE TABLE `users` (
`uid` int NOT NULL PRIMARY KEY AUTO_INCREMENT ,
`username` varchar(25) NOT NULL UNIQUE,
`password` varchar(50) NOT NULL ,
`email` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`profile_pic` varchar(200) NOT NULL,
); 

Enable PDO extension for PHP, find this in php.ini configuration file. 

config.php
Database connection configuration file, here you have to modify username, password and database details. If you are using other database modify PDO() driver connection value. 
exec("set names utf8");
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $dbConnection;
}
catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}

}
?>


PostgreSQL PDO connection
Enable PDO_PGSQL extension and usepgsql:host=$dbhost;port=5432;dbname=$dbname;$dbuser, $dbpass


HTML Login Form
Contains simple HTML code. 
 <div id="login">
<h3>Login</h3>
<form method="post" action="" name="login">
<label>Username or Email</label>
<input type="text" name="usernameEmail" autocomplete="off" />
<label>Password</label>
<input type="password" name="password" autocomplete="off"/>
<div class="errorMsg"><?php echo $errorMsgLogin; ?></div>
<input type="submit" class="button" name="loginSubmit" value="Login">
</form>
</div>

 HTML Signup Code
User registration page. 
<div id="signup">
<h3>Registration</h3>
<form method="post" action="" name="signup">
<label>Name</label>
<input type="text" name="nameReg" autocomplete="off" />
<label>Email</label>
<input type="text" name="emailReg" autocomplete="off" />
<label>Username</label>
<input type="text" name="usernameReg" autocomplete="off" />
<label>Password</label>
<input type="password" name="passwordReg" autocomplete="off"/>
<div class="errorMsg"><?php echo $errorMsgReg; ?></div>
<input type="submit" class="button" name="signupSubmit" value="Signup">
</form> </div>

   
CSS Code
#login,#signup{
width: 300px; border: 1px solid #d6d7da; 
padding: 0px 15px 15px 15px; 
border-radius: 5px;font-family: arial; 
line-height: 16px;color: #333333; font-size: 14px; 
background: #ffffff;rgba(200,200,200,0.7) 0 4px 10px -1px
}
#login{float:left;}
#signup{float:right;}
h3{color:#365D98}
form label{font-weight: bold;}
form label, form input{display: block;margin-bottom: 5px;width: 90%}
form input{ 
border: solid 1px #666666;padding: 10px;
border: solid 1px #BDC7D8; margin-bottom: 20px
}
.button {
background-color: #5fcf80 ;
border-color: #3ac162;
font-weight: bold;
padding: 12px 15px;
max-width: 100px;
color: #ffffff;
}
.errorMsg{color: #cc0000;margin-bottom: 10px}

userClass.php
This class contains there methods userLogin, userRegistion and userDetails.
<?php
class userClass
{
/* User Login */
public function userLogin($usernameEmail,$password)
{
try{
$db = getDB();
$hash_password= hash('sha256', $password); //Password encryption 
$stmt = $db->prepare("SELECT uid FROM users WHERE (username=:usernameEmail or email=:usernameEmail) AND password=:hash_password"); 
$stmt->bindParam("usernameEmail", $usernameEmail,PDO::PARAM_STR) ;
$stmt->bindParam("hash_password", $hash_password,PDO::PARAM_STR) ;
$stmt->execute();
$count=$stmt->rowCount();
$data=$stmt->fetch(PDO::FETCH_OBJ);
$db = null;
if($count)
{
$_SESSION['uid']=$data->uid; // Storing user session value
return true;
}
else
{
return false;
} 
}
catch(PDOException $e) {
echo '{"error":{"text":'. $e->getMessage() .'}}';
}

}

/* User Registration */
public function userRegistration($username,$password,$email,$name)
{
try{
$db = getDB();
$st = $db->prepare("SELECT uid FROM users WHERE username=:username OR email=:email"); 
$st->bindParam("username", $username,PDO::PARAM_STR);
$st->bindParam("email", $email,PDO::PARAM_STR);
$st->execute();
$count=$st->rowCount();
if($count<1 stmt="$db-">prepare("INSERT INTO users(username,password,email,name) VALUES (:username,:hash_password,:email,:name)"); 
$stmt->bindParam("username", $username,PDO::PARAM_STR) ;
$hash_password= hash('sha256', $password); //Password encryption
$stmt->bindParam("hash_password", $hash_password,PDO::PARAM_STR) ;
$stmt->bindParam("email", $email,PDO::PARAM_STR) ;
$stmt->bindParam("name", $name,PDO::PARAM_STR) ;
$stmt->execute();
$uid=$db->lastInsertId(); // Last inserted row id
$db = null;
$_SESSION['uid']=$uid;
return true;
}
else
{
$db = null;
return false;
}

} 
catch(PDOException $e) {
echo '{"error":{"text":'. $e->getMessage() .'}}'; 
}
}

/* User Details */
public function userDetails($uid)
{
try{
$db = getDB();
$stmt = $db->prepare("SELECT email,username,name FROM users WHERE uid=:uid"); 
$stmt->bindParam("uid", $uid,PDO::PARAM_INT);
$stmt->execute();
$data = $stmt->fetch(PDO::FETCH_OBJ); //User data
return $data;
}
catch(PDOException $e) {
echo '{"error":{"text":'. $e->getMessage() .'}}';
}
}
}
?>

index.php
Contains PHP and HTML code, works base on user form submit.
<?php
include("config.php");
include('class/userClass.php');
$userClass = new userClass();

$errorMsgReg='';
$errorMsgLogin='';
/* Login Form */
if (!empty($_POST['loginSubmit'])) 
{
$usernameEmail=$_POST['usernameEmail'];
$password=$_POST['password'];
if(strlen(trim($usernameEmail))>1 && strlen(trim($password))>1 )
{
$uid=$userClass->userLogin($usernameEmail,$password);
if($uid)
{
$url=BASE_URL.'home.php';
header("Location: $url"); // Page redirecting to home.php 
}
else
{
$errorMsgLogin="Please check login details.";
}
}
}

/* Signup Form */
if (!empty($_POST['signupSubmit'])) 
{
$username=$_POST['usernameReg'];
$email=$_POST['emailReg'];
$password=$_POST['passwordReg'];
$name=$_POST['nameReg'];
/* Regular expression check */
$username_check = preg_match('~^[A-Za-z0-9_]{3,20}$~i', $username);
$email_check = preg_match('~^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$~i', $email);
$password_check = preg_match('~^[A-Za-z0-9!@#$%^&*()_]{6,20}$~i', $password);

if($username_check && $email_check && $password_check && strlen(trim($name))>0) 
{
$uid=$userClass->userRegistration($username,$password,$email,$name);
if($uid)
{
$url=BASE_URL.'home.php';
header("Location: $url"); // Page redirecting to home.php 
}
else
{
$errorMsgReg="Username or Email already exists.";
}
}
}
?>
//HTML Code
....Login Form HTML Code....

....Signup Form HTML Code...

Note: You have to include JavaScript validations for better user experience. 

session.php
This will validate and store user session value.
<?php
if(!empty($_SESSION['uid']))
{
$session_uid=$_SESSION['uid'];
include('class/userClass.php');
$userClass = new userClass();
}
if(empty($session_uid))
{
$url=BASE_URL.'index.php';
header("Location: $url");
}
?>
 
 
 
home.php
User welcome page, display user details base on user session value.
<?php
include('config.php');
include('session.php');
$userDetails=$userClass->userDetails($session_uid);
?>
<h1>Welcome <?php echo $userDetails->name; ?></h1>

<h4><a href="<?php echo BASE_URL; ?>logout.php">Logout</a></h4>

logout.php
This code will clear user session values. 
<?php
include('config.php');
$session_uid='';
$_SESSION['uid']=''; 
if(empty($session_uid) && empty($_SESSION['uid']))
{
$url=BASE_URL.'index.php';
header("Location: $url");
//echo "<script>window.location='$url'</script>";
}
?>

Featured Post

Download Music Sharing System PHP Source code

Hello welcome again to my blog, today i`m happy to share my first project that I develop by using codeigniter (MVC based php framework)...

Popular Posts