本文整理汇总了PHP中CommonController::insertUpdateData方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonController::insertUpdateData方法的具体用法?PHP CommonController::insertUpdateData怎么用?PHP CommonController::insertUpdateData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonController
的用法示例。
在下文中一共展示了CommonController::insertUpdateData方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
$data['updated_date'] = date('Y-m-d h:i:s');
$sendRegisterMail = false;
} else {
$password = $commonController->randomPassword();
$data['password'] = md5($password);
$data['created_date'] = date('Y-m-d h:i:s');
$sendRegisterMail = false;
}
if ($uploadFlag) {
$resultPackage = $commonController->getTableData(array('table' => 'packages', 'where' => array('price=0')));
if (mysql_num_rows($resultPackage) > 0) {
$rowPackages = mysql_fetch_array($resultPackage);
$data['subscription_id'] = $rowPackages['id'];
$data['subscribed_on'] = date('Y-m-d h:i:s');
}
if ($commonController->insertUpdateData($data) > 0) {
if ($sendRegisterMail) {
$registrationMsg = 'Hi ' . $data['username'] . ', <br /><br />';
$registrationMsg .= 'You have been successfully registered with Snoozeover site. <br />';
$registrationMsg .= 'email: ' . $data['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' => $data['email'], 'subject' => 'Registration Mail', 'message' => $registrationMsg));
}
header("location:listingUser.php?userType=" . $_REQUEST['userType'] . "&save=success");
} else {
$msg = 'Something went wrong. We are looking into it';
$class = 'danger';
}
示例2: array
$data['payer_email'] = $_POST['payer_email'];
$data['verify_sign'] = $_POST['verify_sign'];
$data['payment_type'] = $_POST['payment_type'];
$data['receiver_email'] = $_POST['receiver_email'];
$data['txn_type'] = $_POST['txn_type'];
$data['item_name'] = $_POST['item_name'];
$data['ipn_track_id'] = $_POST['ipn_track_id'];
$data['payment_for'] = 0;
// 0-upgradation, 1-booking
$data['paypal_log'] = print_r($_POST, true);
$data['table'] = 'paypal_transaction';
$data['where'] = array('txn_id=' . $_POST["txn_id"]);
$resultPaypalTransaction = $commonController->getTableData($data);
if (mysql_num_rows($resultPaypalTransaction) == 0) {
$data['created_date'] = date('Y-m-d h:i:s');
$id = $commonController->insertUpdateData($data);
$data['id'] = $id;
} else {
$row = mysql_fetch_array($resultPaypalTransaction);
$data['updated_date'] = date('Y-m-d h:i:s');
$data['id'] = $row['id'];
$commonController->insertUpdateData($data);
}
// Save and update the logs array
$paypal_log_fetch = mysql_fetch_array(mysql_query($log_query));
$paypal_log_id = $paypal_log_fetch["id"];
if ($p->validate_ipn()) {
// validate the IPN, do the others stuffs here as per your app logic
$commonController->insertUpdateData(array('table' => 'users', 'subscription_id' => $subscription_id, 'id' => $user_id, 'subscribed_on' => date('Y-m-d h:i:s')));
$subject = 'Instant Payment Notification - Recieved Payment';
//$p->send_report($subject); // Send the notification about the transaction
示例3: array
$flag = 0;
//$msg = 'Username and Email must be unique.';
$msg = 'Mobile number must be unique.';
$class = 'danger';
} else {
$flag = 1;
}
}
if ($uploadFlag && $flag) {
$resultPackage = $commonController->getTableData(array('table' => 'packages', 'where' => array('price=0')));
if (mysql_num_rows($resultPackage) > 0) {
$rowPackages = mysql_fetch_array($resultPackage);
$data['subscription_id'] = $rowPackages['id'];
$data['subscribed_on'] = date('Y-m-d h:i:s');
}
$insertedId = $commonController->insertUpdateData($data);
if ($insertedId > 0) {
if ($sendRegisterMail) {
$registrationMsg = 'Hi ' . $data['firstname'] . ', <br /><br />';
$registrationMsg .= 'You have been successfully registered with Snoozeover site. <br />';
$registrationMsg .= 'email: ' . $data['email'] . ' <br />';
$registrationMsg .= 'password: ' . $_POST['txtPassword'] . ' <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 reply to this mail</i></small>';
$commonController->sentMail(array('to' => $data['email'], 'subject' => 'Registration Mail', 'message' => $registrationMsg));
}
$_SESSION['id'] = $insertedId;
$_SESSION['username'] = $data['firstname'];
$_SESSION['type'] = $data['type'];
header('location:account.php');
示例4: foreach
$data['description'] = $_POST['txtDescription'];
$data['email'] = $_POST['txtEmail'];
$data['country_id'] = $_POST['ddlCountry'];
$data['state_id'] = $_POST['ddlState'];
$data['city_id'] = $_POST['ddlCity'];
$data['district_id'] = $_POST['ddlDistrict'];
$data['telephone'] = $_POST['hdnTelephone'];
$data['mobile'] = $_POST['txtMobile'];
$data['fax'] = $_POST['txtFax'];
$data['address'] = $_POST['txtAddress'];
$data['postal_code'] = $_POST['txtPostalCode'];
$data['facebook_url'] = !empty($_POST['txtFacebookUrl']) ? FACEBOOK_URL . $_POST['txtFacebookUrl'] : '';
$data['twitter_url'] = !empty($_POST['txtTwitterUrl']) ? TWITTER_URL . $_POST['txtTwitterUrl'] : '';
$data['status'] = 2;
$data['is_delete'] = 0;
$id = $commonController->insertUpdateData($data);
if ($id > 0) {
for ($i = 0; $i < count($_POST['txtStartWorkingTime']); $i++) {
foreach ($_POST['days' . $i] as $value) {
$dataWorkingDays['table'] = 'establishments_working_days';
$dataWorkingDays['day'] = $value;
$dataWorkingDays['establishment_id'] = $id;
$dataWorkingDays['in_time'] = $_POST['txtStartWorkingTime'][$i];
$dataWorkingDays['out_time'] = $_POST['txtEndWorkingTime'][$i];
$retValWOrkingDays = $commonController->insertUpdateData($dataWorkingDays);
}
}
//
foreach ($_POST['language_type'] as $langvalue) {
$dataLang['table'] = 'establishments_languages';
$dataLang['establishment_id'] = $id;
示例5: CommonController
<?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);
}
示例6: CommonController
<?php
include 'assets/config.php';
if (!empty($_SESSION['id']) && !empty($_POST['id'])) {
$commonController = new CommonController();
$dataReview['table'] = 'establishments_reviews';
$dataReview['establishment_id'] = $_POST['id'];
$dataReview['review'] = mysql_escape_string($_POST['msg']);
$dataReview['reviewed_by'] = $_SESSION['id'];
$dataReview['created_date'] = date('Y-m-d h:i:s');
echo $commonController->insertUpdateData($dataReview);
} else {
echo '0';
}
示例7: array
<?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';
}
示例8: CommonController
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';
}
示例9: array
$resultFacilitiesData = $commonController->getTableData($dataFacilities);
$dataLanguages['table'] = 'establishments_languages el';
$dataLanguages['where'] = array('el.establishment_id=' . $id);
$resultLanguageData = $commonController->getTableData($dataLanguages);
$roomsResult = $commonController->getTableData(array('table' => 'establishment_rooms', 'where' => array('establishment_id=' . $id)));
// if user is logged in, add the establishment into user viewed table
if (!empty($_SESSION['id'])) {
$dataViewed['table'] = 'users_viewed';
$dataViewed['where'] = array('user_id=' . $_SESSION['id'], 'establishment_id=' . $id);
$resultViewed = $commonController->getTableData($dataViewed);
if (mysql_num_rows($resultViewed) == 0) {
$dataInsertView['table'] = 'users_viewed';
$dataInsertView['user_id'] = $_SESSION['id'];
$dataInsertView['establishment_id'] = $id;
$dataInsertView['viewed_on'] = date('Y-m-d h:i:s');
$commonController->insertUpdateData($dataInsertView);
}
}
?>
<div class="inner-page">
<?php
if (mysql_num_rows($resultData)) {
$row = mysql_fetch_array($resultData);
?>
<div class="product-detail-wrap">
<div class="detail-blank">
<!-- <div class="beadcrum">
<a href="#">Home </a>
<a href="#">Listing Page</a>
<a href="#">Listing Detail</a>
示例10: array
$data['payer_email'] = $_POST['payer_email'];
$data['verify_sign'] = $_POST['verify_sign'];
$data['payment_type'] = $_POST['payment_type'];
$data['receiver_email'] = $_POST['receiver_email'];
$data['txn_type'] = $_POST['txn_type'];
$data['item_name'] = $_POST['item_name'];
$data['ipn_track_id'] = $_POST['ipn_track_id'];
$data['payment_for'] = 1;
// 0-upgradation, 1-booking
$data['paypal_log'] = print_r($_POST, true);
$data['table'] = 'paypal_transaction';
$data['where'] = array('txn_id=' . $_POST["txn_id"]);
$resultPaypalTransaction = $commonController->getTableData($data);
if (mysql_num_rows($resultPaypalTransaction) == 0) {
$data['created_date'] = date('Y-m-d h:i:s');
$id = $commonController->insertUpdateData($data);
$data['id'] = $id;
} else {
$row = mysql_fetch_array($resultPaypalTransaction);
$data['updated_date'] = date('Y-m-d h:i:s');
$data['id'] = $row['id'];
$commonController->insertUpdateData($data);
}
// Save and update the logs array
if ($p->validate_ipn()) {
// validate the IPN, do the others stuffs here as per your app logic
$dataOrder = array('table' => 'orders', 'establishment_id' => $establishment_id, 'user_id' => $user_id, 'status' => 1);
$roomsResult = $commonController->getTableData(array('table' => 'establishment_rooms', 'where' => array('id=' . $room_id)));
if (mysql_num_rows($roomsResult) > 0) {
$rowRooms = mysql_fetch_assoc($roomsResult);
$dataOrder['room_name'] = $rowRooms['name'];