public function get_data_empr($id_empr) { global $dbh, $pmb_gestion_financiere, $pmb_gestion_abonnement, $pmb_gestion_tarif_prets, $pmb_gestion_amende; $empr = get_info_empr($id_empr); $i = count($this->data["empr_list"]); $this->data["empr_list"][$i]["name"] = $empr->nom; $this->data["empr_list"][$i]["fistname"] = $empr->prenom; $this->data["empr_list"][$i]["cb"] = $empr->cb; $this->data["empr_list"][$i]["aff_date_adhesion"] = $empr->aff_date_adhesion; $this->data["empr_list"][$i]["aff_date_expiration"] = $empr->aff_date_expiration; $this->data["empr_list"][$i]["categorie"] = $empr->cat_l; if ($pmb_gestion_financiere) { $this->data["empr_list"][$i]["compte_abonnement"]["solde"] = ""; $this->data["empr_list"][$i]["compte_abonnement"]["novalid"] = ""; // abonnement if ($pmb_gestion_abonnement) { $cpt_id = comptes::get_compte_id_from_empr($id_empr, 1); $cpt = new comptes($cpt_id); $solde = $cpt->update_solde(); $novalid = $cpt->summarize_transactions("", "", 0, 0); $this->data["empr_list"][$i]["compte_abonnement"]["solde"] = $solde; $this->data["empr_list"][$i]["compte_abonnement"]["novalid"] = $novalid; } // prets $this->data["empr_list"][$i]["compte_pret"]["solde"] = ""; $this->data["empr_list"][$i]["compte_pret"]["novalid"] = ""; if ($pmb_gestion_tarif_prets) { $cpt_id = comptes::get_compte_id_from_empr($id_empr, 3); $cpt = new comptes($cpt_id); $solde = $cpt->update_solde(); $novalid = $cpt->summarize_transactions("", "", 0, 0); $this->data["empr_list"][$i]["compte_pret"]["solde"] = $solde; $this->data["empr_list"][$i]["compte_pret"]["novalid"] = $novalid; } // amendes $this->data["empr_list"][$i]["compte_amende"]["solde"] = ""; $this->data["empr_list"][$i]["compte_amende"]["novalid"] = ""; if ($pmb_gestion_amende) { $cpt_id = comptes::get_compte_id_from_empr($id_empr, 2); $cpt = new comptes($cpt_id); $solde = $cpt->update_solde(); $novalid = $cpt->summarize_transactions("", "", 0, 0); $this->data["empr_list"][$i]["compte_amende"]["solde"] = $solde; $this->data["empr_list"][$i]["compte_amende"]["novalid"] = $novalid; } // Autre compte $this->data["empr_list"][$i]["compte_autre"]["solde"] = ""; $this->data["empr_list"][$i]["compte_autre"]["novalid"] = ""; $transactype = new transactype_list(); if ($transactype->get_count()) { $cpt_id = comptes::get_compte_id_from_empr($id_empr, 4); $cpte = new comptes($cpt_id); $solde = $cpt->update_solde(); $novalid = $cpt->summarize_transactions("", "", 0, 0); $this->data["empr_list"][$i]["compte_autre"]["solde"] = $solde; $this->data["empr_list"][$i]["compte_autre"]["novalid"] = $novalid; } } return $this->data["empr_list"][$i]; }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: transaction.inc.php,v 1.1 2013-12-24 13:08:33 ngantier Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } //Gestion des Types de transaction require_once $class_path . "/transaction/transaction_list.class.php"; require_once $class_path . "/transaction/transaction.class.php"; if (!$action) { $transactype_list = new transactype_list(); print $transactype_list->get_form(); } else { $transactype = new transactype($id); $transactype->proceed(); }
function do_fiche_compte($typ_compte) { global $msg, $charset; global $empr_comptes_tmpl; global $empr_autre_compte_tmpl; global $show_transactions, $date_debut; $this->fiche_compte = ""; if ($typ_compte == 4) { $form = $empr_autre_compte_tmpl; } else { $form = $empr_comptes_tmpl; } $form = str_replace("!!nom!!", $this->nom, $form); $form = str_replace("!!prenom!!", $this->prenom, $form); $form = str_replace("!!info_nb_pret!!", $this->nb_pret, $form); $form = str_replace("!!info_nb_resa!!", $this->nb_reservations, $form); $id_compte = comptes::get_compte_id_from_empr($this->id, $typ_compte); if ($id_compte) { $cpte = new comptes($id_compte); if (!$show_transactions) { $show_transactions = 2; } $form = str_replace("!!id_compte!!", $id_compte, $form); $form = str_replace("!!type_compte!!", $cpte->get_typ_compte_lib($typ_compte), $form); $form = str_replace("!!typ_compte!!", $typ_compte, $form); $form = str_replace("!!solde!!", comptes::format($cpte->get_solde()), $form); $form = str_replace("!!non_valide!!", comptes::format($cpte->summarize_transactions("", "", 0, 0)), $form); $form = str_replace("!!show_transactions!!", $show_transactions, $form); $form = str_replace("!!date_debut!!", htmlentities(stripslashes($date_debut), ENT_QUOTES, $charset), $form); if (!$show_transactions) { $show_transactions = 1; } for ($i = 1; $i <= 3; $i++) { if ($i == $show_transactions) { $form = str_replace("!!checked{$i}!!", "checked", $form); } else { $form = str_replace("!!checked{$i}!!", "", $form); } } } if ($typ_compte == 4) { // autre compte: afficher les types de transaction... $transactype = new transactype_list(); $type_transac_list = $transactype->get_data(); foreach ($type_transac_list as $transac) { if ($transac["quick_allowed"] && $transac["unit_price"] > 0) { $transac_form .= "\r\n\t\t\t\t\t<input type='button' class='bouton_small' value='" . htmlentities($transac["name"], ENT_QUOTES, $charset) . "'\n\t\t\t\t\t id='transactype_" . $transac["id"] . "' unit_price='" . $transac["unit_price"] . "' \n\t\t\t\t\t onclick=\"sel_type_transactype('" . $transac["id"] . "',this.id,this.value,this.getAttribute('unit_price'));\" align='middle'\r\n\t\t\t\t\t>"; } elseif ($transac["quick_allowed"]) { $transac_form .= "\r\n\t\t\t\t\t<input type='button' class='bouton_small' value='" . htmlentities($transac["name"], ENT_QUOTES, $charset) . "'\n\t\t\t\t\t id='" . $transac["id"] . "' unit_price='" . $transac["unit_price"] . "' \n\t\t\t\t\t onclick=\"sel_type_transactype('" . $transac["id"] . "',this.id,this.value,this.getAttribute('unit_price'));\" align='middle'\n\t\t\t\t\t>"; } } $form = str_replace("!!transactype_list!!", $transac_form, $form); } $this->fiche_compte = $form; }