Site icon T4Tutorials.com

Source Code Download – Business Website Directory  Project [LEED]

Source Code Download – Business Website Directory  Project [LEED]

authorizeuser.php

<?php
$eid="";
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
if(isset($_SESSION["eid"])){
    $eid=$_SESSION["eid"];
}else{
    header('Location:index.php');
}

connect.php

<?php
error_reporting(1);
$conn = new mysqli("localhost","root","","businessdirectory");
?>

deleteBusiness.php

<?php
include 'authorizeuser.php';
if(isset($_GET['id'])){
    include 'connect.php';
    $id = $_GET['id'];
    $sql = "DELETE FROM business WHERE id=$id";
    if ($conn->query($sql) === TRUE) {  
           header('location: employerAccount.php');      
    }else{
        echo "error deleting business";
    }
}
?>

updatedbusiness.php

<?php
include 'authorizeuser.php';
$id=0;
$title=$email=$address=$city=$category=$description=$phone="";
include 'connect.php'; 
     if(!isset($_POST['title']) || !isset($_POST['email']) || !isset($_POST['address']) || !isset($_POST['city'])  || !isset($_POST['category'] )|| !isset($_POST['description'] )  || !isset($_POST['phone'])){    
    }

if(isset($_POST['registerButton'])){
  if($_POST['title']=="")
    {
      $msg= "Please Add title";
    }
    else if($_POST['email']=="")
    {
      $msg= "Please Enter email";
    }
    else if($_POST['address']=="")
    {
      $msg= "Please Enter address";
    }
    else if($_POST['description']=="")
    {
      $msg= "Please Enter description";
    }
    else if($_POST['phone']=="")
    {
      $msg= "Please Enter Phone No";
    }
    else
    {
      $id=$_POST['id'];
            $title= $_POST['title'];
            $email= $_POST['email'];
            $address=$_POST['address'];
            $city=$_POST['city'];
            $category=$_POST['category'];
            $description=$_POST['description'];
            $phone=$_POST['phone'];

  $sql = "UPDATE `business` set title='$title',email='$email',category='$category',city='$city',address='$address',description='$description' eid='$id' WHERE id='$id'";


            $result=mysqli_query($conn,$sql);
            if(!$result)
            {

            }
            else
            {
              header('location: employerAccount.php');
            }
    }
  
    }
   
?>

uploadbusiness.php

<?php
include 'authorizeuser.php';
$id=0;
$title=$email=$address=$city=$category=$description=$phone="";
include 'connect.php';
  
     if(!isset($_POST['title']) || !isset($_POST['email']) || !isset($_POST['address']) || !isset($_POST['city'])  || !isset($_POST['category'] )|| !isset($_POST['description'] )  || !isset($_POST['phone'])){
     
    }

if(isset($_POST['registerButton'])){
  if($_POST['title']=="")
    {
      $msg= "Please Add title";
    }
    else if($_POST['email']=="")
    {
      $msg= "Please Enter email";
    }
    else if($_POST['address']=="")
    {
      $msg= "Please Enter address";
    }
    else if($_POST['description']=="")
    {
      $msg= "Please Enter description";
    }
    else if($_POST['phone']=="")
    {
      $msg= "Please Enter Phone No";
    }
    else
    {
      $id=$_POST['id'];
            $title= $_POST['title'];
            $email= $_POST['email'];
            $address=$_POST['address'];
            $city=$_POST['city'];
            $category=$_POST['category'];
            $description=$_POST['description'];
            $phone=$_POST['phone'];

  $sql = "INSERT INTO `business` (`id`,`title`, `email`,`eid`,`city` ,`category`,`address`, `description`, `phone`) "
            . "VALUES ( NULL,'$title', '$email', '$eid','$city','$category','$address', '$description', '$phone');";

            $result=mysqli_query($conn,$sql);
            if(!$result)
            {

            }
            else
            {
              header('location: employerAccount.php');
            }
    }
  
    }    
?>

Download Full Code

Source Code Download – Business Website Directory  Project [LEED]

USE CASE Descriptions of Business Website Directory  Project

Let’s see the USE CASE Descriptions of Business Website Directory  Project. Click Here.

Test Cases of Business Website Directory Project

Let’s see the test cases of the project of the Business Directory Website. click here.

 

Exit mobile version