private static function addCuadro($gestor, $sesion)
 {
     $destino = "../contenido/" . $sesion->getUser()->getEmail() . "/";
     $subir = new UploadFileMultiple("foto", $destino);
     $subir->upload();
     if ($subir->getSubida(0)) {
         $bd2 = new DB();
         $gestorC = new ManagerCuadro($bd2);
         $cuadro = new Cuadro();
         $cuadro->read();
         $cuadro->setUrl($subir->getDestino(0));
         $gestorC->insert($cuadro);
         $bd2->close();
         self::crearCuadro($gestor, $sesion, "<h1>Cuadro creado.</h1>");
     } else {
         self::crearCuadro($gestor, $sesion, "<h1>Fallo la subida del cuadro. Destino: {$destino}</h1>");
     }
 }
示例#2
0
<?php

require '../clases/AutoCarga.php';
$carpeta = '../../../pacientes';
if (!file_exists($carpeta)) {
    mkdir($carpeta, 0777, true);
}
$numSS = Request::post("id_us");
$dia = Request::post("dia");
$mes = Request::post("mes");
$ano = Request::post("anio");
$dni = Request::post("dni");
//$archivos=  Request::post("imagen[]");
$carpetaSS = '../../../pacientes/' . $numSS;
if (!file_exists($carpetaSS)) {
    mkdir($carpetaSS, 0777, true);
}
$subir = new UploadFileMultiple("imagen", $carpetaSS . '/');
if ($subir->getNumArchivos() > 0) {
    $subir->upload();
    $numSubidos = $subir->getNumeroSubidos();
    $numIntentos = count($subir->getArray());
} else {
    $numSubidos = 0;
    $numIntentos = 0;
}
$paciente = new Paciente($numSS);
$sesion = new Session();
$sesion->set("_paciente", $paciente);
header("Location:paciente.php?subidos={$numSubidos}&intentos={$numIntentos}");