Ejemplo n.º 1
0
<?php

session_start();
include_once 'class/class.pagebuild.php';
include_once 'class/class.user.php';
include_once 'class/class.cars.php';
$car = new cars();
$user = new user();
$page = new pageBuild();
$page->checkLogin();
$title = "New Car Scrimmage - Send Offer";
$page->defaultHead($title);
$page->startBody();
$page->navBar();
//Catch anything posted to ourselves... no use for another utility.
if (isset($_POST['request'])) {
    foreach ($_POST as $key => $value) {
        $_POST[$key] = $user->db->filter($value);
    }
    $price = $_POST['price'];
    $request = $_POST['request'];
    $message = $_POST['message'];
    $dealer = $_SESSION['dealerID'];
    $input = array('request_id' => $request, 'offered_price' => $price, 'offer_details' => $message, 'dealer_id' => $dealer);
    if ($user->db->insert('offers', $input)) {
        header('Location: http://onlinelotbuilder.com/controlpanel.php');
    }
}
if (isset($_SESSION['dealer'])) {
    foreach ($_GET as $key => $value) {
        $_GET[$key] = $user->db->filter($value);
Ejemplo n.º 2
0
require_once $conf['basedir'] . 'class/class.cars.php';
require_once $conf['basedir'] . 'class/class.db.php';
define('DB_HOST', $conf['dbhost']);
// set database host
define('DB_USER', $conf['dbuser']);
// set database user
define('DB_PASS', $conf['dbpass']);
// set database password
define('DB_NAME', $conf['dbname']);
// set database name
define('SEND_ERRORS_TO', $conf['adminmail']);
//set email notification email address
define('DISPLAY_DEBUG', true);
//display db errors?
$db = new DB();
$car = new cars();
$makes = $car->getMakes();
/*
foreach( $makes as $pretty=>$nice ){
    $sel = "SELECT * FROM make WHERE makeNice = '$nice'";
    $count = $db->num_rows($sel);
    if($count == 0){
        $in = array(
            'makeName' => $pretty,
            'makeNice' => $nice
        );
        if($db->insert('make', $in)){
            echo "ADDED $pretty\n";
        }
        
    }
Ejemplo n.º 3
0
<?php

// View file name
$pageName = 'detailed';
$title = "Detailed view";
$car = cars::find_by_id($_GET['id']);
Ejemplo n.º 4
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$conf = parse_ini_file('/var/www/html/v1/config/app.ini');
require_once $conf['basedir'] . '/class/class.cars.php';
$cars = new cars();
$action = isset($_GET['action']) ? $_GET['action'] : NULL;
$type = isset($_GET['type']) ? $_GET['type'] : NULL;
$make = isset($_POST['make']) ? $_POST['make'] : NULL;
$model = isset($_POST['model']) ? $_POST['model'] : NULL;
if ($action == 'modelsByType') {
    if ($type === 'all') {
        $mbt = $cars->getAllMakes();
        foreach ($mbt as $k => $v) {
            echo "<option value=\"{$v["makeID"]}\">{$v["makeName"]}</option>\n";
        }
    } else {
        $mbt = $cars->getModelByType($type);
        foreach ($mbt as $k => $v) {
            echo "<option value=\"{$v["makeID"]}\">{$v["makeName"]}</option>\n";
        }
    }
}
if (!is_null($make) && is_null($model)) {
    $query = "SELECT * FROM model WHERE make ='" . $make . "'";
    $type = isset($_POST['type']) ? $_POST['type'] : NULL;
    if (isset($type) and $type !== 'all') {
Ejemplo n.º 5
0
<?php

session_start();
include_once '../class/class.user.php';
$user = new user();
include_once '../class/class.cars.php';
$car = new cars();
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$req = $_GET['req'];
if (isset($_SESSION['dealer'])) {
    // I'm a dealer
    $request = $user->getRequest($req);
    $request = $request[0];
    $id = $_SESSION['dealerID'];
    $select = "SELECT * FROM offers WHERE dealer_id = {$id} AND request_id = {$req}";
    $results = $user->db->get_results($select);
    $results = $results[0];
    $trim = $car->getNameByTrim($request['car_trim']);
    $price = $amount = "\$" . number_format($results['offered_price'], 2, '.', ',');
    $getCustomer = "SELECT * FROM customers WHERE customer_id IN (SELECT customer_id FROM requests WHERE request_id = {$req})";
    $cus = $user->db->get_results($getCustomer);
    $cus = $cus[0];
}
?>
<!DOCTYPE html>
<html>
<head>
Ejemplo n.º 6
0
        $result = $conn->query($sql);
        if ($result->num_rows > 0) {
            // output data of each row
            while ($row = $result->fetch_assoc()) {
                return $array = array('id' => $row['id'], 'ref' => $row['ref'], 'heading' => $row['heading'], 'text' => $row['text']);
            }
        } else {
            echo "0 results";
        }
    }
}
// end class Cars
?>

 <?php 
$Cars = new cars();
$rowsindata = $Cars->numrows();
$random = rand(1, $rowsindata);
$random2 = rand(1, $rowsindata);
$random3 = rand(1, $rowsindata);
if ($random == $random2) {
    if ($random2 == $rowsindata) {
        $random2--;
    } else {
        $random2++;
    }
}
if ($random == $random3 || $random2 == $random3) {
    if ($random3 == $rowsindata) {
        $random3--;
    } else {
Ejemplo n.º 7
0
// set database user
define('DB_PASS', $config['dbpass']);
// set database password
define('DB_NAME', $config['dbname']);
// set database name
define('SEND_ERRORS_TO', $config['adminmail']);
//set email notification email address
define('DISPLAY_DEBUG', true);
//display db errors?
$database = new DB();
include_once 'class/class.pagebuild.php';
include_once 'class/class.user.php';
include_once 'class/class.cars.php';
$user = new user();
$page = new pageBuild();
$cars = new cars();
$page->checkLogin();
$title = "New Car Scrimmage - Control Panel";
$page->defaultHead($title);
// Start any script or style customizations
//Beginning of mycars/inventory table
$carTable = <<<STARTTABLE
<table class="table table-hover">
                <thead>
                  <tr>
                    <th>Year</th>
                    <th>Make</th>
                    <th>Model</th>
                    <th>Trim</th>
                    <th>Remove</th>
                  </tr>
Ejemplo n.º 8
0
 function get_used_page_search($cari)
 {
     return cars::where('cars_category', 1)->where('cars_name', 'like', '%' . $cari . '%')->orderBy('id_cars', 'DESC')->paginate(20);
 }
Ejemplo n.º 9
0
    $cant = filter_var($_GET['passengers'], FILTER_SANITIZE_NUMBER_INT);
}
if (isset($_POST['enviar']) && isset($_POST['passengers'])) {
    $enviar = $_POST["enviar"];
    $cant = $_POST["passengers"];
    if ($enviar == 'Plane') {
        $obj = new planes();
    }
    $maxPass = $obj->maxPassengers();
    if ($cant > $maxPass) {
        echo "You cant travel on a Plane whit " . $cant . " passengers. The maximum number of allowed passengers for the selected transport is  " . $obj->maxPassengers() . ".";
    } else {
        echo 'Ok! you can now travel. Bye';
    }
    if ($enviar == 'Car') {
        $obj2 = new cars();
    }
    $maxPass = $obj2->maxPassengers();
    if ($cant > $maxPass) {
        echo "You cant travel on a Car whit " . $cant . " passengers. The maximum number of allowed passengers for the selected transport is   " . $obj->maxPassengers() . ".";
    } else {
        echo 'Ok! you can now travel. Bye';
    }
    if ($enviar == 'Bike') {
        $obj3 = new bikes();
    }
    $maxPass = $obj3->maxPassengers();
    if ($cant > $maxPass) {
        echo "You cant travel on a Bike whit " . $cant . " passengers. The maximum number of allowed passengers for the selected transport is   " . $obj->maxPassengers() . ".";
    } else {
        echo 'Ok! you can now travel. Bye';