<commit_before>

<?php

class action_model extends CI_Model {
	public function __construct()	{
	  $this->load->database(); 
	}
	
	public function summary_hive(){
		$sql = "SELECT H.STATUS, COUNT(BEE_HIVE_ID) AS AMOUNT FROM beehive AS H GROUP BY STATUS";
		$query = $this->db->query($sql);
		$data = $query->result_array();
		return $data;
	}
	public function bee_hive_expired($month,$year){
		$sql = "SELECT count(bee_hive_id) as AMOUNT FROM beehive where month(expired_date)=".$month." AND year(expired_date)= ".$year;
		$query = $this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	
	public function bee_con_expired($month,$year){
		$sql = "SELECT count(BEEFRAME_ID) as AMOUNT,count(distinct(BEEHIVE_BEE_HIVE_ID)) as H_AMOUNT FROM beeframe where month(expired_date)=".$month." AND year(expired_date)= ".$year;
		$query = $this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	
	public function bee_queen_expired($month,$year){
		$sql = "SELECT count(QUEEN_ID)as AMOUNT FROM queenbee where month(expired_date)=".$month." AND year(expired_date)= ".$year;
		$query = $this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	public function bee_hive_using($status="เก็บน้ำผึ้ง",$month,$year){
		$sql="SELECT count(bee_hive_id) as AMOUNT FROM beehive WHERE STATUS='".$status."'AND MONTH(STARTDATE) = ".$month." AND ".$month." <= MONTH(ENDDATE) AND YEAR(STARTDATE) =".$year;
		$query =$this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	// start_Date <= EndDateOfMonth And EndDate >=StartDateOfMonth
}

?><commit_msg>FIX php<commit_after>

<?php

class action_model extends CI_Model {
	public function __construct()	{
	  $this->load->database(); 
	}
	
	public function summary_hive(){
		$sql = "SELECT H.STATUS, COUNT(BEE_HIVE_ID) AS AMOUNT FROM beehive AS H GROUP BY STATUS";
		$query = $this->db->query($sql);
		$data = $query->result_array();
		return $data;
	}
	public function bee_hive_expired($month,$year){
		$sql = "SELECT count(bee_hive_id) as AMOUNT FROM beehive where month(expired_date)=".$month." AND year(expired_date)= ".$year;
		$query = $this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	public function bee_con_expired($month,$year){
		$sql = "SELECT count(BEEFRAME_ID) as AMOUNT,count(distinct(BEEHIVE_BEE_HIVE_ID)) as H_AMOUNT FROM beeframe where month(expired_date)=".$month." AND year(expired_date)= ".$year;
		$query = $this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	public function bee_queen_expired($month,$year){
		$sql = "SELECT count(QUEEN_ID)as AMOUNT FROM queenbee where month(expired_date)=".$month." AND year(expired_date)= ".$year;
		$query = $this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	public function bee_hive_using($status="เก็บน้ำผึ้ง",$month,$year){
		$sql="SELECT count(bee_hive_id) as AMOUNT FROM beehive WHERE STATUS='".$status."'AND MONTH(STARTDATE) = ".$month." AND ".$month." <= MONTH(ENDDATE) AND YEAR(STARTDATE) =".$year;
		$query =$this->db->query($sql);
		$data = $query->row_array();
		return $data;
	}
	// start_Date <= EndDateOfMonth And EndDate >=StartDateOfMonth
}

{'fraction_non_alphanumeric': 0.17804340987731992, 'fraction_numerical': 0.0, 'mean_word_length': 5.297029702970297, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 40, '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': '505269', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1189, 'n_words': 253}