Esempio n. 1
0
 function Alta($num, $strUsuario, $strCodigo, $strNombre, $strIdioma, $PreguntasXBloque, $optCri013, $strDescripcion, $FechaInicio, $FechaFin, $strPlantillaMails, $strLogoEmpresa, $strFondo, $strRutaLogo, $strAux, $lngAux, $strAux2, $lngAux2)
 {
     logger('traza', 'clsCNEnc.php-', "Usuario: " . $_SESSION['strUsuario'] . ', Empresa: ' . $_SESSION['strBD'] . ', SesionID: ' . session_id() . " clsCNEnc->Alta()>");
     //validación datos entrada
     if (is_null($strUsuario)) {
         $alta = 'Falta usuario.';
     }
     //        $FechaInicio='000-00-00 00:00:00';
     //	$FechaFin='000-00-00 00:00:00';
     if ($FechaInicio == '') {
         date_default_timezone_set('Europe/Madrid');
         $FechaInicio = date('Y-m-d h:m:s');
     } else {
         //pasarla a DATETIME 0000-00-00 00:00:00
         $FechaInicio = fecha_to_DATETIME($FechaInicio);
     }
     if ($FechaFin == '') {
         date_default_timezone_set('Europe/Madrid');
         $FechaFin = date('Y-m-d h:m:s');
     } else {
         //pasarla a DATETIME 0000-00-00 00:00:00
         $FechaFin = fecha_to_DATETIME($FechaFin);
     }
     if (!isset($strCodigo)) {
         $strCodigo = '';
     }
     if (!isset($strNombre)) {
         $strNombre = '';
     }
     if (!isset($strIdioma)) {
         $strIdioma = 'ES';
     }
     if (!is_numeric($PreguntasXBloque)) {
         $PreguntasXBloque = 0;
     }
     if (!isset($PreguntasXBloque)) {
         $PreguntasXBloque = 0;
     }
     if (!is_numeric($optCri013)) {
         $optCri013 = 1;
     }
     if (!isset($strDescripcion)) {
         $strDescripcion = ' ';
     }
     if (!isset($strPlantillaMails)) {
         $strPlantillaMails = ' ';
     }
     if (!isset($strLogoEmpresa)) {
         $strLogoEmpresa = ' ';
     }
     if (!isset($strFondo)) {
         $strFondo = ' ';
     }
     if (!isset($strRutaLogo)) {
         $strRutaLogo = ' ';
     }
     if (!isset($strAux)) {
         $strAux = ' ';
     }
     if (!is_numeric($lngAux)) {
         $lngAux = 0;
     }
     if (!is_numeric($lngAux2)) {
         $lngAux2 = 0;
     }
     if (!isset($strAux2)) {
         $strAux2 = ' ';
     }
     //Control de la oficina
     /*    $oficina=explode('.',$strOficina);
                $strCodigo=$oficina[0];
          
             $datos=array();
             if(isset($strOficina) && $strOficina=='' || $existeOficina=='NO'){
                 require_once '../CN/clsCNUsu.php';
                 $clsCNUsu=new clsCNUsu();
                 $clsCNUsu->setStrBD($this->getStrBD());
                 $datos=$clsCNUsu->ObtieneOficinaDep_usuario($_SESSION['usuario']);
                 $ofi=explode('.',$datos['strOficina']);
                 $strCodigo=$ofi[0];
             }
             
             //Control del departamento
             //si el dato del departamento viene vacio o no existe en la tabla tbdepartamentos, le asigno el departamento del usuario
             $lngDepartamento=0;
             $existeDpto=$this->existeDpto($strDepartamento);
             if(isset($strDepartamento) && $strDepartamento=='' || $existeDpto=='NO'){
                 $lngDepartamento=$datos['lngDepartamento'];
             }else{
                 //sino busco el $lngDepartamento
                 require_once '../CN/clsCNDep.php';
                 $clsCNDep=new clsCNDep();
                 $clsCNDep->setStrBD($this->getStrBD());
                 
                 $lngDepartamento=$clsCNDep->ObtieneIdDep($strDepartamento);
             }
             */
     $strDescripcion = substr($strDescripcion, 0, 300);
     require_once '../CAD/clsCADEnc.php';
     $clsCADEnc = new clsCADEnc();
     $clsCADEnc->setStrBD($this->getStrBD());
     $alta = $clsCADEnc->Alta($num, $strUsuario, $strCodigo, $FechaInicio, $FechaFin, $strNombre, $strIdioma, $PreguntasXBloque, $optCri013, $strDescripcion, $FechaInicio, $FechaFin, $strPlantillaMails, $strLogoEmpresa, $strFondo, $strRutaLogo, $strAux, $lngAux, $strAux2, $lngAux2);
     return $alta;
 }