Execute(); //End Restrict Access To Page 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; } return $theValue; } } $currentPage = $_SERVER["PHP_SELF"]; $maxRows_Rs_orders = 15; $pageNum_Rs_orders = 0; if (isset($_GET['pageNum_Rs_orders'])) { $pageNum_Rs_orders = $_GET['pageNum_Rs_orders']; } $startRow_Rs_orders = $pageNum_Rs_orders * $maxRows_Rs_orders; $KTColParam1_Rs_orders = "0"; if (isset($_SESSION["kt_login_id"])) { $KTColParam1_Rs_orders = $_SESSION["kt_login_id"]; } mysql_select_db($database_azzurra, $azzurra); $query_Rs_orders = sprintf("SELECT orders.ID_order, orders.descr, orders.data, states.state_desc FROM (orders LEFT JOIN states ON states.ID_state=orders.ID_state) WHERE orders.ID_user=%s ORDER BY orders.ID_order DESC ", GetSQLValueString($KTColParam1_Rs_orders, "int")); $query_limit_Rs_orders = sprintf("%s LIMIT %d, %d", $query_Rs_orders, $startRow_Rs_orders, $maxRows_Rs_orders); $Rs_orders = mysql_query($query_limit_Rs_orders, $azzurra) or die(mysql_error()); $row_Rs_orders = mysql_fetch_assoc($Rs_orders); if (isset($_GET['totalRows_Rs_orders'])) { $totalRows_Rs_orders = $_GET['totalRows_Rs_orders']; } else { $all_Rs_orders = mysql_query($query_Rs_orders); $totalRows_Rs_orders = mysql_num_rows($all_Rs_orders); } $totalPages_Rs_orders = ceil($totalRows_Rs_orders/$maxRows_Rs_orders)-1; $queryString_Rs_orders = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Rs_orders") == false && stristr($param, "totalRows_Rs_orders") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Rs_orders = "&" . htmlentities(implode("&", $newParams)); } } $queryString_Rs_orders = sprintf("&totalRows_Rs_orders=%d%s", $totalRows_Rs_orders, $queryString_Rs_orders); ?>