diff --git a/application/config/routes.php b/application/config/routes.php index c8b9593..92e526a 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -5,14 +5,20 @@ $route['forms'] = 'home/index4'; $route['responses/list/(:num)'] = 'Response_submit/list_responses/$1'; $route['responses/view/(:num)'] = 'Response_submit/viewresponse/$1'; - +$route['publish/(:num)'] = 'forms/preview/$1'; $route['default_controller'] = 'Form_controller/index_forms'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; $route['start'] = 'Form_controller/index_forms'; -$route['new_form'] = 'home/create_form'; -$route['title_desc'] = 'home/title'; -$route['default_page'] = 'Form_controller/index_forms'; +// $route['new_form'] = 'home/create_form'; +$route['title_desc'] = 'homepage/title'; $route['forms/delete/(:any)'] = 'Form_controller/delete/$1'; -// $route['froms_home'] = 'Form_controller/index_forms'; +$route['home'] = 'Form_controller/index_forms'; +$route['published_forms'] = 'Publish_controller/list_user_published_forms'; +$route['drafts'] = 'Form_controller/index_forms_draft'; +$route['edit/(:num)'] = 'Form_controller/edit_form/$1'; + +$route['form_preview/(:num)'] = 'forms/preview_back/$1'; +$route['responses/(:num)'] = 'Response_submit/view_responses/$1'; +$route['designform'] = 'homepage/design_form'; diff --git a/application/controllers/Form_controller.php b/application/controllers/Form_controller.php index 2f0c987..8123384 100644 --- a/application/controllers/Form_controller.php +++ b/application/controllers/Form_controller.php @@ -39,7 +39,7 @@ class Form_controller extends CI_Controller { $this->load->model('Frontend_model'); $this->Frontend_model->deleteForm($id); $this->session->set_flashdata('status','Form data deleted successfully'); -redirect('default_page'); +redirect('home'); } public function __construct() { parent::__construct(); diff --git a/application/controllers/Home.php b/application/controllers/Home.php index 42a82c8..a06f8b4 100644 --- a/application/controllers/Home.php +++ b/application/controllers/Home.php @@ -1,11 +1,11 @@ load->view('Frontend/header'); diff --git a/application/controllers/New_form.php b/application/controllers/New_form.php index f2dab84..0d12807 100644 --- a/application/controllers/New_form.php +++ b/application/controllers/New_form.php @@ -27,7 +27,7 @@ class New_form extends CI_Controller // $this->session->set_flashdata('user_registered', 'You are now registered and can log in'); - redirect('home/design_form'); + redirect('designform'); } } diff --git a/application/controllers/Publish_controller.php b/application/controllers/Publish_controller.php index a04a305..c159a7c 100644 --- a/application/controllers/Publish_controller.php +++ b/application/controllers/Publish_controller.php @@ -19,7 +19,7 @@ class Publish_controller extends CI_Controller { ]); // Redirect to the list_user_published_forms function - redirect('Publish_controller/list_user_published_forms'); + redirect('published_forms'); } // Method to list published forms of a user @@ -49,6 +49,6 @@ class Publish_controller extends CI_Controller { $this->Publish_model->update_form($form_id, ['is_published' => 0]); // Redirect to the list_user_published_forms function - redirect('Publish_controller/list_user_published_forms'); + redirect('published_forms'); } } diff --git a/application/controllers/Response_submit.php b/application/controllers/Response_submit.php index a23d016..6032f5b 100644 --- a/application/controllers/Response_submit.php +++ b/application/controllers/Response_submit.php @@ -14,7 +14,7 @@ class Response_submit extends CI_Controller { $data['questions'] = $questions; // Redirect to the view_responses function in the Response_submit controller - redirect('Response_submit/view_responses/' . $form_id); + redirect('responses/' . $form_id); } public function view_responses($form_id) { @@ -66,7 +66,7 @@ class Response_submit extends CI_Controller { $this->Response_model->insert_response_answer($data); } - redirect('Response_submit/view_responses/' . $form_id); + redirect('responses/' . $form_id); } diff --git a/application/controllers/Users.php b/application/controllers/Users.php index 2dd567f..9d42e47 100644 --- a/application/controllers/Users.php +++ b/application/controllers/Users.php @@ -71,7 +71,7 @@ class Users extends CI_Controller // Set message $this->session->set_flashdata('user_loggedin', 'You are now logged in'); - redirect('default_page'); + redirect('home'); } else { // Set message $this->session->set_flashdata('login_failed', 'Login is invalid'); diff --git a/application/views/Tables/draft.php b/application/views/Tables/draft.php index 0d7355b..f6f9d1c 100644 --- a/application/views/Tables/draft.php +++ b/application/views/Tables/draft.php @@ -30,17 +30,17 @@ Drafts