Пример #1
0
    if (!empty($_FILES['property_img']['name'])) {
        $ran = strtotime('now');
        echo $file_name = $ran . str_replace(" ", "_", $_FILES['property_img']['name']);
        $file_size = $_FILES['property_img']['size'];
        $file_tmp = $_FILES['property_img']['tmp_name'];
        $file_type = $_FILES['property_img']['type'];
        if ($file_size < 5242880) {
            $desired_dir = "../uploads/property_images/";
            //$desired_dir = 'images/projectimages/2';
            if (is_dir($desired_dir) == false) {
                mkdir("{$desired_dir}", 0700);
            }
            move_uploaded_file($file_tmp, "{$desired_dir}" . $file_name);
            $val[] = $file_name;
        } else {
            $msg = "<div class='errordiv'>Please Upload image less than .</div>";
        }
    }
    $image_info = get_row_by_condition("post_add", "where post_id={$post_id} and upid={$upid}");
    if ($image_info['property_image'] != "") {
        $pro_img = $image_info['property_image'] . "," . $file_name;
    } else {
        $pro_img = $file_name;
    }
    $usrData = array('property_image' => $pro_img);
    update($usrData, 'post_add', 'where post_id=' . $post_id . ' and upid=' . $upid);
    $result['status'] = 'success';
    echo json_encode($result);
} else {
    echo json_encode(array("status" => "worng"));
}
Пример #2
0
<?php

session_start();
include "includes/dbutil.php";
$uname = $_POST['user_email'];
$pwd = md5($_POST['password']);
$cond = "where (user_email='{$uname}' or user_mobile='{$uname}') and password='******'";
$count1 = get_row_count_by_condition('convention_users', $cond);
if ($count1 > 0) {
    $row1 = get_row_by_condition('convention_users', $cond);
    $_SESSION['cnv_upid'] = $row1['cnv_upid'];
    $_SESSION['user_name'] = $row1['user_name'];
    $_SESSION['user_type'] = $row1['user_type'];
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\t\t  window.location.href='convention-post.php';</SCRIPT>";
} else {
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\n    window.alert('You entered incorrect Username or Password ')\n\n    window.location.href='convention-centre.php';\n\n    </SCRIPT>";
}
Пример #3
0
<?php

include "includes/dbutil.php";
//echo "hiii";
$state1 = get_row_by_condition("tbl_state", "WHERE state_name='" . $_POST['main_cat'] . "'");
$state_id = $state1['id'];
$pcount = get_row_count_by_condition("tbl_city", "WHERE state_id=" . $state_id);
if ($pcount > 0) {
    $scats = select_rows_by_condition("tbl_city", "WHERE state_id=" . $state_id);
}
?>
<select name="city" id="city">

<option value="">Select City</option>

<?php 
if ($pcount > 0) {
    foreach ($scats as $row) {
        ?>

<option value='<?php 
        echo $row['city_name'];
        ?>
'><?php 
        echo $row['city_name'];
        ?>
</option>

<?php 
    }
}
Пример #4
0
<?php

session_start();
include "includes/dbutil.php";
$uname = $_POST['user_email'];
$pwd = md5($_POST['password']);
$cond = "where (user_email='{$uname}' or user_mobile='{$uname}') and password='******'";
$count1 = get_row_count_by_condition('users', $cond);
if ($count1 > 0) {
    $row1 = get_row_by_condition('users', $cond);
    $_SESSION['upid'] = $row1['upid'];
    $_SESSION['user_name'] = $row1['user_name'];
    $_SESSION['user_type'] = $row1['user_type'];
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\t\t  window.location.href='" . $_SERVER["HTTP_REFERER"] . "';</SCRIPT>";
} else {
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\n    window.alert('You entered incorrect Username or Password ')\n\n    window.location.href='" . $_SERVER["HTTP_REFERER"] . "';\n\n    </SCRIPT>";
}
Пример #5
0
        $user_info = get_row_by_condition("users", "where user_email='" . $email . "'");
        $_SESSION['user_mobile'] = $user_info['user_mobile'];
        $_SESSION['upid'] = $user_info['upid'];
        $_SESSION['user_name'] = $user_info['user_name'];
        $_SESSION['user_email'] = $user_info['user_email'];
        //header("location:http://localhost/safe-wash/index.php");
    } else {
        //user is new
        //echo 'Hi '.$user_name.', Thanks for Registering!';
        $user_info1 = array('google_id' => $user_id, 'user_name' => $user_name, 'user_email' => $email);
        $inserted = insertdata($user_info1, "users");
        /*$mysqli->query("INSERT INTO user_profile (google_id, name, email) 
          VALUES ($user_id, '$user_name','$email')");*/
        if ($inserted > 0) {
            if (!isset($_SESSION['user_email'])) {
                $user_info = get_row_by_condition("users", "where user_email='" . $email . "'");
                $_SESSION['user_mobile'] = $user_info['user_mobile'];
                $_SESSION['upid'] = $user_info['upid'];
                $_SESSION['user_name'] = $user_info['user_name'];
                $_SESSION['user_email'] = $user_info['user_email'];
            }
        }
    }
}
?>
   
<?php 
if (isset($_GET['lng']) && $_GET['lng'] != '' && (isset($_GET['lat']) && $_GET['lat'] != '')) {
    $url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . trim($_GET['lat']) . ',' . trim($_GET['lng']) . '&sensor=false';
    $json = @file_get_contents($url);
    $data = json_decode($json);
Пример #6
0
<?php

session_start();
include "includes/dbutil.php";
$count = get_row_count_by_condition("post_add", "where upid = '" . $_SESSION['upid'] . "' and post_id = '" . $_REQUEST['post'] . "'");
if ($count > 0) {
    $convention_info = get_row_by_condition("post_add", "where upid = '" . $_SESSION['upid'] . "' and post_id = '" . $_REQUEST['post'] . "'");
    if (!empty($convention_info["property_image"])) {
        $images = explode(",", $convention_info["property_image"]);
        foreach ($images as $image) {
            unlink("uploads/property_images/{$image}");
        }
    }
    //delete_row("tbl_showcase","where showcase_id='$showcase_id' and school_id='$school_id'");
    mysql_query("delete from post_add where upid = '" . $_SESSION['upid'] . "' and post_id = '" . $_REQUEST['post'] . "'");
    echo "<SCRIPT>\t\t    \t\n      window.location.href='property-profile-list.php?message=del';\n      </SCRIPT>";
    //}
}
Пример #7
0
<?php

session_start();
include_once 'includes/dbutil.php';
extract($_POST);
$count = get_row_count_by_condition("users", "where fb_token='{$id}' and user_email='{$email}'");
if ($count > 0) {
    $row = get_row_by_condition("users", "where user_email='{$email}'");
    $_SESSION['upid'] = $row['upid'];
    $_SESSION['user_name'] = $row['user_name'];
    $result['status'] = "true";
    echo json_encode($result);
} else {
    $name = $first_name . " " . $last_name;
    $userdata = array('user_name' => $name, 'fb_token' => $id, 'user_email' => $email);
    $isupdated = insertdata($userdata, "users");
    if ($isupdated > 0) {
        $row1 = get_row_by_condition("users", "where user_email='{$email}'");
        $_SESSION['upid'] = $row1['upid'];
        $_SESSION['user_name'] = $row1['user_name'];
        $result['status'] = "true";
        echo json_encode($result);
    }
}