Code :
$colname1__sum = '-1'; $colname2__sum = '-1'; $colname3__sum = '-1'; $query_sum=""; $sum = ""; $totalRows_sum = ""; if (isset($HTTP_GET_VARS['code']) && isset($HTTP_GET_VARS['sens']) && isset($HTTP_GET_VARS['nature'])) { if (! empty($HTTP_GET_VARS['code']) && ! empty($HTTP_GET_VARS['sens']) && ! empty($HTTP_GET_VARS['nature'])) { $colname1__sum = $HTTP_GET_VARS['code']; $colname2__sum = $HTTP_GET_VARS['sens']; $colname3__sum = $HTTP_GET_VARS['nature']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.code_agree_consignataire='%s' AND f_manifest.import_export='%s' AND f_cargo.nature_colis='%s'", $colname1__sum, $colname2__sum, $colname3__sum); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } else { if (! empty($HTTP_GET_VARS['code']) && ! empty($HTTP_GET_VARS['sens'])) { $$colname1__sum = $HTTP_GET_VARS['code']; $$colname2__sum = $HTTP_GET_VARS['sens']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.code_agree_consignataire='%s' AND f_manifest.import_export='%s'", $colname1__sum, $colname2__sum); $rs_sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $rs_sum->RecordCount(); } else { if (! empty($HTTP_GET_VARS['sens']) && ! empty($HTTP_GET_VARS['nature'])) { $colname2__sum = $HTTP_GET_VARS['sens']; $colname3__sum = $HTTP_GET_VARS['nature']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.import_export='%s' AND f_cargo.nature_colis='%s'", $colname2__sum, $colname3__sum); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } else { if (! empty($HTTP_GET_VARS['code']) && ! empty($HTTP_GET_VARS['nature'])) { $colname1__sum = $HTTP_GET_VARS['code']; $colname3__sum = $HTTP_GET_VARS['nature']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.code_agree_consignataire='%s' AND f_cargo.nature_colis='%s'", $colname1__sum, $colname3__sum); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } else { if (! empty($HTTP_GET_VARS['code'])) { $colname1__sum = $HTTP_GET_VARS['code']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.code_agree_consignataire='%s'", $colname1__sum); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } else { if (! empty($HTTP_GET_VARS['sens'])) { $colname2__sum = $HTTP_GET_VARS['sens']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.import_export='%s'", $colname2__sum); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } else { if (! empty($HTTP_GET_VARS['nature'])) { $colname3__sum = $HTTP_GET_VARS['nature']; $query_sum = sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_cargo.nature_colis='%s'", $colname3__sum); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } else { $query_sum= sprintf("SELECT SUM(f_cargo.poids_colis) AS sum_poids_colis_1 FROM (f_manifest INNER JOIN f_cargo ON f_cargo.manifest_id=f_manifest.manifest_id) WHERE f_manifest.code_agree_consignataire='%s' AND f_manifest.import_export='%s' AND f_cargo.nature_colis='%s'" ); $sum = $connexion->SelectLimit ($query_sum) or die($connexion->ErrorMsg ()); $totalRows_sum = $sum->RecordCount(); } } } } } } } }
|