require_once 'Business.php';
require_once 'Connection.php';
require_once 'BusinessTableGateway.php';
require_once 'DealTableGateway.php';
$id = session_id();
if ($id == "") {
    session_start();
}
require 'ensureUserLoggedIn.php';
if (!isset($_GET) || !isset($_GET['id'])) {
    die('Invalid request');
}
$businessID = $_GET['id'];
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
$dealGateway = new DealTableGateway($connection);
$deals = $dealGateway->getDeals();
$statement = $gateway->getBusinessById($businessID);
if ($statement->rowCount() !== 1) {
    die("Illegal request");
}
$row = $statement->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
        <meta charset="UTF-8">
        <script type="text/javascript" src="Javascript/business.js"></script>
        <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA3kPZdtcJcP3EuDFpPNU3iIfAh0q-X6Gc&libraries=places"></script>
<?php 
require_once 'Connection.php';
require_once 'DealTableGateway.php';
require_once 'BusinessTableGateway.php';
require_once 'UserTableGateway.php';
$id = session_id();
if ($id == "") {
    session_start();
}
require 'ensureUserLoggedIn.php';
$username = $_SESSION['user_id'];
require 'ensureUserLoggedIn.php';
$conn = Connection::getInstance();
$dealGateway = new DealTableGateway($conn);
$userGateway = new UserTableGateway($conn);
$businessGateway = new BusinessTableGateway($conn);
$deals = $dealGateway->getDeals();
$users = $userGateway->getUserByUserName($username);
$businesses = $businessGateway->getBusinesses();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
        <meta charset="UTF-8">
        <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA3kPZdtcJcP3EuDFpPNU3iIfAh0q-X6Gc&libraries=places"></script>
        <title>Yoink!</title>
        <meta charset="utf-8">  
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Bootstrap -->
        <link href="CSS/bootstrap.min.css" rel="stylesheet">
<?php

require_once 'Business.php';
require_once 'Connection.php';
require_once 'BusinessTableGateway.php';
$id = session_id();
if ($id == "") {
    session_start();
}
require 'ensureUserLoggedIn.php';
if (!isset($_GET) || !isset($_GET['id'])) {
    die('Invalid request');
}
$id = $_GET['id'];
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
//gateway calls deleteBusiness method from BusinessTableGateway
$gateway->deleteBusiness($id);
header("Location: home.php");
<?php

require_once 'Connection.php';
require_once 'BusinessTableGateway.php';
require 'ensureUserLoggedIn.php';
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
$statement = $gateway->getBusinesses();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <script type="text/javascript" src="js/business.js"></script>
        <?php 
require "styles.php";
?>
        <title></title>
    </head>
    <body>
        <?php 
require 'toolbar.php';
?>
        <?php 
require 'header.php';
?>
        <?php 
require 'mainMenu.php';
?>
        <div class="container">
            <h2>View Businesses</h2>
Beispiel #5
0
require_once 'Connection.php';
require_once 'UserTableGateway.php';
require_once 'BusinessTableGateway.php';
require_once 'DealTableGateway.php';
$connection = Connection::getInstance();
if (isset($_GET) && isset($_GET['sortOrder'])) {
    $sortOrder = $_GET['sortOrder'];
    $columnNames = array("businessID", "business_name", "business_address", "business_lat", "business_long", "business_type");
    if (!in_array($sortOrder, $columnNames)) {
        $sortOrder = 'businessID';
    }
} else {
    $sortOrder = 'businessID';
}
$gateway = new UserTableGateway($connection);
$businessGateway = new BusinessTableGateway($connection);
$dealGateway = new DealTableGateway($connection);
/* Starts new session if session doesn't already exist */
$id = session_id();
if ($id == "") {
    session_start();
}
/* Validates data entered and filters it to be applicable to the field */
$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
$password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);
/* Error message array for data entered */
/* If data is blank error message is shown */
$errorMessage = array();
if ($username === FALSE || $username === '') {
    $errorMessage['username'] = '******';
}
<?php

require_once 'Business.php';
require_once 'Connection.php';
require_once 'BusinessTableGateway.php';
require_once 'DealTableGateway.php';
$id = session_id();
if ($id == "") {
    session_start();
}
$userId = $_SESSION['user_id'];
require 'ensureUserLoggedIn.php';
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
$dealGateway = new DealTableGateway($connection);
//Validates form data, removes harmful input
$businessId = filter_input(INPUT_POST, 'businessId', FILTER_SANITIZE_NUMBER_INT);
$business_name = filter_input(INPUT_POST, 'business_name', FILTER_SANITIZE_STRING);
$business_address = filter_input(INPUT_POST, 'business_address', FILTER_SANITIZE_STRING);
$business_lat = filter_input(INPUT_POST, 'business_lat', FILTER_SANITIZE_NUMBER_FLOAT);
$business_long = filter_input(INPUT_POST, 'business_long', FILTER_SANITIZE_NUMBER_FLOAT);
$business_type = filter_input(INPUT_POST, 'business_type', FILTER_SANITIZE_STRING);
if ($userId == -1) {
    $userId = null;
}
//if statements to validate form
$errorMessage = array();
if ($business_name === FALSE || $business_name === '') {
    $errorMessage['business_name'] = 'Business Name must not be blank<br/>';
}
if ($business_address === FALSE || $business_address === '') {
require 'ensureUserLoggedIn.php';
if (isset($_GET) && isset($_GET['sortOrder'])) {
    $sortOrder = $_GET['sortOrder'];
    $columnNames = array("businessID", "business_name", "business_address", "business_lat", "business_long", "business_type");
    if (!in_array($sortOrder, $columnNames)) {
        $sortOrder = 'businessID';
    }
} else {
    $sortOrder = 'businessID';
}
if (!isset($_GET) || !isset($_GET['id'])) {
    die('Invalid request');
}
$bId = $_GET['id'];
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
$dealGateway = new DealTableGateway($connection);
$statement = $gateway->getBusinessById($bId);
$deals = $dealGateway->getDealByBusinessId($bId);
?>
<!DOCTYPE html>
<html>
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
        <meta charset="UTF-8">
        <script type="text/javascript" src="Javascript/business.js"></script>
        <title>Yoink!</title>
        <meta charset="utf-8">  
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Bootstrap -->
        <link href="CSS/bootstrap.min.css" rel="stylesheet">
    $sortOrder = $_GET['sortOrder'];
    $columnNames = array("businessID", "business_name", "business_address", "business_lat", "business_long", "business_type");
    if (!in_array($sortOrder, $columnNames)) {
        $sortOrder = 'businessID';
    }
} else {
    $sortOrder = 'businessID';
}
if (!isset($_GET) || !isset($_GET['id'])) {
    die('Invalid request');
}
$dealId = $_GET['id'];
$_SESSION['id'] = $dealId;
$connection = Connection::getInstance();
$gateway = new DealTableGateway($connection);
$businessGateway = new BusinessTableGateway($connection);
$businesses = $businessGateway->getBusinessByUserId($username, $sortOrder);
$statement = $gateway->getDealById($dealId);
if ($statement->rowCount() !== 1) {
    die("Illegal request");
}
$row = $statement->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html>
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
        <meta charset="UTF-8">
        <script type="text/javascript" src="Javascript/deal.js"></script>
        <title>Yoink</title>
        <meta charset="utf-8">  
Beispiel #9
0
if (isset($_GET) && isset($_GET['sortOrder'])) {
    $sortOrder = $_GET['sortOrder'];
    $columnNames = array("businessID", "business_name", "business_address", "business_lat", "business_long", "business_type");
    if (!in_array($sortOrder, $columnNames)) {
        $sortOrder = 'businessID';
    }
} else {
    $sortOrder = 'businessID';
}
if (isset($_GET) && isset($_GET['filterName'])) {
    $filterName = filter_input(INPUT_GET, 'filterName', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
} else {
    $filterName = NULL;
}
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
$statement = $gateway->getBusinessByUserId($username, $sortOrder);
?>
<!DOCTYPE html>
<html>
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
        <meta charset="UTF-8">
        <script type="text/javascript" src="Javascript/business.js"></script>
        <title>Yoink</title>
        <meta charset="utf-8">  
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Bootstrap -->
        <link href="CSS/bootstrap.min.css" rel="stylesheet">
        <link href="CSS/custom.css" rel="stylesheet">
        <script src="Javascript/respond.js"></script>
Beispiel #10
0
<?php

require_once 'Business.php';
require_once 'Connection.php';
require_once 'BusinessTableGateway.php';
$id = session_id();
if ($id == "") {
    session_start();
}
require 'ensureUserLoggedIn.php';
$connection = Connection::getInstance();
$gateway = new BusinessTableGateway($connection);
$businessID = filter_input(INPUT_POST, 'businessID', FILTER_SANITIZE_STRING);
$business_name = filter_input(INPUT_POST, 'business_name', FILTER_SANITIZE_STRING);
$business_address = filter_input(INPUT_POST, 'business_address', FILTER_SANITIZE_STRING);
$business_lat = filter_input(INPUT_POST, 'business_lat', FILTER_SANITIZE_STRING);
$business_long = filter_input(INPUT_POST, 'business_long', FILTER_SANITIZE_STRING);
$business_type = filter_input(INPUT_POST, 'business_type', FILTER_SANITIZE_STRING);
$gateway->updateBusiness($businessID, $business_name, $business_address, $business_lat, $business_long, $business_type);
header('Location: home.php');
require 'editBusinessForm.php';
Beispiel #11
0
require_once 'DealTableGateway.php';
require_once 'Deal.php';
require_once 'BusinessTableGateway.php';
$sessionId = session_id();
if ($sessionId == "") {
    session_start();
}
require 'ensureUserLoggedIn.php';
if (!isset($_GET) || !isset($_GET['id'])) {
    die('Invalid request');
}
$dealId = $_GET['id'];
$connection = Connection::getInstance();
$dealGateway = new DealTableGateway($connection);
$businessGateway = new BusinessTableGateway($connection);
$businessGateway2 = new BusinessTableGateway($connection);
$deals = $dealGateway->getDealById($dealId);
$businessDeal = $businessGateway2->getBusinessByDealId($dealId);
?>
<!DOCTYPE html>
<html>
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
        <meta charset="UTF-8">
        <script type="text/javascript" src="Javascript/deal.js"></script>
        <title>Yoink!</title>
        <meta charset="utf-8">  
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Bootstrap -->
        <link href="CSS/bootstrap.min.css" rel="stylesheet">
        <link href="CSS/custom.css" rel="stylesheet">