Ejemplo n.º 1
0
<?php

include_once "../Model/Destinos.php";
if (isset($_POST['destinos']) and $_POST['destinos'] == "all") {
    $desti = new Destinos();
    $response = $desti->Get_all_destinos();
    if (isset($response)) {
        echo json_encode($response);
    }
}
if (isset($_POST['id_destino'])) {
    $id = $_POST['id_destino'];
    $desti = new Destinos();
    $response = $desti->Get_destino($id);
    if (isset($response)) {
        $respon = array($response[0], utf8_encode($response[1]), utf8_encode($response[2]), $response[3], $response[4], $response[5]);
    }
    echo json_encode($respon);
}
// Muestra todos los paises //
if (isset($_POST['paises'])) {
    $desti = new Destinos();
    $response = $desti->Get_paises();
    if (isset($response)) {
        $respon = array($response[0], $response[1]);
    }
    echo json_encode($respon);
}
if (isset($_REQUEST['destin_pais'])) {
    $desti = new Destinos();
    $id = $_REQUEST['destin_pais'];
Ejemplo n.º 2
0
  }
  body{
    background-color: rgba(255, 219, 251, 0.2);

  }



  </style>
  	    <?php 
if (isset($_GET['destinos'])) {
    $id_desti = $_GET['destinos'];
    echo '<script> var id_destin = ' . $id_desti . ';</script>';
    $destino = new Destinos();
    $lugares = new Lugares();
    $response_desti = $destino->Get_destino($id_desti);
    $response_lugar = $lugares->Get_lugares($id_desti);
    if (isset($response_desti)) {
        $cabecera = '
          <div class="row">
            <p></p>
            <div class="panel panel-default">
             <form enctype="multipart/form-data" method="post">
             <div class="panel-body"> 
               <div class="jumbotron" style="background-image: url(img/' . $response_desti[3] . '); background-repeat: no-repeat;"></div>
                <div class="row">
                 <div class="col-md-6">
                  <div class="panel panel-default">
                   <div class="panel-body">
                    <label> Actualizar foto</label>
                    <input id="foto_new" type="file" class="file" data-preview-file-type="text">
Ejemplo n.º 3
0
        } else {
            unlink("../img/" . $data[0]);
        }
    }
    $conexion->update_query($dele_fotos);
    $conexion->update_query($sql);
    $conexion->update_query($sql2);
    $dato['success'] = true;
    echo json_encode($dato);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// devuelve informacion de destino
if (isset($_POST['id_destino'])) {
    $id = $_POST['id_destino'];
    $destino = new Destinos();
    $data = $destino->Get_destino($id);
    if (isset($data)) {
        $array = array($data[0], utf8_encode($data[1]), utf8_encode($data[2]), $data[3], $data[4], $data[5]);
    }
    if (isset($array)) {
        $respon['success'] = $array;
        echo json_encode($respon);
    } else {
        echo null;
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
if (isset($_POST['imgen'])) {
    $conexion = new Conectar();
    $foto1 = $_POST['imgen'];
    unlink("../img/" . $foto1);