📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
otelscripti.demodesign.com.tr
/
application
/
models
📝
Reservation.php
← Geri Dön
<?php class Reservation extends CI_Model { /** * İlgili koşula uygun müsaitlik kontrolü yapar * * @param array $kosul * @return mixed */ public function getMusaitlikKontrol($kosul = []) { $sorgu = $this->db->where($kosul)->order_by("musteri", "asc")->get('reservations_musaitlik')->row(); //echo $this->db->last_query(); return $sorgu; } /** * insert * * @return mixed */ public function insert() { $room = $this->session->userdata('oda_'.$this->session->userdata('roomId')); $input = $this->session->userdata('input'); $yatakFiyat = $room['room']->yatak_fiyat * $this->input->post('yatak'); $data = [ 'fullname' => $this->input->post('fullname'), 'phone' => $this->input->post('phone'), 'email' => $this->input->post('email'), 'address' => $this->input->post('address'), 'message' => $this->input->post('rez_notu'), 'enterDate' => $this->date->set($input['girisTarihi'])->mysqlDate(), 'releaseDate' => $this->date->set($input['cikisTarihi'])->mysqlDate(), 'room_id' => $room['room']->id, 'room_count' => $input['rooms'], 'adults' => $input['adults'], 'children' => $input['children'], 'yatak' => $this->input->post('yatak'), 'oda_fiyat' => $room['odaFiyat'], 'yatak_fiyat' => $yatakFiyat, 'toplam_fiyat' => $room['odaFiyat'] + $yatakFiyat, 'ip' => $this->input->ip_address(), 'date' => $this->date->set()->mysqlDatetime(), ]; $this->db->insert('reservations', $data); $success = $this->db->insert_id(); if ($success && $this->module->arguments->notification == true) { $this->load->library('email'); $this->email->initialize([ 'smtp_host' => $this->site->get('smtpHost'), 'smtp_port' => $this->site->get('smtpPort'), 'smtp_user' => $this->site->get('smtpUser'), 'smtp_pass' => $this->site->get('smtpPass'), ]); $this->email->from($this->input->post('email'), htmlspecialchars($this->input->post('fullname'))); $this->email->to($this->module->arguments->notificationMail); $this->email->subject('Rezervasyon Bildirimi'); $this->email->message($this->load->view('reservation/mail', $data, true)); $this->email->send(); } return $success; } /* public function getHotels() { $result = $this->db ->from('hotels') ->where('language', $this->language) ->order_by('order', 'asc') ->get() ->result(); foreach( $result as $rooms ): $rooms->room = $this->db ->from('rooms') ->where('hotelId', $rooms->id) ->where('language', $this->language) ->order_by('order', 'asc') ->get() ->result(); endforeach; return $result; } public function getHotel($hotelId) { return $this->db ->from('hotels') ->where('id', $hotelId) ->where('language', $this->language) ->get() ->row(); } */ public function getRooms() { return $this->db ->from('rooms') //->where('hotelId', $hotelId) ->where('language', $this->language) ->order_by('order', 'asc') ->get() ->result(); } public function getRoom($roomId) { return $this->db ->from('rooms') ->where('id', $roomId) ->where('language', $this->language) ->get() ->row(); } }
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula