session_start(); ob_start(); require ('config.php'); include ("funzioni.php"); $codice=$_SESSION['cod_ordine']; if ($codice=='') { $codice=stringa(); $_SESSION['cod_ordine'] = $codice; } ?> if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } // switch return $theValue; } // GetSQLValueString } // if // ???? mysql_select_db($database_piscineitalia, $piscineitalia); $query_Recordset1 = "SELECT * FROM tblprodotti WHERE prod_stato ='Y'"; $Recordset1 = mysql_query($query_Recordset1, $piscineitalia) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); // selezione dati carrello $colname_carrello_prod = "-1"; if (isset($_SESSION['cod_ordine'])) { $colname_carrello_prod = $_SESSION['cod_ordine']; } mysql_select_db($database_piscineitalia, $piscineitalia); $query_carrello_prod = sprintf("SELECT * FROM carrello WHERE sessione = %s", GetSQLValueString($colname_carrello_prod, "text")); $carrello_prod = mysql_query($query_carrello_prod, $piscineitalia) or die(mysql_error()); $row_carrello_prod = mysql_fetch_assoc($carrello_prod); $totalRows_carrello_prod = mysql_num_rows($carrello_prod); // selezione SESSIONE x sessione corrente $colname_verifica = "-1"; if (isset($_SESSION['cod_ordine'])) { $colname_verifica = $_SESSION['cod_ordine']; } mysql_select_db($database_piscineitalia, $piscineitalia); $query_verifica = sprintf("SELECT session_id FROM tblordini WHERE session_id = %s", GetSQLValueString($colname_verifica, "text")); $verifica = mysql_query($query_verifica, $piscineitalia) or die(mysql_error()); $row_verifica = mysql_fetch_assoc($verifica); $totalRows_verifica = mysql_num_rows($verifica); if($totalRows_verifica>0){ unset($_SESSION['cod_ordine']); } // selezione PRODOTTI x VETRINA mysql_select_db($database_piscineitalia, $piscineitalia); $query_in_evidenza = "SELECT tblprodotti.*, home.* FROM tblprodotti INNER JOIN home WHERE tblprodotti.prod_id=home.prod_id ORDER BY home.ordine ASC"; $in_evidenza = mysql_query($query_in_evidenza, $piscineitalia) or die(mysql_error()); $row_in_evidenza = mysql_fetch_assoc($in_evidenza); $totalRows_in_evidenza = mysql_num_rows($in_evidenza); ?>
|
|
|