<commit_before><?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Create_subject_offer extends CI_Capstone_Controller
{

        function __construct()
        {
                parent::__construct();
                $this->load->model('Subject_offer_model');
                $this->load->library('form_validation');
                $this->form_validation->set_error_delimiters('<span class="help-inline">', '</span> ');
                $this->breadcrumbs->unshift(2, lang('index_subject_heading_th'), 'subjects');
                $this->breadcrumbs->unshift(3, lang('index_subject_offer_heading'), 'subject-offers');
                $this->breadcrumbs->unshift(4, lang('create_subject_offer_heading'), 'create-subject-offer');
                /**
                 * for check box, in days
                 */
                $this->load->library('table');
                $this->load->helper('time');
        }

        /**
         * @Contributor: <NAME> <<EMAIL>>
         *         
         */
        public function index()
        {
                if ($this->input->post('submit'))
                {
                        $id = $this->Subject_offer_model->from_form(NULL, array(
                                    'created_user_id' => $this->session->userdata('user_id')
                                ))->insert();
                        if ($id)
                        {
                                $this->session->set_flashdata('message', lang('create_subject_offer_succesfully_added_message'));
                                redirect(site_url('create-subject-offer'), 'refresh');
                        }
                }
                $this->_form_view();
        }

        public function subject_offer_check_check_conflict()<commit_msg>add additional data in insert subject offer, semester and year<commit_after><?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Create_subject_offer extends CI_Capstone_Controller
{

        function __construct()
        {
                parent::__construct();
                $this->load->model('Subject_offer_model');
                $this->load->library('form_validation');
                $this->form_validation->set_error_delimiters('<span class="help-inline">', '</span> ');
                $this->breadcrumbs->unshift(2, lang('index_subject_heading_th'), 'subjects');
                $this->breadcrumbs->unshift(3, lang('index_subject_offer_heading'), 'subject-offers');
                $this->breadcrumbs->unshift(4, lang('create_subject_offer_heading'), 'create-subject-offer');
                /**
                 * for check box, in days
                 */
                $this->load->library('table');
                $this->load->helper('time');
        }

        /**
         * @Contributor: <NAME> <<EMAIL>>
         *         
         */
        public function index()
        {
                if ($this->input->post('submit'))
                {
                        $this->load->helper('school');
                        $id = $this->Subject_offer_model->from_form(NULL, array(
                                    'subject_offer_semester'    => current_school_semester(TRUE),
                                    'subject_offer_school_year' => current_school_year(),
                                    'created_user_id'           => $this->session->userdata('user_id')
                                ))->insert();
                        if ($id)
                        {
                                $this->session->set_flashdata('message', lang('create_subject_offer_succesfully_added_message'));
                                redirect(site_url('create-subject-offer'), 'refresh');
                        }
                }
                $this->_form_view();
        }

        public function subject_offer_check_check_conflict()
{'fraction_non_alphanumeric': 0.1327683615819209, 'fraction_numerical': 0.0015408320493066256, 'mean_word_length': 1.5292207792207793, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3863462', 'n_tokens_mistral': 1018, 'n_tokens_neox': 945, 'n_words': 133}