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

class Home extends CI_Controller {

	private $view_data = [];
	private $page_limit = 8;

	public function __construct()
	{
		parent::__construct();
		$this->output->enable_profiler();
		$this->load->model("Search");
		$this->load->library("pagination");
		$this->view_data["categories"] = $this->Search->fetch_categories();
	}

	public function index (){
		// $this->session->sess_destroy();
		// $this->session->set_userdata('selected_prouducts',[]);
		header("Location:/add");
	}



	public function index2()
	{
		$this->session->set_userdata("page_at", $this->uri->segment(2));
		
		$sort_by = ($this->uri->segment(3)) ? $this->uri->segment(3) : "low_price";
		$total_rows = $this->Search->record_count();

		$this->products_list("/home/index/$sort_by", $total_rows, 4, $sort_by, 0);
		$this->view_data["title"] = "All $total_rows items";
		$this->load->view("index", $this->view_data);
	}<commit_msg>Home index change<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends CI_Controller {

	private $view_data = [];
	private $page_limit = 8;

	public function __construct()
	{
		parent::__construct();
		$this->output->enable_profiler();
		$this->load->model("Search");
		$this->load->library("pagination");
		$this->view_data["categories"] = $this->Search->fetch_categories();
	}

	public function index()
	{
		$this->session->set_userdata("page_at", $this->uri->segment(2));
		
		$sort_by = ($this->uri->segment(3)) ? $this->uri->segment(3) : "low_price";
		$total_rows = $this->Search->record_count();

		$this->products_list("/home/index/$sort_by", $total_rows, 4, $sort_by, 0);
		$this->view_data["title"] = "All $total_rows items";
		$this->load->view("index", $this->view_data);
	}
{'fraction_non_alphanumeric': 0.21139101861993428, 'fraction_numerical': 0.007119386637458927, 'mean_word_length': 5.410526315789474, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, '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': '4310198', 'n_tokens_mistral': 672, 'n_tokens_neox': 623, 'n_words': 104}