<commit_before><?php

class pages extends CI_Controller {
	public function index()
	{	$data['page'] = "Home";
		$this->load->model('Product_model');	
		$pdata = $this->Product_model->newProduct();
		$num = 0;
    	foreach($pdata->result_array() as $rows){
			$num++;
			$tdata[$num] = $rows;
		}
		$temp['data'] = $tdata;
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('home.php',$temp);
		$this->load->view('footer.php');
	}
	public function register()
	{
		$data['page'] = "Register";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('register.php');
		$this->load->view('footer.php');
	}
	public function confirm()
	{
		$data['page'] = "confirm";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('confirm.php');
		$this->load->view('footer.php');
	}
	public function iden()
	{
		$data['page'] = "identify";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('indentify.php');
		$this->load->view('footer.php');
	}
	public function login(){
		if($this->session->userdata('username')){
			$sess = $this->session->all_userdata();
			echo"<script language='javascript'>
    window.location.href = '../../../pages/member/".$sess['username']."';
</script>";
		}
		$data['page'] = "Log in";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('login.php');	
		$this->load->view('footer.php');
	}
	public function addproduct(){
		$this->load->model('member_model');
		$sess = $this->session->all_userdata();
		$checkiden = $this->member_model->memberDetail($sess);
		if($checkiden['iden']==0)
			echo"<script language='javascript'>
	alert('Please identify first');
    window.location.href = '../../../pages/member/".$sess['username']."';
</script>";
		$data['page'] = "addproduct";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('add_product.php');	
		$this->load->view('footer.php');
	}
	public function editproduct(){
		if($this->session->userdata('username')){
			$data = $this->session->all_userdata();
			$id = $data['username'];		
			if ($this->uri->segment(3) === FALSE)
				echo"<script language='javascript'>
		window.location.href = '../../../pages/member/".$data['username']."';
	</script>";
			else{
				$this->load->model('Product_model');
				$pdata = $this->Product_model->getproductdetail($this->uri->segment(3));
				$head['page'] = "Edit product";	
				$this->load->helper('body.php');
				$this->load->view('header.php',$head);
				$this->load->view('space.php');
				$this->load->view('edit_product.php',$pdata);
				$this->load->view('footer.php');
			}
		}
		else
			echo"<script language='javascript'>
		window.location.href = '../../../pages';
	</script>";
	}
	public function displayproduct(){
		$this->load->model('Product_model');	
		$data = $this->Product_model->getproductdetail();
		$this->load->helper('body.php');
		$this->load->view('header.php');
		$this->load->view('space.php');
		$this->load->view('display_product.php',$data);
		$this->load->view('footer.php');
	}
	public function message(){
		$data['page'] = "Message"; 
		$this->load->helper('body.php');<commit_msg>test24<commit_after><?php

class pages extends CI_Controller {
	public function index()
	{	$data['page'] = "Home";
		$this->load->model('Product_model');	
		$pdata = $this->Product_model->newProduct();
		$num = 0;
    	foreach($pdata->result_array() as $rows){
			$num++;
			$tdata[$num] = $rows;
		}
		$temp['data'] = $tdata;
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('home.php',$temp);
		$this->load->view('footer.php');
	}
	public function register()
	{
		$data['page'] = "Register";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('register.php');
		$this->load->view('footer.php');
	}
	public function confirm()
	{
		$data['page'] = "confirm";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('confirm.php');
		$this->load->view('footer.php');
	}
	public function iden()
	{
		$data['page'] = "identify";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('indentify.php');
		$this->load->view('footer.php');
	}
	public function login(){
		if($this->session->userdata('username')){
			$sess = $this->session->all_userdata();
			echo"<script language='javascript'>
    window.location.href = '../../../pages/member/".$sess['username']."';
</script>";
		}
		$data['page'] = "Log in";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('login.php');	
		$this->load->view('footer.php');
	}
	public function addproduct(){
		$this->load->model('member_model');
		$sess = $this->session->all_userdata();
		$checkiden = $this->member_model->memberDetail($sess);
		if($checkiden['iden']==0)
			echo"<script language='javascript'>
	alert('Please identify first');
    window.location.href = '../../../pages/member/".$sess['username']."';
</script>";
		$data['page'] = "addproduct";
		$this->load->helper('body.php');
		$this->load->view('header.php',$data);
		$this->load->view('space.php');
		$this->load->view('add_product.php');	
		$this->load->view('footer.php');
	}
	public function editproduct(){
		if($this->session->userdata('username')){
			$data = $this->session->all_userdata();
			$id = $data['username'];		
			if ($this->uri->segment(3) === FALSE)
				echo"<script language='javascript'>
		window.location.href = '../../../pages/member/".$data['username']."';
	</script>";
			else{
				$this->load->model('Product_model');
				$pdata = $this->Product_model->getproductdetail($this->uri->segment(3));
				$head['page'] = "Edit product";	
				$this->load->helper('body.php');
				$this->load->view('header.php',$head);
				$this->load->view('space.php');
				//$this->load->view('edit_product.php',$pdata);
				$this->load->view('footer.php');
			}
		}
		else
			echo"<script language='javascript'>
		window.location.href = '../../../pages';
	</script>";
	}
	public function displayproduct(){
		$this->load->model('Product_model');	
		$data = $this->Product_model->getproductdetail();
		$this->load->helper('body.php');
		$this->load->view('header.php');
		$this->load->view('space.php');
		$this->load->view('display_product.php',$data);
		$this->load->view('footer.php');
	}
	public function message(){
		$data['page'] = "Message"; 
		$this->load->helper('body.php');
{'fraction_non_alphanumeric': 0.26796729307129535, 'fraction_numerical': 0.0014345144168698895, 'mean_word_length': 4.42568093385214, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 245, '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': '798489', 'n_tokens_mistral': 2696, 'n_tokens_neox': 2486, 'n_words': 303}