$lobjUtil = new clsUtil(); $Texto = addslashes($_POST['textonot']); //Funcion que permite cambiar las comillas simples o dobles. $lobjNoticia->set_Noticia($_POST['idnoticia']); $lobjNoticia->set_Titulo($_POST['titulonot']); $lobjNoticia->set_Texto($Texto); $nombreimagen = basename($_FILES['imagennot']['name']) ? basename($_FILES['imagennot']['name']) : "default.jpg"; $lobjNoticia->set_Imagen($nombreimagen); $lobjNoticia->set_Fechanot($_POST['fechanot']); $lobjNoticia->set_Estatus($_POST['estatusnot']); $lcReal_ip = $lobjUtil->get_real_ip(); $ldFecha = date('Y-m-d h:m'); $operacion = $_POST['operacion']; switch ($operacion) { case 'registrar_noticia': $hecho = $lobjNoticia->registrar_noticia(); if ($hecho) { $target_path = "../media/img/noticia/"; $target_path = $target_path . basename($_FILES['imagennot']['name']); move_uploaded_file($_FILES['imagennot']['tmp_name'], $target_path); $lobjBitacora->set_Datos($_SERVER['HTTP_REFERER'], $ldFecha, $lcReal_ip, 'Registrar', 'Cargar datos', '*', 'tnoticia', '', '', $_SESSION['usuario'], $operacion); //envia los datos a la clase bitacora $lobjBitacora->registrar_bitacora(); //registra los datos en la tabla tbitacora. $_SESSION['msj'] = 'Se ha registrado exitosamente'; } else { $_SESSION['msj'] = 'Error en el registro'; } header('location: ../vista/intranet.php?vista=sistema/noticia'); break; case 'editar_noticia':