function calcular_precio_inicialmente() { $dbhandler = new db_handler("localhost", "congreso"); $dbhandler->connect(); //para poner el precio inicialemtne $n_actividades = $dbhandler->count("Actividad"); //calculamos el numero de actividades para pasarlo a la funcion javaScript echo "<script>precio_inscriptcion(" . $n_actividades . ")</script>"; $dbhandler->close(); }
echo "<input id=\"precio_hotel" . $i . "\" type=\"hidden\" name=\"precio_hotel\" value=\"" . $this->precio . "\"></input>"; echo "<input onclick=\"precio_inscriptcion(" . $n_actividades . ")\" id=\"hotel" . $i . "\" type=\"radio\" name=\"hotel\" value=\"" . $this->idAlojamiento . "\" >"; echo "<h2> HOTEL " . $this->nombre . " </h2>"; echo "</input>"; echo "<h5>Precio: " . $this->precio . "€</h5>"; echo "<p>" . $this->resumen . "</p>"; echo "</div>"; } } if (isset($_POST["tipohab"]) && isset($_POST["fecha_entrada"]) && isset($_POST["fecha_entrada"])) { //calculamos el numoer de actividades require "dbhandler.php"; $dbhandler = new db_handler("localhost", "congreso"); $dbhandler->connect(); //para poner el precio inicialemtne $n_actividades = $dbhandler->count("Actividad"); //calculamos el numero de actividades para pasarlo a la funcion javaScript $dbhandler->close(); ///////////// $service_url = "http://localhost/heisenburg/rest/hotel/" . $_POST["tipohab"] . "/" . $_POST["fecha_entrada"] . "/" . $_POST["fecha_salida"]; //funcion de buscar alojameintos $curl = curl_init($service_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); //to return the content $result = curl_exec($curl); $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); $decoded = json_decode($result, true); //echo "Header:" . $httpcode . "</br>"; $size = count($decoded); if ($httpcode == 200 && $size > 0) {