Esempio n. 1
0
function searchDriver($name)
{
    getDrivers($name, "search");
}
Esempio n. 2
0
<?php

include_once "session.php";
$search = $_POST['searchFor'];
$where = $_POST['where'];
if ($where == "Clients") {
    if (strlen($search) == 0) {
        getClient(0, "all");
    } else {
        searchClient($search);
    }
} elseif ($where == "Drivers") {
    if (strlen($search) == 0) {
        getDrivers(0, "all");
    } else {
        searchDriver($search);
    }
} elseif ($where == "Deliveries") {
    if (strlen($search) == 0) {
        //Get all data here
    } else {
        //Get specific data here.
    }
} elseif ($where == "Reports") {
    if (strlen($search) == 0) {
        getEmergencyTable(0, "all");
    } else {
        searchEmergencies($search);
    }
} elseif ($where == "Accounts") {
    if (strlen($search) == 0) {
Esempio n. 3
0
<?php

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/config.php';
use Illuminate\Http\Request;
use Recca0120\Socialite\SocialiteManager;
session_start();
$request = Request::capture();
$app = getApp($request);
$drivers = getDrivers($app['config']);
$showUser = empty($_GET['show']) === false;
// $driver = empty($_GET['next']) ? $drivers[0] : $_GET['next'];
// dump($drivers);
// OAuth1
// $driver = 'bitbucket';
// $driver = 'twitter';
// OAuth2
// $driver = 'dropbox';
$driver = 'facebook';
// $driver = 'github';
// $driver = 'google';
// $driver = 'googleservice';
// $driver = 'instagram';
// $driver = 'linkedin';
$socialiteManager = new SocialiteManager($app);
$socialite = $socialiteManager->driver($driver);
// ->stateless();
if ($driver === 'googleservice') {
    dump($socialite->scopes(['https://www.googleapis.com/auth/analytics.readonly'])->getAccessToken());
} elseif ($showUser) {
    dump($socialite->user(), $socialite->service());
    $liftid = $_GET['liftid'];
    $results = $db->update("UPDATE Lift SET L_Seats = L_Seats - 1 WHERE L_ID = " . $liftid . ";");
    foreach ($results as $result) {
        echo $result;
    }
}
function likePost()
{
    global $db;
    $userID = $_SESSION["U_ID"];
    $postID = $_GET['like'];
    $sql = "INSERT INTO Likes(`P_ID`, `U_ID`)VALUES('" . $postID . "','" . $userID . "');";
    $results = $db->insert($sql);
    return $results;
}
if (isset($_GET['function'])) {
    switch ($_GET['function']) {
        case 'updatelift':
            decrementAvailableSeats();
            break;
        case 'displaylift':
            getAvailableLifts();
            break;
        case 'searchdrivers':
            getDrivers();
            break;
        case 'likepost':
            likePost();
            break;
    }
}