Exemple #1
0
// Copyright Author Dany De Bontridder danydb@aevalys.eu
if (!defined('ALLOWED')) {
    die('Forbidden');
}
/*!\file
* \brief Management of the folder
 *
 */
require_once NOALYSS_INCLUDE . '/class_itext.php';
require_once NOALYSS_INCLUDE . '/class_icheckbox.php';
require_once NOALYSS_INCLUDE . '/class_itextarea.php';
require_once NOALYSS_INCLUDE . '/class_html_input.php';
$sa = isset($_REQUEST['sa']) ? $_REQUEST['sa'] : 'list';
//---------------------------------------------------------------------------
// Update
$dossier_id = HtmlInput::default_value_request('d', -1);
if (isset($_POST['upd']) && isNumber($dossier_id) == 1 && $dossier_id != -1) {
    $dos = new dossier($dossier_id);
    $name = HtmlInput::default_value_post('name', "--vide--");
    $desc = HtmlInput::default_value_post('desc', "--vide--");
    $dos->set_parameter('name', $name);
    $dos->set_parameter('desc', $desc);
    $dos->save();
}
echo '<div class="content" style="width:80%;margin-left:10%">';
/*
 *  check and add an new folder
 */
if (isset($_POST["DATABASE"])) {
    $repo = new Database();
    $dos = HtmlInput::default_value_post('DATABASE', "");
Exemple #2
0
$op = HtmlInput::default_value_request("op", "list");
switch ($op) {
    case 'list':
        Anc_Key::display_list();
        Anc_Key::key_add();
        break;
    case 'consult':
        $id = HtmlInput::default_value_request("key", "0");
        if (isNumber($id) == 0 || $id == 0) {
            die(_('Clef invalide'));
        }
        $key = new Anc_Key($id);
        if (isset($_POST['save_key'])) {
            try {
                $key->save($_POST);
                Anc_Key::display_list();
                Anc_Key::key_add();
                break;
            } catch (Exception $e) {
                echo span($e->getMessage(), ' class="notice"');
            }
        }
        $key->input();
        break;
    case 'delete_key':
        $id = HtmlInput::default_value_request("key", "0");
        $key = new Anc_Key($id);
        $key->delete();
        Anc_Key::display_list();
        Anc_Key::key_add();
}
Exemple #3
0
">
	<?php 
    echo '<h2>' . "Exercice " . $g_user->get_exercice() . '</h2>';
    echo dossier::hidden();
    $a = isset($_GET['query']) ? $_GET['query'] : "";
    printf(_('Recherche') . ' <input class="input_text" type="text" name="query" value="%s">', $a);
    echo HtmlInput::request_to_hidden(array('ac'));
    $choice_cat = HtmlInput::default_value_request("choice_cat", 1);
    if ($choice_cat == 1) {
        $sel_card = new ISelect('cat');
        $sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' . ' where  frd_id=$1 ' . ' order by fd_label ', 1, array(FICHE_TYPE_ADM_TAX));
        $sel_card->selected = isset($_GET['cat']) ? $_GET['cat'] : -1;
        $sel_card->javascript = ' onchange="submit(this);"';
        echo _('Catégorie :') . $sel_card->input();
    } else {
        $cat = HtmlInput::default_value_request('cat', '');
        echo HtmlInput::hidden("cat", $cat);
        echo HtmlInput::hidden('choice_cat', 0);
    }
    echo Dossier::hidden();
    ?>
    <input type="submit" class="button" name="submit_query" value="<?php 
    echo _('recherche');
    ?>
">
	 <input type="hidden" name="p_action" value="adm">
                                                                     </form>
                                                                     </div>
                                                                     <?php 
    $adm = new Admin($cn);
    $search = isset($_GET['query']) ? $_GET['query'] : "";
 function Replace($p_tag, $p_array)
 {
     global $g_parameter;
     $p_tag = strtoupper($p_tag);
     $p_tag = str_replace('=', '', $p_tag);
     $r = "Tag inconnu";
     switch ($p_tag) {
         case 'DATE':
             $r = isset($p_array['ag_timestamp']) ? $p_array['ag_timestamp'] : $p_array['e_date'];
             break;
         case 'DATE_CALC':
             $r = ' Date inconnue ';
             // Date are in $p_array['ag_date']
             // or $p_array['e_date']
             if (isset($p_array['ag_timestamp'])) {
                 $date = format_date($p_array['ag_timestamp'], 'DD.MM.YYYY', 'YYYY-MM-DD');
                 $r = $date;
             }
             if (isset($p_array['e_date'])) {
                 $date = format_date($p_array['e_date'], 'DD.MM.YYYY', 'YYYY-MM-DD');
                 $r = $date;
             }
             break;
             //
             //  the company priv
         //
         //  the company priv
         case 'MY_NAME':
             $r = $g_parameter->MY_NAME;
             break;
         case 'MY_CP':
             $r = $g_parameter->MY_CP;
             break;
         case 'MY_COMMUNE':
             $r = $g_parameter->MY_COMMUNE;
             break;
         case 'MY_TVA':
             $r = $g_parameter->MY_TVA;
             break;
         case 'MY_STREET':
             $r = $g_parameter->MY_STREET;
             break;
         case 'MY_NUMBER':
             $r = $g_parameter->MY_NUMBER;
             break;
         case 'MY_TEL':
             $r = $g_parameter->MY_TEL;
             break;
         case 'MY_FAX':
             $r = $g_parameter->MY_FAX;
             break;
         case 'MY_PAYS':
             $r = $g_parameter->MY_PAYS;
             break;
             // customer
             /*\note The CUST_* are retrieved thx the $p_array['tiers']
              * which contains the quick_code
              */
         // customer
         /*\note The CUST_* are retrieved thx the $p_array['tiers']
          * which contains the quick_code
          */
         case 'SOLDE':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $p = $tiers->strAttribut(ATTR_DEF_ACCOUNT);
             $poste = new Acc_Account_Ledger($this->db, $p);
             $r = $poste->get_solde(' true');
             break;
         case 'CUST_NAME':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_NAME);
             break;
         case 'CUST_ADDR_1':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_ADRESS);
             break;
         case 'CUST_CP':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_CP);
             break;
         case 'CUST_CITY':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_CITY);
             break;
         case 'CUST_CO':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_PAYS);
             break;
             // Marchandise in $p_array['e_march*']
             // \see user_form_achat.php or user_form_ven.php
         // Marchandise in $p_array['e_march*']
         // \see user_form_achat.php or user_form_ven.php
         case 'CUST_VAT':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_NUMTVA);
             break;
         case 'CUST_NUM':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER);
             break;
         case 'CUST_BANQUE_NO':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_BQ_NO);
             break;
         case 'CUST_BANQUE_NAME':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_BQ_NAME);
             break;
             /* -------------------------------------------------------------------------------- */
             /* BENEFIT (fee notes */
         /* -------------------------------------------------------------------------------- */
         /* BENEFIT (fee notes */
         case 'BENEF_NAME':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_NAME);
             break;
         case 'BENEF_ADDR_1':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_ADRESS);
             break;
         case 'BENEF_CP':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_CP);
             break;
         case 'BENEF_CITY':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_CITY);
             break;
         case 'BENEF_CO':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_PAYS);
             break;
             // Marchandise in $p_array['e_march*']
             // \see user_form_achat.php or user_form_ven.php
         // Marchandise in $p_array['e_march*']
         // \see user_form_achat.php or user_form_ven.php
         case 'BENEF_VAT':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_NUMTVA);
             break;
         case 'BENEF_NUM':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER);
             break;
         case 'BENEF_BANQUE_NO':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_BQ_NO);
             break;
         case 'BENEF_BANQUE_NAME':
             $tiers = new Fiche($this->db);
             $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
             if ($qcode == '') {
                 $r = '';
                 break;
             }
             $tiers->get_by_qcode($qcode, false);
             $r = $tiers->strAttribut(ATTR_DEF_BQ_NAME);
             break;
             // Marchandise in $p_array['e_march*']
             // \see user_form_achat.php or user_form_ven.php
         // Marchandise in $p_array['e_march*']
         // \see user_form_achat.php or user_form_ven.php
         case 'NUMBER':
             $r = $this->d_number;
             break;
         case 'USER':
             return $_SESSION['use_name'] . ', ' . $_SESSION['use_first_name'];
             break;
         case 'REFERENCE':
             $act = new Follow_Up($this->db);
             $act->ag_id = $this->ag_id;
             $act->get();
             $r = $act->ag_ref;
             break;
             /*
              *  - [VEN_ART_NAME]
              *  - [VEN_ART_PRICE]
              *  - [VEN_ART_QUANT]
              *  - [VEN_ART_TVA_CODE]
              *  - [VEN_ART_STOCK_CODE]
              *  - [VEN_HTVA]
              *  - [VEN_TVAC]
              *  - [VEN_TVA]
              *  - [TOTAL_VEN_HTVA]
              *  - [DATE_LIMIT]
              */
         /*
          *  - [VEN_ART_NAME]
          *  - [VEN_ART_PRICE]
          *  - [VEN_ART_QUANT]
          *  - [VEN_ART_TVA_CODE]
          *  - [VEN_ART_STOCK_CODE]
          *  - [VEN_HTVA]
          *  - [VEN_TVAC]
          *  - [VEN_TVA]
          *  - [TOTAL_VEN_HTVA]
          *  - [DATE_LIMIT]
          */
         case 'DATE_LIMIT_CALC':
             extract($p_array);
             $id = 'e_ech';
             if (!isset(${$id})) {
                 return "";
             }
             $r = format_date(${$id}, 'DD.MM.YYYY', 'YYYY-MM-DD');
             break;
         case 'DATE_LIMIT':
             extract($p_array);
             $id = 'e_ech';
             if (!isset(${$id})) {
                 return "";
             }
             $r = ${$id};
             break;
         case 'MARCH_NEXT':
             $this->counter++;
             $r = '';
             break;
         case 'VEN_ART_NAME':
             extract($p_array);
             $id = 'e_march' . $this->counter;
             // check if the march exists
             if (!isset(${$id})) {
                 return "";
             }
             // check that something is sold
             if (${'e_march' . $this->counter . '_price'} != 0 && ${'e_quant' . $this->counter} != 0) {
                 $f = new Fiche($this->db);
                 $f->get_by_qcode(${$id}, false);
                 $r = $f->strAttribut(ATTR_DEF_NAME);
             } else {
                 $r = "";
             }
             break;
         case 'VEN_ART_LABEL':
             extract($p_array);
             $id = 'e_march' . $this->counter . "_label";
             // check if the march exists
             if (!isset(${$id}) || isset(${$id}) && strlen(trim(${$id})) == 0) {
                 $id = 'e_march' . $this->counter;
                 // check if the march exists
                 if (!isset(${$id})) {
                     $r = "";
                 } else {
                     // check that something is sold
                     if (${'e_march' . $this->counter . '_price'} != 0 && ${'e_quant' . $this->counter} != 0) {
                         $f = new Fiche($this->db);
                         $f->get_by_qcode(${$id}, false);
                         $r = $f->strAttribut(ATTR_DEF_NAME);
                     } else {
                         $r = "";
                     }
                 }
             } else {
                 $r = ${'e_march' . $this->counter . '_label'};
             }
             break;
         case 'VEN_ART_STOCK_CODE':
             extract($p_array);
             $id = 'e_march' . $this->counter;
             // check if the march exists
             if (!isset(${$id})) {
                 $r = "";
             } else {
                 // check that something is sold
                 if (${'e_march' . $this->counter . '_price'} != 0 && ${'e_quant' . $this->counter} != 0) {
                     $f = new Fiche($this->db);
                     $f->get_by_qcode(${$id}, false);
                     $r = $f->strAttribut(ATTR_DEF_STOCK);
                     $r = $r == NOTFOUND ? '' : $r;
                 }
             }
             break;
         case 'VEN_ART_PRICE':
             extract($p_array);
             $id = 'e_march' . $this->counter . '_price';
             if (!isset(${$id})) {
                 return "";
             }
             if (${$id} == 0) {
                 return "";
             }
             $r = ${$id};
             break;
         case 'TVA_RATE':
         case 'VEN_ART_TVA_RATE':
             extract($p_array);
             $id = 'e_march' . $this->counter . '_tva_id';
             if (!isset(${$id})) {
                 return "";
             }
             if (${$id} == -1 || ${$id} == '') {
                 return "";
             }
             $march_id = 'e_march' . $this->counter . '_price';
             if (!isset(${$march_id})) {
                 return '';
             }
             $tva = new Acc_Tva($this->db);
             $tva->set_parameter("id", ${$id});
             if ($tva->load() == -1) {
                 return '';
             }
             return $tva->get_parameter("rate");
             break;
         case 'TVA_CODE':
         case 'VEN_ART_TVA_CODE':
             extract($p_array);
             $id = 'e_march' . $this->counter . '_tva_id';
             if (!isset(${$id})) {
                 return "";
             }
             if (${$id} == -1) {
                 return "";
             }
             $qt = 'e_quant' . $this->counter;
             $price = 'e_march' . $this->counter . '_price';
             if (${$price} == 0 || ${$qt} == 0 || strlen(trim($price)) == 0 || strlen(trim($qt)) == 0) {
                 return "";
             }
             $r = ${$id};
             break;
         case 'TVA_LABEL':
             extract($p_array);
             $id = 'e_march' . $this->counter . '_tva_id';
             if (!isset(${$id})) {
                 return "";
             }
             $march_id = 'e_march' . $this->counter . '_price';
             if (!isset(${$march_id})) {
                 return '';
             }
             if (${$march_id} == 0) {
                 return '';
             }
             $tva = new Acc_Tva($this->db, ${$id});
             if ($tva->load() == -1) {
                 return "";
             }
             $r = $tva->get_parameter('label');
             break;
             /* total VAT for one sold */
         /* total VAT for one sold */
         case 'TVA_AMOUNT':
         case 'VEN_TVA':
             extract($p_array);
             $qt = 'e_quant' . $this->counter;
             $price = 'e_march' . $this->counter . '_price';
             $tva = 'e_march' . $this->counter . '_tva_id';
             /* if we do not use vat this var. is not set */
             if (!isset(${$tva})) {
                 return '';
             }
             if (!isset(${'e_march' . $this->counter})) {
                 return "";
             }
             // check that something is sold
             if (${$price} == 0 || ${$qt} == 0 || strlen(trim($price)) == 0 || strlen(trim($qt)) == 0) {
                 return "";
             }
             $r = ${'e_march' . $this->counter . '_tva_amount'};
             break;
             /* TVA automatically computed */
         /* TVA automatically computed */
         case 'VEN_ART_TVA':
             extract($p_array);
             $qt = 'e_quant' . $this->counter;
             $price = 'e_march' . $this->counter . '_price';
             $tva = 'e_march' . $this->counter . '_tva_id';
             if (!isset(${'e_march' . $this->counter})) {
                 return "";
             }
             // check that something is sold
             if (${$price} == 0 || ${$qt} == 0 || strlen(trim($price)) == 0 || strlen(trim($qt)) == 0) {
                 return "";
             }
             $oTva = new Acc_Tva($this->db, ${$tva});
             if ($oTva->load() == -1) {
                 return "";
             }
             $r = round(${$price}, 2) * $oTva->get_parameter('rate');
             $r = round($r, 2);
             break;
         case 'VEN_ART_TVAC':
             extract($p_array);
             $qt = 'e_quant' . $this->counter;
             $price = 'e_march' . $this->counter . '_price';
             $tva = 'e_march' . $this->counter . '_tva_id';
             if (!isset(${'e_march' . $this->counter})) {
                 return "";
             }
             // check that something is sold
             if (${$price} == 0 || ${$qt} == 0 || strlen(trim($price)) == 0 || strlen(trim($qt)) == 0) {
                 return "";
             }
             if (!isset(${$tva})) {
                 return '';
             }
             $tva = new Acc_Tva($this->db, ${$tva});
             if ($tva->load() == -1) {
                 $r = round(${$price}, 2);
             } else {
                 $r = round(${$price} * $tva->get_parameter('rate') + ${$price}, 2);
             }
             break;
         case 'VEN_ART_QUANT':
             extract($p_array);
             $id = 'e_quant' . $this->counter;
             if (!isset(${$id})) {
                 return "";
             }
             // check that something is sold
             if (${'e_march' . $this->counter . '_price'} == 0 || ${'e_quant' . $this->counter} == 0 || strlen(trim(${'e_march' . $this->counter . '_price'})) == 0 || strlen(trim(${'e_quant' . $this->counter})) == 0) {
                 return "";
             }
             $r = ${$id};
             break;
         case 'VEN_HTVA':
             extract($p_array);
             $id = 'e_march' . $this->counter . '_price';
             $quant = 'e_quant' . $this->counter;
             if (!isset(${$id})) {
                 return "";
             }
             // check that something is sold
             if (${'e_march' . $this->counter . '_price'} == 0 || ${'e_quant' . $this->counter} == 0 || strlen(trim(${'e_march' . $this->counter . '_price'})) == 0 || strlen(trim(${'e_quant' . $this->counter})) == 0) {
                 return "";
             }
             bcscale(4);
             $r = bcmul(${$id}, ${$quant});
             $r = round($r, 2);
             break;
         case 'VEN_TVAC':
             extract($p_array);
             $id = 'e_march' . $this->counter . '_tva_amount';
             $price = 'e_march' . $this->counter . '_price';
             $quant = 'e_quant' . $this->counter;
             if (!isset(${'e_march' . $this->counter . '_price'}) || !isset(${'e_quant' . $this->counter})) {
                 return "";
             }
             // check that something is sold
             if (${'e_march' . $this->counter . '_price'} == 0 || ${'e_quant' . $this->counter} == 0) {
                 return "";
             }
             bcscale(4);
             // if TVA not exist
             if (!isset(${$id})) {
                 $r = bcmul(${$price}, ${$quant});
             } else {
                 $r = bcmul(${$price}, ${$quant});
                 $r = bcadd($r, ${$id});
             }
             $r = round($r, 2);
             return $r;
             break;
         case 'TOTAL_VEN_HTVA':
             extract($p_array);
             bcscale(4);
             $sum = 0.0;
             for ($i = 0; $i < $nb_item; $i++) {
                 $sell = 'e_march' . $i . '_price';
                 $qt = 'e_quant' . $i;
                 if (!isset(${$sell})) {
                     break;
                 }
                 if (strlen(trim(${$sell})) == 0 || strlen(trim(${$qt})) == 0 || ${$qt} == 0 || ${$sell} == 0) {
                     continue;
                 }
                 $tmp1 = bcmul(${$sell}, ${$qt});
                 $sum = bcadd($sum, $tmp1);
             }
             $r = round($sum, 2);
             break;
         case 'TOTAL_VEN_TVAC':
             extract($p_array);
             $sum = 0.0;
             bcscale(4);
             for ($i = 0; $i < $nb_item; $i++) {
                 $tva = 'e_march' . $i . '_tva_amount';
                 $tva_amount = 0;
                 /* if we do not use vat this var. is not set */
                 if (isset(${$tva})) {
                     $tva_amount = ${$tva};
                 }
                 $sell = ${'e_march' . $i . '_price'};
                 $qt = ${'e_quant' . $i};
                 $tot = bcmul($sell, $qt);
                 $tot = bcadd($tot, $tva_amount);
                 $sum = bcadd($sum, $tot);
             }
             $r = round($sum, 2);
             break;
         case 'TOTAL_TVA':
             extract($p_array);
             $sum = 0.0;
             for ($i = 0; $i < $nb_item; $i++) {
                 $tva = 'e_march' . $i . '_tva_amount';
                 if (!isset(${$tva})) {
                     $tva_amount = 0.0;
                 } else {
                     $tva_amount = ${$tva};
                 }
                 $sum += $tva_amount;
                 $sum = round($sum, 2);
             }
             $r = $sum;
             break;
         case 'BON_COMMANDE':
             if (isset($p_array['bon_comm'])) {
                 return $p_array['bon_comm'];
             } else {
                 return "";
             }
             break;
         case 'PJ':
             if (isset($p_array['e_pj'])) {
                 return $p_array['e_pj'];
             } else {
                 return "";
             }
         case 'OTHER_INFO':
             if (isset($p_array['other_info'])) {
                 return $p_array['other_info'];
             } else {
                 return "";
             }
             break;
         case 'COMMENT':
             if (isset($p_array['e_comm'])) {
                 return $p_array['e_comm'];
             }
             break;
         case 'ACOMPTE':
             if (isset($p_array['acompte'])) {
                 return $p_array['acompte'];
             }
             return "0";
             break;
         case 'STOCK_NAME':
             if (!isset($p_array['repo'])) {
                 return "";
             }
             $ret = $this->db->get_value('select r_name from public.stock_repository where r_id=$1', array($p_array['repo']));
             return $ret;
         case 'STOCK_ADRESS':
             if (!isset($p_array['repo'])) {
                 return "";
             }
             $ret = $this->db->get_value('select r_adress from public.stock_repository where r_id=$1', array($p_array['repo']));
             return $ret;
         case 'STOCK_COUNTRY':
             if (!isset($p_array['repo'])) {
                 return "";
             }
             $ret = $this->db->get_value('select r_country from public.stock_repository where r_id=$1', array($p_array['repo']));
             return $ret;
         case 'STOCK_CITY':
             if (!isset($p_array['repo'])) {
                 return "";
             }
             $ret = $this->db->get_value('select r_city from public.stock_repository where r_id=$1', array($p_array['repo']));
             return $ret;
         case 'STOCK_PHONE':
             if (!isset($p_array['repo'])) {
                 return "";
             }
             $ret = $this->db->get_value('select r_phone from public.stock_repository where r_id=$1', array($p_array['repo']));
             return $ret;
         case 'TITLE':
             $title = HtmlInput::default_value_request("ag_title", "");
             return $title;
     }
     /*
      * retrieve the value of ATTR for e_march
      */
     if (preg_match('/^ATTR/', $p_tag) == 1) {
         // Retrieve f_id
         if (isset($p_array['e_march' . $this->counter])) {
             $id = $p_array['e_march' . $this->counter];
             $r = $this->replace_special_tag($id, $p_tag);
         }
     }
     /*
      * retrieve the value of ATTR for e_march
      */
     if (preg_match('/^BENEFATTR/', $p_tag) == 1) {
         $qcode = isset($p_array['qcode_benef']) ? $p_array['qcode_benef'] : '';
         // Retrieve f_id
         $r = $this->replace_special_tag($qcode, $p_tag);
     }
     if (preg_match('/^CUSTATTR/', $p_tag) == 1) {
         if (isset($p_array['qcode_dest']) || isset($p_array['e_client'])) {
             $qcode = isset($p_array['qcode_dest']) ? $p_array['qcode_dest'] : $p_array['e_client'];
             $r = $this->replace_special_tag($qcode, $p_tag);
         }
     }
     return $r;
 }
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
echo '<div style="content">';
require_once NOALYSS_INCLUDE . '/class_anc_grandlivre.php';
$grandLivre = new Anc_Grandlivre($cn);
$grandLivre->get_request();
/*
 * Form
 */
echo '<form method="get" >';
echo $grandLivre->display_form();
echo '<p>' . HtmlInput::submit('Recherche', _('Rechercher')) . '</p>';
echo HtmlInput::request_to_hidden(array('sa', 'ac', 'gDossier'));
echo '</form>';
$result = HtmlInput::default_value_request('result', null);
if ($result != null) {
    $result = $grandLivre->display_html();
    if ($grandLivre->has_data != 0) {
        echo '<span style="display:block">';
        echo _('Tout sélectionner') . " " . ICheckBox::toggle_checkbox('export_pdf_bt1', 'export_anc_receipt_pdf');
        echo '</span>';
        echo $grandLivre->show_button();
        echo '<form method="GET" id="export_anc_receipt_pdf" action="export.php" style="display:inline">';
        echo $grandLivre->button_export_pdf();
        echo $grandLivre->display_html();
        echo $grandLivre->button_export_pdf();
        echo HtmlInput::get_to_hidden(array('ac', 'gDossier', 'sa'));
        echo '</form>';
        echo $grandLivre->show_button();
    } else {
 * @file
 * @brief show the profile detail, included from ajax_misc.php
 * @see ajax_misc.php scripts.js profile.inc.php
 *
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
// Security
if ($g_user->check_module('CFGPRO') == 0) {
    die;
}
require_once NOALYSS_INCLUDE . '/class_profile_sql.php';
require_once NOALYSS_INCLUDE . '/class_profile_menu.php';
require_once NOALYSS_INCLUDE . '/class_html_input.php';
$p_id = HtmlInput::default_value_request('p_id', -1);
$profile = new Profile_sql($cn, $p_id);
$gDossier = Dossier::id();
$add_impression = HtmlInput::button("add", _("Ajout Menu"), "onclick=\"add_menu({dossier:{$gDossier},p_id:{$p_id},type:'pr'})\"");
$call_tab = HtmlInput::default_value_post('tab', 'none');
$a_tab = array('profile_gen_div' => 'tabs', 'profile_menu_div' => 'tabs', 'profile_print_div' => 'tabs', 'profile_gestion_div' => 'tabs', 'profile_repo_div' => 'tabs');
$a_tab[$call_tab] = 'tabs_selected';
?>
<h1>Profil <?php 
echo $profile->p_name;
?>
</h1>
<?php 
echo HtmlInput::anchor(_('Retour'), "", " onclick = \" \$('detail_profile').hide();\$('list_profile').show(); \" ", 'class="line"');
if ($p_id > 0) {
    ?>
        $ask_pay = 0;
        $p_array['ledger_type'] = 'ALL';
        $Ledger->type = 'ALL';
        break;
    case 'VEN':
        $Ledger = new Acc_Ledger_Sold($cn, 0);
        $ask_pay = 1;
        break;
    case 'FIN':
        $Ledger = new Acc_Ledger_Fin($cn, 0);
        $ask_pay = 0;
        break;
}
echo '<div class="content">';
// Check privilege
$p_jrn = HtmlInput::default_value_request("p_jrn", -1);
if (isset($_REQUEST['p_jrn']) && $g_user->check_jrn($_REQUEST['p_jrn']) == 'X') {
    NoAccess();
    exit - 1;
}
$Ledger->id = $p_jrn;
echo $Ledger->display_search_form();
//------------------------------
// UPdate the payment
//------------------------------
if (isset($_GET['paid'])) {
    $Ledger->update_paid($_GET);
}
$msg = "";
/* by default we should use the default period */
if (!isset($p_array['date_start'])) {
 *
 *   You should have received a copy of the GNU General Public License
 *   along with NOALYSS; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu
/*! \file
 * \brief Send the poste list in csv
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
include_once "ac_common.php";
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_fiche.php';
$f_id = HtmlInput::default_value_request("f_id", "-");
if ($f_id == "-") {
    throw new Exception('Invalid parameter');
}
require_once NOALYSS_INCLUDE . '/class_dossier.php';
$gDossier = dossier::id();
/* Admin. Dossier */
$cn = new Database($gDossier);
$Fiche = new Fiche($cn, $f_id);
$qcode = $Fiche->get_quick_code();
header('Content-type: application/csv');
header('Pragma: public');
header('Content-Disposition: attachment;filename="fiche-' . $qcode . '.csv"', FALSE);
$Fiche->getName();
list($array, $tot_deb, $tot_cred) = $Fiche->get_row_date($_GET['from_periode'], $_GET['to_periode'], $_GET['ople']);
if (count($Fiche->row) == 0) {
Exemple #9
0
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_iselect.php';
require_once NOALYSS_INCLUDE . '/class_icheckbox.php';
require_once NOALYSS_INCLUDE . '/class_ihidden.php';
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/ac_common.php';
require_once NOALYSS_INCLUDE . '/class_pre_operation.php';
/*
 * Value from $_GET or $_REQUEST
 */
$request_jrn = HtmlInput::default_value_request("jrn", -1);
$request_ac = HtmlInput::default_value_request("ac", "");
$request_sa = HtmlInput::default_value_request("sa", "");
$get_jrn = HtmlInput::default_value_get('jrn', -1);
echo '<div class="content">';
echo '<form method="GET">';
$sel = new ISelect();
$sel->name = "jrn";
$sel->value = $cn->make_array("select jrn_def_id,jrn_def_name from " . " jrn_def where jrn_def_type in ('VEN','ACH','ODS') order by jrn_def_name");
// Show a list of ledger
$sel->selected = $request_jrn;
echo 'Choisissez un journal ' . $sel->input();
echo dossier::hidden();
$hid = new IHidden();
echo $hid->input("sa", "jrn");
echo $hid->input("ac", $request_ac);
echo '<hr>';
echo HtmlInput::submit('Accepter', 'Accepter');
Exemple #10
0
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu
require_once '../include/constant.php';
require_once "constant.php";
require_once 'class_database.php';
require_once "class_user.php";
require_once 'ac_common.php';
$rep = new Database();
$User = new User($rep);
$User->Check();
if ($User->admin != 1) {
    echo "<script>alert('" . _("Vous n\\'êtes pas administrateur") . "') </script>";
    return;
}
$dossier_number = HtmlInput::default_value_request("d", 0);
if ($dossier_number == 0 || isNumber($dossier_number) == 0) {
    die('Invalid folder number');
}
/*!\file
 * \brief Make and restore backup
 */
if (isset($_REQUEST['sa'])) {
    if (defined('PG_PATH')) {
        putenv("PATH=" . PG_PATH);
    }
    if (!isset($_REQUEST['t'])) {
        echo "Erreur : paramètre manquant ";
        exit;
    }
    $sa = $_REQUEST['sa'];
Exemple #11
0
   
   Merci d'utiliser NOALYSS
   
Cordialement,

Noalyss team
      
EOF;
        $mail->set_message($message);
        $mail->compose();
        $mail->send();
        echo '<p style="position:absolute;z-index:2;top:25px;left: 50px; background-color:whitesmoke;">
L\'email a été envoyé avec un lien et le nouveau mot de passe, vérifiez vos spams</p>';
    }
} elseif ($action == "req") {
    $request_id = HtmlInput::default_value_request("req", "");
    if (strlen(trim($request_id)) == SIZE_REQUEST) {
        require_once NOALYSS_INCLUDE . '/class_database.php';
        $cn = new Database(0);
        $value = $cn->get_value("select password from recover_pass where request=\$1 and created_on > now() - interval '12 hours' and recover_on is null", array($request_id));
        if ($cn->get_affected() > 0) {
            $cn->exec_sql("update ac_users set use_pass=md5(rp.password) from recover_pass as rp where rp.use_id=ac_users.use_id and request=\$1", array($request_id));
            $cn->exec_sql("update recover_pass set recover_by=\$1 , recover_on=now() where request=\$2", array($_SERVER['REMOTE_ADDR'], $request_id));
            ?>
    <p style="position:absolute;z-index:2;top:25px;left: 50px; background-color:whitesmoke;">
            Opération réussie , vous pouvez vous connecter avec votre nouveau mot de passe
             
    </p>
            <?php 
        }
    } else {