public function cargarArreglosDiagnosticoDiagramaDermatologico() { if ($this->idDiagnostico != 0) { $sql = "SELECT [idLesion] FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . ";"; $result = ejecutaQueryClases($sql); if (is_string($consulta)) { $this->error = true; $this->msgError = $consulta . " SQL:" . $sqlA; } else { while ($tabla = devuelveRowAssoc($result)) { $idTemp = $tabla["idLesion"]; $objTemp = new DiagramaDermatologico(); $objTemp->obtenerBD($idTemp); array_push($this->arrDiagramaDermatologico, $objTemp); } } } }
session_start(); require_once '../include/var_global.php'; require_once '../include/bdatos.php'; require_once '../include/fecha_hora.php'; require_once '../include/log.php'; require_once '../include/funciones.php'; require_once '../include/clasesLepra.php'; $connectionBD = conectaBD(); if ($_POST['cargaFoto']) { $query = 'SELECT [idLesion],[idCatTipoLesion],[imgUrl] FROM [diagramaDermatologico] WHERE [idLesion]=' . $_POST['idLesion']; $result = ejecutaQuery($query); $imagenes = array(); while ($lesion = devuelveRowAssoc($result)) { $imagenes = explode(";;;", $lesion['imgUrl']); $imgUrlOld = $lesion['imgUrl']; } $numeroFoto = count($imagenes) + 1; $new_name = "photo_" . $numeroFoto . "_" . $_POST['idLesion']; $new_name2 = "nuevaFoto"; $ext = explode("/", $_FILES[$new_name2]['type']); $extencion = $ext[1]; if ($_FILES[$new_name2]["size"] > 0) { $dir = "../pacienteImg/"; $new_name .= "." . $extencion; $lesionDiagrama = new DiagramaDermatologico(); move_uploaded_file($_FILES[$new_name2]['tmp_name'], $dir . $new_name); $lesionDiagrama->idLesion = $_POST['idLesion']; $lesionDiagrama->imgUrl = $imgUrlOld . $new_name . ";;;"; $lesionDiagrama->updateImgUrl(); } }
$lesionDiagrama = new DiagramaDermatologico(); foreach ($delTagLesiones as $id) { $lesionDiagrama->eliminarBD($id); if ($lesionDiagrama->error) { $errorSql = true; echo $lesionDiagrama->msgError; } } $lesiones = json_decode($_POST['tagLesiones']); $tipoLesionDiagrama = NULL; $rsTipoLesionDiagrama = ejecutaQuery('SELECT [idCatTipoLesionDiagrama],[descripcion] FROM [catTipoLesionDiagrama]'); while ($tipo = devuelveRowAssoc($rsTipoLesionDiagrama)) { $tipoLesionDiagrama[$tipo['descripcion']] = $tipo['idCatTipoLesionDiagrama']; } foreach ($lesiones as $temp) { $lesionDiagrama = new DiagramaDermatologico(); $lesionDiagrama->idDiagnostico = $diagnostico->idDiagnostico; $lesionDiagrama->idPaciente = $paciente->idPaciente; $lesionDiagrama->idLesion = $temp->{'id'}; $tempId = $temp->{'id'}; $lesionDiagrama->idCatTipoLesion = $tipoLesionDiagrama[$temp->{'text'}]; $lesionDiagrama->x = $temp->{'left'}; $lesionDiagrama->y = $temp->{'top'}; $lesionDiagrama->w = $temp->{'width'}; $lesionDiagrama->h = $temp->{'height'}; $lesionDiagrama->replaceDB($lesionDiagrama->idLesion); if ($_POST['guardar'] || $_POST['actualizar']) { $new_name = "photo_1_" . $lesionDiagrama->idLesion; $new_name2 = "file_photoTag-tag_" . $tempId; $ext = explode("/", $_FILES[$new_name2]['type']); $extencion = $ext[1];