define('PHOTO_TYPE_CATEGORY', 2);
define('PHOTO_TYPE_SUBCATEGORY', 3);
define('PHOTO_TYPE_BRAND', 4);
define('PHOTO_TYPE_SERIES', 5);
define('PHOTO_TYPE_INSTALLATION', 6);
define('PHOTO_TYPE_CUSTOMER', 7);
//---location(related to the location id in database of datahouse)
//define('LOCATION_SERVER', 1);
define('LOCATION_LOFINC', 2);
define('LOCATION_TRUCKCHAMP', 3);
//define('LOCATION_LOCAL', 4);
//define('LOCATION_URL', 5);
//define('LOCATION_CSV', 6);
//define('LOCATION_XML', 7);
//******************************Dispatcher******************************
if (verified($token, $controller, $action, $time)) {
    //---keep running in background
    ignore_user_abort(1);
    set_time_limit(0);
    //---just let browser disconnect
    header("Content-Length: 0");
    header("Connection: close");
    flush();
    //---fetch data,(send $_POST directly)
    //var_dump(call_api($controller, $action, $_POST));exit;
    $photos = unserialize(call_api($controller, $action, $_POST));
    //sleep(10);
    //---do sync(Now it will do api_update_photo)
    do_sync($photos, 'api_update_photo');
    //---update sync status[!!!Now it will be done in do_sync()!!!]
    //call_api('photo_inventory', 'api_update_photo', array('photo_updated' => json_encode($photo_updated)));
<div id="page-wrapper">
<div id="page" class="container">
	<div id="content">
		<div class="title">
			<h3>Welcome , <?php 
echo $_SESSION['sess_name'];
?>
</h3>
			<h4>Donate Blood Save Life<h4>


<?php 
if ($data['mobileverified'] == 'N') {
    unverified();
} else {
    verified();
}
?>
 <?php 
function unverified()
{
    ?>

 <div class='container'>
    <div class='panel panel-primary dialog-panel'>
      <div class='panel-heading'>
        <h5>You Haven't verified Your Mobile Number Please Verify</h5>
      </div>
      <div class='panel-body'>
        <form class='form-horizontal' role='form' action="./verify.php" method="post">
        <div class='form-group'>
<?php 
$db = 'mysql:dbname=idlegame;host=127.0.0.1';
$user = '******';
$pass = '';
try {
    $db = new PDO($db, $user, $pass);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    echo 'Error establishing Connection';
    exit;
}
if (isset($_POST['submit'])) {
    $user = $_POST['newUser'];
    $pass = $_POST['newPass'];
    $successfulRegister = register($user, $pass);
    if (verified($user, $pass) && $successfulRegister == true) {
        echo 'User created. Go back to login <br>';
    } else {
        echo 'Error: failed to create user <br>';
    }
}
function verified($username, $password)
{
    global $db;
    $stmt = $db->prepare("SELECT password FROM users WHERE username='******';");
    $stmt->execute();
    $hash = $stmt->fetchColumn();
    return password_verify($password, $hash);
}
function register($username, $password)
{