From b419e804bbea0d53d9c85f5df0632434cf79716f Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:59:05 +0200 Subject: [PATCH] Added updated controller --- application/controllers/Labels.php | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index ef12376b..366c4760 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -88,6 +88,39 @@ class Labels extends CI_Controller { } + /* + |-------------------------------------------------------------------------- + | Function: createpaper + |-------------------------------------------------------------------------- + | + | Shows the form used to create a paper type. + | + */ + public function createpaper() { + + $data['page_title'] = "Create Paper Type"; + + $this->load->library('form_validation'); + + $this->form_validation->set_rules('paper_name', 'Paper Name', 'required'); + + if ($this->form_validation->run() == FALSE) + { + $this->load->view('interface_assets/header', $data); + $this->load->view('labels/createpaper'); + $this->load->view('interface_assets/footer'); + } + else + { + $this->load->model('labels_model'); + $this->labels_model->addPaper(); + + redirect('labels'); + } + + } + + public function printids() { $ids = xss_clean(json_decode($this->input->post('id'))); $offset = xss_clean($this->input->post('startat'));