<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class borrow extends CI_Controller {
	public function __construct()
	{
        parent::__construct();
		// echo("test");
		$this->load->helper('application_helper');
		$this->load->model('gear_model');
        $this->load->view('templates/header');
        $this->load->view('templates/footer');
	}

	public function borrow()
	{
		$output['data']['gear']= $this->gear_model->get_stuff();
		// dbg($output);
        render('borrow/borrow',$output);
	}

	public function save($id=null){
		// dbg($_POST);
		$postData=json_decode($_POST['gear_selected']);
		dbg($postData);
		//TODO data validation
		if($id){
			// save the edited entry
			$this->gear_model->edit_asset($_POST,$id);
		} else {
			// save the new entry
			unset($_POST[0]); //This randomly gets added and it's easier to fix like this :)
			$this->gear_model->save_new_asset($_POST);
		}
		redirect('gear/view');
	}
}<commit_msg>im tired. finish borrow later<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class borrow extends CI_Controller {
	public function __construct()
	{
        parent::__construct();
		// echo("test");
		$this->load->helper('application_helper');
		$this->load->model('gear_model');
        $this->load->view('templates/header');
        $this->load->view('templates/footer');
	}

	public function borrow()
	{
		$output['data']['gear']= $this->gear_model->get_stuff();
		// dbg($output);
        render('borrow/borrow',$output);
	}

	public function save($id=null){
		// dbg($_POST);
		$postData=json_decode($_POST['gear_selected']);

		// get borrow id
		// get person
		// get deposit (now())
		// get date
		dbg($postData);
		//TODO data validation
		//EG if empty

		if($id){
			// save the edited entry
			$this->gear_model->edit_asset($_POST,$id);
		} else {
			// save the new entry
			unset($_POST[0]); //This randomly gets added and it's easier to fix like this :)
			$this->gear_model->save_new_asset($_POST);
		}
		redirect('gear/view');
	}
}
{'fraction_non_alphanumeric': 0.1875, 'fraction_numerical': 0.0009689922480620155, 'mean_word_length': 3.7911832946635733, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3084391', 'n_tokens_mistral': 738, 'n_tokens_neox': 674, 'n_words': 141}