Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
558554c
host db and model
ZLing514 May 11, 2022
72f8835
host db and model_2
ZLing514 May 11, 2022
13d8288
appointment frame-footer replace host-data
ZLing514 May 11, 2022
3306ae7
appointment css_background replace main_color
ZLing514 May 11, 2022
2bf63cb
backend_header+footer replace host_data
ZLing514 May 11, 2022
4547053
backend replace host_data
ZLing514 May 12, 2022
12120fc
Merge pull request #31 from exma-square/host
clonn May 12, 2022
1a0e0f6
docker_question
ZLing514 May 12, 2022
7294c4b
send_notify_to_appoiment
ZLing514 May 13, 2022
ff2deaf
send_notify_to_appoiment_2
ZLing514 May 13, 2022
27105f2
fixed the query method
CaesarEXMA May 13, 2022
64d7308
hide none use echo
CaesarEXMA May 13, 2022
ea33961
get_scheduled_appointments_3
ZLing514 May 13, 2022
196c7ba
line_message_cronjob
ZLing514 May 13, 2022
3da09c5
line_message_cronjob_fix
ZLing514 May 13, 2022
e17af88
line_message_cronjob_fix2
ZLing514 May 13, 2022
7b78bfa
line_message_cronjob_fix3
ZLing514 May 13, 2022
89c8939
line_message_cronjob_fix4
ZLing514 May 13, 2022
f8a220f
fix settings db
ZLing514 May 16, 2022
22d4e0c
cancel send line message
ZLing514 May 16, 2022
df81ac5
fix name: is_notification
ZLing514 May 17, 2022
88372ad
Merge pull request #32 from exma-square/remind_appointment_meassage
ZLing514 May 17, 2022
173e422
can get have lineUserId customer data
ZLing514 May 17, 2022
72687c1
front end connected to back end
ZLing514 May 17, 2022
0160b15
fix front end connected back end
ZLing514 May 17, 2022
8d170d3
fix view book_record
ZLing514 May 19, 2022
8cdba57
fix view book_record_2
ZLing514 May 19, 2022
01ec682
fix view book_record situation
ZLing514 May 19, 2022
b33e5c5
fix view book_record services_name
ZLing514 May 19, 2022
bb092c3
fix view book_record card
ZLing514 May 20, 2022
ae4fca3
fix line_flex book_record url
ZLing514 May 20, 2022
881891f
Merge pull request #33 from exma-square/get_lineUserId_customerData
clonn May 24, 2022
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
57 changes: 57 additions & 0 deletions application/controllers/Appointments.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct()
$this->load->model('services_model');
$this->load->model('customers_model');
$this->load->model('settings_model');
$this->load->model('host_model');
$this->load->library('timezones');
$this->load->library('synchronization');
$this->load->library('notifications');
Expand Down Expand Up @@ -79,6 +80,14 @@ public function index($appointment_hash = '')
$privacy_policy_content = $this->settings_model->get_setting('privacy_policy_content');
$display_any_provider = $this->settings_model->get_setting('display_any_provider');
$timezones = $this->timezones->to_array();
$chinese_name = $this->host_model->get_host('chinese_name');
$english_name = $this->host_model->get_host('english_name');
$url = $this->host_model->get_host('url');
$logo = $this->host_model->get_host('logo');
$description = $this->host_model->get_host('description');
$main_color = $this->host_model->get_host('main_color');
$secondary_color = $this->host_model->get_host('secondary_color');
$text_color = $this->host_model->get_host('text_color');

// Remove the data that are not needed inside the $available_providers array.
foreach ($available_providers as $index => $provider)
Expand Down Expand Up @@ -182,6 +191,14 @@ public function index($appointment_hash = '')
'privacy_policy_content' => $privacy_policy_content,
'timezones' => $timezones,
'display_any_provider' => $display_any_provider,
'chinese_name' => $chinese_name,
'english_name' => $english_name,
'url' => $url,
'logo' => $logo,
'description' => $description,
'main_color' => $main_color,
'secondary_color' => $secondary_color,
'text_color' => $text_color
];
}
catch (Exception $exception)
Expand Down Expand Up @@ -711,5 +728,45 @@ protected function search_providers_by_service($service_id)
return $provider_list;
}

/**
*
*/
public function book_record()
{
try
{
$company_name = $this->settings_model->get_setting('company_name');
$company_address = $this->settings_model->get_setting('company_address');
$company_logo = $this->settings_model->get_setting('company_logo');
$company_banner = $this->settings_model->get_setting('company_banner');
$timezones = $this->timezones->to_array();
$chinese_name = $this->host_model->get_host('chinese_name');
$english_name = $this->host_model->get_host('english_name');
$url = $this->host_model->get_host('url');
$logo = $this->host_model->get_host('logo');
$description = $this->host_model->get_host('description');
$main_color = $this->host_model->get_host('main_color');

// Load the book appointment view.
$variables = [
'company_name' => $company_name,
'company_address' => $company_address,
'company_logo' => $company_logo,
'company_banner' => $company_banner,
'timezones' => $timezones,
'chinese_name' => $chinese_name,
'english_name' => $english_name,
'url' => $url,
'logo' => $logo,
'description' => $description,
'main_color' => $main_color,
];
}
catch (Exception $exception)
{
$variables['exceptions'][] = $exception;
}
$this->load->view('appointments/book_record', $variables);
}

}
41 changes: 41 additions & 0 deletions application/controllers/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function __construct()
$this->load->model('roles_model');
$this->load->model('user_model');
$this->load->model('secretaries_model');
$this->load->model('host_model');
$this->load->model('admins_model');
$this->load->library('timezones');
$this->load->library('migration');
Expand Down Expand Up @@ -79,6 +80,14 @@ public function index($appointment_hash = '')
$view['customers'] = $this->customers_model->get_batch();
$view['calendar_view'] = ! empty($calendar_view_query_param) ? $calendar_view_query_param : $user['settings']['calendar_view'];
$view['timezones'] = $this->timezones->to_array();
$view['chinese_name'] = $this->host_model->get_host('chinese_name');
$view['english_name'] = $this->host_model->get_host('english_name');
$view['url'] = $this->host_model->get_host('url');
$view['logo'] = $this->host_model->get_host('logo');
$view['description'] = $this->host_model->get_host('description');
$view['main_color'] = $this->host_model->get_host('main_color');
$view['secondary_color'] = $this->host_model->get_host('secondary_color');
$view['text_color'] = $this->host_model->get_host('text_color');
$this->set_user_data($view);

if ($this->session->userdata('role_slug') === DB_SLUG_SECRETARY)
Expand Down Expand Up @@ -199,6 +208,14 @@ public function customers()
$view['available_providers'] = $this->providers_model->get_available_providers();
$view['available_services'] = $this->services_model->get_available_services();
$view['timezones'] = $this->timezones->to_array();
$view['chinese_name'] = $this->host_model->get_host('chinese_name');
$view['english_name'] = $this->host_model->get_host('english_name');
$view['url'] = $this->host_model->get_host('url');
$view['logo'] = $this->host_model->get_host('logo');
$view['description'] = $this->host_model->get_host('description');
$view['main_color'] = $this->host_model->get_host('main_color');
$view['secondary_color'] = $this->host_model->get_host('secondary_color');
$view['text_color'] = $this->host_model->get_host('text_color');

if ($this->session->userdata('role_slug') === DB_SLUG_SECRETARY)
{
Expand Down Expand Up @@ -245,6 +262,14 @@ public function services()
$view['services'] = $this->services_model->get_batch();
$view['categories'] = $this->services_model->get_all_categories();
$view['timezones'] = $this->timezones->to_array();
$view['chinese_name'] = $this->host_model->get_host('chinese_name');
$view['english_name'] = $this->host_model->get_host('english_name');
$view['url'] = $this->host_model->get_host('url');
$view['logo'] = $this->host_model->get_host('logo');
$view['description'] = $this->host_model->get_host('description');
$view['main_color'] = $this->host_model->get_host('main_color');
$view['secondary_color'] = $this->host_model->get_host('secondary_color');
$view['text_color'] = $this->host_model->get_host('text_color');
$this->set_user_data($view);

$this->load->view('backend/header', $view);
Expand Down Expand Up @@ -282,6 +307,14 @@ public function users()
$view['working_plan'] = $this->settings_model->get_setting('company_working_plan');
$view['timezones'] = $this->timezones->to_array();
$view['working_plan_exceptions'] = '{}';
$view['chinese_name'] = $this->host_model->get_host('chinese_name');
$view['english_name'] = $this->host_model->get_host('english_name');
$view['url'] = $this->host_model->get_host('url');
$view['logo'] = $this->host_model->get_host('logo');
$view['description'] = $this->host_model->get_host('description');
$view['main_color'] = $this->host_model->get_host('main_color');
$view['secondary_color'] = $this->host_model->get_host('secondary_color');
$view['text_color'] = $this->host_model->get_host('text_color');
$this->set_user_data($view);

$this->load->view('backend/header', $view);
Expand Down Expand Up @@ -319,6 +352,14 @@ public function settings()
$view['system_settings'] = $this->settings_model->get_settings();
$view['user_settings'] = $this->user_model->get_user($user_id);
$view['timezones'] = $this->timezones->to_array();
$view['chinese_name'] = $this->host_model->get_host('chinese_name');
$view['english_name'] = $this->host_model->get_host('english_name');
$view['url'] = $this->host_model->get_host('url');
$view['logo'] = $this->host_model->get_host('logo');
$view['description'] = $this->host_model->get_host('description');
$view['main_color'] = $this->host_model->get_host('main_color');
$view['secondary_color'] = $this->host_model->get_host('secondary_color');
$view['text_color'] = $this->host_model->get_host('text_color');

// book_advance_timeout preview
$book_advance_timeout = $this->settings_model->get_setting('book_advance_timeout');
Expand Down
10 changes: 8 additions & 2 deletions application/controllers/Backend_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ public function ajax_save_appointment()
$response = AJAX_SUCCESS;

//send appointment change line message
line_message_change($settings, $customer, $service, $appointment);
$is_notification = $this->input->post('is_notification');
if($is_notification == 1){
line_message_change($settings, $customer, $service, $appointment);
}

}
catch (Exception $exception)
Expand Down Expand Up @@ -474,7 +477,10 @@ public function ajax_delete_appointment()
}

//send appointment delet line message
line_message_delete($settings, $customer, $service, $appointment);
$is_notification = $this->input->post('is_notification');
if($is_notification == 1){
line_message_delete($settings, $customer, $service, $appointment);
}

}
catch (Exception $exception)
Expand Down
41 changes: 41 additions & 0 deletions application/controllers/Cronjob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');

class Cronjob extends EA_Controller {

public function __construct()
{
parent::__construct();

$this->load->helper('line_message');
$this->load->model('appointments_model');
$this->load->model('providers_model');
$this->load->model('services_model');
$this->load->model('customers_model');
$this->load->model('settings_model');
$this->load->library('timezones');
}

public function send_notify_to_appoiment()
{
$appointment = [];
$remind_time = $this->settings_model->get_setting('remind_time');
$day_start = $remind_time;
$day_end = $remind_time +1;
$appointments = $this->appointments_model->get_scheduled_appointments($day_start, $day_end);

if(count($appointments) > 0){
$settings = [
'company_name' => $this->settings_model->get_setting('company_name'),
'company_address' => $this->settings_model->get_setting('company_address'),
];
foreach ($appointments as $appointment) {
$provider = $this->providers_model->get_row($appointment['id_users_provider']);
$service = $this->services_model->get_row($appointment['id_services']);
$customer = $this->customers_model->get_row($appointment['id_users_customer']);
line_message_cronjob($settings, $provider, $service, $customer, $appointment);
}
}
print_r($appointments);
// echo json_encode($datetime);
}
}
31 changes: 31 additions & 0 deletions application/controllers/Customer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');

class Customer extends EA_Controller {

public function __construct()
{
parent::__construct();

$this->load->model('customers_model');
}

public function send_customer_to_appoiment()
{
$lineUserId = $this->input->post('lineUserId');

if (empty($lineUserId))
{
$response = ['warnings' => 'Error line user id is required'];
}
else
{
$lineUserId_customerData = $this->customers_model->get_data_from_line_id($lineUserId);
$response = $lineUserId_customerData;
}

$this->output
->set_content_type('application/json')
->set_output(json_encode($response));

}
}
39 changes: 39 additions & 0 deletions application/controllers/Record.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');

class Record extends EA_Controller {

public function __construct()
{
parent::__construct();

$this->load->model('appointments_model');
$this->load->model('providers_model');
$this->load->model('services_model');
$this->load->model('customers_model');
$this->load->model('settings_model');
}

public function get_appointments_from_line_id()
{
$lineUserId = $this->input->post('lineUserId');

if (empty($lineUserId))
{
$response = ['warnings' => 'Error line user id is required'];
}
else
{
$customer_id = $this->customers_model->get_value_from_line_id('id', $lineUserId);
$appointments = $this->appointments_model->get_appointments_from_customer($customer_id);

foreach($appointments as $id_services => $appointments)
{
$service = $this->services_model->get_row($appointments['id_services']);
$response[] = $appointments + $service;
}
}
$this->output
->set_content_type('application/json')
->set_output(json_encode($response));
}
}
Loading