1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
   | <?php
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_rsRecap = 32;
$pageNum_rsRecap = 0;
if (isset($_GET['pageNum_rsRecap'])) {
  $pageNum_rsRecap = $_GET['pageNum_rsRecap'];
}
$startRow_rsRecap = $pageNum_rsRecap * $maxRows_rsRecap;
 
$col_mois_rsRecap = "-1";
if (isset($_POST['mois'])) {
  $col_mois_rsRecap = $_POST['mois'];
}
$col_marques_rsRecap = "-1";
if (isset($_POST['marques'])) {
  $col_marques_rsRecap = $_POST['marques'];
}
$col_annee_rsRecap = "-1";
if (isset($_POST['annee'])) {
  $col_annee_rsRecap = $_POST['annee'];
}
mysql_select_db($database_interface_c14, $interface_c14);
$query_rsRecap = sprintf("SELECT clients.ID, clients.nom_client, documents.ID, documents.nom_doc, documents.icoMasterExe, documents.icoCom, documents.icoFab, documents.icoCrea, documents.icoGravure, documents.icoInfo, documents.icoExe, documents.clientID, documents.marqueID, documents.tempsH_com, documents.tempsMN_com, documents.tempsH_fab, documents.tempsMN_fab, documents.tempsH_crea, documents.tempsMN_crea, documents.tempsH_exe, documents.tempsMN_exe, documents.tempsH_info, documents.tempsMN_info, documents.tempsH_gravure, documents.tempsMN_gravure, documents.temps FROM documents JOIN clients ON documents.clientID = clients.ID WHERE documents.temps LIKE %s AND documents.temps LIKE %s AND documents.marqueID LIKE %s ORDER BY nom_doc ASC", GetSQLValueString("%" . $col_mois_rsRecap . "%", "text"),GetSQLValueString("%" . $col_annee_rsRecap . "%", "text"),GetSQLValueString("%" . $col_marques_rsRecap . "%", "text"));
$query_limit_rsRecap = sprintf("%s LIMIT %d, %d", $query_rsRecap, $startRow_rsRecap, $maxRows_rsRecap);
$rsRecap = mysql_query($query_limit_rsRecap, $interface_c14) or die(mysql_error());
$row_rsRecap = mysql_fetch_assoc($rsRecap);
 
if (isset($_GET['totalRows_rsRecap'])) {
  $totalRows_rsRecap = $_GET['totalRows_rsRecap'];
} else {
  $all_rsRecap = mysql_query($query_rsRecap);
  $totalRows_rsRecap = mysql_num_rows($all_rsRecap);
}
$totalPages_rsRecap = ceil($totalRows_rsRecap/$maxRows_rsRecap)-1;
 
$queryString_rsRecap = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_rsRecap") == false && 
        stristr($param, "totalRows_rsRecap") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_rsRecap = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_rsRecap = sprintf("&totalRows_rsRecap=%d%s", $totalRows_rsRecap, $queryString_rsRecap);
?> |