ayuda con insert en base de datos. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: ayuda con insert en base de datos. (/showthread.php?tid=58992) |
ayuda con insert en base de datos. - El Forum - 08-12-2013 [eluser]Unknown[/eluser] hola, seƱores de la comunidad, tengo una semana leyendo sobre el framework porque me mandaron a editar una aplicacion que desarrollo otra persona pero tengo un problema y es que no encuentro por ninguna parte del model donde se hace el insert a la base de datos de los datos y de la sesion que esta iniciada al momento del insert. anexo el controlador y el model para que lo examinen. add_proyect_model.php (MODELS) function _set_proyect($perfil) { $Query = $this->db->query("SELECT * FROM dgdpt.add_proyect( '".$this->input->post('sTipo')."'::character, '".$this->_return_single_data($this->input->post('txtNombre'))."'::text, '".$this->_return_single_data($this->input->post('txtOrg'))."'::text, ".$this->input->post('sEstado').":mallint, ".$this->input->post('sMunicipio').":mallint, '".str_replace("'","''",$this->input->post('txtDirecc'))."'::text, '".str_replace("'","''",$this->input->post('txtDireccI'))."'::text, ".$this->input->post('sZona').":mallint, '".$this->input->post('txtCi')."'::character varying, '".$this->input->post('txtPr')."'::character varying, '".$this->input->post('txtTlf')."'::character varying, '".$this->input->post('txtSol')."'::date, '".$this->input->post('txtIni')."'::date, '".$this->input->post('txtFin')."'::date, array[".@implode(',',$this->input->post('accion'))."]:mallint[], array[".@implode(',',$this->input->post('prt_pre'))."]:mallint[], array[".@implode(',',$this->input->post('activ_rlz'))."]:mallint[], '".$this->input->post('txtBenefT')."':mallint, '".$this->input->post('txtEmpI')."':mallint, '".$this->input->post('txtMontS')."'::integer, '".$this->input->post('txtRrhh')."'::integer, '".$this->input->post('txtMate')."'::integer, '".$this->input->post('txtProm')."'::integer, '".$this->input->post('txtText')."'::integer, '".$this->input->post('txtEdoFi')."'::integer, '".$this->input->post('sAdmin')."':mallint, '".$this->input->post('sCod')."':mallint, '".$this->input->post('sEdo')."':mallint, array[".@implode(',',$this->input->post('document'))."]:mallint[], ".$this->input->post('txtSq')."::integer, '".$this->_return_single_data($this->input->post('txtECi'))."'::character varying, '".$this->_return_single_data($this->input->post('txtEPr'))."'::character varying, '".$this->_return_single_data($this->input->post('txtETlf'))."'::character varying, ".$perfil->get_codigo().":mallint, ".$this->input->post('sDirectorL').":mallint, ".$this->input->post('sDirectorG').":mallint, '".$this->input->post('sRif').'-'.$this->input->post('txtRif')."'::character varying, '".$this->input->post('txtBenefM')."':mallint, '".$this->input->post('txtBenefF')."':mallint, '".$this->_return_single_data($this->input->post('txtMail'))."'::character varying, '".str_replace("'","''",$this->input->post('txtYy'))."'::character varying, '".$this->input->post('txtBenefN')."':mallint, '".$this->input->post('txtBenefA')."':mallint, '".$this->input->post('txtBenefJ')."':mallint, '".$this->input->post('txtBenefAd')."':mallint, '".$this->input->post('txtBenefAdM')."':mallint, '".$this->input->post('txtBenefPD')."':mallint, '".$this->_return_single_data($this->input->post('txtNRegistro'))."'::character varying, ".$this->input->post('txtNumero').":mallint, ".$this->input->post('txtFolio').":mallint, '".$this->input->post('txtMFechaComp')."'::date, ".$this->input->post('sEstado2').":mallint, ".$this->input->post('sMunicipio2').":mallint, '".$this->input->post('txtParroquia')."'::character varying, 0:mallint, ".$this->input->post('txtDistribucion').":mallint, 0:mallint )"); $row = $Query->row(); return ($row->add_proyect == 'f') ? FALSE : TRUE; } /////////////////////HASTA AQUI. add_proyect.php (CONTROLLER). function procesar() { if ($this->validation->run() == FALSE) { $this->index(); }else { $perfil = unserialize($this->session->userdata('perfil')); if($this->dbase->_set_proyect($perfil)) { $this->load->library('perfil'); $this->load->helper ('perfil'); $this->session->set_userdata('object',serialize(build_perfil_org($this->input->post('txtSq')))); echo '[removed] //<![CDATA[ var op = confirm(\'Proyecto incluido exitosamente. \'+String.fromCharCode(191)+\' Desea UD. evaluarlo ahora ?.\'); if(op){ document.location = "'. base_url() .'eval/eval_proyect/evaluar/'.$this->session->userdata('session_id').'"; }else{ document.location = "'. base_url() .'init/wlcm/"; } //]]> [removed]'; }else{ echo '[removed] alert("Ha ocurrido un error durante el proceso. Intente luego."); document.location = "'. base_url() .'add/add_proyect/"; [removed]'; } unset($perfil); } } DE ANTE MANO MUCHAS GRACIAS POR SU AYUDA. |