Commit eac24ef3 authored by Simon Magnin-Feysot's avatar Simon Magnin-Feysot

add comptoir for all new cotiz form

parent de2f875d
...@@ -139,6 +139,7 @@ function add_new_form($id = null) ...@@ -139,6 +139,7 @@ function add_new_form($id = null)
),1); ),1);
$sub_frm_cotiz->add_select_field("paiement","Mode de paiement",array(1 => "Chèque", 3 => "Liquide", 4 => "Administration")); $sub_frm_cotiz->add_select_field("paiement","Mode de paiement",array(1 => "Chèque", 3 => "Liquide", 4 => "Administration"));
$sub_frm_cotiz->add_select_field("comptoir","Comptoir",array(0 => "Bureau AE Belfort", 1 => "Bureau AE Sevenans", 2 => "Bureau AE Montbéliard"));
$sub_frm_cotiz->add_info(" "); $sub_frm_cotiz->add_info(" ");
$sub_frm_cotiz_ecole = new form("ecoleform",null,null,null,"Étudiant"); $sub_frm_cotiz_ecole = new form("ecoleform",null,null,null,"Étudiant");
...@@ -317,8 +318,16 @@ elseif ( $_REQUEST["action"] == "savecotiz" ) ...@@ -317,8 +318,16 @@ elseif ( $_REQUEST["action"] == "savecotiz" )
$site->add_contents($info); $site->add_contents($info);
} }
if ( $_REQUEST["comptoir"] == 0 ) {
$id_comptoir = 6;
} elseif ( $_REQUEST["comptoir"] == 1 ) {
$id_comptoir = 5;
} elseif ( $_REQUEST["comptoir"] == 2 ) {
$id_comptoir = 9;
}
$cotisation->load_lastest_by_user ( $user->id ); $cotisation->load_lastest_by_user ( $user->id );
$cotisation->add ( $user->id, $date_fin, $_REQUEST["paiement"], $prix_paye, $_REQUEST["cotiz"] ); $cotisation->add ( $user->id, $date_fin, $_REQUEST["paiement"], $prix_paye, $_REQUEST["cotiz"], $id_comptoir );
$a_pris_cadeau = $_REQUEST["cadeau"] == true; $a_pris_cadeau = $_REQUEST["cadeau"] == true;
...@@ -510,6 +519,7 @@ elseif ( $_REQUEST["action"] == "searchstudent" ) ...@@ -510,6 +519,7 @@ elseif ( $_REQUEST["action"] == "searchstudent" )
10 => "Cursus Alternant, 30 €, jusqu'au $date4", 10 => "Cursus Alternant, 30 €, jusqu'au $date4",
),1); ),1);
$frm->add_select_field("paiement","Mode de paiement",array(1 => "Chèque", 3 => "Liquide", 4 => "Administration")); $frm->add_select_field("paiement","Mode de paiement",array(1 => "Chèque", 3 => "Liquide", 4 => "Administration"));
$frm->add_select_field("comptoir","Comptoir",array(0 => "Bureau de Belfort", 1 => "Bureau de Sevenans", 2 => "Bureau de Montbéliard"));
$frm->add_checkbox("droit_image","Droit à l'image",$user->droit_image); $frm->add_checkbox("droit_image","Droit à l'image",$user->droit_image);
$frm->add_checkbox("a_pris_cadeau","Cadeau distribué",false); $frm->add_checkbox("a_pris_cadeau","Cadeau distribué",false);
foreach ($partenariats as $id_partenariat => $texte_partenariat) foreach ($partenariats as $id_partenariat => $texte_partenariat)
...@@ -635,6 +645,7 @@ elseif ( $_REQUEST["action"] == "newcotiz" ) ...@@ -635,6 +645,7 @@ elseif ( $_REQUEST["action"] == "newcotiz" )
$frm->add_hidden("cotiz",$_POST['cotiz']); $frm->add_hidden("cotiz",$_POST['cotiz']);
$frm->add_hidden("paiement",$_POST['paiement']); $frm->add_hidden("paiement",$_POST['paiement']);
$frm->add_hidden("comptoir",$_POST['comptoir']);
$frm->add_hidden("droit_image",$_POST['droit_image']); $frm->add_hidden("droit_image",$_POST['droit_image']);
$frm->add_hidden("cadeau",$_REQUEST["cadeau"]); $frm->add_hidden("cadeau",$_REQUEST["cadeau"]);
if (isset($_REQUEST['partenariats'])) if (isset($_REQUEST['partenariats']))
...@@ -730,6 +741,7 @@ elseif ($_REQUEST["action"] == "newstudent") ...@@ -730,6 +741,7 @@ elseif ($_REQUEST["action"] == "newstudent")
$frm->add($sub_frm,false,false,false,false,false,true,true); $frm->add($sub_frm,false,false,false,false,false,true,true);
$frm->add_hidden("cotiz",$_POST['cotiz']); $frm->add_hidden("cotiz",$_POST['cotiz']);
$frm->add_hidden("paiement",$_POST['paiement']); $frm->add_hidden("paiement",$_POST['paiement']);
$frm->add_hidden("comptoir",$_POST['comptoir']);
$frm->add_hidden("droit",$_REQUEST["droit_image"]); $frm->add_hidden("droit",$_REQUEST["droit_image"]);
$frm->add_hidden("cadeau",$_REQUEST["cadeau"]); $frm->add_hidden("cadeau",$_REQUEST["cadeau"]);
if (isset($_REQUEST['partenariats'])) if (isset($_REQUEST['partenariats']))
......
...@@ -90,7 +90,7 @@ class cotisation extends stdentity ...@@ -90,7 +90,7 @@ class cotisation extends stdentity
} }
function add ( $id_utilisateur, $date_fin, $mode_paiement, $prix_paye, $type_cotis ) function add ( $id_utilisateur, $date_fin, $mode_paiement, $prix_paye, $type_cotis, $id_comptoir )
{ {
$this->id_utilisateur = $id_utilisateur; $this->id_utilisateur = $id_utilisateur;
...@@ -101,7 +101,7 @@ class cotisation extends stdentity ...@@ -101,7 +101,7 @@ class cotisation extends stdentity
$this->mode_paiement_cotis = $mode_paiement; $this->mode_paiement_cotis = $mode_paiement;
$this->prix_paye_cotis = $prix_paye; $this->prix_paye_cotis = $prix_paye;
$this->type_cotis = $type_cotis; $this->type_cotis = $type_cotis;
$this->id_comptoir = $id_comptoir;
$sql = new insert ($this->dbrw, $sql = new insert ($this->dbrw,
"ae_cotisations", "ae_cotisations",
array( array(
...@@ -113,6 +113,7 @@ class cotisation extends stdentity ...@@ -113,6 +113,7 @@ class cotisation extends stdentity
"mode_paiement_cotis" => $this->mode_paiement_cotis, "mode_paiement_cotis" => $this->mode_paiement_cotis,
"prix_paye_cotis" => $this->prix_paye_cotis, "prix_paye_cotis" => $this->prix_paye_cotis,
"type_cotis" => $this->type_cotis, "type_cotis" => $this->type_cotis,
"id_comptoir" => $this->id_comptoir,
) )
); );
...@@ -161,6 +162,21 @@ class cotisation extends stdentity ...@@ -161,6 +162,21 @@ class cotisation extends stdentity
); );
} }
function comptoir($cadeau=true)
{
$this->a_pris_cadeau = $cadeau;
$sql = new update ($this->dbrw,
"ae_cotisations",
array(
"a_pris_cadeau" => $this->a_pris_cadeau
),
array(
"id_cotisation"=>$this->id
)
);
}
function mark_carte($carte=true) function mark_carte($carte=true)
{ {
$this->a_pris_carte = $carte; $this->a_pris_carte = $carte;
......
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