diff --git a/application/controllers/Station.php b/application/controllers/Station.php index 78f138d32..a11639dd0 100644 --- a/application/controllers/Station.php +++ b/application/controllers/Station.php @@ -32,6 +32,7 @@ class Station extends CI_Controller $this->form_validation->set_rules('station_profile_name', 'Station Profile Name', 'required'); $this->form_validation->set_rules('dxcc', 'DXCC', 'required'); + $this->form_validation->set_rules('gridsquare', 'Locator', 'callback_check_locator'); if ($this->form_validation->run() == FALSE) { $data['page_title'] = __("Create Station Location"); @@ -52,6 +53,7 @@ class Station extends CI_Controller $data['page_title'] = __("Edit Station Location: ") . $data['my_station_profile']->station_profile_name; $this->form_validation->set_rules('dxcc', 'DXCC', 'required'); + $this->form_validation->set_rules('gridsquare', 'Locator', 'callback_check_locator'); if ($this->form_validation->run() == FALSE) { $this->load->view('interface_assets/header', $data); $this->load->view('station_profile/edit'); @@ -180,4 +182,14 @@ class Station extends CI_Controller } } + function check_locator($grid = '') { + $this->load->library('Qra'); + if ($this->qra->validate_grid($grid)) { + return true; + } else { + $this->form_validation->set_message('check_locator', 'Please check value for grid locator ('.strtoupper($grid).').'); + return false; + } + } + } diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index 1481fb13b..3375ef2cb 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -28,6 +28,20 @@ if ($dxcc_list->result() > 0) { + session->flashdata('notice')) { ?> +
+ session->flashdata('notice'); ?> +
+ + + load->helper('form'); ?> + + +
+ +
+ +
@@ -36,16 +50,6 @@ if ($dxcc_list->result() > 0) {

- session->flashdata('notice')) { ?> -
- session->flashdata('notice'); ?> -
- - - load->helper('form'); ?> - - -
diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php index 3c727af93..2b3ab30d0 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -43,7 +43,11 @@ if ($dxcc_list->result() > 0) { load->helper('form'); ?> - + +
+ +
+ station_id != NULL) { $form_action = __("Update"); diff --git a/application/views/user/edit.php b/application/views/user/edit.php index 545482245..beef056cf 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -30,7 +30,6 @@
- x