Commit 4564bdc0 authored by Simon Magnin-Feysot's avatar Simon Magnin-Feysot

Fix comptoir field

parent 298d9be4
......@@ -177,8 +177,7 @@ $frm->add_hidden("action","view");
$frm->add_select_field("mode","Mode", array(""=>"Brut","day"=>"Statistiques/Jour","week"=>"Statistiques/Semaines","month"=>"Statistiques/Mois","year"=>"Statistiques/Année"),$_REQUEST["mode"]);
$frm->add_datetime_field("debut","Date et heure de début");
$frm->add_datetime_field("fin","Date et heure de fin");
$frm->add_select_field("id_comptoir","Comptoir", array(""=>"Tous", 5=>"Bureau de Sevenans", 6=>"Bureau de Belfort", 7=>"Bureau de Montbéliard"),$_REQUEST["id_comptoir"]);
$frm->add_entity_select("type_cotis", "Type de cotisation", $site->db, "cotis",$_REQUEST["type_cotis"],true);
$frm->add_select_field("comptoir","Comptoir", array(""=>"Tous", 5=>"Bureau de Sevenans", 6=>"Bureau de Belfort", 7=>"Bureau de Montbéliard"),$_REQUEST["comptoir"]);
$frm->add_submit("valid","Voir");
$cts->add($frm,true);
......@@ -193,23 +192,12 @@ if ( $_REQUEST["action"] == "view" && $_REQUEST["mode"] == "" )
if ( $_REQUEST["fin"] )
$conds[] = "ae_cotisations.date_cotis <= '".date("Y-m-d H:i:s",$_REQUEST["fin"])."'";
if ( isset($comptoirs[$_REQUEST["id_comptoir"]]) && $_REQUEST["id_comptoir"] )
if ( isset($comptoirs[$_REQUEST["id_comptoir"]]) && $_REQUEST["comptoir"] )
{
$conds[] = "ae_cotisations.id_comptoir='".intval($_REQUEST["id_comptoir"])."'";
$conds[] = "ae_cotisations.id_comptoir='".intval($_REQUEST["comptoir"])."'";
$comptoir=true;
}
if ( $comptoir || $site->user->is_in_group("gestion_ae") )
{
if ( $_REQUEST["type_cotis"] )
$conds[] = "ae_cotisations.id_comptoir='".intval($_REQUEST["id_comptoir"])."'";
if ( $_REQUEST["type_cotis"] )
$conds[] = "ae_cotisation.type_cotis='".intval($_REQUEST["type_cotis"])."'";
}
if ( count($conds) )
{
$req= new requete($site->db, "SELECT " .
......@@ -294,23 +282,12 @@ elseif ( $_REQUEST["action"] == "view" )
if ( $_REQUEST["fin"] )
$conds[] = "ae_cotisations.date_cotis <= '".date("Y-m-d H:i:s",$_REQUEST["fin"])."'";
if ( isset($comptoirs[$_REQUEST["id_comptoir"]]) && $_REQUEST["id_comptoir"] )
if ( isset($comptoirs[$_REQUEST["id_comptoir"]]) && $_REQUEST["comptoir"] )
{
$conds[] = "ae_cotisations.id_comptoir='".intval($_REQUEST["id_comptoir"])."'";
$conds[] = "ae_cotisations.id_comptoir='".intval($_REQUEST["comptoir"])."'";
$comptoir=true;
}
if ( $comptoir || $site->user->is_in_group("gestion_ae") )
{
if ( $_REQUEST["type_cotis"] )
$conds[] = "ae_cotisations.id_comptoir='".intval($_REQUEST["id_comptoir"])."'";
if ( $_REQUEST["type_cotis"] )
$conds[] = "ae_cotisation.type_cotis='".intval($_REQUEST["type_cotis"])."'";
}
if ( count($conds))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment