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

class Teacher extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{

		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{
				//cargar modelo
			$this->load->model('director/TeacherModel');
				//metodo del modelo para obtener la lista de todos los profesores
			$teachers=$this->TeacherModel->GetAll();
			
			$teachers['teachers']=$teachers;
			$this->load->model('director/TeacherModel');
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/Teacher/teacher_view',$teachers);
			$this->load->view('director/footer_view');		
		}
		//post
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

		}

		
	}
	public function add()
	{


		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/Teacher/add_teacher_view');
			$this->load->view('director/footer_view');
		}
		//post
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

			//cargar modelo
			$this->load->model('director/TeacherModel');


			$teacher['nomProfesor']=$this->input->post('names');
			$teacher['apePaternoProfesor']=$this->input->post('father_last_name');
			$teacher['apeMaternoProfesor']=$this->input->post('mother_last_name');
			$teacher['sexoProfesor']=$this->input->post('sex');//FM
			$teacher['dirProfesor']=$this->input->post('address_street');
			$teacher['emailProfesor']=$this->input->post('email');//*
			$teacher['telfProfesor']=$this->input->post('cellphone');//*
			$teacher['fechaNacProfesor']=$this->input->post('date');

			
			$this->TeacherModel->add(json_encode($teacher,true));
			//cargar WEb
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/Teacher/add_teacher_view');
			$this->load->view('director/footer_view');



			

		}
	}




	public function relation_course_teacher($idTeacher=null,$fullNameTeacher=null)
	{
		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{
			$this->load->model('director/CourseModel');
			$couses=$this->CourseModel->GetAll();

			$couseHigh;
			$couseHigh2 = array();
			$count=0;
			foreach ($couses as $couse) {
				# code...
				
				if (substr($couse['CodGrado'], 1)=='S' ) {
					$couseHigh[$count]['CodCurso']=$couse['CodCurso'];
					$couseHigh[$count]['DescripCurso']=$couse['DescripCurso'];
					$couseHigh[$count]['CodGrado']=$couse['CodGrado'][0];
					$count++;



				}

			}
			$count=0;
			$count2=0;


			foreach ($couseHigh as  $key => $value) {

				if ($couseHigh2== array()){
					$couseHigh2[$count]['DescripCurso']=$value['DescripCurso'];
					$couseHigh2[$count]['grades'][0]= array('CodCurso' => $value['CodCurso'],'CodGrado'=>$value['CodGrado']);
					$count++;
				}else{

					$llave=null;
					foreach ($couseHigh2 as $key2 => $value2) {
						if ($value2['DescripCurso']==$value['DescripCurso']) {
							$llave=$key2;
							break;
						}
					}
					if ($llave!=null) {
						$couseHigh2[$llave]['grades'][count($couseHigh2[$llave]['grades'])]= array('CodCurso' => $value['CodCurso'],'CodGrado'=>$value['CodGrado']);

					}else{
						$couseHigh2[$count]['DescripCurso']=$value['DescripCurso'];
						$couseHigh2[$count]['grades'][$count2]= array('CodCurso' => $value['CodCurso'],'CodGrado'=>$value['CodGrado']);
						$count++;
					
					}
					
						

				}



<commit_msg>array para listar cursos que puede enseñar un profesor<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Teacher extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{

		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{
				//cargar modelo
			$this->load->model('director/TeacherModel');
				//metodo del modelo para obtener la lista de todos los profesores
			$teachers=$this->TeacherModel->GetAll();
			
			$teachers['teachers']=$teachers;
			$this->load->model('director/TeacherModel');
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/Teacher/teacher_view',$teachers);
			$this->load->view('director/footer_view');		
		}
		//post
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

		}

		
	}
	public function add()
	{


		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/Teacher/add_teacher_view');
			$this->load->view('director/footer_view');
		}
		//post
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

			//cargar modelo
			$this->load->model('director/TeacherModel');


			$teacher['nomProfesor']=$this->input->post('names');
			$teacher['apePaternoProfesor']=$this->input->post('father_last_name');
			$teacher['apeMaternoProfesor']=$this->input->post('mother_last_name');
			$teacher['sexoProfesor']=$this->input->post('sex');//FM
			$teacher['dirProfesor']=$this->input->post('address_street');
			$teacher['emailProfesor']=$this->input->post('email');//*
			$teacher['telfProfesor']=$this->input->post('cellphone');//*
			$teacher['fechaNacProfesor']=$this->input->post('date');

			
			$this->TeacherModel->add(json_encode($teacher,true));
			//cargar WEb
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/Teacher/add_teacher_view');
			$this->load->view('director/footer_view');



			

		}
	}




	public function relation_course_teacher($idTeacher=null,$fullNameTeacher=null)
	{
		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{
			$this->load->model('director/CourseModel');
			$couses=$this->CourseModel->GetAll();

			$couseHigh;
			$couseHigh2 = array();
			$count=0;
			foreach ($couses as $couse) {
				# code...
				
				if (substr($couse['CodGrado'], 1)=='S' ) {
					$couseHigh[$count]['CodCurso']=$couse['CodCurso'];
					$couseHigh[$count]['DescripCurso']=$couse['DescripCurso'];
					$couseHigh[$count]['CodGrado']=$couse['CodGrado'][0];
					$count++;



				}

			}
			$count=0;
			$count2=0;


			foreach ($couseHigh as  $key => $value) {

				if ($couseHigh2== array()){
					$couseHigh2[$count]['DescripCurso']=$value['DescripCurso'];
					$couseHigh2[$count]['grades'][0]= array('CodCurso' => $value['CodCurso'],'CodGrado'=>$value['CodGrado']);
					$count++;
				}else{

					$llave=null;
					foreach ($couseHigh2 as $key2 => $value2) {
						if ($value2['DescripCurso']==$value['DescripCurso']) {

							$llave=$key2;

							break;
						}
					}

					if (!is_null($llave)) {
						
						$couseHigh2[$llave]['grades'][count($couseHigh2[$llave]['grades'])]= array('CodCurso' => $value['CodCurso'],'CodGrado'=>$value['CodGrado']);

					}else{

						$couseHigh2[$count]['DescripCurso']=$value['DescripCurso'];
						$couseHigh2[$count]['grades'][$count2]= array('CodCurso' => $value['CodCurso'],'CodGrado'=>$value['CodGrado']);
						$count++;
					
					}
					
						

				}




{'fraction_non_alphanumeric': 0.2094819391634981, 'fraction_numerical': 0.004990494296577947, 'mean_word_length': 4.113608748481166, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 161, 'https://': 2, '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': '4729733', 'n_tokens_mistral': 3637, 'n_tokens_neox': 2952, 'n_words': 380}