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

class Analytics extends CI_Controller {
	
	function __construct(){
		parent::__construct();
		$this->load->database();
	}

	public function index()
	{
		$user_dept_query = $this->db->query("SELECT D.name as dept_name, count(*) as user_num FROM User U, Department D, Role R WHERE R.rid = U.rid AND R.did = D.did GROUP BY D.did");
		$user_dept_data = $user_dept_query->result();
		
		$user_gender_query = $this->db->query("SELECT gender,count(*) as user_num FROM USER GROUP BY gender");
		$user_gender_data = $user_gender_query->result();

		$user_role_query = $this->db->query("SELECT count(*) as user_num, R.name as role_name FROM User U, Role R WHERE R.rid = U.rid GROUP BY R.rid");
		$user_role_data = $user_role_query->result();
		
		$this->load->view("manage/analytics",array("user_gender_data"=>$user_gender_data);
	}

}<commit_msg>Update analytics.php<commit_after><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Analytics extends CI_Controller {
	
	function __construct(){
		parent::__construct();
		$this->load->database();
	}

	public function index()
	{
		$user_dept_query = $this->db->query("SELECT D.name as dept_name, count(*) as user_num FROM User U, Department D, Role R WHERE R.rid = U.rid AND R.did = D.did GROUP BY D.did");
		$user_dept_data = $user_dept_query->result();
		
		$user_gender_query = $this->db->query("SELECT gender,count(*) as user_num FROM USER GROUP BY gender");
		$user_gender_data = $user_gender_query->result();

		$user_role_query = $this->db->query("SELECT count(*) as user_num, R.name as role_name FROM User U, Role R WHERE R.rid = U.rid GROUP BY R.rid");
		$user_role_data = $user_role_query->result();
		
		$this->load->view("manage/analytics",array("user_gender_data"=>$user_gender_data));
	}

}
{'fraction_non_alphanumeric': 0.157725321888412, 'fraction_numerical': 0.0, 'mean_word_length': 5.035598705501618, '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': '1370806', 'n_tokens_mistral': 680, 'n_tokens_neox': 624, 'n_words': 159}