<commit_before><?php defined('BASEPATH') OR exit('No direct script access allowed');
	class Admin extends CI_Controller{

		function __construct(){
			parent:: __construct();
			$this->load->helper(array('form','url'));
			$this->load->library('form_validation');
			$this->load->library('session');

			$user_name = $this->session->userdata('tipo_usuario');
			$user_id = $this->session->userdata('usuario_id');
			$p_id = $this->session->userdata('persona_id');

			$this->form_validation->set_rules('nombre','Nombre','trim|required|min_length[2]|max_length[45]');
			$this->form_validation->set_rules('apellido','Apellido','trim|required|min_length[2]|max_length[45]');
			$this->form_validation->set_rules('sexo','Sexo','trim|required|max_length[1]');
			$this->form_validation->set_rules('anio','Anio','trim|required|min_length[4]|max_length[4]|numeric');
			$this->form_validation->set_rules('mes','Mes','trim|required|min_length[2]|max_length[2]|numeric');
			$this->form_validation->set_rules('dia','Dia','trim|required|min_length[2]|max_length[2]|numeric');

			$this->form_validation->set_rules('correo','Correo','trim|required|max_length[45]|valid_email');
			$this->form_validation->set_rules('pass','<PASSWORD>','trim|required|matches[passConf]|min_length[6]|max_length[100]');
			$this->form_validation->set_rules('passConf','<PASSWORD>','trim|min_length[6]|required|max_length[100]');
		}

		function registrar(){
			if(isset($this->session)){
				if ($user_name == 'admin'){
				
					$this->load->model('admin_model','',true);
				
					if($this->form_validation->run()==false){
						$datos['title'] = 'Registrar Administrador';
				
						$this->load->view('registro_admin',$datos);
					
					}
					else{
						$data_usuario["correo"] = $this->input->post('correo');
						$data_usuario["clave"] = $this->input->post('pass');
						$data_usuario["activo"] = true;

						$data_persona["nombre"] = $this->input->post('nombre');
						$data_persona["apellido"] = $this->input->post('apellido');
						$data_persona["sexo"] = $this->input->post('sexo');
						$fecha = $this->input->post('anio') . '-' . $this->input->post('mes') . '-' . $this->input->post('dia');
						$data_persona["fecha_nacimiento"] = $fecha;

						$this->admin_model->insertarAdmin($data_usuario,$data_persona);
					}
				}else{
					/*$sesion = $this->session->userdata('tipo_usuario');
					echo $sesion;*/
				}
			}

		}
		function update(){
			if (isset ($this->session)){
				$sesion = $this->session->userdata('tipo_usuario');
				if ($sesion=='admin'){
					$this->load->model('admin_model','',true);
		
					$user_data = $this->admin_model->getInfo();

					if($this->form_validation->run()== FALSE){
						$user_data["title"] = "Actualizar Informacion";
						$this->load->view('update_admin',$user_data);

					}else{							
						$data_usuario["correo"] = $this->input->post('correo');
						$data_usuario["clave"] = $this->input->post('clave');
						$data_usuario["usuario_id"] = $user_id;
			
						$data_persona["nombre"] = $this->input->post('nombre');
						$data_persona["apellido"] = $this->input->post('apellido');
						$data_persona["sexo"] = $this->input->post('sexo');
						$fecha = $this->input->post('anio') . '-' . $this->input->post('mes') . '-' . $this->input->post('dia');
						$data_persona["fecha_nacimiento"] = $fecha;
						$data_persona["persona_id"] = $p_id;
			
						#$this->admin_model->updateAdmin($data_usuario,$data_persona);
					}
				}
			}
		}

		function borrar(){
			$this->load->model('admin_model','',true);

			$data_usuario["usuario_id"] = "9";
			$data_usuario["activo"] = false;

			$this->admin_model->borrarAdmin($data_usuario);
		}
	}
?><commit_msg>AdminUpdateTerminado<commit_after><?php defined('BASEPATH') OR exit('No direct script access allowed');
	class Admin extends CI_Controller{

		function __construct(){
			parent:: __construct();
			$this->load->helper(array('form','url'));
			$this->load->library('form_validation');
			$this->load->library('session');

			$this->form_validation->set_rules('nombre','Nombre','trim|required|min_length[2]|max_length[45]');
			$this->form_validation->set_rules('apellido','Apellido','trim|required|min_length[2]|max_length[45]');
			$this->form_validation->set_rules('sexo','Sexo','trim|required|max_length[1]');
			$this->form_validation->set_rules('anio','Anio','trim|required|min_length[4]|max_length[4]|numeric');
			$this->form_validation->set_rules('mes','Mes','trim|required|min_length[2]|max_length[2]|numeric');
			$this->form_validation->set_rules('dia','Dia','trim|required|min_length[2]|max_length[2]|numeric');

			$this->form_validation->set_rules('correo','Correo','trim|required|max_length[45]|valid_email');
			$this->form_validation->set_rules('pass','<PASSWORD>aseña','trim|required|matches[passConf]|min_length[6]|max_length[100]');
			$this->form_validation->set_rules('passConf','Confirmar <PASSWORD>','trim|min_length[6]|required|max_length[100]');
		}

		function registrar(){
			if(isset($this->session)){
				$this->getIds();
				if ($user_info['tipo_usuario'] == 'admin'){
				
					$this->load->model('admin_model','',true);
				
					if($this->form_validation->run()==false){
						$datos['title'] = 'Registrar Administrador';
				
						$this->load->view('registro_admin',$datos);
					
					}
					else{
						$data_usuario["correo"] = $this->input->post('correo');
						$data_usuario["clave"] = $this->input->post('pass');
						$data_usuario["activo"] = true;

						$data_persona["nombre"] = $this->input->post('nombre');
						$data_persona["apellido"] = $this->input->post('apellido');
						$data_persona["sexo"] = $this->input->post('sexo');
						$fecha = $this->input->post('anio') . '-' . $this->input->post('mes') . '-' . $this->input->post('dia');
						$data_persona["fecha_nacimiento"] = $fecha;

						$this->admin_model->insertarAdmin($data_usuario,$data_persona);
					}
				}else{
					/*$sesion = $this->session->userdata('tipo_usuario');
					echo $sesion;*/
				}
			}

		}
		function update(){
			if (isset ($this->session)){
				$info = $this->getIds();
				if ($info['tipo_usuario']=='admin'){
					$this->load->model('admin_model','',true);
		
					$user_data = $this->admin_model->getInfo();

					if($this->form_validation->run()== FALSE){
						$user_data["title"] = "Actualizar Informacion";
						$this->load->view('update_admin',$user_data);

					}else{							
						$data_usuario["correo"] = $this->input->post('correo');
						$data_usuario["clave"] = $this->input->post('pass');
						$data_usuario["usuario_id"] = $info['usuario_id'];
			
						$data_persona["nombre"] = $this->input->post('nombre');
						$data_persona["apellido"] = $this->input->post('apellido');
						$data_persona["sexo"] = $this->input->post('sexo');
						$fecha = $this->input->post('anio') . '-' . $this->input->post('mes') . '-' . $this->input->post('dia');
						$data_persona["fecha_nacimiento"] = $fecha;
						$data_persona["persona_id"] = $info['persona_id'];
			
						$this->admin_model->updateAdmin($data_usuario,$data_persona);
					}
				}
			}
		}

		function borrar(){
			$this->load->model('admin_model','',true);

			$data_usuario["usuario_id"] = "9";
			$data_usuario["activo"] = false;

			$this->admin_model->borrarAdmin($data_usuario);
		}

		function getIds(){
				$user_info['tipo_usuario'] = $this->session->userdata('tipo_usuario');
				$user_info['usuario_id'] = $this->session->userdata('usuario_id');
				$user_info['persona_id'] = $this->session->userdata('persona_id');
				return $user_info;
		}
	}
?>
{'fraction_non_alphanumeric': 0.22666666666666666, 'fraction_numerical': 0.006336633663366337, 'mean_word_length': 4.823212913143736, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 189, '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': '2342631', 'n_tokens_mistral': 3296, 'n_tokens_neox': 2730, 'n_words': 244}