CodeIgniter Forums
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').":Confusedmallint,
".$this->input->post('sMunicipio').":Confusedmallint,
'".str_replace("'","''",$this->input->post('txtDirecc'))."'::text,
'".str_replace("'","''",$this->input->post('txtDireccI'))."'::text,
".$this->input->post('sZona').":Confusedmallint,
'".$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'))."]:Confusedmallint[],
array[".@implode(',',$this->input->post('prt_pre'))."]:Confusedmallint[],
array[".@implode(',',$this->input->post('activ_rlz'))."]:Confusedmallint[],
'".$this->input->post('txtBenefT')."':Confusedmallint,
'".$this->input->post('txtEmpI')."':Confusedmallint,
'".$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')."':Confusedmallint,
'".$this->input->post('sCod')."':Confusedmallint,
'".$this->input->post('sEdo')."':Confusedmallint,
array[".@implode(',',$this->input->post('document'))."]:Confusedmallint[],
".$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().":Confusedmallint,
".$this->input->post('sDirectorL').":Confusedmallint,
".$this->input->post('sDirectorG').":Confusedmallint,
'".$this->input->post('sRif').'-'.$this->input->post('txtRif')."'::character varying,
'".$this->input->post('txtBenefM')."':Confusedmallint,
'".$this->input->post('txtBenefF')."':Confusedmallint,
'".$this->_return_single_data($this->input->post('txtMail'))."'::character varying,
'".str_replace("'","''",$this->input->post('txtYy'))."'::character varying,
'".$this->input->post('txtBenefN')."':Confusedmallint,
'".$this->input->post('txtBenefA')."':Confusedmallint,
'".$this->input->post('txtBenefJ')."':Confusedmallint,
'".$this->input->post('txtBenefAd')."':Confusedmallint,
'".$this->input->post('txtBenefAdM')."':Confusedmallint,
'".$this->input->post('txtBenefPD')."':Confusedmallint,


'".$this->_return_single_data($this->input->post('txtNRegistro'))."'::character varying,
".$this->input->post('txtNumero').":Confusedmallint,
".$this->input->post('txtFolio').":Confusedmallint,
'".$this->input->post('txtMFechaComp')."'::date,
".$this->input->post('sEstado2').":Confusedmallint,
".$this->input->post('sMunicipio2').":Confusedmallint,
'".$this->input->post('txtParroquia')."'::character varying,
0:Confusedmallint,
".$this->input->post('txtDistribucion').":Confusedmallint,
0:Confusedmallint


)");
$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.