
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php
// Start the session
session_start();

?>
<?php
// Start the session
//session_start();

date_default_timezone_set('Asia/Riyadh');

//Connection Detail
$dbhost = 'localhost';
$dbuser = 'coreagen_jhonsonads';
$db = 'coreagen_jhonsonads';
$dbpass = 'BGCjeddah@69';
//$id = $_GET['id'];

$link = mysqli_connect($dbhost, $dbuser, $dbpass, $db);
$GLOBALS["link"] = mysqli_connect($dbhost, $dbuser, $dbpass, $db);
$link->set_charset("utf8");
if (!$link) {
    echo "Error: Unable to connect to MySQL." . PHP_EOL;
    echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
    echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
    exit;
}

?>

<?php

function authuser($usr,$pwd){

$codequery = "select * from xx_honda_admin_user where username = '$usr'";

//echo $codequery;

$result = $GLOBALS["link"]->query($codequery);
while($row = $result->fetch_assoc()) {
$id = $row;
}

if($id['password'] == $pwd && $id['password'] != ''){


$_SESSION['UID'] = $id['id'];
$_SESSION['USN'] = $id['username'];
$_SESSION['AUTH'] = 'Y';
$_SESSION['ROLE'] = $id['role'];
 
return 1;    
    
}else{

return 0;    
    
}
    
}


function get_prize_details($data){

$codequery = "select * from xx_funland_luckywheel_prize
where prize_code = '$data'";

//echo $codequery;

$result = $GLOBALS["link"]->query($codequery);
while($row = $result->fetch_assoc()) {
$id = $row;
}


return $id;
    
}

?>

