Exemplo n.º 1
0
if (empty($_SESSION['id'])) {
    header('location:' . SITE_URL . 'error.php');
}
?>
<h1>Dashboard </h1>
<hr />
<?php 
$id = $_SESSION['id'];
$data['select'] = 'u.*, c.name country_name, s.name state_name, city.name city_name, d.name district_name';
$data['table'] = 'users u LEFT JOIN countries c ON u.country_id = c.id
				  LEFT JOIN states s ON u.state_id = s.id
				  LEFT JOIN cities city ON u.city_id = city.id
				  LEFT JOIN districts d ON u.district_id = d.id';
$data['where'] = array('u.id = ' . $id, 'u.is_delete=0', 'u.status=1');
$commonController = new CommonController();
$dataUser = $commonController->getTableData($data);
$user = mysql_fetch_assoc($dataUser);
?>
<div class='row'>
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-heading">
				Profile
			</div>
			<div class="panel-body">
				<a class="fancybox" href="<?php 
echo SITE_URL . (!empty($user['image']) ? $commonController->getUsersFolderPath($user['image']) : 'images/common/no-member-image.png');
?>
" 
				 style="float:left; margin:0 10px 0 0;">
					<img src="<?php 
<?php

include 'assets/config.php';
if (!empty($_POST['establishment_id'])) {
    $commonController = new CommonController();
    $data = $commonController->getTableData(array('table' => 'establishment_rooms', 'where' => array('establishment_id=' . $_POST['establishment_id'])));
    echo '<option value="0">-select-</option>';
    while ($row = mysql_fetch_array($data)) {
        echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
    }
} else {
    echo "";
}
Exemplo n.º 3
0
<?php

include 'assets/config.php';
require_once "paypal_class.php";
$commonController = new CommonController();
$resultPaypalSetting = $commonController->getTableData(array('table' => 'paypal_settings'));
if (mysql_num_rows($resultPaypalSetting) > 0) {
    $rowPaypalSetting = mysql_fetch_array($resultPaypalSetting);
}
DEFINE('EMAIL_ADD', $rowPaypalSetting['business_email']);
// define any notification email
DEFINE('PAYPAL_EMAIL_ADD', $rowPaypalSetting['business_email']);
// facilitator email which will receive payments change this email to a live paypal account id when the site goes live
$p = new paypal_class();
// paypal class
$p->admin_mail = EMAIL_ADD;
// set notification email
$action = $_REQUEST["action"];
switch ($action) {
    case "process":
        // case process insert the form data in DB and process to the paypal
        // mysql_query("INSERT INTO `purchases` (`invoice`, `product_id`, `product_name`, `product_quantity`, `product_amount`, `payer_fname`, `payer_lname`, `payer_address`, `payer_city`, `payer_state`, `payer_zip`, `payer_country`, `payer_email`, `payment_status`, `posted_date`) VALUES ('".$_POST["invoice"]."', '".$_POST["product_id"]."', '".$_POST["product_name"]."', '".$_POST["product_quantity"]."', '".$_POST["product_amount"]."', '".$_POST["payer_fname"]."', '".$_POST["payer_lname"]."', '".$_POST["payer_address"]."', '".$_POST["payer_city"]."', '".$_POST["payer_state"]."', '".$_POST["payer_zip"]."', '".$_POST["payer_country"]."', '".$_POST["payer_email"]."', 'pending', NOW())");
        $this_script = SITE_URL . 'paypal.php';
        $p->add_field('business', PAYPAL_EMAIL_ADD);
        // Call the facilitator eaccount
        $p->add_field('cmd', $_POST["cmd"]);
        // cmd should be _cart for cart checkout
        $p->add_field('upload', '1');
        $p->add_field('return', $this_script . '?action=success');
        // return URL after the transaction got over
        $p->add_field('cancel_return', $this_script . '?action=cancel');
Exemplo n.º 4
0
    }
}
if (!empty($_REQUEST['viewed']) && ($_REQUEST['viewed'] = "1")) {
    if (!empty($_SESSION['id'])) {
        $user_id = $_SESSION['id'];
        $tables .= ' LEFT JOIN users_viewed uv ON uv.establishment_id = e.id';
        $whereData[] = 'uv.user_id = "' . $user_id . '"';
    }
}
$data['select'] = $select;
$data['table'] = $tables;
$data['where'] = $whereData;
if (!empty($order)) {
    $data['order'] = $order;
}
$resultSearch = $commonController->getTableData($data);
?>
<form method="post" action="map_listing.php" class="form filter-form">
	
	<div class="filter-wrapper">
		<div class="filter-left">
			<div class="filter-lable">Refine</div>
			<div class="filter-select">
				<input type="text" id="searchField" name="searchField" placeholder="Where to Snooze" class="filter-feild search-location" value="<?php 
echo $_POST['searchField'];
?>
">
			</div>
			<div class="filter-calender">
				<input name="check-in" placeholder="Check In" type="text" class="filter-feild calender-icon check-in filter-check-in" value="<?php 
echo !empty($_POST['check-in']) ? $_POST['check-in'] : '';
Exemplo n.º 5
0
<?php

include 'assets/config.php';
$commonController = new CommonController();
if (!empty($_POST['btnLogin']) && !empty($_POST['txtEmailUsername']) && !empty($_POST['txtPassword'])) {
    $resultData = $commonController->getTableData(array('table' => 'users', 'where' => array('(`username`="' . $_POST['txtEmailUsername'] . '" OR `email`="' . $_POST['txtEmailUsername'] . '")', '`password`="' . md5($_POST['txtPassword']) . '"', '`status` = 1', '`is_delete` = 0')));
    if (mysql_num_rows($resultData)) {
        $rowLogin = mysql_fetch_array($resultData);
        $_SESSION['id'] = $rowLogin['id'];
        $_SESSION['username'] = $rowLogin['username'];
        $_SESSION['type'] = $rowLogin['type'];
        $_SESSION['image'] = $rowLogin['image'];
    }
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Snoozover</title>	
    <link href='http://fonts.googleapis.com/css?family=Raleway:500,600,700,400,300' rel='stylesheet' type='text/css'>

	<link rel="stylesheet" href="<?php 
echo SITE_URL;
?>
assets/css/lightslider.css"/>

	<!-- Important Owl stylesheet -->
    $order = $_POST['ddlSortBy'];
    if ($order == 'price asc') {
        $order = 'MIN(rate) ASC';
    } else {
        if ($order == 'price desc') {
            $order = 'MIN(rate) DESC';
        }
    }
}
$data['select'] = $select;
$data['table'] = $tables;
$data['where'] = $whereData;
if (!empty($order)) {
    $data['order'] = $order;
}
$resultSearch = $commonController->getTableData($data);
if (mysql_num_rows($resultSearch)) {
    $index = 0;
    while ($row = mysql_fetch_assoc($resultSearch)) {
        $mapResult[$index] = $row;
        $mapResult[$index]['encoded_id'] = base64_encode($row['id']);
        $dataDeal['select'] = 'd.name as deal_name, d.value as discount ';
        $dataDeal['table'] = 'deals d';
        $dataDeal['where'] = array('d.id = ' . $row['deals'], 'd.status = 1');
        $dataDeal['limit'] = '0,1';
        $resultDeal = $commonController->getTableData($dataDeal);
        if (mysql_num_rows($resultDeal)) {
            $rowDeal = mysql_fetch_array($resultDeal);
            $mapResult[$index]['discount'] = $rowDeal['discount'];
            $mapResult[$index]['deal_name'] = $rowDeal['deal_name'];
        }
Exemplo n.º 7
0
        header('location: index.php');
    }
}
if (empty($_GET['q'])) {
    header('location:' . ADMIN_SITE_URL . '/listingUser.php?userType=' . $_REQUEST['userType']);
}
include 'header.php';
$id = base64_decode($_GET['q']);
$data['select'] = 'users.*, countries.name country_name, states.name state_name, cities.name city_name, districts.name district_name,' . "(SELECT COUNT(id) FROM users_viewed WHERE user_id = users.id) AS viewCount," . "(SELECT COUNT(id) FROM establishments_reviews WHERE reviewed_by = users.id) AS reviewCount," . "(SELECT COUNT(id) FROM establishments WHERE user_id = users.id) AS listingCount," . "(SELECT COUNT(id) FROM establishment_favourite WHERE user_id = users.id) AS favListingCount," . "(SELECT COUNT(id) FROM booking_requests WHERE from_id = users.id AND status='0') AS awaitingBookingCount," . "(SELECT COUNT(id) FROM booking_requests WHERE from_id = users.id AND status='1') AS approvedBookingCount," . "(SELECT COUNT(id) FROM booking_requests WHERE from_id = users.id AND status='2') AS declinedBookingCount";
$data['table'] = 'users LEFT JOIN countries ON users.country_id = countries.id
									LEFT JOIN states ON users.state_id = states.id
									LEFT JOIN cities ON users.city_id = cities.id
									LEFT JOIN districts ON users.district_id = districts.id';
$data['where'] = array('users.id = ' . $id);
$commonController = new CommonController();
$dataUser = $commonController->getTableData($data);
$user = mysql_fetch_assoc($dataUser);
?>
<div class="row">
	<div class="col-md-12 page-header">
		<h1 class="pull-left"><?php 
echo $user['firstname'] != '' ? $user['firstname'] . "'s" : "User's";
?>
 Details</h1>
		<a class="btn btn-primary functionality-link pull-right user-detail-back-btn" href='<?php 
echo ADMIN_SITE_URL . 'listingUser.php?userType=' . $_REQUEST['userType'];
?>
' title="Back"><i class="fa fa-arrow-left"></i></a>
	</div>
</div>
<div class='row'>
Exemplo n.º 8
0
include 'assets/config.php';
if (!empty($_POST['listing_id'])) {
    $listingId = $_POST['listing_id'];
    $commonController = new CommonController();
    $data['table'] = 'booking_requests';
    $data['from_id'] = $_POST['from_id'];
    $data['from_email'] = $_POST['from_email'];
    $data['from_name'] = $_POST['from_name'];
    $data['check_in'] = date('Y-m-d h:i:s', strtotime($_POST['check_in']));
    $data['check_out'] = date('Y-m-d h:i:s', strtotime($_POST['check_out']));
    $data['sent_date'] = date('Y-m-d h:i:s');
    $data['status'] = 0;
    $data['establishment_id'] = $_POST['listing_id'];
    $data['thread_id'] = strtotime(date("Y-m-d h:i:s"));
    $data['status_changed_date'] = date('Y-m-d h:i:s');
    $result = $commonController->getTableData(array('select' => 'u.id, u.username, u.email, e.name as establishment_name', 'table' => 'establishments e INNER JOIN users u ON u.id = e.user_id', 'where' => array('e.id=' . $_POST['listing_id'])));
    if (!empty($result) && mysql_num_rows($result) > 0) {
        $row = mysql_fetch_array($result);
        $data['to_id'] = $row['id'];
        $data['to_name'] = $row['username'];
        $data['to_email'] = $row['email'];
    }
    $msg = "Hi " . $data['to_name'] . ",<br /><br />";
    $msg .= $data['from_name'] . " has contacted you for <a href='" . SITE_URL . "detail.php?q=" . base64_encode($listingId) . "'>" . $row['establishment_name'] . "</a> listing. <br /><br />";
    $msg .= "Following are the details, <br />";
    $msg .= "<ul><li>Rooms: " . $_POST['bookingRooms'] . "</li><li>Adults: " . $_POST['bookingAdults'] . "</li><li>Children: " . $_POST['bookingChildrens'] . "</li><li>Special Request: " . $_POST['bookingMessage'] . "</li></ul>";
    $data['message'] = mysql_escape_string($msg);
    if ($commonController->insertUpdateData($data) > 0) {
        // sent mail
        $commonController->sentMail(array('to' => $data['to_email'], 'from' => $data['from_email'], 'subject' => 'Booking Request regarding ' . $row['establishment_name'], 'message' => $msg));
        $array = array("d" => "1");
Exemplo n.º 9
0
<?php

include 'assets/config.php';
if (!empty($_SESSION['id']) && !empty($_POST['id'])) {
    $commonController = new CommonController();
    $resultReviews = $commonController->getTableData(array('table' => 'establishments_reviews er LEFT JOIN users u ON u.id = er.reviewed_by LEFT JOIN establishments e ON e.id = er.establishment_id', 'select' => 'er.review, er.created_date, u.username, er.id, u.email, e.name as establishment_name, er.establishment_id', 'where' => array('er.id=' . $_POST['id'])));
    if (mysql_num_rows($resultReviews)) {
        $rowReview = mysql_fetch_array($resultReviews);
        $reviewMail = 'Hi ' . $rowReview['username'] . ',<br />';
        $reviewMail .= 'Thank you for your review on <strong>
		<a href="' . SITE_URL . 'detail.php?q=' . base64_encode($rowReview['establishment_id']) . '">' . $rowReview['establishment_name'] . '</a></strong> on ' . date('m-d-Y', strtotime($rowReview['created_date'])) . '<br />';
        $reviewMail .= 'Your review was as below, <br />';
        $reviewMail .= $rowReview['review'] . '<br /><br /><br />';
        $reviewMail .= $_POST['msg'];
        $commonController->sentMail(array('to' => $rowReview['email'], 'subject' => $rowReview['establishment_name'] . ' Review Reply', 'message' => $reviewMail));
        echo '1';
    } else {
        echo '0';
    }
} else {
    echo '0';
}
Exemplo n.º 10
0
<?php

include 'assets/config.php';
if (!empty($_SESSION['id'])) {
    $commonController = new CommonController();
    $result = $commonController->getTableData(array('table' => 'establishment_favourite', 'where' => array('id=' . $_POST['id'])));
    if (mysql_num_rows($result) == 0) {
        $data['table'] = 'establishment_favourite';
        $data['establishment_id'] = $_POST['eid'];
        $data['user_id'] = $_SESSION['id'];
        echo $commonController->insertUpdateData($data);
    } else {
        $data['table'] = 'establishment_favourite';
        $data['id'] = $_POST['id'];
        echo $commonController->deleteData($data);
    }
} else {
    echo '0';
}
Exemplo n.º 11
0
<?php

include 'header.php';
if (!empty($_SESSION['id'])) {
    header('location:' . SITE_URL);
}
$commonController = new CommonController();
if (!empty($_POST['btnSubmit'])) {
    if (!empty($_POST['txtEmail'])) {
        $resultUser = $commonController->getTableData(array('table' => 'users', 'where' => array('email="' . $_POST['txtEmail'] . '"', 'status=1', 'is_delete=0')));
        if (mysql_num_rows($resultUser) > 0) {
            $rowUsers = mysql_fetch_array($resultUser);
            $password = $commonController->randomPassword();
            $data['id'] = $rowUsers['id'];
            $data['password'] = md5($password);
            $data['updated_date'] = date('Y-m-d h:i:s');
            $data['table'] = 'users';
            if ($commonController->insertUpdateData($data)) {
                $registrationMsg = 'Hi ' . $rowUsers['username'] . ', <br /><br />';
                $registrationMsg .= 'You have been successfully reseted your password. <br />';
                $registrationMsg .= 'email: ' . $rowUsers['email'] . ' <br />';
                $registrationMsg .= 'password: '******' <br />';
                $registrationMsg .= 'Please <a href="' . SITE_URL . '">click here</a> to have a look to our SnoozeOver <br />';
                $registrationMsg .= 'Thank you <br />';
                $registrationMsg .= '<br /><br /><small><i>please don\'t replay to this mail</i></small>';
                $commonController->sentMail(array('to' => $rowUsers['email'], 'subject' => 'Forgot Password', 'message' => stripslashes($registrationMsg)));
                $msg = "Password changed successfully and had been mail to you.";
                $class = 'success';
            } else {
                $msg = "Something went wrong, we are looking into it.";
                $class = 'danger';
Exemplo n.º 12
0
			<h2>Find a Place to Snooze</h2>
			<form method="post" action="listing.php" class="form">
				<div class="search-row">
					<div class="search-text">
						<input name="searchField" type="text" class="search-feild border-right border-corner-left" id="searchField" placeholder="Where to Snooze">
						<input type="hidden" name="hdnLatitude" id="hdnLatitude" value="" />
						<input type="hidden" name="hdnLongitude" id="hdnLongitude" value="" />
					</div>
					<div class="search-select">
						<select id="myDropdown" class="search-feild">
							<option value="" data-imagesrc="<?php 
echo $commonController->resize_image('images/common/no-accomodation-image.png', 16);
?>
">Accommodation Type</option>
							<?php 
$dataAccommodationType = $commonController->getTableData(array('table' => 'accommodations', 'order' => 'name', 'where' => array('status=1', 'is_delete=0')));
if (!empty($dataAccommodationType)) {
    while ($row = mysql_fetch_array($dataAccommodationType)) {
        ?>
									<option value="<?php 
        echo $row['id'];
        ?>
" data-imagesrc="<?php 
        echo $commonController->resize_image(!empty($row['logo']) ? $commonController->getAccomodationFolderPath($row['logo']) : 'images/common/no-accomodation-image.png', 16);
        ?>
" ><?php 
        echo $row['name'];
        ?>
</option>				
								<?php 
    }
Exemplo n.º 13
0
    if ($_POST['txtDuration'] > 0) {
        $dataUpdate['duration'] = $_POST['txtDuration'];
        if ($adminController->insertUpdateData($dataUpdate)) {
            $msg = 'Saved successfully';
            $class = 'success';
        } else {
            $msg = 'Something went wrong. We are looking into it';
            $class = 'danger';
        }
    } else {
        $msg = 'Durations in days should not be zero';
        $class = 'danger';
    }
}
$commonController = new CommonController();
$data = $commonController->getTableData(array('table' => "packages", 'where' => array('price > 0'), 'order' => 'duration'));
?>
<script type="text/javascript">
function confirmDelete(id){
	var r = confirm("Are you sure you want to delete this package!");
	if (r == true) {
		window.location='packages.php?id='+id+'&action=delete';
	}
	else {
		return false;
	}
}
</script>
<div class="row">
	<div class="col-md-12">
		<h1 class="page-header">Packages Management<br /><small><i>Add, Edit and Delete packages</i></small></h1>
Exemplo n.º 14
0
<?php

include 'header.php';
if (empty($_SESSION['id'])) {
    header('location:' . SITE_URL . 'error.php');
}
$id = $_SESSION['id'];
$data['select'] = 'u.*, c.name country_name, s.name state_name, city.name city_name, d.name district_name';
$data['table'] = 'users u LEFT JOIN countries c ON u.country_id = c.id
				  LEFT JOIN states s ON u.state_id = s.id
				  LEFT JOIN cities city ON u.city_id = city.id
				  LEFT JOIN districts d ON u.district_id = d.id';
$data['where'] = array('u.id = ' . $id, 'u.is_delete=0', 'u.status=1');
$commonController = new CommonController();
$dataUser = $commonController->getTableData($data);
$user = mysql_fetch_assoc($dataUser);
?>
<div class="inner-page">
	<h1>Messages from Snoozeover</h1><br />	
	<?php 
$dataMessage['table'] = 'email_records';
$dataMessage['where'] = array('`to` LIKE "%' . $user['email'] . '%"');
$dataMessage['order'] = 'send_on DESC';
$dataResult = $commonController->getTableData($dataMessage);
if (mysql_num_rows($dataResult)) {
    ?>
			<div id="accordion">
			<?php 
    while ($row = mysql_fetch_array($dataResult)) {
        ?>
	
Exemplo n.º 15
0
<?php

include 'assets/config.php';
if (!empty($_SESSION['id']) && !empty($_POST['eid'])) {
    $commonController = new CommonController();
    $resultRate = $commonController->getTableData(array('table' => 'establishment_ratings', 'where' => array('user_id=' . $_SESSION['id'], 'establishment_id=' . $_POST['eid'])));
    $existsId = 0;
    if (mysql_num_rows($resultRate) > 0) {
        $rowRate = mysql_fetch_array($resultRate);
        $existsId = $rowRate['id'];
    }
    $dataRating['table'] = 'establishment_ratings';
    $dataRating['establishment_id'] = $_POST['eid'];
    $dataRating['user_id'] = $_SESSION['id'];
    $dataRating['ratings'] = $_POST['score'];
    if (!empty($_POST['id']) && $_POST['id'] > 0) {
        $dataRating['id'] = $_POST['id'];
    }
    if ($existsId > 0 && !empty($_POST['id'])) {
        echo $commonController->insertUpdateData($dataRating);
    } else {
        if ($existsId > 0 && empty($_POST['id'])) {
            echo '0';
        } else {
            if ($existsId == 0) {
                echo $commonController->insertUpdateData($dataRating);
            }
        }
    }
} else {
    echo '0';
Exemplo n.º 16
0
if (mysql_num_rows($resultPaypalSetting) > 0) {
    $rowPaypalSetting = mysql_fetch_assoc($resultPaypalSetting);
}
$roomsResult = $commonController->getTableData(array('table' => 'establishment_rooms', 'where' => array('id=' . $room_id)));
if (mysql_num_rows($roomsResult) > 0) {
    $rowRooms = mysql_fetch_assoc($roomsResult);
}
$id = $_SESSION['id'];
$data['select'] = 'u.*, c.name country_name, s.name state_name, city.name city_name, d.name district_name';
$data['table'] = 'users u LEFT JOIN countries c ON u.country_id = c.id
				  LEFT JOIN states s ON u.state_id = s.id
				  LEFT JOIN cities city ON u.city_id = city.id
				  LEFT JOIN districts d ON u.district_id = d.id';
$data['where'] = array('u.id = ' . $id, 'u.is_delete=0', 'u.status=1');
$commonController = new CommonController();
$dataUser = $commonController->getTableData($data);
$user = mysql_fetch_assoc($dataUser);
$price = 0;
$resultReservation = $commonController->getTableData(array('table' => 'reservations', 'where' => array('establishment_id=' . $establishment_id)));
if (mysql_num_rows($resultReservation) > 0) {
    $rowReservation = mysql_fetch_assoc($resultReservation);
    $reservationData = json_decode($rowReservation['data'], true);
    $price = $reservationData[0]['price_total'];
}
//die();
?>
<h1>Processing.. Please wait..!!</h1>
<form action="booking_paypal.php?sandbox=<?php 
echo $rowPaypalSetting['mode'] == 0 ? '1' : '0';
?>
" method="post" id="myForm" name="myForm" style="display:none;"> 
Exemplo n.º 17
0
 $data['email'] = $_REQUEST['email'];
 $data['created_date'] = date('Y-m-d h:i:s');
 $data['password'] = md5($password);
 $data['type'] = empty($_REQUEST['t']) ? '0' : '1';
 $data['status'] = 1;
 $data['subscribed_on'] = date('Y-m-d h:i:s');
 $data['is_delete'] = 0;
 $data['table'] = 'users';
 if ($_REQUEST['st'] == 'fb') {
     $data['facebook_id'] = $_REQUEST['id'];
 } else {
     if ($_REQUEST['st'] == 'google') {
         $data['google_id'] = $_REQUEST['id'];
     }
 }
 $resultUser = $commonController->getTableData(array('table' => $data['table'], 'where' => array('email="' . $_REQUEST['email'] . '"')));
 if (mysql_num_rows($resultUser) > 0) {
     $rowUser = mysql_fetch_array($resultUser);
     $_SESSION['id'] = $rowUser['id'];
     $_SESSION['type'] = $rowUser['type'];
     $_SESSION['username'] = $rowUser['username'];
     $_SESSION['image'] = $rowUser['image'];
 } else {
     // insert if not exists
     if ($adminController->checkRecordUniqueNess(array('table' => $data['table'], 'column' => 'email', 'value' => $data['email'])) == 0) {
         $insertedId = $commonController->insertUpdateData($data);
         if ($insertedId > 0) {
             $registrationMsg = 'Hi ' . $data['username'] . ', <br /><br />';
             $registrationMsg .= 'You have been successfully registered with Snoozeover site. <br />';
             $registrationMsg .= 'email: ' . $data['email'] . ' <br />';
             $registrationMsg .= 'password: '******' <br />';
Exemplo n.º 18
0
<?php

include 'header.php';
if (empty($_GET['q'])) {
    header('location:' . SITE_URL);
}
$commonController = new CommonController();
$id = base64_decode($_GET['q']);
$data['table'] = 'establishments e';
$data['where'] = array('e.is_delete = 0', 'e.status = 1', 'e.id=' . $id);
$resultData = $commonController->getTableData($data);
$dataGallery['table'] = 'establishments_gallery';
$dataGallery['where'] = array('establishment_id=' . $id);
$resultGalleryData = $commonController->getTableData($dataGallery);
if (mysql_num_rows($resultGalleryData)) {
    while ($rowGallery = mysql_fetch_array($resultGalleryData)) {
        if ($rowGallery['type'] == 1) {
            $existingGallery['id'][] = $rowGallery['id'];
            $existingGallery['path'][] = $rowGallery['path'];
        } else {
            $existingVideoGallery['id'] = $rowGallery['id'];
            $existingVideoGallery['path'] = $rowGallery['path'];
        }
    }
}
$resultReviews = $commonController->getTableData(array('select' => 'er.*, u.username', 'table' => 'establishments_reviews er LEFT JOIN `users` u ON u.id=er.reviewed_by', 'where' => array('er.establishment_id=' . $id), 'order' => 'created_date desc'));
$dataFacilities['table'] = 'establishments_facilities ef LEFT JOIN facilities f ON f.id = ef.facility_id';
$dataFacilities['where'] = array('ef.establishment_id=' . $id);
$resultFacilitiesData = $commonController->getTableData($dataFacilities);
$dataLanguages['table'] = 'establishments_languages el';
$dataLanguages['where'] = array('el.establishment_id=' . $id);
<?php

include 'assets/config.php';
if (!empty($_SESSION['id']) && !empty($_POST['id'])) {
    $status = array('0' => 'Awaiting Approval', '1' => 'Approved', '2' => 'Declined');
    $commonController = new CommonController();
    $resultReviews = $commonController->getTableData(array('table' => 'booking_requests br LEFT JOIN establishments e ON e.id = br.establishment_id', 'select' => 'br.*, e.name as establishment_name', 'where' => array('br.id=' . $_POST['id'])));
    if (mysql_num_rows($resultReviews)) {
        $row = mysql_fetch_array($resultReviews);
        $rowBookingStatusMail = 'Hi ' . $row['from_name'] . ',<br />';
        $rowBookingStatusMail .= 'Thank you for your booking request for <strong>
		<a href="' . SITE_URL . 'detail.php?q=' . base64_encode($row['listing_id']) . '">' . $row['establishment_name'] . '</a></strong> on ' . date('m-d-Y', strtotime($row['sent_date'])) . '<br />';
        $rowBookingStatusMail .= 'Your requirement meesage was as below, <br />';
        $rowBookingStatusMail .= $row['message'] . '<br /><br /><br />';
        $rowBookingStatusMail .= 'Your current request status is : ' . $status[$_POST['status']];
        $updateData['table'] = 'booking_requests';
        $updateData['id'] = $_POST['id'];
        $updateData['status'] = $_POST['status'];
        $updateData['status_changed_date'] = date('Y-m-d h:i:s');
        $commonController->insertUpdateData($updateData);
        $commonController->sentMail(array('to' => $row['from_email'], 'subject' => $row['establishment_name'] . ' Booking Request', 'message' => $rowBookingStatusMail));
        echo '1';
    } else {
        echo '0';
    }
} else {
    echo '0';
}
$data['child_allowed'] = '1';
$data['child_age_from'] = '';
$data['child_age_to'] = '';
$data['stay_type'] = '';
$data['stay_value'] = '';
$data['cancellation_policy'] = '';
$data['things_to_do'] = '';
$data['deals'] = '';
$data['table'] = 'establishments';
$hdnUserName = '';
$hdnEmail = '';
$commonController = new CommonController();
$adminController = new AdminController();
/*-------- fetch meals------*/
$selectmeals = '';
$mealsResult = $commonController->getTableData(array('table' => 'meals', 'where' => array("status='1'")));
if (!empty($mealsResult)) {
    while ($rowmeals = mysql_fetch_array($mealsResult)) {
        $selectmeals .= '<option value="' . $rowmeals['id'] . '" > ' . $rowmeals['meal'] . '</option>';
    }
}
/*-------- fetch days------*/
$selectdays = '';
$timestamp = strtotime('next Monday');
for ($i = 0; $i < 7; $i++) {
    $selectdays .= '<option value="' . sprintf("%s", strftime('%A', $timestamp)) . '" > ' . sprintf("%s", strftime('%A', $timestamp)) . '</option>';
    $timestamp = strtotime('+1 day', $timestamp);
}
?>
<link href="assets/css/jquery.filer.css" type="text/css" rel="stylesheet" />
<link href="assets/css/themes/jquery.filer-dragdropbox-theme.css" type="text/css" rel="stylesheet" />
Exemplo n.º 21
0
<?php

include 'header.php';
$msg = '';
$class = '';
$hdnName = '';
$display = 'style="display:none"';
$data['id'] = '';
$data['name'] = '';
$data['value'] = '';
$data['status'] = '';
$data['table'] = 'deals';
$commonController = new CommonController();
if (!empty($_GET['q'])) {
    $data['id'] = base64_decode($_GET['q']);
    $result = $commonController->getTableData($data);
    if (!empty($result)) {
        $row = mysql_fetch_array($result);
        $hdnName = $row['name'];
        $data['name'] = $row['name'];
        $data['value'] = $row['value'];
        $data['status'] = $row['status'];
    }
}
if (!empty($_POST['btnSubmit'])) {
    $data['name'] = $_POST['txtName'];
    $data['status'] = $_POST['rdoStatus'];
    $data['value'] = $_POST['txtValue'];
    if (!empty($_POST['hdnId'])) {
        $data['id'] = $_POST['hdnId'];
    }
Exemplo n.º 22
0
if ($_REQUEST[block] == '1') {
    $msg = 'Accommodation activated.';
    $class = 'success';
} else {
    if ($_REQUEST[block] == '0') {
        $msg = 'Accommodation de-activated.';
        $class = 'warning';
    } else {
        if ($_REQUEST[block] == 'fail') {
            $msg = 'Could not perform any action on this Accommodation. Please try again.';
            $class = 'danger';
        }
    }
}
$commonController = new CommonController();
$data = $commonController->getTableData(array('table' => "accommodations", 'order' => 'name ASC'));
?>
<script type="text/javascript">
function confirmDelete(id){
	var r = confirm("Are you sure you want to delete this accommodation!");
	if (r == true) {
		window.location='accommodations.php?id='+id+'&action=delete';
	}
	else {
		return false;
	}
}
</script>
<div class="row">
	<div class="col-md-12">
		<h1 class="page-header">Accommodations Management<br /><small><i>Add, Edit and Delete accommodations</i></small></h1>
Exemplo n.º 23
0
		<div class="panel-body">
			<div class="table-responsive">
				<table class="table table-striped table-bordered table-hover" id="dataTables-example">
					<thead>
						<tr>
							<th>S.No</th>
							<th>Name</th>
							<th>Status</th>
							<th>Deleted</th>
							<th>Action</th>
						</tr>
					</thead>
					<tbody>
					<?php 
$commonController = new CommonController();
$data = $commonController->getTableData(array('table' => "facilities", 'order' => 'name'));
if (!empty($data)) {
    $cnt = 1;
    while ($row = mysql_fetch_array($data)) {
        ?>
								<tr>
									<td><?php 
        echo $cnt;
        ?>
</td>
									<td><?php 
        echo $row['name'];
        ?>
</td>
									<td>
										<label class="radio-inline">
Exemplo n.º 24
0
<?php

include 'header.php';
$commonController = new CommonController();
if (!empty($_POST['btnContactUs'])) {
    $resultAdmin = $commonController->getTableData(array('table' => 'admin-user', 'where' => array('id=1')));
    if (mysql_num_rows($resultAdmin)) {
        $row = mysql_fetch_assoc($resultAdmin);
        $commonController->sentMail(array('to' => $row['email'], 'subject' => $_POST['txtSubject'], 'from' => $_POST['txtFrom'], 'message' => $_POST['txtMessage']));
        $msg = "Thank you for contacting us. We will get into touch with you soon.";
        $class = 'success';
    } else {
        $msg = "Sorry..!! But unfortunately something went wrong while processing your request. Please try after sometime";
        $class = 'danger';
    }
}
?>
<div class="inner-page">
	<h1>Contact Us</h1>
	<p>Happy to help you.</p> <br />

	<form method="POST" class="contact-us col-lg-4">
		<div class="checkin-form margin-1">
			<?php 
$name = '';
$email = '';
if (!empty($_SESSION['id'])) {
    $dataUser['table'] = 'users';
    $dataUser['where'] = array('id=' . $_SESSION['id'], 'status=1', 'is_delete=0');
    $resultUser = $commonController->getTableData($dataUser);
    if (mysql_num_rows($resultUser) > 0) {
Exemplo n.º 25
0
$dataBookingInfo['select'] = 'br.*, e.name, e.logo';
$statusLabel = 'All';
$incoming = '';
if (!empty($_GET['q'])) {
    $statusLabel = $status[base64_decode($_GET['q'])];
    if (empty($_GET['incoming'])) {
        $dataBookingInfo['where'] = array('br.status=' . base64_decode($_GET['q']), 'br.from_id=' . $user_id);
    } else {
        $incoming = 'Incoming ';
        $dataBookingInfo['where'] = array('br.status=' . base64_decode($_GET['q']), 'br.to_id=' . $user_id);
    }
} else {
    $dataBookingInfo['where'] = array('br.from_id=' . $user_id);
}
$dataBookingInfo['order'] = 'br.sent_date DESC';
$resultBookingInfo = $commonController->getTableData($dataBookingInfo);
?>
<div class="inner-page">
<h1><?php 
echo ucFirst($incoming . $statusLabel);
?>
 Booking Request</h1><br />
	<div class="row">
		<div class="col-lg-12">
			<div class="panel panel-default">
				<div class="panel-body">
				<?php 
if (mysql_num_rows($resultBookingInfo)) {
    while ($row = mysql_fetch_array($resultBookingInfo)) {
        ?>
							<div class="listing-item">
            $class = 'success';
            $display = 'style="display:block"';
        } else {
            $msg = 'Something went wrong. We are looking into it';
            $class = 'danger';
            $display = 'style="display:block"';
        }
    } else {
        $class = 'danger';
        $display = 'style="display:block"';
    }
}
if (!empty($_GET['q'])) {
    $data['id'] = base64_decode($_GET['q']);
    $data['where'] = array('user_id=' . $user_id);
    $result = $commonController->getTableData($data);
    if (mysql_num_rows($result)) {
        $row = mysql_fetch_array($result);
        $data['user_id'] = $user_id;
        $data['name'] = $row['name'];
        $data['logo'] = $row['logo'];
        $data['description'] = $row['description'];
        $data['email'] = $row['email'];
        $data['country_id'] = $row['country_id'];
        $data['state_id'] = $row['state_id'];
        $data['city_id'] = $row['city_id'];
        $data['district_id'] = $row['district_id'];
        $data['latitude'] = $row['latitude'];
        $data['longitude'] = $row['longitude'];
        $data['telephone'] = $row['telephone'];
        $data['mobile'] = $row['mobile'];
Exemplo n.º 27
0
<?php

/*
* Title                   : Booking Calendar PRO (jQuery Plugin)
* Version                 : 2.0
* File                    : save.php
* File Version            : 2.0
* Created / Last Modified : 29 September 2014
* Author                  : Dot on Paper
* Copyright               : © 2011 Dot on Paper
* Website                 : http://www.dotonpaper.net
* Description             : Save booking data in database.
*/
include '../../assets/config.php';
if (!empty($_POST['dopbcp_calendar_id']) && !empty($_GET['r']) && $_GET['r'] != "0") {
    // If calendar ID is received.
    $commonController = new CommonController();
    $data['table'] = 'schedule';
    $data['where'] = array('establishment_id=' . $_POST['dopbcp_calendar_id'], 'room_id=' . $_GET['r']);
    $resultSchedule = $commonController->getTableData($data);
    if (mysql_num_rows($resultSchedule)) {
        $row = mysql_fetch_array($resultSchedule);
        $dataSave['id'] = $row['id'];
    }
    $dataSave['establishment_id'] = $_POST['dopbcp_calendar_id'];
    $dataSave['data'] = $_POST['dopbcp_schedule'];
    $dataSave['table'] = 'schedule';
    $dataSave['room_id'] = $_GET['r'];
    $commonController->insertUpdateData($dataSave);
}
            $msg = 'Saved successfully';
            $class = 'success';
            $display = 'style="display:block"';
        } else {
            $msg = 'Something went wrong. We are looking into it';
            $class = 'danger';
            $display = 'style="display:block"';
        }
    } else {
        $class = 'danger';
        $display = 'style="display:block"';
    }
}
if (!empty($_GET['q'])) {
    $data['id'] = base64_decode($_GET['q']);
    $result = $commonController->getTableData($data);
    if (!empty($result)) {
        $row = mysql_fetch_array($result);
        $data['user_id'] = $row['user_id'];
        $data['name'] = $row['name'];
        $data['logo'] = $row['logo'];
        $data['description'] = $row['description'];
        $data['email'] = $row['email'];
        $data['country_id'] = $row['country_id'];
        $data['state_id'] = $row['state_id'];
        $data['city_id'] = $row['city_id'];
        $data['district_id'] = $row['district_id'];
        $data['latitude'] = $row['latitude'];
        $data['longitude'] = $row['longitude'];
        $data['telephone'] = $row['telephone'];
        $data['mobile'] = $row['mobile'];
Exemplo n.º 29
0
$data['city_id'] = '';
$data['district_id'] = '';
$data['fax'] = '';
$data['postal_code'] = '';
$data['facebook_url'] = '';
$data['twitter_url'] = '';
$data['sms_time'] = '';
$data['table'] = 'users';
$hdnUserName = '';
$hdnEmail = '';
$hdnContact = '';
$commonController = new CommonController();
$adminController = new AdminController();
if (!empty($_GET['q'])) {
    $data['id'] = base64_decode($_GET['q']);
    $result = $commonController->getTableData($data);
    if (!empty($result)) {
        $row = mysql_fetch_array($result);
        $hdnUserName = $row['username'];
        $hdnEmail = $row['email'];
        $hdnContact = $row['contact'];
        $data['firstname'] = $row['firstname'];
        $data['lastname'] = $row['lastname'];
        $data['username'] = $row['username'];
        $data['email'] = $row['email'];
        $data['password'] = $row['password'];
        $data['image'] = $row['image'];
        $data['address'] = $row['address'];
        $data['contact'] = $row['contact'];
        $data['type'] = $row['type'];
        $data['status'] = $row['status'];
Exemplo n.º 30
0
">
			</div>
			<div class="filter-calender">
				<input name="check-out" type="text" placeholder="Check Out" class="filter-feild calender-icon check-out filter-check-out" value="<?php 
echo !empty($_POST['check-out']) ? $_POST['check-out'] : '';
?>
">
			</div>
			<div class="filter-lable">
				<a class="clear-dates" style="color:#fff; text-decoration:none;">Clear Dates</a>
			</div>
			<div class="filter-select"> 
				<select id="myDropdownListing" class="filter-feild filter-accommodation">
					<option value="">Accommodation Type</option>
					<?php 
$dataAccommodationType = $commonController->getTableData(array('table' => 'accommodations', 'order' => 'name', 'where' => array('status=1', 'is_delete=0')));
if (!empty($dataAccommodationType)) {
    while ($row = mysql_fetch_array($dataAccommodationType)) {
        ?>
					<option <?php 
        echo !empty($_POST['accommodation']) && $_POST['accommodation'] == $row['id'] || !empty($_POST['filterAccommodation']) && $_POST['filterAccommodation'] == $row['id'] ? 'selected' : '';
        ?>
 value="<?php 
        echo $row['id'];
        ?>
" data-imagesrc="<?php 
        echo $commonController->resize_image(!empty($row['logo']) ? $commonController->getAccomodationFolderPath($row['logo']) : 'images/common/no-accomodation-image.png', 16);
        ?>
" ><?php 
        echo $row['name'];
        ?>