<commit_before><?php
class Home_model extends CI_Model
{
		public function __construct()
		{
			$this->load->database();
			$this->load->helper('url');
			$this->load->helper('cookie');
		}
		
		public function search_pg($city, $area, $gender,$range="",$type="")
		{
			$this->db->select('*');
	        $this->db->where('city',$city);
	        $this->db->where('gender',$gender);
	        if($range!="")
	        {
	        	$arr = explode('_', $range);
	        	$min = $arr[0];
	        	$max = $arr[1];
	        	$this->db->where('price_from >= ',$min);
	        	$this->db->where('price_from <= ',$max);
	        	$this->db->where('price_to >= ',$min);
	        	$this->db->where('price_to <= ',$max);
	        }
	        if($type!="")
	        {
	        	$this->db->where('type',$type);
	        }
	        $this->db->like('area',$area);

	        $query=$this->db->get('pg');
	        $result=$query->result_array();
	        
        	$this->db->select('*');
        	$this->db->from('search');
        	$this->db->where('area',$area);
        	$query2=$this->db->get();
        	$row=$query2->num_rows();
        	if($row<=0)
        	{
		        $data = array(
	        		'area' => $area,
	        		'city' => $city,
	        		'count' => 1
        		);
        		$this->db->insert('search',$data);
	        }
	        else
	        {<commit_msg>city wide search<commit_after><?php
class Home_model extends CI_Model
{
		public function __construct()
		{
			$this->load->database();
			$this->load->helper('url');
			$this->load->helper('cookie');
		}
		
		public function search_pg($city, $area="", $gender,$range="",$type="")
		{
			$this->db->select('*');
	        $this->db->where('city',$city);
	        $this->db->where('gender',$gender);
	        if($range!="")
	        {
	        	$arr = explode('_', $range);
	        	$min = $arr[0];
	        	$max = $arr[1];
	        	$this->db->where('price_from >= ',$min);
	        	$this->db->where('price_from <= ',$max);
	        	$this->db->where('price_to >= ',$min);
	        	$this->db->where('price_to <= ',$max);
	        }
	        if($type!="")
	        {
	        	$this->db->where('type',$type);
	        }
	        if($area!="")
	        {	
	        	$this->db->where('area',$area);
	        }
	        
	        $query=$this->db->get('pg');
	        $result=$query->result_array();
	        
        	$this->db->select('*');
        	$this->db->from('search');
        	$this->db->where('area',$area);
        	$query2=$this->db->get();
        	$row=$query2->num_rows();
        	if($row<=0)
        	{
		        $data = array(
	        		'area' => $area,
	        		'city' => $city,
	        		'count' => 1
        		);
        		$this->db->insert('search',$data);
	        }
	        else
	        {
{'fraction_non_alphanumeric': 0.2363963963963964, 'fraction_numerical': 0.004324324324324324, 'mean_word_length': 1.743083003952569, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 89, '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': '7567895', 'n_tokens_mistral': 1049, 'n_tokens_neox': 953, 'n_words': 115}