当前位置: 首页>>代码示例>>PHP>>正文


PHP CommonController::getTableData方法代码示例

本文整理汇总了PHP中CommonController::getTableData方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonController::getTableData方法的具体用法?PHP CommonController::getTableData怎么用?PHP CommonController::getTableData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommonController的用法示例。


在下文中一共展示了CommonController::getTableData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

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 
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:account.php

示例2: CommonController

<?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 "";
}
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:13,代码来源:get_room_by_establishment_id.php

示例3: CommonController

<?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');
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:paypal.php

示例4:

    }
}
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'] : '';
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:listing.php

示例5: CommonController

<?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 -->
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:header22ndAug.php

示例6: while

    $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'];
        }
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:ajax_get_map_listing.php

示例7: header

        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'>
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:view_users.php

示例8: CommonController

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");
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:booking_request.php

示例9: CommonController

<?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';
}
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:22,代码来源:review_reply.php

示例10: CommonController

<?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';
}
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:19,代码来源:update_favourite.php

示例11: header

<?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: ' . $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';
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:forgot_password.php

示例12: array

			<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 
    }
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:index.php

示例13: confirmDelete

    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>
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:packages.php

示例14: header

<?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)) {
        ?>
	
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:30,代码来源:site_messages.php

示例15: CommonController

<?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';
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:submit_ratings.php


注:本文中的CommonController::getTableData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。