Esempio n. 1
0
<?php

if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
include "./pdo.php";
$db_file = "./restaurant.sqlite3";
PDO_Connect("sqlite:{$db_file}");
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (isset($_POST['action'])) {
        switch ($_POST['action']) {
            case 'updateuserDatabase':
                updateUserDetails();
                break;
            case 'showexistinguserlist':
                sendUserList();
                break;
            case 'showexisting_items_inDB':
                showExistingItemsInDb();
                break;
            case 'updateitemsWithNewPrices':
                updateitemsWithNewPrices();
                break;
        }
    }
}
function updateitemsWithNewPrices()
{
    $itemname = $_POST['name'];
    $itemprice = $_POST['price'];
    $selectdCategory = $_POST['selectedcategory'];
Esempio n. 2
0
        $change[0] = true;
        //username
    }
    if ($changeVal == 1 | $changeVal == 4 | $changeVal == 7 | $changeVal == 8 | $changeVal == 10 | $changeVal == 11 | $changeVal == 13 | $changeVal == 14) {
        $change[1] = true;
        //email
    }
    if ($changeVal == 2 | $changeVal == 5 | $changeVal == 7 | $changeVal == 9 | $changeVal == 10 | $changeVal == 12 | $changeVal == 13 | $changeVal == 14) {
        $change[2] = true;
        //password
    }
    if ($changeVal == 3 | $changeVal == 6 | $changeVal == 8 | $changeVal == 9 | $changeVal == 11 | $changeVal == 12 | $changeVal == 13 | $changeVal == 14) {
        $change[3] = true;
        //company
    }
    echo json_encode(updateUserDetails($dbh, $change, $_POST));
});
/*
Michael Gilbert
getMODHunter
Gets Message of Day For a Hunter
Errors:
0: success
1: No statement executed
*/
$app->get('/api/getMODHunter', function () use($dbh) {
    $args = array();
    echo json_encode(getMessageOfDayHUnter($dbh));
});
/*
Michael Gilbert
Esempio n. 3
0
function updateUser($d, $ip, $token)
{
    return updateUserDetails($d);
}
 case "pay-callback-failure":
     $_SESSION['message'] = 51;
     $_SESSION['messageval'] = $_REQUEST['ErrorMsg'];
     header("Location: pay");
     break;
 case "Update Settings":
     saveSystemSettings($_REQUEST);
     break;
 case "Add New User":
     addUser($_REQUEST);
     break;
 case "Upload Users":
     uploadUsers($_FILES);
     break;
 case "Update User Details":
     updateUserDetails($_REQUEST);
     break;
 case "Edit Form":
 case "Add Form":
     editAddPaperworkForm($_FILES, $_REQUEST);
     break;
 case "Edit Activity":
 case "Add Activity":
     editAddActivity($_REQUEST);
     break;
 case "Book Now":
 case "Edit Booking":
     editAddBooking($_REQUEST);
     break;
 case "Logout":
     logout();