Beispiel #1
0
        die;
        $mysql = mysql_query($fb_login) or die(mysql_error());
        if ($mysql) {
            $id = mysql_insert_id();
            $_SESSION['message']['user_login'] = "******";
            $_SESSION['LoginUserId'] = $id;
            echo "success";
        } else {
            echo "error";
        }
    } else {
        $condition = " email = '" . $data['email'] . "'";
        $user_login = userExists($condition);
        $_SESSION['message']['user_login'] = "******";
        $_SESSION['LoginUserId'] = $user_login['id'];
        lastVisit($user_login['id']);
        echo "success";
    }
}
/*change password*/
if (isset($_POST['change_pass']) && $_POST['change_pass'] == "change_password") {
    $current_pass = mysql_real_escape_string(trim($_POST['current_pass']));
    $new_pass = mysql_real_escape_string(trim($_POST['new_pass']));
    $user_id = mysql_real_escape_string(trim($_POST['user_id']));
    $condition = " id='" . $user_id . "'   and password = '******' ";
    //and is_admin='no'
    /* check if email id is alreadye exists or not */
    $user = getUserDetail($condition);
    if (mysql_num_rows($user) == 1) {
        $update_pass = mysql_query("UPDATE users set password='******' WHERE id='" . $user_id . "' ");
        if ($update_pass) {
echo $opdnum;
?>
</span></td>
			            </tr>
            			<tr>
			            	<td valign="top"><label for="address">Address:</label></td>
            			    <td><span class="info"><?php 
echo $address;
?>
</span></td>
			            </tr>
            			<tr>
			            	<td><label for="lastvisit">Last Visit:</label></td>
            		    	<td>
							<?php 
$last = lastVisit($pid);
if (empty($last)) {
    ?>
								<span class="info">No Records Found.</span>
							<?php 
} else {
    foreach ($last as $lst) {
        ?>
            					<span class="info"><?php 
        echo date('F d, Y', strtotime($lst["dateofvisit"]));
        ?>
</span>
			        	    <?php 
    }
}
?>