本文整理汇总了PHP中get_currency_code函数的典型用法代码示例。如果您正苦于以下问题:PHP get_currency_code函数的具体用法?PHP get_currency_code怎么用?PHP get_currency_code使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_currency_code函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_currency_symbol
<p> <span><?php
if ($list_staus->num_rows() == 0) {
echo 'List Deletion';
} else {
echo $row->name;
}
?>
</span>
<?php
if (isset($topay) && $topay != '' && $paid != 1) {
if ($hostpaid != 1 && $guestpaid != 1) {
// $topay = get_currency_value2($currency,$topay);
?>
<br>
<span><?php
echo get_currency_symbol($row->list_id) . get_currency_value_lys($currency, get_currency_code(), $topay);
?>
</span>
<?php
}
}
?>
</p>
</div>
<?php
}
?>
</li>
<?php
}
} else {
示例2: get_currency_symbol1
<a style="background-image:url(<?php
echo $image;
?>
);background-size: cover;" class="media-photo media-cover wishlist-bg-img" href="/rooms/281390">
</a>
<div class="panel-overlay-bottom-left panel-overlay-label panel-overlay-listing-label">
<sup class="h6 text-contrast" style="font-size: 14px;"><?php
echo get_currency_symbol1();
?>
</sup>
<span class="h3 price-amount" style="font-size: 24px;"><?php
echo get_currency_value1($row->list_id, $row->price);
?>
</span>
<sup class="h6 text-contrast" style="font-size: 14px;"><?php
echo get_currency_code();
?>
</sup>
</div>
<div class="panel-overlay-top-right wl-social-connection-panel">
<span class="rich-toggle wish_list_button wishlist-button not_saved">
<label for="">
<?php
$wishlist_user_check = $this->Common_model->getTableData('user_wishlist', array('list_id' => $row->list_id, 'user_id' => $this->dx_auth->get_user_id()));
if (!$this->dx_auth->is_logged_in()) {
?>
<img class="search_heart_normal search_heart" id="<?php
echo $row->list_id;
?>
示例3: ajax_refresh_subtotal
//.........这里部分代码省略.........
$per_night = round($perDay, 2);
if ($differNights > 0) {
$addAmount = $differNights * $per_night;
$finalAmount = $Wprice + $addAmount;
}
$price = $finalAmount;
//Additional guests
if ($data['guests'] > $guests) {
$diff_days = $data['guests'] - $guests;
$price = $price + $days * $xprice->addguests * $diff_days;
$extra_guest = 1;
$extra_guest_price = $xprice->addguests * $diff_days;
}
}
}
if ($days >= 30) {
if (!empty($Mprice)) {
$finalAmount = $Mprice;
$differNights = $days - 30;
$perDay = $Mprice / 30;
$per_night = round($perDay, 2);
if ($differNights > 0) {
$addAmount = $differNights * $per_night;
$finalAmount = $Mprice + $addAmount;
}
$price = $finalAmount;
//Additional guests
if ($data['guests'] > $guests) {
$diff_days = $data['guests'] - $guests;
$price = $price + $days * $xprice->addguests * $diff_days;
$extra_guest = 1;
$extra_guest_price = $xprice->addguests * $diff_days;
}
}
}
if ($row->is_premium == 1) {
if ($row->is_fixed == 1) {
$fix = $row->fixed_amount;
$amt = $price + $fix;
$data['commission'] = $fix;
$Fprice = $amt;
} else {
$per = $row->percentage_amount;
$camt = floatval($price * $per / 100);
$amt = $price + $camt;
$data['commission'] = $camt;
$Fprice = $amt;
}
if ($Wprice == 0) {
$data['Wprice'] = $price * 7;
} else {
$data['Wprice'] = $Wprice;
}
if ($Mprice == 0) {
$data['Mprice'] = $price * 30;
} else {
$data['Mprice'] = $Mprice;
}
}
$xprice = $this->Common_model->getTableData('list', array('id' => $id))->row();
if ($cleaning != 0) {
$price = $price + $cleaning;
}
if ($security != 0) {
$price = $price + $security;
}
$data['price'] = $price;
}
}
$query = $this->db->query("SELECT id,list_id FROM `calendar` WHERE `list_id` = '" . $id . "' AND (`booked_days` = '" . get_gmt_time(strtotime($checkin)) . "' OR `booked_days` = '" . get_gmt_time(strtotime($checkout)) . "') GROUP BY `list_id`");
$rows = $query->num_rows();
$daysexist = $this->db->query("SELECT id,list_id,booked_days FROM `calendar` WHERE `list_id` = '" . $id . "' AND (`booked_days` >= '" . get_gmt_time(strtotime($checkin)) . "' AND `booked_days` <= '" . get_gmt_time(strtotime($checkout)) . "') GROUP BY `list_id`");
$rowsexist = $daysexist->num_rows();
if ($rowsexist > 0) {
if (isset($extra_guest)) {
if ($extra_guest == 1) {
echo '{"available":false,"extra_guest":1,"extra_guest_price":"' . get_currency_symbol($id) . get_currency_value1($id, $extra_guest_price) . '","total_price":' . $data['price'] . ',"reason_message":"Those dates are not available"}';
}
} else {
echo '{"available":false,"total_price":' . $data['price'] . ',"reason_message":"Those dates are not available"}';
}
} else {
if ($data['guests'] > $capacity) {
echo '{"available":false,"total_price":' . $data['price'] . ',"reason_message":"' . $capacity . ' guest(s) only allowed"}';
} else {
$this->session->set_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'", $data['price']);
$staggered_price = "";
if ($days >= 30) {
$staggered_price = ',"staggered_price":"' . get_currency_symbol($id) . get_currency_value1($id, $data['price']) . '","staggered":false';
}
if (isset($extra_guest)) {
if ($extra_guest == 1) {
echo '{"service_fee":"' . get_currency_symbol($id) . get_currency_value_lys($row->currency, get_currency_code(), $data['commission']) . '","extra_guest_price":"' . get_currency_symbol($id) . get_currency_value1($id, $extra_guest_price) . '","extra_guest":1,"reason_message":"","price_per_night":"' . get_currency_symbol($id) . get_currency_value1($id, $per_night) . '","nights":' . $days . ',"available":true,"can_instant_book":false,"total_price":"' . get_currency_symbol($id) . get_currency_value1($id, $data['price']) . '"' . $staggered_price . '}';
}
} else {
echo '{"service_fee":"' . get_currency_symbol($id) . get_currency_value_lys($row->currency, get_currency_code(), $data['commission']) . '","reason_message":"","price_per_night":"' . get_currency_symbol($id) . get_currency_value1($id, $per_night) . '","nights":' . $days . ',"available":true,"can_instant_book":false,"total_price":"' . get_currency_symbol($id) . get_currency_value1($id, $data['price']) . '"' . $staggered_price . '}';
}
}
}
}
示例4: ajax_get_results
//.........这里部分代码省略.........
}
if ($sort == 2) {
$order = "ORDER BY price ASC";
} else {
if ($sort == 3) {
$order = "ORDER BY price DESC";
} else {
if ($sort == 4) {
$order = "ORDER BY id DESC";
} else {
$order = "ORDER BY id ASC";
}
}
}
$query_status = $this->db->where($condition)->get('list');
if ($query_status->num_rows() != 0) {
foreach ($query_status->result() as $row_status) {
$result_status = $this->db->where('id', $row_status->id)->get('lys_status');
if ($result_status->num_rows() != 0) {
$result_status = $result_status->row();
$total = $result_status->calendar + $result_status->price + $result_status->overview + $result_status->photo + $result_status->address + $result_status->listing;
if ($total != 6) {
$condition .= " AND (`id` != '" . $row_status->id . "')";
}
}
}
}
if ($min == '' && $max == '') {
} else {
$query_price = $this->db->where($condition)->get('list');
if ($query_price->num_rows() != 0) {
foreach ($query_price->result() as $row_price) {
$check_price = get_currency_value1($row_price->id, $row_price->price);
$max = get_currency_value_lys(get_currency_code(), 'USD', $max);
if ($max == 10000) {
$max = $max * 1000000000;
$max = get_currency_value1($row_price->id, $max);
} else {
$max = get_currency_value_lys('USD', get_currency_code(), $max);
}
//echo $max. ' - '.$check_price;exit;
if ($this->input->get('new_search')) {
if ($check_price <= $max && $check_price >= $min) {
} else {
$condition .= " AND (`id` != '" . $row_price->id . "')";
}
} else {
if ($check_price <= $max || $check_price >= $min) {
} else {
$condition .= " AND (`id` != '" . $row_price->id . "')";
}
}
}
}
}
//My ShortLists
if ($search_view == 2) {
$constraint = "";
$shortlists = $this->db->where('id', $this->dx_auth->get_user_id())->get('users')->row()->shortlist;
$my_lists = explode(',', $shortlists);
$i = 1;
foreach ($my_lists as $list) {
if ($i == count($my_lists)) {
$OR = "";
} else {
$OR = " OR ";
示例5: get_currency_symbol
?>
</div>
<div class="line_reg" style="z-index:<?php
echo $j;
?>
;" id="square_<?php
echo $i;
?>
"> <span class="startcap"></span> <span class="content"></span> <span class="endcap"><b><?php
echo get_currency_symbol($list_id) . get_currency_value1($list_id, $price);
?>
</b></span> </div>
<!--Edit calender --->
<?php
echo get_currency_symbol($list_id) . get_currency_value_lys($listcurrency, get_currency_code(), $price);
?>
</b></span> </div>
<!--edit calender -->
</div>
</div>
<?php
}
?>
<?php
$day_count++;
$day_nextmonth++;
$i++;
示例6: translate
</span> </p>
<div class="clear"></div>
</div>
<div id="payment_method_2c" class="payment_method_content<?php
echo $show2C;
?>
">
<h2><?php
echo translate("Credit Card");
?>
</h2>
<div class="currency_alert"><?php
echo translate("This payment transacts in");
?>
<?php
echo get_currency_symbol1() . get_currency_code();
?>
. <?php
echo translate("Your total charge is");
?>
<?php
echo get_currency_symbol1() . $amt;
?>
.</div>
<div class="two_c_explanation col-md-2 col-sm-5 col-xs-5"></div>
<p class="payment_method_explanation col-md-10 col-sm-7 col-xs-7"> <span class="paypallogo"><?php
echo translate("Instructions:");
?>
</span> <br>
<?php
echo translate("After clicking 'Book it' you will be redirected to Braintree to complete payment.");
示例7: modify_calendar
public function modify_calendar()
{
if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
/* $from = $this->input->post('from');
$to = $this->input->post('to');
$amount = $this->input->post('amount');
$min_currency= round(get_currency_value_lys($from,$to,$amount)); echo $min_currency; */
//Seasonal Price
$availability = $this->input->post('availability');
$pricevalue = $this->input->post('seasonal_price');
$id = $this->input->post('hosting_id');
echo $id;
$cur_code = $this->db->where('id', $id)->from('list')->get()->row()->currency;
$cur_val = $this->db->where('currency_code', $cur_code)->from('currency_converter')->get()->row()->currency_value;
$currency_value = round($cur_val * 10);
$currency_maxvalue = $currency_value * 1000;
echo $currency_maxvalue;
if ($availability == "Available" && $pricevalue != "" && $pricevalue >= $currency_value && $pricevalue <= $currency_maxvalue) {
$month = $this->input->get('month', TRUE);
$year = $this->input->get('year', TRUE);
$startdate = $this->input->post('starting_date');
$starttime = get_gmt_time(strtotime($startdate));
$enddate = $this->input->post('stopping_date');
$endtime = get_gmt_time(strtotime($enddate));
$pdata = array('list_id' => $this->input->post('hosting_id'), 'price' => $this->input->post('seasonal_price'), 'start_date' => $starttime, 'end_date' => $endtime, 'currency' => $cur_code);
// print_r($pdata);
// echo $pricevalue;echo $availability;
$update = 0;
$query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $pdata['list_id']));
$res = $query->result_array();
$count = 1;
foreach ($res as $row) {
$from = $row['start_date'];
$to = $row['end_date'];
if ($starttime == $from && $endtime == $to) {
$condition = array('list_id' => $pdata['list_id'], 'start_date' => $from, 'end_date' => $to);
$updatedata = array('price' => $pdata['price']);
$this->Common_model->updateTableData('seasonalprice', NULL, $condition, $updatedata);
$update = 1;
} else {
if ($starttime == $from && $endtime == $from) {
//update
$starttime_update = get_gmt_time(strtotime('+1 day', $starttime));
$condition = array('list_id' => $pdata['list_id'], 'start_date' => $from, 'end_date' => $to);
$updatedata = array('start_date' => $starttime_update);
$this->Common_model->updateTableData('seasonalprice', NULL, $condition, $updatedata);
//insert
$insertdata1 = array('list_id' => $this->input->post('hosting_id'), 'price' => $this->input->post('seasonal_price'), 'start_date' => $starttime, 'end_date' => $endtime, 'currency' => get_currency_code());
$this->db->insert('seasonalprice', $insertdata1);
$update = 1;
} else {
if ($starttime == $to && $endtime == $to) {
//update
$endtime_update = get_gmt_time(strtotime('-1 day', $endtime));
$condition = array('list_id' => $pdata['list_id'], 'start_date' => $from, 'end_date' => $to);
$updatedata = array('end_date' => $endtime_update);
$this->Common_model->updateTableData('seasonalprice', NULL, $condition, $updatedata);
//insert
$insertdata1 = array('list_id' => $this->input->post('hosting_id'), 'price' => $this->input->post('seasonal_price'), 'start_date' => $starttime, 'end_date' => $endtime, 'currency' => get_currency_code());
$this->db->insert('seasonalprice', $insertdata1);
$update = 1;
} else {
if ($starttime > $from && $starttime < $to && ($endtime > $from && $endtime < $to)) {
//update
$endtime_update = get_gmt_time(strtotime('+1 day', $endtime));
$condition = array('list_id' => $pdata['list_id'], 'start_date' => $from, 'end_date' => $to);
$updatedata = array('start_date' => $endtime_update);
$this->Common_model->updateTableData('seasonalprice', NULL, $condition, $updatedata);
//insert 1
$starttime_update = get_gmt_time(strtotime('-1 day', $starttime));
$insertdata1 = array('list_id' => $this->input->post('hosting_id'), 'price' => $row['price'], 'start_date' => $row['start_date'], 'end_date' => $starttime_update, 'currency' => get_currency_code());
$this->db->insert('seasonalprice', $insertdata1);
//insert 2
$insertdata1 = array('list_id' => $this->input->post('hosting_id'), 'price' => $this->input->post('seasonal_price'), 'start_date' => $starttime, 'end_date' => $endtime, 'currency' => get_currency_code());
$this->db->insert('seasonalprice', $insertdata1);
$update = 1;
} else {
if ($starttime <= $from && $starttime < $to && ($endtime > $from && $endtime < $to) || $starttime < $from && $starttime < $to && $endtime == $from) {
//update
$endtime_update = get_gmt_time(strtotime('+1 day', $endtime));
$condition = array('list_id' => $pdata['list_id'], 'start_date' => $from, 'end_date' => $to);
$updatedata = array('start_date' => $endtime_update);
$this->Common_model->updateTableData('seasonalprice', NULL, $condition, $updatedata);
//insert 1
$insertdata1 = array('list_id' => $this->input->post('hosting_id'), 'price' => $this->input->post('seasonal_price'), 'start_date' => $starttime, 'end_date' => $endtime, 'currency' => get_currency_code());
$this->db->insert('seasonalprice', $insertdata1);
$update = 1;
} else {
if ($starttime > $from && $starttime < $to && ($endtime > $from && $endtime >= $to) || $starttime == $to && ($endtime > $from && $endtime > $to)) {
//update
$starttime_update = get_gmt_time(strtotime('-1 day', $starttime));
$condition = array('list_id' => $pdata['list_id'], 'start_date' => $from, 'end_date' => $to);
$updatedata = array('end_date' => $starttime_update);
$this->Common_model->updateTableData('seasonalprice', NULL, $condition, $updatedata);
//insert 1
$insertdata1 = array('list_id' => $this->input->post('hosting_id'), 'price' => $this->input->post('seasonal_price'), 'start_date' => $starttime, 'end_date' => $endtime, 'currency' => get_currency_code());
$this->db->insert('seasonalprice', $insertdata1);
$update = 1;
} else {
if ($starttime < $from && $starttime < $to && ($endtime > $from && $endtime > $to) || $starttime == $from && $endtime > $to & $startime < $to || $starttime < $from && $starttime < $to && $endtime == $to) {
//.........这里部分代码省略.........
示例8: braintree_success
public function braintree_success()
{
$result = Braintree_Transaction::sale(array('amount' => get_currency_value_lys(get_currency_code(), 'USD', $this->session->userdata('list_commission')), "paymentMethodNonce" => $_POST['payment_method_nonce'], 'options' => array('submitForSettlement' => true)));
$transaction = $result->transaction;
/*
if($result->success == 1)
{
if($result->message == "Amount must be greater than zero.")
{
$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error',$result->message));
redirect('rooms/'.$this->input->post('custom',true), "refresh");
}
*/
if (!$this->dx_auth->is_logged_in() || !$this->facebook_lib->logged_in()) {
//$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error',translate('Session expired, please try again.')));
//redirect('users/signin');
}
if ($transaction->status == "authorized" || $transaction->status == "submitted_for_settlement") {
$listId = $this->input->post('custom', true);
$condition = array('id' => $listId);
$data['status'] = 1;
$data['list_pay'] = 1;
$data['is_enable'] = 1;
$data['payment'] = 1;
$this->Common_model->updateTableData('list', NULL, $condition, $data);
if (!$this->dx_auth->is_logged_in() || !$this->facebook_lib->logged_in()) {
//$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error',translate('Session expired, please try again.')));
//redirect('users/signin');
}
$query_user = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row();
$username = $query_user->username;
$insertData = array('list_id' => $listId, 'conversation_id' => $listId, 'userby' => $this->dx_auth->get_user_id(), 'userto' => 1, 'message' => "{$username} created a new list.", 'created' => time(), 'message_type ' => 10);
$this->Message_model->sentMessage($insertData);
$host_email = $query_user->email;
$admin_email = $this->dx_auth->get_site_sadmin();
$admin_name = $this->dx_auth->get_site_title();
$admin_to_email = $this->Common_model->getTableData('users', array('id' => 1))->row()->email;
$query_list = $this->Common_model->getTableData('list', array('id' => $listId))->row();
$currency = $query_list->currency;
$price = $query_list->price;
$title = $query_list->title;
$link = base_url() . 'rooms/' . $listId;
$email_name = 'list_create_host';
$splVars = array("{host_name}" => $username, "{price}" => $currency . $price, "{link}" => $link, "{list_title}" => $title, "{site_name}" => $this->dx_auth->get_site_title());
$this->Email_model->sendMail($host_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
$email_name = 'list_create_admin';
$splVars = array("{host_name}" => $username, "{price}" => $currency . $price, "{link}" => $link, "{list_title}" => $title, "{site_name}" => $this->dx_auth->get_site_title());
$this->Email_model->sendMail($admin_to_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
$data_listpay['list_id'] = $listId;
$data_listpay['amount'] = $this->session->userdata('list_commission');
$data_listpay['currency'] = get_currency_code();
$data_listpay['created'] = time();
$this->db->insert('list_pay', $data_listpay);
$data['title'] = "Payment Success !";
$data['message_element'] = "payments/paypal_success";
$this->load->view('template', $data);
//redirect('rooms/edit/'.$listId, 'refresh');
//$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success',translate('Rooms added successfully.')));
//redirect('rooms/'.$listId, 'refresh');
} else {
$data['title'] = "Payment Cancelled !";
$data['message_element'] = "payments/paypal_cancel";
$this->load->view('template', $data);
}
/* }
else {
$data['title']="Payment Cancelled !";
$data['message_element'] = "payments/paypal_cancel";
$this->load->view('template',$data);
}
*/
}
示例9: braintree_success
function braintree_success()
{
$result = Braintree_Transaction::sale(array('amount' => get_currency_value_lys(get_currency_code(), 'USD', $this->session->userdata('subtotal')), "paymentMethodNonce" => $_POST['payment_method_nonce'], 'options' => array('submitForSettlement' => true)));
$transaction = $result->transaction;
if ($transaction->status == "authorized" || $transaction->status == "submitted_for_settlement") {
$custom = $this->session->userdata('custom');
$data = array();
$list = array();
$data = explode('@', $custom);
$contact_key = $data[9];
$list['list_id'] = $data[0];
$list['userby'] = $data[1];
$query1 = $this->Common_model->getTableData('list', array('id' => $list['list_id']));
$buyer_id = $query1->row()->user_id;
$list['userto'] = $buyer_id;
$list['checkin'] = $data[2];
$list['checkout'] = $data[3];
$list['no_quest'] = $data[4];
$date1 = new DateTime(date('Y-m-d H:i:s', $list['checkin']));
$date2 = new DateTime(date('Y-m-d H:i:s', $list['checkout']));
$interval = $date1->diff($date2);
if ($interval->days >= 28) {
$list['policy'] = 5;
} else {
$list['policy'] = $query1->row()->cancellation_policy;
}
$amt = $data[14];
$list['transaction_id'] = "{$transaction->id}";
$list['price'] = $this->session->userdata('subtotal');
$currency = $data[15];
$list['payment_id'] = 2;
$list['credit_type'] = 1;
$is_travelCretids = $data[5];
$user_travel_cretids = $data[6];
$list['currency'] = get_currency_code();
if ($currency != 'USD') {
$list['admin_commission'] = $data[8];
$list['cleaning'] = $data[10];
$list['security'] = $data[11];
$list['topay'] = $amt - $data[8];
} else {
$list['admin_commission'] = $data[8];
$list['cleaning'] = $data[10];
$list['security'] = $data[11];
$list['topay'] = $amt - $data[8];
}
$list['guest_count'] = $data[13];
if ($list['no_quest'] > $list['guest_count']) {
if ($currency != 'USD') {
$list['extra_guest_price'] = $data[12];
} else {
$list['extra_guest_price'] = $data[12];
}
}
if ($this->session->userdata('contact_key') != '') {
$updateKey = array('contact_key' => $this->session->userdata('contact_key'));
$updateData = array();
$list['contacts_offer'] = $this->session->userdata('contacts_offer');
$updateData['status'] = 10;
$this->Contacts_model->update_contact($updateKey, $updateData);
}
if ($contact_key != "None") {
$list['status'] = 1;
$this->db->select_max('group_id');
$group_id = $this->db->get('calendar')->row()->group_id;
if (empty($group_id)) {
echo $countJ = 0;
} else {
$countJ = $group_id;
}
$insertData['list_id'] = $list['list_id'];
$insertData['group_id'] = $countJ + 1;
$insertData['availability'] = 'Booked';
$insertData['booked_using'] = 'Other';
$checkin = date('m/d/Y', $list['checkin']);
$checkout = date('m/d/Y', $list['checkout']);
$days = getDaysInBetween($checkin, $checkout);
$count = count($days);
$i = 1;
foreach ($days as $val) {
if ($count == 1) {
$insertData['style'] = 'single';
} else {
if ($count > 1) {
if ($i == 1) {
$insertData['style'] = 'left';
} else {
if ($count == $i) {
$insertData['notes'] = '';
$insertData['style'] = 'right';
} else {
$insertData['notes'] = '';
$insertData['style'] = 'both';
}
}
}
}
$insertData['booked_days'] = $val;
$this->Trips_model->insert_calendar($insertData);
$i++;
//.........这里部分代码省略.........
示例10: list_success
public function list_success()
{
//echo $payment_status = $this->input->post('payment_status',true);
//exit;
$token = $_GET['token'];
$payer_id = $_GET['PayerID'];
// GetExpressCheckoutDetails
$get_ec_return = $this->paypal_ec->get_ec($token);
if (isset($get_ec_return['ec_status']) && $get_ec_return['ec_status'] === true) {
// at this point, you have all of the data for the transaction.
// you may want to save the data for future action. what's left to
// do is to collect the money -- you do that by call DoExpressCheckoutPayment
// via $this->paypal_ec->do_ec();
//
// I suggest to save all of the details of the transaction. You get all that
// in $get_ec_return array
$ec_details = array('token' => $token, 'payer_id' => $payer_id, 'currency' => get_currency_code(), 'amount' => $get_ec_return['PAYMENTREQUEST_0_AMT'], 'IPN_URL' => site_url('payments/ipn'), 'type' => 'sale');
// DoExpressCheckoutPayment
$do_ec_return = $this->paypal_ec->do_ec($ec_details);
if (isset($do_ec_return['ec_status']) && $do_ec_return['ec_status'] === true) {
// at this point, you have collected payment from your customer
// you may want to process the order now.
/* echo "<h1>Thank you. We will process your order now.</h1>";
echo "<pre>";
echo "\nGetExpressCheckoutDetails Data\n" . print_r($get_ec_return, true);
echo "\n\nDoExpressCheckoutPayment Data\n" . print_r($do_ec_return, true);
echo "</pre>";exit; */
if ($this->input->post('payment_status', true) == 'Completed') {
$listId = $this->input->post('custom', true);
$condition = array('id' => $listId);
$data['status'] = 1;
$data['list_pay'] = 1;
$data['is_enable'] = 1;
$this->Common_model->updateTableData('list', NULL, $condition, $data);
//redirect('rooms/edit/'.$listId, 'refresh');
$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success', translate('Rooms added successfully.')));
redirect('rooms/' . $listId, 'refresh');
} else {
if ($this->input->post('payment_status', true) == '') {
$listId = $this->uri->segment('3');
$condition = array('id' => $listId);
$data['status'] = 1;
$data['list_pay'] = 1;
$data['is_enable'] = 1;
$this->Common_model->updateTableData('list', NULL, $condition, $data);
//redirect('rooms/edit/'.$listId, 'refresh');
$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success', translate('Rooms added successfully.')));
redirect('rooms/' . $listId, 'refresh');
} else {
//echo $this->input->post('payment_status',true);
//exit;
//redirect('home/addlist','refresh');
redirect('rooms/new', 'refresh');
}
}
} else {
$this->_error($do_ec_return);
}
} else {
$this->_error($do_ec_return);
}
}
示例11: get_currency_symbol
</span></span>
<span class="data col-md-8 col-sm-7 col-xs-12"><span class="inner"><?php
echo get_currency_symbol($result->list_id) . get_currency_value_lys($result->currency, get_currency_code(), $subtotal);
if ($result->contacts_offer == 1) {
$special_offer = '(Special offer used.)';
} else {
$special_offer = '';
}
?>
<!--<li class="clearfix">
<span class="label"><span class="inner"><span class="checkout_icon" id="icon_cal"></span><?php
echo translate("Total Payout");
?>
</span></span>
<span class="data"><span class="inner"><?php
echo get_currency_symbol($result->list_id) . get_currency_value_lys($result->currency, get_currency_code(), $subtotal) . $special_offer;
?>
-->
<?php
if ($result->coupon == 1) {
echo ' (Coupon code used)';
}
?>
</span></span>
</li>
<li class="clearfix bottom">
<span class="label col-md-4 col-sm-5 col-xs-12" style="padding:10px 10px 0 10px;" ><span class="inner"><span class="checkout_icon" id="icon_cal"></span>
<?php
if ($result->status == 1) {
?>
示例12: paypal_success
function paypal_success()
{
$token = $_GET['token'];
$payer_id = $_GET['PayerID'];
// GetExpressCheckoutDetails
$get_ec_return = $this->paypal_ec->get_ec($token);
if (isset($get_ec_return['ec_status']) && $get_ec_return['ec_status'] === true) {
// at this point, you have all of the data for the transaction.
// you may want to save the data for future action. what's left to
// do is to collect the money -- you do that by call DoExpressCheckoutPayment
// via $this->paypal_ec->do_ec();
//
// I suggest to save all of the details of the transaction. You get all that
// in $get_ec_return array
$ec_details = array('token' => $token, 'payer_id' => $payer_id, 'currency' => get_currency_code(), 'amount' => $get_ec_return['PAYMENTREQUEST_0_AMT'], 'IPN_URL' => site_url('payments/ipn'), 'type' => 'sale');
// DoExpressCheckoutPayment
$do_ec_return = $this->paypal_ec->do_ec($ec_details);
if (isset($do_ec_return['ec_status']) && $do_ec_return['ec_status'] === true) {
// at this point, you have collected payment from your customer
// you may want to process the order now.
/* echo "<h1>Thank you. We will process your order now.</h1>";
echo "<pre>";
echo "\nGetExpressCheckoutDetails Data\n" . print_r($get_ec_return, true);
echo "\n\nDoExpressCheckoutPayment Data\n" . print_r($do_ec_return, true);
echo "</pre>";exit; */
if (isset($do_ec_return['L_SHORTMESSAGE0']) && $do_ec_return['L_SHORTMESSAGE0'] === 'Duplicate Request') {
redirect('home');
}
$custom = $this->session->userdata('custom');
$data = array();
$list = array();
$data = explode('@', $custom);
$contact_key = $data[9];
$list['list_id'] = $data[0];
$list['userby'] = $data[1];
$query1 = $this->Common_model->getTableData('list', array('id' => $list['list_id']));
$buyer_id = $query1->row()->user_id;
$list['userto'] = $buyer_id;
$list['checkin'] = $data[2];
$list['checkout'] = $data[3];
$list['no_quest'] = $data[4];
$amt = $do_ec_return['PAYMENTINFO_0_AMT'];
$list['price'] = $amt;
$currency = $do_ec_return['PAYMENTINFO_0_CURRENCYCODE'];
$list['payment_id'] = 2;
$list['credit_type'] = 1;
$list['transaction_id'] = 0;
$is_travelCretids = $data[5];
$user_travel_cretids = $data[6];
$list['topay'] = $amt - $data[8];
$list['currency'] = $query1->row()->currency;
$list['admin_commission'] = $data[8];
$list['cleaning'] = $data[10];
$list['security'] = $data[11];
$list['extra_guest_price'] = $data[12];
$list['guest_count'] = $data[13];
if ($contact_key != "None") {
$list['status'] = 1;
$this->db->select_max('group_id');
$group_id = $this->db->get('calendar')->row()->group_id;
if (empty($group_id)) {
echo $countJ = 0;
} else {
$countJ = $group_id;
}
$insertData['list_id'] = $list['list_id'];
$insertData['group_id'] = $countJ + 1;
$insertData['availability'] = 'Booked';
$insertData['booked_using'] = 'Other';
$checkin = date('m/d/Y', $list['checkin']);
$checkout = date('m/d/Y', $list['checkout']);
$days = getDaysInBetween($checkin, $checkout);
$count = count($days);
$i = 1;
foreach ($days as $val) {
if ($count == 1) {
$insertData['style'] = 'single';
} else {
if ($count > 1) {
if ($i == 1) {
$insertData['style'] = 'left';
} else {
if ($count == $i) {
$insertData['notes'] = '';
$insertData['style'] = 'right';
} else {
$insertData['notes'] = '';
$insertData['style'] = 'both';
}
}
}
}
$insertData['booked_days'] = $val;
$this->Trips_model->insert_calendar($insertData);
$i++;
}
} else {
$list['status'] = 1;
}
if ($list['price'] > 75) {
//.........这里部分代码省略.........
示例13: array
?>
" />
</p>
<?php
$currency_symbol = $this->Common_model->getTableData('currency', array('currency_code' => get_currency_code()))->row()->currency_symbol;
?>
<p align="center"><b>Price <?php
echo $currency_symbol;
?>
:</b>
<input type="text" id="price_special" name="price_special" value="<?php
echo get_currency_value_lys($result->currency, get_currency_code(), $subtotal);
?>
" /></p>
<input type="hidden" id="price_original" name="price_original" value="<?php
echo get_currency_value_lys($result->currency, get_currency_code(), $price_original);
?>
" /></p>
<p align="center">Enter the price for the reservation including all additional costs</p>
<p></p>
<p><?php
echo translate("Optional message") . "...";
?>
</p>
<p><textarea class="comment_contact" name="comment_special" id="comment_special"></textarea></p>
<p>
<input type="button" class="accept_button" name="offered" value="<?php
echo "Send message";
?>
" onclick="javascript:req_action('special');" />
示例14: trips_success
public function trips_success()
{
$reservation_id = $this->session->userdata('reservation_id');
$is_block = $this->session->userdata('is_block');
$comment = $this->session->userdata('comment');
$checkin = $this->session->userdata('checkin');
$checkout = $this->session->userdata('checkout');
$token = $_GET['token'];
$payer_id = $_GET['PayerID'];
// GetExpressCheckoutDetails
$get_ec_return = $this->paypal_ec->get_ec($token);
if (isset($get_ec_return['ec_status']) && $get_ec_return['ec_status'] === true) {
// at this point, you have all of the data for the transaction.
// you may want to save the data for future action. what's left to
// do is to collect the money -- you do that by call DoExpressCheckoutPayment
// via $this->paypal_ec->do_ec();
//
// I suggest to save all of the details of the transaction. You get all that
// in $get_ec_return array
$ec_details = array('token' => $token, 'payer_id' => $payer_id, 'currency' => get_currency_code(), 'amount' => $get_ec_return['PAYMENTREQUEST_0_AMT'], 'IPN_URL' => site_url('payments/ipn'), 'type' => 'sale');
// DoExpressCheckoutPayment
$do_ec_return = $this->paypal_ec->do_ec($ec_details);
if (isset($do_ec_return['ec_status']) && $do_ec_return['ec_status'] === true) {
// at this point, you have collected payment from your customer
// you may want to process the order now.
/* echo "<h1>Thank you. We will process your order now.</h1>";
echo "<pre>";
echo "\nGetExpressCheckoutDetails Data\n" . print_r($get_ec_return, true);
echo "\n\nDoExpressCheckoutPayment Data\n" . print_r($do_ec_return, true);
echo "</pre>";exit; */
if (isset($do_ec_return['L_SHORTMESSAGE0']) && $do_ec_return['L_SHORTMESSAGE0'] === 'Duplicate Request') {
redirect('home');
}
$admin_email = $this->dx_auth->get_site_sadmin();
$admin_name = $this->dx_auth->get_site_title();
$conditions = array('reservation.id' => $reservation_id);
$row = $this->Trips_model->get_reservation($conditions)->row();
/* $query1 = $this->Users_model->get_user_by_id($row->userby);
$traveler_name = $query1->row()->username;
$traveler_email = $query1->row()->email; */
$query1 = $this->db->where('id', $row->userby)->get('users');
$traveler_name = $query1->row()->username;
$traveler_email = $query1->row()->email;
//$query2 = $this->Users_model->get_user_by_id($row->userto);
$query2 = $this->db->where('id', $row->userto)->get('users');
$host_name = $query2->row()->username;
$host_email = $query2->row()->email;
$list_title = $this->Common_model->getTableData('list', array('id' => $row->list_id))->row()->title;
$traveler = $this->Common_model->getTableData('profiles', array('id' => $row->userby))->row();
$host = $this->Common_model->getTableData('profiles', array('id' => $row->userto))->row();
//Traveller Info
if (!empty($traveler)) {
$FnameT = $traveler->Fname;
$LnameT = $traveler->Lname;
$liveT = $traveler->live;
$phnumT = $traveler->phnum;
} else {
$FnameT = '';
$LnameT = '';
$liveT = '';
$phnumT = '';
}
//Host Info
if (!empty($host)) {
$FnameH = $host->Fname;
$LnameH = $host->Lname;
$liveH = $host->live;
$phnumH = $host->phnum;
} else {
$FnameH = '';
$LnameH = '';
$liveH = '';
$phnumH = '';
}
//for calendar
if ($is_block == 'on') {
$this->db->select_max('group_id');
$group_id = $this->db->get('calendar')->row()->group_id;
if (empty($group_id)) {
echo $countJ = 0;
} else {
$countJ = $group_id;
}
$insertData['list_id'] = $row->list_id;
$insertData['group_id'] = $countJ + 1;
$insertData['availability'] = 'Booked';
$insertData['booked_using'] = 'Other';
$checkin = date('m/d/Y', $checkin);
$checkout = date('m/d/Y', $checkout);
$days = getDaysInBetween($checkin, $checkout);
$count = count($days);
$i = 1;
foreach ($days as $val) {
if ($count == 1) {
$insertData['style'] = 'single';
} else {
if ($count > 1) {
if ($i == 1) {
$insertData['style'] = 'left';
} else {
//.........这里部分代码省略.........
示例15: special
public function special()
{
$contact_id = $this->input->post('contact_id');
$message = $this->input->post('comment');
//Update the status,price
$updateKey = array('id' => $contact_id);
$updateData = array();
$updateData['status'] = 3;
$updateData['offer'] = 1;
$updateData['currency'] = get_currency_code();
$updateData['price'] = $this->input->post('price');
$updateData['original_price'] = $this->input->post('price_original');
if ($updateData['price'] <= get_currency_value_lys('USD', get_currency_code(), 10)) {
$validation_amt = get_currency_value_lys('USD', get_currency_code(), 10);
echo "Sorry! Your special offer amount should be greater than or equal to {$validation_amt}.";
exit;
} else {
$this->Contacts_model->update_contact($updateKey, $updateData);
}
extract($this->input->post());
$currency_symbol = $this->Common_model->getTableData('currency', array('currency_code' => get_currency_code()))->row()->currency_symbol;
$price = $currency_symbol . $this->input->post('price');
//Email the confirmation link to the traveller
$result = $this->Common_model->getTableData('contacts', array('id' => $contact_id))->row();
$traveller_id = $result->userby;
$key = $result->contact_key;
$list_id = $result->list_id;
$title = $this->Common_model->getTableData('list', array('id' => $list_id))->row()->title;
$host_email = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row()->email;
$traveller_email = $this->Common_model->getTableData('users', array('id' => $traveller_id))->row()->email;
//send message to traveller
$host_id = $result->userto;
$travellername = $this->Common_model->getTableData('users', array('id' => $traveller_id))->row()->username;
$hostname = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row()->username;
$list_title = $this->Common_model->getTableData('list', array('id' => $list_id))->row()->title;
$insertData = array('list_id' => $list_id, 'contact_id' => $contact_id, 'userby' => $host_id, 'userto' => $traveller_id, 'message' => '<b>Contact Request granted by ' . $hostname . '</b><br><br>' . $message, 'created' => local_to_gmt(), 'message_type' => 8);
$this->Message_model->sentMessage($insertData, ucfirst($hostname), ucfirst($travellername), $list_title, $contact_id);
$updateData1['is_respond'] = 1;
$updateKey1['contact_id'] = $contact_id;
$updateKey1['userto'] = $host_id;
$this->Message_model->updateMessage($updateKey1, $updateData1);
$admin_name = $this->dx_auth->get_site_title();
$admin_email = $this->dx_auth->get_site_sadmin();
$link = base_url() . 'payments/index/' . $list_id . '?contact=' . $key;
$email_name = 'special_request_granted_to_host';
$splVars = array("{price}" => $price, "{traveller_username}" => $travellername, "{host_email}" => $host_email, "{guest_email}" => $traveller_email, "{checkin}" => $checkin, "{checkout}" => $checkout, "{message}" => $message, "{site_name}" => $this->dx_auth->get_site_title(), "{host_username}" => ucfirst($hostname), "{title}" => $list_title);
$this->Email_model->sendMail($host_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
$email_name = 'special_request_granted_to_guest';
$splVars = array("{price}" => $price, "{link}" => $link, "{host_email}" => $host_email, "{guest_email}" => $traveller_email, "{traveller_username}" => $travellername, "{checkin}" => $checkin, "{checkout}" => $checkout, "{message}" => $message, "{site_name}" => $this->dx_auth->get_site_title(), "{host_username}" => ucfirst($hostname), "{title}" => $list_title);
$this->Email_model->sendMail($traveller_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
if ($host_email != $admin_email && $traveller_email != $admin_email) {
$email_name = 'special_request_granted_to_admin';
$splVars = array("{price}" => $price, "{traveller_username}" => $travellername, "{host_email}" => $host_email, "{guest_email}" => $traveller_email, "{checkin}" => $checkin, "{checkout}" => $checkout, "{guest}" => $data['guests'], "{message}" => $message, "{site_name}" => $this->dx_auth->get_site_title(), "{host_username}" => ucfirst($hostname), "{title}" => $list_title);
$this->Email_model->sendMail($admin_email, $host_email, ucfirst($admin_name), $email_name, $splVars);
}
}