Exemplo n.º 1
0
<?php

require_once './app-config.php';
include_once ABSPATH . "/php/CDBConn.php";
include_once ABSPATH . "/php/hostconfig.php";
$conn = new CDBConn($jet_ip, $db_name, $db_user, $db_pass);
echo "CDBConn::connect_no_locathost();<br>";
$conn->connect_no_localhost();
$conn->printinfo();
$sql = "SELECT * FROM hostels";
echo "<div style=\"background-color:#00FF00\">" . $conn->run_select($sql) . "</div>";
$conn->close();
$conn2 = new CDBConn("127.0.0.1", $db_name, $db_user, $db_pass);
echo "<br>--------------<br>";
echo "CDBConn::connect()<br>";
$conn2->connect_no_localhost();
$conn2->printinfo();
$sql = "SELECT * FROM rooms";
echo "<div style=\"background-color:#00FF00\">" . $conn2->run_select($sql) . "</div>";
$conn2->close();
Exemplo n.º 2
0
    echo "Session is on<br>";
    http_response_code(302);
    exit;
}
require_once "../app-config.php";
include_once ABSPATH . "/php/CDBConn.php";
include_once ABSPATH . "/php/hostconfig.php";
$login = json_decode($_POST['login']);
$password = json_decode($_POST['password']);
$conn = new CDBConn($jet_ip, $db_name, $db_user, "qwerty123");
if (!$conn->connect()) {
    http_response_code(503);
    exit;
}
$check_user_sql = "SELECT * FROM users WHERE login='******' AND password='******'";
echo $conn->run_select($check_user_sql);
if ($conn->affected_rows() != 1) {
    echo "user with login:'******'; and password:'******' doesnot exists" . "<br>";
    http_response_code(401);
    exit;
} else {
    $_SESSION['g_username'] = $login;
    $get_hostel_id_sql = "SELECT hostel_id FROM users WHERE login='******'";
    $conn->run_query($get_hostel_id_sql);
    $row = $conn->fetch_array();
    $hostel_id = $row['hostel_id'];
    // Even in case if hostel_id is null,
    // doConfigure.php script will create it
    $_SESSION['g_hostel_id'] = $hostel_id;
    http_response_code(200);
    exit;
Exemplo n.º 3
0
<?php

require_once "../app-config.php";
include_once ABSPATH . "/php/CDBConn.php";
include_once ABSPATH . "/php/hostconfig.php";
$send_to = $_GET["email"];
if ($send_to == "") {
    echo "Email is empty. nothing to do<br>";
    http_response_code(422);
    exit(1);
}
$conn = new CDBConn($jet_ip, $db_name, $db_user, "qwerty123", FALSE);
$conn->connect();
$conn->run_select("SELECT * FROM users WHERE login='******'");
if ($conn->affected_rows() > 0) {
    echo "Following email '{$send_to}' is already used or activation requested. Please, select another email, if appropriate.<br>";
    http_response_code(422);
    exit(1);
} else {
    $subject = "JetPMS.com Registration Request";
    $message = "Dear customer, <br><br><br>We are glad to inform that you have almost done with the registration at JetPMS.<br/> Please, follow further simple instruction and be ready for evaluating our product.<br>";
    /*$message .= "So far, you have requested JetPMS for:<br>";
    
          $message .= "Beds <b>".$_POST["bedscount"] . "</b><br/>";
          $message .= "Country <b>".$_POST["country"]."</b><br/>";
          $message .= "Total price: <b>".$_POST["b_price"]."$/month</b><br>";
          */
    $message .= "Please, click to this activation link: ";
    $reg_token = bin2hex(openssl_random_pseudo_bytes(16));
    $activation_link = "http://" . $_SERVER["HTTP_HOST"] . "/signup/activateAccount.php?email=" . $send_to . "&reg_token=" . $reg_token;
    $href_tag = "<a href=" . $activation_link . ">{$activation_link}</a>";