From c90f3bbab129f6114f0557b65a368c4e9d147ef7 Mon Sep 17 00:00:00 2001 From: RameshT Date: Mon, 5 Aug 2024 12:53:53 +0530 Subject: [PATCH] Test Husky pre-commit hook. --- application/controllers/Form.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/controllers/Form.php b/application/controllers/Form.php index 926d997..9cc8f94 100644 --- a/application/controllers/Form.php +++ b/application/controllers/Form.php @@ -11,18 +11,22 @@ class Form extends CI_Controller public function __construct() { parent::__construct(); - $this->load->model('Form_model') + $this->load->model('Form_model'); } public function submit() { + + + if (!$this->session->userdata('logged_in')) { - // If not logged in, redirect to login page redirect('users/login'); } $form_data = json_decode($this->input->raw_input_stream, true); $this->load->model('Form_model'); + + if ($this->Form_model->save_form($form_data)) { $response = array('status' => 'success', 'message' => 'Form submitted successfully.'); } else {