• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_gmt_time函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_gmt_time函数的典型用法代码示例。如果您正苦于以下问题:PHP get_gmt_time函数的具体用法?PHP get_gmt_time怎么用?PHP get_gmt_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getDaysInBetween

function getDaysInBetween($startdate, $enddate)
{
    $period = (strtotime($enddate) - strtotime($startdate)) / (60 * 60 * 24);
    $dateinfo = get_gmt_time(strtotime($startdate));
    do {
        $days[] = $dateinfo;
        $dateinfo = date('m/d/Y', $dateinfo);
        $pre_dateinfo = date('m/d/Y', strtotime('+1 day', strtotime($dateinfo)));
        $dateinfo = get_gmt_time(strtotime($pre_dateinfo));
        $period--;
    } while ($period >= 0);
    return $days;
}
开发者ID:BersnardC,项目名称:DROPINN,代码行数:13,代码来源:user_helper.php


示例2: expire

 public function expire()
 {
     $sql = "select *from reservation";
     $query = $this->db->query($sql);
     $res = $query->result_array();
     $date = date("F j, Y, g:i a");
     $date = get_gmt_time(strtotime($date));
     foreach ($res as $reservation) {
         $timestamp = $reservation['book_date'];
         $book_date = date("F j, Y, g:i a", $timestamp);
         $book_date = strtotime($book_date);
         $gmtTime = get_gmt_time(strtotime('+1 day', $timestamp));
         if ($gmtTime <= $date && $reservation['status'] == 1) {
             $reservation_id = $reservation['id'];
             $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;
             $query2 = $this->Users_model->get_user_by_id($row->userto);
             $host_name = $query2->row()->username;
             $host_email = $query2->row()->email;
             $list_title = $this->Common_model->getTableData('list', array('id' => $row->list_id))->row()->title;
             $updateKey = array('id' => $reservation_id);
             $updateData = array();
             $updateData['status '] = 2;
             $this->Trips_model->update_reservation($updateKey, $updateData);
             //Send Mail To Traveller
             $email_name = 'traveler_reservation_expire';
             $splVars = array("{site_name}" => $this->dx_auth->get_site_title(), "{traveler_name}" => ucfirst($traveler_name), "{list_title}" => $list_title, "{host_name}" => ucfirst($host_name));
             $this->Email_model->sendMail($traveler_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
             //Send Mail To Host
             $email_name = 'host_reservation_expire';
             $splVars = array("{site_name}" => $this->dx_auth->get_site_title(), "{traveler_name}" => ucfirst($traveler_name), "{list_title}" => $list_title, "{host_name}" => ucfirst($host_name));
             $this->Email_model->sendMail($host_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
             //Send Mail To Administrator
             $email_name = 'admin_reservation_expire';
             $splVars = array("{site_name}" => $this->dx_auth->get_site_title(), "{traveler_name}" => ucfirst($traveler_name), "{list_title}" => $list_title, "{host_name}" => ucfirst($host_name));
             $this->Email_model->sendMail($admin_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
         }
     }
 }
开发者ID:empotix,项目名称:travelo,代码行数:44,代码来源:cron.php


示例3: ajax_refresh_subtotal

 public function ajax_refresh_subtotal()
 {
     $id = $this->input->get('hosting_id');
     $this->session->unset_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'");
     $checkin = $this->input->get('checkin');
     $checkout = $this->input->get('checkout');
     $data['guests'] = $this->input->get('number_of_guests');
     $capacity = $this->Common_model->getTableData('list', array('id' => $id))->row()->capacity;
     $ckin = explode('/', $checkin);
     $ckout = explode('/', $checkout);
     $xprice = $this->Common_model->getTableData('price', array('id' => $id))->row();
     $guests = $xprice->guests;
     $per_night = $xprice->night;
     if (isset($xprice->cleaning)) {
         $cleaning = $xprice->cleaning;
     } else {
         $cleaning = 0;
     }
     if (isset($xprice->security)) {
         $security = $xprice->security;
     } else {
         $security = 0;
     }
     if (isset($xprice->night)) {
         $price = $xprice->night;
     } else {
         $price = 0;
     }
     if (isset($xprice->week)) {
         $Wprice = $xprice->week;
     } else {
         $Wprice = 0;
     }
     if (isset($xprice->month)) {
         $Mprice = $xprice->month;
     } else {
         $Mprice = 0;
     }
     $guest_count = $xprice->guests;
     //check admin premium condition and apply so for
     $query = $this->Common_model->getTableData('paymode', array('id' => 2));
     $row = $query->row();
     //Seasonal Price
     //1. Store all the dates between checkin and checkout in an array
     $checkin_time = get_gmt_time(strtotime($checkin));
     $checkout_time = get_gmt_time(strtotime($checkout));
     $travel_dates = array();
     $seasonal_prices = array();
     $total_nights = 1;
     $total_price = 0;
     $is_seasonal = 0;
     $i = $checkin_time;
     while ($i < $checkout_time) {
         $checkin_date = date('m/d/Y', $i);
         $checkin_date = explode('/', $checkin_date);
         $travel_dates[$total_nights] = $checkin_date[1] . $checkin_date[0] . $checkin_date[2];
         $i = get_gmt_time(strtotime('+1 day', $i));
         $total_nights++;
     }
     for ($i = 1; $i < $total_nights; $i++) {
         $seasonal_prices[$travel_dates[$i]] = "";
     }
     //Store seasonal price of a list in an array
     $seasonal_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id));
     $seasonal_result = $seasonal_query->result_array();
     if ($seasonal_query->num_rows() > 0) {
         foreach ($seasonal_result as $time) {
             //Get Seasonal price
             $seasonalprice_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id, 'start_date' => $time['start_date'], 'end_date' => $time['end_date']));
             $seasonalprice = $seasonalprice_query->row()->price;
             //Days between start date and end date -> seasonal price
             $start_time = $time['start_date'];
             $end_time = $time['end_date'];
             $i = $start_time;
             while ($i <= $end_time) {
                 $start_date = date('m/d/Y', $i);
                 $s_date = explode('/', $start_date);
                 $s_date = $s_date[1] . $s_date[0] . $s_date[2];
                 $seasonal_prices[$s_date] = $seasonalprice;
                 $i = get_gmt_time(strtotime('+1 day', $i));
             }
         }
         //Total Price
         for ($i = 1; $i < $total_nights; $i++) {
             if ($seasonal_prices[$travel_dates[$i]] == "") {
                 $total_price = $total_price + $xprice->night;
             } else {
                 $total_price = $total_price + $seasonal_prices[$travel_dates[$i]];
                 $is_seasonal = 1;
             }
         }
         //Additional Guests
         if ($data['guests'] > $guests) {
             $days = $total_nights - 1;
             $diff_guests = $data['guests'] - $guests;
             $total_price = $total_price + $days * $xprice->addguests * $diff_guests;
             $extra_guest = 1;
             $extra_guest_price = $xprice->addguests * $diff_guests;
         }
         //Cleaning
//.........这里部分代码省略.........
开发者ID:BersnardC,项目名称:DROPINN,代码行数:101,代码来源:rooms.php


示例4: after_checkin

 function after_checkin()
 {
     $date = date("F j, Y, g:i a");
     $date = get_gmt_time(strtotime($date));
     $result = $this->Common_model->getTableData('reservation', array('status' => 7));
     if ($result->num_rows() != 0) {
         foreach ($result->result() as $row_status) {
             $timestamp = $row_status->checkout;
             $checkout = date("F j, Y, g:i a", $timestamp);
             $checkout = strtotime($checkout);
             $gmtTime = get_gmt_time(strtotime('+1 day', $timestamp));
             if ($gmtTime <= $date) {
                 $reservation_id = $row_status->id;
                 $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();
                 $updateKey = array('id' => $reservation_id);
                 $updateData = array();
                 $updateData['status '] = 8;
                 $this->Trips_model->update_reservation($updateKey, $updateData);
                 $conditions = array('reservation.id' => $reservation_id);
                 $row = $this->Trips_model->get_reservation($conditions)->row();
                 $before_status = $row->status;
                 if ($this->Users_model->get_user_by_id($row->userby)) {
                     $query1 = $this->Users_model->get_user_by_id($row->userby);
                 } else {
                     //$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error',translate('Your List was deleted.')));
                     //redirect('travelling/your_trips');
                 }
                 $traveler_name = $query1->row()->username;
                 $traveler_email = $query1->row()->email;
                 $query2 = $this->Users_model->get_user_by_id($row->userto);
                 $host_name = $query2->row()->username;
                 $host_email = $query2->row()->email;
                 $list_title = $this->Common_model->getTableData('list', array('id' => $row->list_id))->row()->title;
                 $username = $traveler_name;
                 if ($row->list_id) {
                     $insertData = array('list_id' => $row->list_id, 'reservation_id' => $reservation_id, 'userby' => $row->userby, 'userto' => $row->userto, 'message' => "{$username} wants the review from you.", 'created' => date('m/d/Y g:i A'), 'message_type ' => 4);
                     $this->Message_model->sentMessage($insertData);
                     //Send Mail To Traveller
                     $email_name = 'checkout_traveler';
                     $splVars = array("{site_name}" => $this->dx_auth->get_site_title(), "{traveler_name}" => ucfirst($traveler_name), "{list_title}" => $list_title, "{host_name}" => ucfirst($host_name));
                     $this->Email_model->sendMail($traveler_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
                     //Send Mail To Host
                     $email_name = 'checkout_host';
                     $splVars = array("{site_name}" => $this->dx_auth->get_site_title(), "{traveler_name}" => ucfirst($traveler_name), "{list_title}" => $list_title, "{host_name}" => ucfirst($host_name));
                     $this->Email_model->sendMail($host_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
                     //Send Mail To Administrator
                     $email_name = 'checkout_admin';
                     $splVars = array("{site_name}" => $this->dx_auth->get_site_title(), "{traveler_name}" => ucfirst($traveler_name), "{list_title}" => $list_title, "{host_name}" => ucfirst($host_name));
                     $this->Email_model->sendMail($admin_email, $admin_email, ucfirst($admin_name), $email_name, $splVars);
                     //$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success',translate('You are successfully checked out.')));
                     //redirect('travelling/previous_trips');
                 }
             }
         }
     }
     echo '<h2>Cron Successfully Runned.</h2>';
 }
开发者ID:BersnardC,项目名称:DROPINN,代码行数:60,代码来源:cron.php


示例5: translate

      <li class="top col-md-12 col-sm-12 col-xs-12 padding-zero"> <span class="label col-md-3 col-sm-3 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_check_in"></span><?php 
    echo translate("Check in");
    ?>
</span></span> <span class="data col-md-9 col-sm-9 col-xs-12"><span class="inner"> <?php 
    echo get_user_times(get_gmt_time(strtotime($checkin)), get_user_timezone());
    ?>
 <em class="check_in_out_time"><?php 
    echo translate("(Flexible check in time)");
    ?>
</em></span></span> </li>
						
      <li class="col-md-12 col-sm-12 col-xs-12 padding-zero"> <span class="label col-md-3 col-sm-3 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_check_out"></span><?php 
    echo translate("Check out");
    ?>
</span></span> <span class="data col-md-9 col-sm-9 col-xs-12"><span class="inner"> <?php 
    echo get_user_times(get_gmt_time(strtotime($checkout)), get_user_timezone());
    ?>
 <em class="check_in_out_time"><?php 
    echo translate("(Flexible check out time)");
    ?>
</em></span></span> </li>
						
      <li class=" col-md-12 col-sm-12 col-xs-12 padding-zero"> <span class="label col-md-3 col-sm-3 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_nights"></span><?php 
    echo translate("Nights");
    ?>
</span></span> <span class="data col-md-9 col-sm-9 col-xs-12"><span class="inner"><?php 
    echo $days;
    ?>
</span></span> </li>
						      
      <li class="bottom col-md-12 col-sm-12 col-xs-12 padding-zero"> <span class="label col-md-3 col-sm-3 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_person"></span><?php 
开发者ID:BersnardC,项目名称:DROPINN,代码行数:31,代码来源:view_booking.php


示例6: date

    ?>
                                                <!--<?php 
    $timestamp = $result->book_date;
    // $timestamp = strtotime('+1 day',$timestamp);
    $book_date = date('m/d/Y', $timestamp);
    // $gmtTime   = get_gmt_time($timestamp);
    $gmtTime = get_gmt_time(strtotime('+24 hours', $timestamp));
    //$gmtTime   = get_gmt_time(strtotime('-20 minutes',$gmtTime));
    //$date=gmdate("Year: %Y Month: %m Day: %d - %h:%i %a",$gmdate);
    $date = gmdate('D, d M Y H:i:s +\\G\\M\\T', $gmtTime);
    ?>
-->
                                                <?php 
    $timestamp = $result->book_date;
    $book_date = date('m/d/Y', $timestamp);
    $gmtTime = get_gmt_time(strtotime('+24 hours', $timestamp));
    //$gmtTime   = get_gmt_time(strtotime('-20 minutes',$gmtTime));
    //$date=gmdate("Year: %Y Month: %m Day: %d - %h:%i %a",$gmdate);
    $date = gmdate('D, d M Y H:i:s +\\G\\M\\T', $gmtTime);
    ?>
                                                <div id="expire" style="font-size:20px;"></div>
                                    <?php 
} else {
    ?>
        <?php 
    echo translate("Status");
    ?>
    <?php 
}
?>
                                    </span></span>
开发者ID:empotix,项目名称:travelo,代码行数:31,代码来源:request.php


示例7: translate

</span></span>
                            </li>

                            <li class="clearfix bottom">
                                <span class="label" ><span class="inner"><span class="checkout_icon" id="icon_cal"></span>
                                        <?php 
if ($result->status == 1) {
    ?>
                                                <?php 
    echo translate("Expires in");
    ?>
                                                <?php 
    $timestamp = $result->book_date;
    $book_date = date('m/d/Y', $timestamp);
    $gmtTime = get_gmt_time(strtotime('+24 hours', $timestamp));
    $gmtTime = get_gmt_time(strtotime('-18 minutes', $gmtTime));
    $date = gmdate('D, d M Y H:i:s \\G\\M\\T', $gmtTime);
    ?>
                                                <div id="expire" style="font-size:20px;"></div>
                                    <?php 
} else {
    ?>
        <?php 
    echo translate("Status");
    ?>
    <?php 
}
?>
                                    </span></span>

<?php 
开发者ID:empotix,项目名称:travelo,代码行数:31,代码来源:request_traveller.php


示例8: form


//.........这里部分代码省略.........
             $data['commission'] = $camt;
         }
     } else {
         $amt = $amt;
     }
     // Coupon Code Starts
     //print_r($amt);exit;
     if ($amt > 110) {
         $da = array();
         $this->db->select('*');
         $this->db->where('id', $this->dx_auth->get_user_id());
         $this->db->from('users');
         $value = $this->db->get()->result();
         foreach ($value as $val) {
             $da = $val->referral_amount;
         }
         if ($da != 0) {
             $data['amt'] = $amt;
             $data['referral_amount'] = $da;
         } else {
             $data['amt'] = $amt;
         }
     } else {
         $data['amt'] = $amt;
     }
     if ($amt < 0) {
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your payment should be greater than 0.')));
         redirect('rooms/' . $id, "refresh");
     }
     $dat['result'] = $this->Common_model->getTableData('payments')->result();
     $array_items = array('list_id' => '', 'Lcheckin' => '', 'Lcheckout' => '', 'number_of_guests' => '', 'formCheckout' => '');
     $this->session->unset_userdata($array_items);
     //$id = $list_id;
     $checkin_time = get_gmt_time(strtotime($checkin));
     $checkout_time = get_gmt_time(strtotime($checkout));
     $travel_dates = array();
     $seasonal_prices = array();
     $total_nights = 1;
     $total_price = 0;
     $is_seasonal = 0;
     $i = $checkin_time;
     while ($i < $checkout_time) {
         $checkin_date = date('m/d/Y', $i);
         $checkin_date = explode('/', $checkin_date);
         $travel_dates[$total_nights] = $checkin_date[1] . $checkin_date[0] . $checkin_date[2];
         $i = get_gmt_time(strtotime('+1 day', $i));
         $total_nights++;
     }
     for ($i = 1; $i < $total_nights; $i++) {
         $seasonal_prices[$travel_dates[$i]] = "";
     }
     //Store seasonal price of a list in an array
     $seasonal_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id));
     $seasonal_result = $seasonal_query->result_array();
     if ($seasonal_query->num_rows() > 0) {
         foreach ($seasonal_result as $time) {
             //Get Seasonal price
             $seasonalprice_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id, 'start_date' => $time['start_date'], 'end_date' => $time['end_date']));
             $seasonalprice = $seasonalprice_query->row()->price;
             //Days between start date and end date -> seasonal price
             $start_time = $time['start_date'];
             $end_time = $time['end_date'];
             $i = $start_time;
             while ($i <= $end_time) {
                 $start_date = date('m/d/Y', $i);
                 $s_date = explode('/', $start_date);
开发者ID:empotix,项目名称:travelo,代码行数:67,代码来源:payment.php


示例9: availability

 function availability()
 {
     $checkin = $this->input->get('checkin');
     $checkin_time = $checkin;
     $checkin_time = get_gmt_time(strtotime($checkin_time));
     $checkout = $this->input->get('checkout');
     $checkout_time = $checkout;
     $checkout_time = get_gmt_time(strtotime($checkout_time));
     $id = $this->input->get('room_id');
     $conditions = array("id" => $id);
     $result = $this->Common_model->getTableData('list', $conditions);
     if ($result->num_rows() == 0) {
         echo "[ { \"status\":\"Access Denied\" } ]";
     } else {
         $status = 1;
         $daysexist = $this->db->query("SELECT id,list_id,booked_days FROM `calendar` WHERE `list_id` = '" . $id . "' AND (`booked_days` >= '" . $checkin_time . "' AND `booked_days` <= '" . $checkout_time . "') GROUP BY `id`");
         $rowsexist = $daysexist->num_rows();
         if ($rowsexist > 0) {
             $status = 0;
         }
         if ($status == 0) {
             echo "[ { \"status\":\"NO\" } ]";
         } else {
             echo "[ { \"status\":\"YES\" } ]";
         }
     }
 }
开发者ID:BersnardC,项目名称:DROPINN,代码行数:27,代码来源:rooms.php


示例10: 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) {
//.........这里部分代码省略.........
开发者ID:BersnardC,项目名称:DROPINN,代码行数:101,代码来源:calendar.php


示例11: getFeeds

 public function getFeeds()
 {
     //Get the checkin and chekout dates
     $checkin = '';
     $checkout = '';
     $stack = array();
     $room_types = array();
     $property_type_id = array();
     $checkin = $this->input->get('checkin');
     $checkout = $this->input->get('checkout');
     $nof_guest = $this->input->get('guests');
     $room_types = $this->input->get('room_types');
     $min = $this->input->get('price_min');
     $max = $this->input->get('price_max');
     $keywords = $this->input->get('keywords');
     $min_bedrooms = $this->input->get('min_bedrooms');
     $min_bathrooms = $this->input->get('min_bathrooms');
     $min_beds = $this->input->get('min_beds');
     $property_type_id = $this->input->get('property_type_id');
     $hosting_amenities = $this->input->get('hosting_amenities');
     if ($checkin != '--' && $checkout != '--' && $checkin != "yy-mm-dd" && $checkout != "yy-mm-dd" && $checkin != '' && $checkout != '') {
         $ans = $this->db->query("SELECT id,list_id FROM `calendar` WHERE `booked_days` = '" . get_gmt_time(strtotime($checkin)) . "' OR `booked_days` = '" . get_gmt_time(strtotime($checkout)) . "' GROUP BY `list_id`");
         $a = $ans->result();
         $this->db->flush_cache();
         // Now after the checkin is completed
         if (!empty($a)) {
             foreach ($a as $a1) {
                 array_push($stack, $a1->list_id);
             }
         }
     }
     $condition = '';
     $location = $this->input->get('location');
     $pieces = explode(",", $location);
     $print = "";
     $len = count($pieces);
     $condition .= "(`is_enable` != '0')";
     if ($location != '') {
         $i = 1;
         foreach ($pieces as $address) {
             $this->db->flush_cache();
             $address = $this->db->escape_like_str($address);
             if ($i == $len) {
                 $and = "";
             } else {
                 $and = " AND ";
             }
             if ($i == 1) {
                 $condition .= " AND (";
             }
             $condition .= "`address`  LIKE '%" . $address . "%'" . $and;
             if ($i == $len) {
                 $condition .= ")";
             }
             $i++;
         }
     }
     if (!empty($min_bedrooms)) {
         $condition .= " AND (`bedrooms` = '" . $min_bedrooms . "')";
     }
     if (!empty($min_bathrooms)) {
         $condition .= " AND (`bathrooms` = '" . $min_bathrooms . "')";
     }
     if (!empty($min_beds)) {
         $condition .= " AND (`beds` = '" . $min_beds . "')";
     }
     if (!empty($stack)) {
         $condition .= " AND (`id` NOT IN(" . implode(',', $stack) . "))";
     }
     if ($nof_guest > 1) {
         $condition .= " AND (`capacity` = '" . $nof_guest . "')";
     }
     if (is_array($room_types)) {
         if (count($room_types) > 0) {
             $i = 1;
             foreach ($room_types as $room_type) {
                 if ($i == count($room_types)) {
                     $and = "";
                 } else {
                     $and = " AND ";
                 }
                 if ($i == 1) {
                     $condition .= " AND (";
                 }
                 $condition .= "`room_type` = '" . $room_type . "'" . $and;
                 if ($i == count($room_types)) {
                     $condition .= ")";
                 }
                 $i++;
             }
         }
     }
     if (is_array($hosting_amenities)) {
         if (count($hosting_amenities) > 0) {
             $i = 1;
             foreach ($hosting_amenities as $amenity) {
                 if ($i == count($hosting_amenities)) {
                     $and = "";
                 } else {
                     $and = " AND ";
//.........这里部分代码省略.........
开发者ID:BersnardC,项目名称:DROPINN,代码行数:101,代码来源:rss.php


示例12: manageAffiliates


//.........这里部分代码省略.........
                 $this->affiliate_model->addAffiliateWelcomeMsg($insertData);
                 $this->session->set_flashdata('flash_message', $this->common_model->admin_flash_message('success', $this->lang->line('updated_success')));
                 //$this->load->view('affiliate/affilateCenter',$this->outputData);
             } else {
                 $updateKey1 = array('affiliate_welcome_msg.refid' => $this->loggedInUser->user_name, 'id' => $msg_result_row->id);
                 $updateData1 = array();
                 $updateData1['welcome_msg '] = $welcome_msg;
                 //Update Site Settings
                 $this->affiliate_model->updateAffiliateWelcomeMeg($updateKey1, $updateData1);
                 $this->session->set_flashdata('flash_message', $this->common_model->admin_flash_message('success', $this->lang->line('updated_success')));
             }
         }
     }
     // get affiliate welcome messages
     $condition2 = array('affiliate_welcome_msg.refid' => $this->loggedInUser->user_name);
     $msg_result = $this->affiliate_model->getAffiliateWelcomeMsg($condition2);
     $msg_num_rows = $msg_result->num_rows();
     $msg_result_row = $msg_result->row();
     if (isset($msg_result_row->welcome_msg)) {
         $this->outputData['affiliate_welcome_msg'] = $msg_result_row->welcome_msg;
     }
     // insert total affiliate amount
     $this->load->model('affiliate_model');
     $this->load->model('user_model');
     $results = $this->affiliate_model->getReleasePayments();
     //pr($results->result());
     if ($results->num_rows() > 0) {
         foreach ($results->result() as $row) {
             //prepare insert data
             $insertData = array();
             $insertData['refid'] = $row->refid;
             $insertData['account_type'] = $row->account_type;
             $insertData['payment'] = $row->total;
             // get user
             $condition = array('users.user_name' => $insertData['refid']);
             $user_data = $this->user_model->getUsers($condition);
             //$user_data_result = $user_data->result();
             $user_data_row = $user_data->row();
             $user_id = 0;
             if (isset($user_data_row->id)) {
                 if ($user_data_row->id != '') {
                     $user_id = $user_data_row->id;
                 }
             }
             $insertData['user_id'] = $user_id;
             $insertData['created_date'] = get_est_time();
             $date_with_time = show_date($insertData['created_date']);
             $arr = explode(' ', $date_with_time);
             //pr($arr_str);
             for ($i = 0; $i < count($arr); $i++) {
                 $mon = $arr[0];
                 $year = $arr[2];
             }
             $created_date_forrmat = $mon . ", " . $year;
             $insertData['created_date_format'] = $created_date_forrmat;
             $insertData['is_released'] = '0';
             $unrelease_condition = array('refid' => $row->refid, 'is_released' => '0');
             $unrelease_results = $this->affiliate_model->getUnReleasePayments($unrelease_condition);
             $unreleased_row = $unrelease_results->row();
             $released_condition = array('refid' => $row->refid, 'is_released' => '1');
             $released_results = $this->affiliate_model->getUnReleasePayments($released_condition);
             $released_row = $released_results->row();
             if ($unrelease_results->num_rows() > 0) {
                 $updateKey['payment'] = $row->total;
                 $cond = array('affiliate_unreleased_payments.refid' => $row->refid, 'affiliate_unreleased_payments.id' => $unreleased_row->id);
                 $result = $this->affiliate_model->updateUnReleasedPayments(TRUE, $updateKey, $cond);
             } else {
                 if ($released_results->num_rows() > 0) {
                     foreach ($released_results->result() as $row1) {
                         $sales_total = $row->total;
                         $released_total = $row1->total;
                         $check_balance = $sales_total - $released_total;
                         if ($check_balance > 0) {
                             //prepare insert data
                             $insertData1 = array();
                             $insertData1['refid'] = $row->refid;
                             $insertData1['account_type'] = $row->account_type;
                             $insertData1['payment'] = $check_balance;
                             $user_id;
                             $insertData1['user_id'] = $user_id;
                             $insertData1['created_date'] = get_gmt_time();
                             $insertData1['created_date_format'] = $created_date_forrmat;
                             $insertData1['is_released'] = '0';
                             $condition = array('users.user_name' => $insertData1['refid']);
                             $this->affiliate_model->addUnReleasedPayments($insertData1);
                         }
                     }
                 }
             }
             if ($unrelease_results->num_rows() == 0 and $released_results->num_rows() == 0) {
                 $this->affiliate_model->addUnReleasedPayments($insertData);
             }
         }
     }
     //exit;
     $cond = array('affiliate_released_payments.refid' => $this->loggedInUser->user_name);
     $released_amount = $this->affiliate_model->getReleasedPayments($cond);
     $this->outputData['released_amount'] = $released_amount;
     $this->load->view('affiliate/affilateCenter', $this->outputData);
 }
开发者ID:khanals,项目名称:rbs-ext,代码行数:101,代码来源:affiliate.php


示例13: submission_cc


//.........这里部分代码省略.........
         $amt = $contact_result->price + $contact_result->admin_commission;
         $this->session->set_userdata('contacts_offer', $contact_result->offer);
     }
     $ref_total1 = $ref_total + 10;
     if ($amt > $ref_total1) {
         if ($this->db->select('referral_amount')->where('id', $user_id)->get('users')->row()->referral_amount != 0) {
             $referral_amount = $this->db->select('referral_amount')->where('id', $user_id)->get('users')->row()->referral_amount;
             if ($referral_amount > $ref_total) {
                 $final_amt = get_currency_value1($id, $amt) - get_currency_value($ref_total);
             } else {
                 $final_amt = $amt - $referral_amount;
             }
             $amt = $final_amt;
         } else {
             $amt = $amt;
         }
     } else {
         $amt = $amt;
     }
     $amount = $amt;
     if ($contact_key == "") {
         $contact_key = "None";
     }
     //Entering it into data variables
     $row = $this->Common_model->getTableData('payment_details', array('code' => 'PAYPAL_ID'))->row();
     $paymode = $this->db->where('payment_name', 'Paypal')->get('payments')->row()->is_live;
     if ($this->session->userdata('final_amount') != '') {
         $amt = $this->session->userdata('final_amount');
         $this->session->unset_userdata('final_amount');
     } else {
         $amt = get_currency_value1($id, $amt) + $admin_commission;
     }
     //seasonal price
     $checkin_time = get_gmt_time(strtotime($checkin));
     $checkout_time = get_gmt_time(strtotime($checkout));
     $travel_dates = array();
     $seasonal_prices = array();
     $total_nights = 1;
     $total_price = 0;
     $is_seasonal = 0;
     $i = $checkin_time;
     while ($i < $checkout_time) {
         $checkin_date = date('m/d/Y', $i);
         $checkin_date = explode('/', $checkin_date);
         $travel_dates[$total_nights] = $checkin_date[1] . $checkin_date[0] . $checkin_date[2];
         $i = get_gmt_time(strtotime('+1 day', $i));
         //	echo "<pre>";
         //	print_r($i);
         $total_nights++;
     }
     for ($i = 1; $i < $total_nights; $i++) {
         $seasonal_prices[$travel_dates[$i]] = "";
     }
     $seasonal_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id));
     $seasonal_result = $seasonal_query->result_array();
     // echo "<pre>";
     // print_r($seasonal_result);
     if ($seasonal_query->num_rows() > 0) {
         foreach ($seasonal_result as $time) {
             $seasonalprice_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id, 'start_date' => $time['start_date'], 'end_date' => $time['end_date']));
             $seasonalprice = $seasonalprice_query->row()->price;
             //Days between start date and end date -> seasonal price
             $start_time = $time['start_date'];
             $end_time = $time['end_date'];
             $i = $start_time;
             while ($i <= $end_time) {
开发者ID:BersnardC,项目名称:DROPINN,代码行数:67,代码来源:payments.php


示例14: submission


//.........这里部分代码省略.........
                 if ($differNights > 0) {
                     $addAmount = $differNights * $per_night;
                     $finalAmount = $Mprice + $addAmount;
                 }
                 $amt = $finalAmount;
             }
         }
         //Cleaning fee
         if ($cleaning != 0) {
             $amt = $amt + $cleaning;
         }
         if ($security != 0) {
             $amt = $amt + $cleaning;
         } else {
             $amt = $amt;
         }
 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_gmtime函数代码示例发布时间:2022-05-15
下一篇:
PHP get_gmt_from_date函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap