Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions config/menu.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
<?php
$module_menu = array(
// array(
// 'label' => 'Integrations',
// 'location' => 'SECONDARY',
// 'parent_menu' => 'settings',
// 'link' => 'integrations'
// ),
// array(
// 'label' => 'Online Booking Engine',
// 'location' => 'THIRD',
// 'parent_menu' => 'integrations',
// 'link' => 'integrations/booking_engine'
// ),

);
$module_menu = array();
484 changes: 10 additions & 474 deletions controllers/integrations.php

Large diffs are not rendered by default.

704 changes: 318 additions & 386 deletions controllers/online_reservation.php

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions language/english/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,24 @@
$lang['online-booking-engine']['Please select a date range between %d and %d nights'] = 'Please select a date range between %d and %d nights';
$lang['online-booking-engine']['Please select a date range'] = 'Please select a date range';

$lang['online-booking-engine']['online_booking_engine_widget_code'] = 'online booking engine widget code';
$lang['online-booking-engine']['online_reservation_work_properly'] = 'online_reservation_work_properly';
$lang['online-booking-engine']['Create'] = 'Create';
$lang['online-booking-engine']['Rate Plans'] = 'Rate Plans';
$lang['online-booking-engine']['Update your property information in'] = 'Update your property information in';
$lang['online-booking-engine']['Property Settings'] = 'Property Settings';
$lang['online-booking-engine']['Set the appropriate rooms in'] = 'Set the appropriate rooms in';
$lang['online-booking-engine']['Room Settings'] = 'Room Settings';
$lang['online-booking-engine']['Online booking engine link'] = 'Online booking engine link';
$lang['online-booking-engine']['Online booking engine fields'] = 'Online booking engine fields';
$lang['online-booking-engine']['Show on booking form'] = 'Show on booking form';
$lang['online-booking-engine']['Is a required field'] = 'Is a required field';
$lang['online-booking-engine']['No booking field have been found.'] = 'No booking field have been found.';
$lang['online-booking-engine']['save_all'] = 'Save All';
$lang['online-booking-engine']['If this feature is disabled, online reservations check-in date must be tomorrow or later'] = 'If this feature is disabled, online reservations check-in date must be tomorrow or later';
$lang['online-booking-engine']['Enabled'] = 'Enabled';
$lang['online-booking-engine']['Disabled'] = 'Disabled';



?>
97 changes: 1 addition & 96 deletions models/booking_log_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,105 +27,10 @@ function insert_log($data)
{
return null;
}
// insert_id function won't work as it converts id(bigint) to int, results in incorrect value
// return $this->db->insert_id();

}



function insert_logs($data)
{
$this->db->insert_batch("booking_log", $data);

if ($this->db->_error_message())
{
show_error($this->db->_error_message());
}
$query = $this->db->query('select LAST_INSERT_ID( ) AS last_id');
$result = $query->result_array();
if(isset($result[0]))
{
return $result[0]['last_id'];
}
else
{
return null;
}
// insert_id function won't work as it converts id(bigint) to int, results in incorrect value
// return $this->db->insert_id();

}

function get_booking_logs($booking_id)
{
$sql = "
SELECT bl.*, u.id, up.first_name, up.last_name, u.email
FROM booking_log as bl
LEFT JOIN users as u ON bl.user_id = u.id
LEFT JOIN user_profiles as up ON u.id = up.user_id
WHERE
bl.booking_id = '$booking_id'
ORDER BY date_time ASC
";

$q = $this->db->query($sql);

if ($this->db->_error_message())
{
show_error($this->db->_error_message());
}

$result = $q->result_array();

return $result;
}

function get_action_report($company_id, $from_date, $to_date, $user_id='', $start_time = '', $end_time = '', $include_sibling_dates = null)
{
$employee_query = '';
if ($user_id != '')
{
$employee_query = " AND bl.user_id = '$user_id'";
}
$start_time_sql = "";
if($start_time){
$start_time_sql = "AND DATE_FORMAT(bl.date_time,'%H:%i') >= '$start_time'";
}
$end_time_sql = "";
if($end_time){
$end_time_sql = "AND DATE_FORMAT(bl.date_time,'%H:%i') <= '$end_time'";
}

// $date_sql = "DATE(bl.date_time) = '$date'";
$date_sql = "DATE(bl.selling_date) >= '$from_date' AND DATE(bl.selling_date) <= '$to_date' ";
if($include_sibling_dates && $from_date && $to_date){
$prev_date = date("Y-m-d", strtotime($from_date));
$next_date = date("Y-m-d", strtotime($to_date));
$date_sql = "DATE(bl.selling_date) >= '$prev_date' AND DATE(bl.selling_date) <= '$next_date' ";
}
$sql = "
SELECT bl.date_time, up.first_name, up.last_name, bl.log, b.booking_id, bl.log_type
FROM booking_log as bl, users as u, user_profiles as up, booking as b
WHERE
b.company_id = '$company_id' AND
b.booking_id = bl.booking_id AND
bl.user_id = u.id AND
u.id = up.user_id AND
$date_sql
$employee_query $start_time_sql $end_time_sql
ORDER BY bl.date_time ASC
";

$q = $this->db->query($sql);

if ($this->db->_error_message())
{
show_error($this->db->_error_message());
}

$result = $q->result();

return $result;
}

}
Loading