if ($_GET[dsc] == 1) { $precio = $atraccions->getPreuByID($_GET["idcompra"]) - $atraccions->getPreuByID($_GET["idcompra"]) * 0.1; } else { $precio = $atraccions->getPreuByID($_GET["idcompra"]); } // echo $precio; $carro[$num]["preu"] = $precio; $carro[$num]["quantitat"] = 1; $carro[$num]["idAtraccio"] = $_GET["idcompra"]; $carro[$num]["nomAtraccio"] = $atraccions->getNomAtraccionByID($_GET["idcompra"]); $_SESSION["carro"] = $carro; } } if ($_GET["comprar"]) { $num = sizeof($_SESSION["carro"]); $lp = new LiniaPedido(); for ($i = 0; $i < $num; $i++) { $resul = $lp->insertLinea($_SESSION["carro"][$i]["preu"] * $_GET["quant{$i}"], $_GET["quant{$i}"], $_SESSION["carro"][$i]["idAtraccio"], $_SESSION["idUsuario"]); if (!$resul) { echo "Error en la compra!"; } } unset($_SESSION["carro"]); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Social Travel</title>
<?php session_start(); require_once '../Logica/Connexio.php'; require_once '../Logica/Usuaris.php'; require_once '../Logica/HistoricCompres.php'; require_once '../Logica/LiniaPedido.php'; require_once '../Logica/Atraccions.php'; $Connexio = new Connexio(); $Connexio->connectar(); $Connexio->selectdb("socialtravel"); $histCompres = new HistoricCompres(); $liniaPedido = new LiniaPedido(); $atraccions = new Atraccions(); // $idHistCompres = mysql_result($result, 1,2); // echo $idHistCompres; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php $result = $histCompres->getHistoricCompres($_SESSION[idUsuario]); if (mysql_num_rows($result) > 0) { ?> <table border=0 class='hovertable'> <tr> <td><b>Atracción</b></td>
require_once '../../Logica/Desti.php'; require_once '../../Logica/TipusAtraccions.php'; require_once '../../Logica/Atraccions.php'; require_once '../../Logica/LiniaPedido.php'; if(!$_SESSION[usuari]){ header("Location: index.php"); } if($_GET[logout] == 1){ session_unset(); header("Location: index.php"); } $con = new Connexio(); $lComanda = new LiniaPedido(); $atraccio = new Atraccions(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Social Travel</title> <link rel="stylesheet" href="../css/estil.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8"/> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]});