include_once '../../include/conn.php';
include_once '../../include/response_objects.php';
include_once '../../include/common_functions.php';
date_default_timezone_set("US/Eastern");
$r = new resGeneral();
function error($msg)
{
    $r->success = 0;
    $r->message = $msg;
    return json_encode($r);
}
$apikey = pickup('apikey');
$username = pickup('username');
$email = pickup('email');
$token = pickup('token');
$device = pickup('device');
if ($apikey != $REST_API_KEY) {
    $r->success = 0;
    $r->message = "Error: Invalid API Key.";
} else {
    if ($username == null || $username != null && strlen($username) < 3) {
        $r->success = 0;
        $r->message = "Error: User name cannot be less than 3 characters.";
    } else {
        if ($email == null || $email != null && strlen($email) < 3) {
            $r->success = 0;
            $r->message = "Error: Email too short.";
        } else {
            if ($token == "") {
                $r->success = 0;
                $r->message = "Error: Token cannot be blank.";
<?php

include_once '../../include/conn.php';
include_once '../../include/response_objects.php';
include_once '../../include/common_functions.php';
date_default_timezone_set("US/Eastern");
$r = new resGeneral();
function error($msg)
{
    $r->success = 0;
    $r->message = $msg;
    return json_encode($r);
}
$apikey = pickup('apikey');
$username = pickup('username');
if ($apikey != $REST_API_KEY) {
    $r->success = 0;
    $r->message = "Error: Invalid API Key.";
} else {
    if ($username == null || $username != null && strlen($username) < 3) {
        $r->success = 0;
        $r->message = "Error: User name cannot be less than 3 characters.";
    } else {
        $result = mysqli_query($con, "SELECT * FROM users WHERE username='******'") or die(error("Error: Loading usernames"));
        if (mysqli_num_rows($result) == 0) {
            $r->success = 1;
            $r->message = "User name is available.";
        } else {
            $r->success = 0;
            $r->message = "Error: User name taken.";
        }
include_once '../../include/conn.php';
include_once '../../include/response_objects.php';
include_once '../../include/common_functions.php';
date_default_timezone_set("US/Eastern");
$r = new resGeneral();
function error($msg)
{
    $r->success = 0;
    $r->message = $msg;
    return json_encode($r);
}
$apikey = pickup('apikey');
$username = pickup('username');
$email = pickup('email');
$token = pickup('token');
if ($apikey != $REST_API_KEY) {
    $r->success = 0;
    $r->message = "Error: Invalid API Key.";
} else {
    if ($username == null || $username != null && strlen($username) < 3) {
        $r->success = 0;
        $r->message = "Error: User name too short.";
    } else {
        if ($email == null || $email != null && strlen($email) < 3) {
            $r->success = 0;
            $r->message = "Error: Email too short.";
        } else {
            if ($token == "") {
                $r->success = 0;
                $r->message = "Error: Token cannot be blank.";
Beispiel #4
0
<?php

//ASSUMING getting $restId;
include_once '../../include/conn.php';
include_once '../../include/functions.php';
$name = pickup('name', 250, true);
mysqli_query($con, "UPDATE restaurants SET name='{$name}' WHERE id='{$restId}'") or die("Failed 001");
redirect('../settings');
include_once '../../include/conn.php';
include_once '../../include/response_objects.php';
include_once '../../include/common_functions.php';
date_default_timezone_set("US/Eastern");
$r = new resGeneral();
function error($msg)
{
    $r->success = 0;
    $r->message = $msg;
    return json_encode($r);
}
$apikey = pickup('apikey');
$username = pickup('username');
$email = pickup('email');
$password = pickup('password');
if ($apikey != $REST_API_KEY) {
    $r->success = 0;
    $r->message = "Error: Invalid API Key.";
} else {
    if ($username == null || $username != null && strlen($username) < 3) {
        $r->success = 0;
        $r->message = "Error: User name cannot be blank.";
    } else {
        if ($email == null || $email != null && strlen($email) < 3) {
            $r->success = 0;
            $r->message = "Error: Email cannot be blank.";
        } else {
            //updates the username
            $result = mysqli_query($con, "SELECT * FROM users WHERE email='{$email}'") or die(error("Error: Loading user data"));
            if (mysqli_num_rows($result) != 1) {
Beispiel #6
0
<?php

//ASSUMING getting $restId;
include_once '../../include/conn.php';
include_once '../../include/functions.php';
$latitude = pickup('latitudeField', 250, true);
$longitude = pickup('longitudeField', 250, true);
mysqli_query($con, "UPDATE restaurants SET latitude='{$latitude}', longitude='{$longitude}' WHERE id='{$restId}'") or die("Failed 001");
redirect('../settings');
<?php

include_once '../../include/conn.php';
include_once '../../include/response_objects.php';
include_once '../../include/common_functions.php';
$r = new resPosts();
function error($msg)
{
    $r->success = 0;
    $r->message = $msg;
    return json_encode($r);
}
$apikey = pickup('apikey');
$token = pickup('token');
$username = pickup('username');
$starting = pickup('starting');
if ($apikey != $REST_API_KEY) {
    $r->success = 0;
    $r->message = "Error: Invalid API Key.";
} else {
    if ($token == "") {
        $r->success = 0;
        $r->message = "Error: Blank token.";
    } else {
        if ($username == "") {
            $r->success = 0;
            $r->message = "Error: Blank user name.";
        } else {
            $userId = -1;
            $result_find_user_id = mysqli_query($con, "SELECT * FROM loginTokens WHERE token='{$token}'") or die(error("Error: loading current user info"));
            while ($row_find_user_id = mysql_fetch_array($result_find_user_id)) {
Beispiel #8
0
<?php

session_start();
include_once '../include/conn.php';
include_once '../include/functions.php';
$email = pickup('email', 250, true);
$password = pickup('password', 250, true);
$result = mysqli_query($con, "SELECT * FROM partners WHERE email='{$email}' AND password='******'") or die("Failed 001");
if (mysqli_num_rows($result) == 1) {
    //SESSION LOGIN CODE GOES HERE
    //-
    //-
    $id = "";
    while ($row = mysqli_fetch_array($result)) {
        $id = $row['rest_id'];
    }
    $_SESSION['ordr_ri'] = $id;
    redirect('../account/');
} else {
    die("Invalid log in");
}
Beispiel #9
0
<?
//Инклуды - зацеп
pickup('includes', 'service', 'db', 'tables', 'uris', 'files', 'menus', 'templates', 'it', 'auth', 'sort', 'windows');

//Действия - зацеп
//pickup('actions', 'show_positions');

//Инициализируем сессию COOKIE
block("init_session");

//Подключаемся к базе данных
db_connect();

//prepared_uri
$prepared_uri=array();

//цвета
$colors=array('red', 'green', 'blue', 'orange', 'brown', 'magenta', 'darkblue');

//Если вход не выполнен
if(!isset($_SESSION['user'])){
	echo login_form();
	exit;
}

//Подключаемся к базе данных
db_connect();

//Чистим uri
uri_clean('add_position', 'add_document', 'edit_document', 'delete_document', 'save_document', 'show_originals', 'delete_file', 'edit_file',
			'show_histories', 'search_document', 'search_string', 'show_contragents', 'show_positions', 'edit_position', 'add_position', 'delete_position',