예제 #1
0
<?php

include 'classes/realestate.php';
$obj = new realestate();
if (!isset($_GET['get_id'])) {
    header('Location:index.php');
} else {
    $param['post_id'] = $_GET['get_id'];
    $row = $obj->get_post($param);
    $main_post = mysqli_fetch_array($row);
    //    print_r($main_post);
}
if (isset($_POST['submit'])) {
    foreach ($_POST as $key => $value) {
        if (empty($_POST[$key])) {
            $error = true;
        }
        $_data[$key] = $value;
    }
    if (!isset($error)) {
        print_r($_data);
        $to = '*****@*****.**';
        $subject = 'About property';
        $message = '<h2>Hi Dear</h2><br>' . $_data['message'] . '<br> Property URL: ' . $_data['url'] . '<br> Property ID: ' . $_data['post_id'] . '<br><br> Redards:<br> ' . $_data['name'] . '<br> ' . $_data['email'] . '<br> ' . $_data['phone'];
        //echo $message;
        $result = $obj->send_email($to, $subject, $message);
    }
}
?>

<!DOCTYPE html>
예제 #2
0
<?php

include_once '../classes/realestate.php';
//echo session_status();
if (!isset($_SESSION['login']) && $_SESSION['login'] != 'login') {
    header("Location:../index.php");
}
$obj = new realestate();
//echo $_SESSION['post_id'];
if (isset($_SESSION['post_id']) && isset($_GET['token']) && $_GET['token'] == TRUE) {
    $param['post_id'] = $_SESSION['post_id'][$_GET['edit']];
    $result_edit = $obj->get_post($param);
    $post_images = $obj->get_images($param);
    $edit = TRUE;
    $_SESSION['post_id'] = NULL;
    //    exit();
} elseif (isset($_SESSION['post_id']) && !isset($_GET['token']) && isset($_GET['edit'])) {
    $param['post_id'] = $_SESSION['post_id'];
    //    exit();
    $result_edit = $obj->get_post($param);
    $post_images = $obj->get_images($param);
    $edit = TRUE;
} else {
    //    echo 'session not set';
}
//while ($row1 = mysqli_fetch_row($result_edit)) {
//    print_r($row1);
//}
if (isset($edit) && $edit == TRUE) {
    //    exit();
    while ($row = mysqli_fetch_array($result_edit)) {
예제 #3
0
<?php

include_once 'classes/realestate.php';
$obj = new realestate();
$param['submit'] = 'fresh';
$get_data = $obj->contactus($param);
while ($row = mysqli_fetch_array($get_data)) {
    $_DATA[$row['name']] = $row['value'];
}
$obj = new realestate();
if (!isset($_GET['get_id'])) {
    header('Location:index.php');
} else {
    $param['post_id'] = $_GET['get_id'];
    $row = $obj->get_post($param);
    $main_post = mysqli_fetch_array($row);
    switch ($main_post['category']) {
        case 1:
            $category = 'Apartment';
            break;
        case 2:
            $category = 'House';
            break;
        case 3:
            $category = 'Commercial';
            break;
    }
    $post_images = $obj->get_images($param);
    $param['next_id'] = TRUE;
    $next_row = $obj->get_post($param);
    $next_id = mysqli_fetch_array($next_row);