コード例 #1
0
ファイル: class_stock.php プロジェクト: Kloadut/noalyss_ynh
 /**
  * show history of all the stock movement
  * @param $p_array usually contains $_GET
  */
 function history($p_array)
 {
     $sql = $this->create_query_histo($p_array);
     require_once NOALYSS_INCLUDE . '/class_sort_table.php';
     $p_url = HtmlInput::get_to_string(array("gDossier", "ac", "wcard", "wdate_start", "wdate_end", "wrepo", "wamount_start", "wamount_end", "wcode_stock", "wdirection"));
     $tb = new Sort_Table();
     $tb->add("Date", $p_url, " order by real_date asc", "order by real_date desc", "da", "dd");
     $tb->add("Code Stock", $p_url, " order by sg_code asc", "order by sg_code desc", "sa", "sd");
     $tb->add("Dépôt", $p_url, " order by r_name asc", "order by r_name desc", "ra", "rd");
     $tb->add("Fiche", $p_url, " order by 2 asc", "order by 2 desc", "fa", "fd");
     $tb->add("Commentaire", $p_url, " order by coalesce(sg_comment,jr_comment)  asc", "order by coalesce(sg_comment,jr_comment)  desc", "ca", "cd");
     $tb->add("Montant", $p_url, " order by j_montant asc", "order by j_montant desc", "ja", "jd");
     $tb->add("Quantité", $p_url, " order by sg_quantity asc", "order by sg_quantity  desc", "qa", "qd");
     $tb->add("IN/OUT", $p_url, " order by (case when sg_type='c' then 'OUT' when sg_type='c' then 'IN' end ) asc", "order by (case when sg_type='c' then 'OUT' when sg_type='c' then 'IN' end ) desc", "ta", "td");
     $order = isset($p_array['ord']) ? $p_array['ord'] : 'da';
     $sql .= $tb->get_sql_order($order);
     $step = $_SESSION['g_pagesize'];
     $page = isset($_GET['offset']) ? $_GET['page'] : 1;
     $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
     $res = $this->cn->exec_sql($sql);
     $max_row = Database::num_row($res);
     $nav_bar = navigation_bar($offset, $max_row, 0, $page);
     if ($step != -1) {
         $res = $this->cn->exec_sql($sql . " , sg_id asc limit " . $step . " offset " . $offset);
     }
     $max_row = Database::num_row($res);
     $this->search_box_button();
     $this->search_box($p_array);
     require_once NOALYSS_INCLUDE . '/template/stock_histo.php';
     $this->export_stock_histo_form();
     echo HtmlInput::print_window();
 }
コード例 #2
0
 function load()
 {
     $filter = $this->set_sql_filter();
     // sum debit
     $sql = "select m.po_id,sum(deb) as sum_deb,sum(cred) as sum_cred,";
     $sql .= " po_name||'  '||coalesce(po_description,'') as po_name";
     $sql .= " from ";
     $sql .= " (select po_id,case when oa_debit='t' then oa_amount else 0 end as deb,";
     $sql .= "case when oa_debit='f' then oa_amount else 0 end as cred ";
     $sql .= " from operation_analytique join poste_analytique using(po_id)";
     $sql .= empty($filter) == false ? " where " . $filter : "";
     $sql .= " ) as m join poste_analytique using (po_id)";
     $sql .= " where pa_id=" . $this->pa_id;
     $sql .= " group by po_id,po_name,po_description";
     $sql .= " order by po_id";
     $res = $this->db->exec_sql($sql);
     if (Database::num_row($res) == 0) {
         $this->has_data = 0;
         return null;
     }
     $a = array();
     $count = 0;
     $array = Database::fetch_all($res);
     foreach ($array as $row) {
         $a[$count]['po_id'] = $row['po_id'];
         $a[$count]['sum_deb'] = $row['sum_deb'];
         $a[$count]['sum_cred'] = $row['sum_cred'];
         $a[$count]['po_name'] = $row['po_name'];
         $a[$count]['solde'] = abs($row['sum_deb'] - $row['sum_cred']);
         $a[$count]['debit'] = $row['sum_deb'] > $row['sum_cred'] ? "debit" : "credit";
         $count++;
     }
     $this->has_data = $count;
     return $a;
 }
コード例 #3
0
ファイル: user_menu.php プロジェクト: Kloadut/noalyss_ynh
function ShowMenuFiche($p_dossier)
{
    $cn = new Database($p_dossier);
    $mod = "&ac=" . $_REQUEST['ac'];
    $str_dossier = dossier::get() . $mod;
    echo '<div class="lmenu">';
    echo '<TABLE>';
    echo '<TR><TD colspan="1" class="mtitle"  style="width:auto" >
    <A class="mtitle" HREF="?p_action=fiche&action=add_modele&fiche=modele&' . $str_dossier . '">' . _('Création') . '</A></TD>
    <TD><A class="mtitle" HREF="?p_action=fiche&' . $str_dossier . '">' . _('Recherche') . '</A></TD>
    </TR>';
    $Res = $cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
    $Max = Database::num_row($Res);
    for ($i = 0; $i < $Max; $i++) {
        $l_line = Database::fetch_array($Res, $i);
        printf('<TR><TD class="cell">
               <A class="mtitle" HREF="?p_action=fiche&action=modifier&fiche=%d&%s">%s</A></TD>
               <TD class="mshort">
               <A class="mtitle" HREF="?p_action=fiche&action=vue&fiche=%d&%s">Liste</A>
               </TD>
               </TR>', $l_line['fd_id'], $str_dossier, $l_line['fd_label'], $l_line['fd_id'], $str_dossier);
    }
    echo "</TABLE>";
    echo '</div>';
}
コード例 #4
0
 function search_by_jid($p_jid)
 {
     $res = $this->db->exec_sql("select qs_id from quant_sold where j_id=" . $p_jid);
     if (Database::num_row($res) == 1) {
         $this->qs_id = Database::fetch_result($res, 0, 0);
     } else {
         $this->qs_id = 0;
     }
 }
コード例 #5
0
 function get_lib()
 {
     $ret = $this->db->exec_sql("select pcm_lib from tmp_pcmn where\n                 pcm_val=\$1", array($this->pcm_val));
     if (Database::num_row($ret) != 0) {
         $r = Database::fetch_array($ret);
         $this->pcm_lib = $r['pcm_lib'];
     } else {
         $this->pcm_lib = _("Poste inconnu");
     }
     return $this->pcm_lib;
 }
コード例 #6
0
 function __construct()
 {
     global $cn;
     $menu = new Default_Menu_SQL($cn);
     $ret = $menu->seek();
     for ($i = 0; $i < Database::num_row($ret); $i++) {
         $tmenu = $menu->next($ret, $i);
         $idx = $tmenu->getp('md_code');
         $this->a_menu_def[$idx] = $tmenu->getp('me_code');
     }
     $this->code = explode(',', 'code_follow,code_invoice');
 }
コード例 #7
0
ファイル: class_own.php プロジェクト: Kloadut/noalyss_ynh
 function Own($p_cn)
 {
     $this->db = $p_cn;
     $Res = $p_cn->exec_sql("select * from parameter where pr_id like 'MY_%'");
     for ($i = 0; $i < Database::num_row($Res); $i++) {
         $row = Database::fetch_array($Res, $i);
         $key = $row['pr_id'];
         $elt = $row['pr_value'];
         // store value here
         $this->{"{$key}"} = $elt;
     }
 }
コード例 #8
0
ファイル: user_common.php プロジェクト: Kloadut/noalyss_ynh
function isValid_deprecrated($p_cn, $p_grpt_id)
{
    $Res = $p_cn->exec_sql("select jr_valid from jrn where jr_grpt_id={$p_grpt_id}");
    if (($M = Database::num_row($Res)) == 0) {
        return 0;
    }
    $a = Database::fetch_array($Res, 0);
    if ($a['jr_valid'] == 't') {
        return 1;
    }
    if ($a['jr_valid'] == 'f') {
        return 0;
    }
    echo_error("Invalid result = " . $a['result']);
}
コード例 #9
0
 private function fetch_from_db($p_where)
 {
     $sql = "select po_id,\n             po_name ,\n             pa_id,\n             po_amount,\n             po_description,\n             ga_id\n             from poste_analytique\n             where " . $p_where;
     $ret = $this->db->exec_sql($sql);
     if (Database::num_row($ret) == 0) {
         return null;
     }
     $line = Database::fetch_array($ret);
     $this->id = $line['po_id'];
     $this->name = $line['po_name'];
     $this->pa_id = $line['pa_id'];
     $this->amount = $line['po_amount'];
     $this->description = $line['po_description'];
     $this->ga_id = $line['ga_id'];
 }
コード例 #10
0
    /**
     * Display the content of a profile menu for printing
     * @param type $resource
     * @param type $p_id
     */
    function sub_menu($resource, $p_id)
    {
        if (Database::num_row($resource) != 0) {
            ////
            // If there are submenus
            $gDossier = dossier::id();
            echo '<td>';
            for ($e = 0; $e < Database::num_row($resource); $e++) {
                $menu = Database::fetch_array($resource, $e);
                $me_code = $menu['me_code'];
                $me_code_dep = $menu['me_code_dep'];
                $mp_type = $menu['p_type_display'];
                $me_menu = $menu['me_menu'];
                $me_desc = $menu['me_description'];
                $me_def = $menu['pm_default'] == '1' ? '<span class="notice" style="display:inline">Défaut</span>' : '';
                ?>
                <li id="sub<?php 
                echo $menu['pm_id'];
                ?>
">

                    <?php 
                echo $me_menu;
                ?>
                    <?php 
                echo $me_desc;
                ?>
  <?php 
                echo $me_def;
                ?>
                    <?php 
                $ret2 = $this->cn->exec_sql("\n                                    SELECT pm_id,\n                                            pm.me_code,\n                                            me_code_dep,\n                                            p_id,\n                                            p_order,\n                                            p_type_display,\n                                            pm_default,\n                                            pm_desc,\n                                            me_menu,\n                                            me_description\n                                            FROM profile_menu as pm\n                                                    join profile_menu_type on (p_type_display=pm_type)\n                                                    join menu_ref as mr on (mr.me_code=pm.me_code)\n                                            where\n                                            p_id=\$1 and me_code_dep=\$2\n                                            order by p_order asc\n                        ", array($p_id, $me_code));
                ?>
                    <span>
                        <?php 
                echo HtmlInput::anchor(SMALLX, "", sprintf(" onclick = \"remove_sub_menu(%d,%d)\"", Dossier::id(), $menu['pm_id']), 'class="tinybutton"');
                ?>
                    </span>
                    <?php 
                echo "</li>";
            }
            //end loop e
            echo '</ul>';
        }
        // end if
    }
コード例 #11
0
 function get_by_account($p_poste = 0)
 {
     $this->poste = $p_poste == 0 ? $this->poste : $p_poste;
     $sql = "select * from vw_supplier where poste_comptable=" . $this->poste;
     $Res = $this->cn->exec_sql($sql);
     if (Database::num_row($Res) == 0) {
         return null;
     }
     // There is only _one_ row by supplier
     $row = Database::fetch_array($Res, 0);
     $this->name = $row['name'];
     $this->id = $row['f_id'];
     $this->street = $row['rue'];
     $this->cp = $row['code_postal'];
     $this->country = $row['pays'];
     $this->vat_number = $row['tva_num'];
 }
コード例 #12
0
            $a = $line_tva['tva_id'];
            if (isset($a_tva_amount[$a])) {
                echo '<td class="num">' . nb($a_tva_amount[$a]) . '</td>';
                $tot['tva'][$a] = isset($tot['tva'][$a]) ? bcadd($tot['tva'][$a], floatval($a_tva_amount[$a])) : floatval($a_tva_amount[$a]);
            } else {
                printf("<td class=\"num\"></td>");
            }
        }
    }
    echo '<td class="num">' . $line['TVAC'] . '</td>';
    $tot['tvac'] = bcadd($tot['tvac'], floatval($line['TVAC']));
    /*
     * If reconcile print them
     */
    echo '<td>';
    $max = Database::num_row($ret_reconcile);
    if ($max > 0) {
        $sep = "";
        for ($e = 0; $e < $max; $e++) {
            $row = Database::fetch_array($ret_reconcile, $e);
            echo $sep . HtmlInput::detail_op($row['jr_id'], $row['jr_date'] . ' ' . $row['jr_internal']);
            $sep = ' ,';
        }
    }
    echo '</td>';
    echo "</tr>";
}
/** 
 * summary
 */
?>
コード例 #13
0
 function get_jrid()
 {
     $sql = "select distinct jr_id from jrn join jrnx on (j_grpt=jr_grpt_id) join operation_analytique using (j_id) where j_id is not null and oa_group=" . $this->oa_group;
     $res = $this->db->exec_sql($sql);
     if (Database::num_row($res) == 0) {
         return 0;
     }
     $ret = Database::fetch_all($res);
     return $ret[0]['jr_id'];
 }
コード例 #14
0
 public function load()
 {
     $sql = "select tl_id,tl_title,tl_desc,to_char( tl_date,'DD.MM.YYYY') as tl_date,is_public,use_login\n             from todo_list where tl_id=\$1 ";
     $res = $this->cn->exec_sql($sql, array($this->tl_id));
     if (Database::num_row($res) == 0) {
         return;
     }
     $row = Database::fetch_array($res, 0);
     foreach ($row as $idx => $value) {
         $this->{$idx} = $value;
     }
 }
コード例 #15
0
 function load()
 {
     try {
         if ($this->b_id == "") {
             throw new Exception(_("le formulaire id n'est pas donnee"));
         }
         $sql = "select b_name,b_file_template,b_file_form,lower(b_type) as b_type from bilan where" . " b_id = " . $this->b_id;
         $res = $this->db->exec_sql($sql);
         if (Database::num_row($res) == 0) {
             throw new Exception(_('Aucun enregistrement trouve'));
         }
         $array = Database::fetch_array($res, 0);
         foreach ($array as $name => $value) {
             $this->{$name} = $value;
         }
     } catch (Exception $Ex) {
         echo $Ex->getMessage();
         throw $Ex;
     }
 }
コード例 #16
0
 function load()
 {
     $filter_poste = "";
     $and = "";
     if ($this->from_poste != "") {
         $filter_poste .= " {$and} upper(pa.po_name)>= upper('" . Database::escape_string($this->from_poste) . "')";
         $and = " and ";
     }
     if ($this->to_poste != "") {
         $filter_poste .= " {$and} upper(pa.po_name)<= upper('" . Database::escape_string($this->to_poste) . "')";
         $and = " and ";
     }
     if ($this->from_poste2 != "") {
         $filter_poste .= " {$and} upper(pb.po_name)>= upper('" . Database::escape_string($this->from_poste2) . "')";
         $and = " and ";
     }
     if ($this->to_poste2 != "") {
         $filter_poste .= " {$and} upper(pb.po_name)<= upper('" . Database::escape_string($this->to_poste2) . "')";
         $and = " and ";
     }
     if ($filter_poste != "") {
         $filter_poste = " where " . $filter_poste;
     }
     $sql = "\n             select  a_po_id ,\n             pa.po_name as a_po_name,\n             pa.po_description as a_po_description,\n             pb.po_description as b_po_description,\n\n             b_po_id,\n             pb.po_name as b_po_name,\n             sum(a_oa_amount_c) as a_c,\n             sum(a_oa_amount_d) as a_d\n             from (select\n\t\t\ta.j_id,\n             a.po_id as a_po_id,\n             b.po_id as b_po_id,\n             case when a.oa_debit='t' then a.oa_amount else 0 end as a_oa_amount_d,\n             case when a.oa_debit='f' then a.oa_amount else 0 end as a_oa_amount_c\n             from\n             operation_analytique as a join operation_analytique as b on (a.j_id=b.j_id and a.oa_row=b.oa_row)\n\t\tjoin poste_analytique as poa on (a.po_id=poa.po_id)\n\t\tjoin poste_analytique as pob on (b.po_id=pob.po_id)\n             where poa.pa_id=" . $this->pa_id . "\n             and pob.pa_id=" . $this->pa_id2 . "  " . $this->set_sql_filter() . "\n             ) as m join poste_analytique as pa on ( a_po_id=pa.po_id)\n             join poste_analytique as pb on (b_po_id=pb.po_id)\n\n             {$filter_poste}\n\n             group by a_po_id,b_po_id,pa.po_name,pa.po_description,pb.po_name,pb.po_description\n             order by 2;\n             ";
     $res = $this->db->exec_sql($sql);
     $this->has_data = Database::num_row($res);
     if (Database::num_row($res) == 0) {
         return null;
     }
     $a = array();
     $count = 0;
     $array = Database::fetch_all($res);
     foreach ($array as $row) {
         $a[$count]['a_po_id'] = $row['a_po_id'];
         $a[$count]['a_d'] = $row['a_d'];
         $a[$count]['a_c'] = $row['a_c'];
         $a[$count]['b_po_id'] = $row['b_po_id'];
         $a[$count]['a_po_name'] = $row['a_po_name'];
         $a[$count]['a_po_description'] = $row['a_po_description'];
         $a[$count]['b_po_name'] = $row['b_po_name'];
         $a[$count]['b_po_description'] = $row['b_po_description'];
         $a[$count]['a_solde'] = abs($row['a_d'] - $row['a_c']);
         $a[$count]['a_debit'] = $row['a_d'] > $row['a_c'] ? "debit" : "credit";
         $count++;
     }
     return $a;
 }
コード例 #17
0
 function get()
 {
     $sql = "select * from document where d_id=" . $this->d_id;
     $ret = $this->db->exec_sql($sql);
     if (Database::num_row($ret) == 0) {
         return;
     }
     $row = Database::fetch_array($ret, 0);
     $this->ag_id = $row['ag_id'];
     $this->d_mimetype = $row['d_mimetype'];
     $this->d_filename = $row['d_filename'];
     $this->d_lob = $row['d_lob'];
     $this->d_number = $row['d_number'];
     $this->d_description = $row['d_description'];
 }
コード例 #18
0
ファイル: class_dossier.php プロジェクト: Kloadut/noalyss_ynh
 public function load()
 {
     $sql = "select dos_name,dos_description from ac_dossier where dos_id=\$1";
     $res = $this->cn->exec_sql($sql, array($this->dos_id));
     if (Database::num_row($res) == 0) {
         return;
     }
     $row = Database::fetch_array($res, 0);
     foreach ($row as $idx => $value) {
         $this->{$idx} = $value;
     }
 }
コード例 #19
0
ファイル: fiche.inc.php プロジェクト: Kloadut/noalyss_ynh
         return;
     } else {
         continue;
     }
 }
 echo '<h2>' . $cn->get_value("select fd_label from fiche_def where fd_id=\$1", array($afiche[$e]['fd_id'])) . '</h2>';
 $id = "table_" . $afiche[$e]['fd_id'] . "_id";
 echo _('Filtre rapide:') . HtmlInput::filter_table($id, '0,1,2', '1');
 echo '<table class="sortable" id="' . $id . '" class="result" >';
 echo tr(th('Quick Code') . th('Libellé') . '<th>Poste' . HtmlInput::infobulle(27) . '</th>' . th('Débit', 'style="text-align:right"') . th('Crédit', 'style="text-align:right"') . th('Solde', 'style="text-align:right"') . th('D/C', 'style="text-align:right"'));
 $idx = 0;
 $sum_deb = 0;
 $sum_cred = 0;
 $sum_solde = 0;
 bcscale(4);
 for ($i = 0; $i < Database::num_row($ret); $i++) {
     $filter = " (j_date >= to_date('" . $_REQUEST['start'] . "','DD.MM.YYYY') " . " and  j_date <= to_date('" . $_REQUEST['end'] . "','DD.MM.YYYY')) ";
     $aCard = Database::fetch_array($ret, $i);
     $oCard = new Fiche($cn, $aCard['f_id']);
     $solde = $oCard->get_solde_detail($filter);
     if ($solde['debit'] == 0 && $solde['credit'] == 0) {
         continue;
     }
     /* only not purged card */
     if ($_GET['histo'] == 5 && $solde['debit'] == $solde['credit']) {
         continue;
     }
     $class = $idx % 2 == 0 ? 'class="odd"' : 'class="even"';
     $idx++;
     $sum_cred = bcadd($sum_cred, $solde['credit']);
     $sum_deb = bcadd($sum_deb, $solde['debit']);
コード例 #20
0
 function load()
 {
     if ($this->p_code == -1) {
         return "p_code non initialisé";
     }
     $sql = 'select * from parm_code where p_code=$1 ';
     $Res = $this->db->exec_sql($sql, array($this->p_code));
     if (Database::num_row($Res) == 0) {
         return 'INCONNU';
     }
     $row = Database::fetch_array($Res, 0);
     $this->p_value = $row['p_value'];
     $this->p_comment = $row['p_comment'];
 }
コード例 #21
0
ファイル: ac_common.php プロジェクト: Kloadut/noalyss_ynh
/**
 * \brief Minimal  page header for each page, used for small popup window
 *
 * \param p_theme default theme
 * \param $p_script
 * \param $p_script2  another js script
 *
 * \return none
 */
function html_min_page_start($p_theme = "", $p_script = "", $p_script2 = "")
{
    $cn = new Database();
    if ($p_theme != "") {
        $Res = $cn->exec_sql("select the_filestyle from theme\n                           where the_name='" . $p_theme . "'");
        if (Database::num_row($Res) == 0) {
            $style = "style-classic.css";
        } else {
            $s = Database::fetch_array($Res, 0);
            $style = $s['the_filestyle'];
        }
    } else {
        $style = "style-classic.css";
    }
    // end if
    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">';
    echo "<HTML>";
    if ($p_script2 != "") {
        $p_script2 = '<script src="' . $p_script2 . '" type="text/javascript"></script>';
    }
    echo "<HEAD>\n    <TITLE>NOALYSS</TITLE>\n    <META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF8\">\n    <LINK REL=\"stylesheet\" type=\"text/css\" href=\"{$style}\" media=\"screen\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style-print.css\" media=\"print\">" . $p_script2 . "\n    <script src=\"js/scripts.js\" type=\"text/javascript\"></script>\n    <script src=\"js/acc_ledger.js\" type=\"text/javascript\"></script>\n    <script src=\"js/smoke.js\" type=\"text/javascript\"></script>";
    echo '</HEAD>
    ';
    echo "<BODY {$p_script}>";
    /* If we are on the user_login page */
    if (basename($_SERVER['PHP_SELF']) == 'user_login.php') {
        return;
    }
}
コード例 #22
0
            $ctl = 'nok';
        }
    }
}
//-----------------------------------------------------
// Action == remove a line
if ($action == "update" && $acc_delete == 1) {
    /* Ligne a enfant */
    $R = $cn->exec_sql("select pcm_val from tmp_pcmn where pcm_val_parent=\$1", array($p_valu));
    if (Database::num_row($R) != 0) {
        $message = _("Ne peut pas effacer le poste: d'autres postes en dépendent");
        $ctl = 'nok';
    } else {
        /* Vérifier que le poste n'est pas utilisé qq part dans les journaux */
        $Res = $cn->exec_sql("select * from jrnx where j_poste=\$1", array($p_valu));
        if (Database::num_row($Res) != 0) {
            $message = _("Ne peut pas effacer le poste: il est utilisé dans les journaux");
            $ctl = 'nok';
        } else {
            $Del = $cn->exec_sql("delete from tmp_pcmn where pcm_val=\$1", array($p_valu));
        }
        // if Database::num_row
    }
    // if Database::num_row
}
//$action == del
$message = escape_xml($message);
if (!headers_sent()) {
    header('Content-type: text/xml; charset=UTF-8');
} else {
    echo "HTML" . unescape_xml($html);
コード例 #23
0
 function get_attr_min($p_fiche_def_ref)
 {
     // find the min attr for the fiche_def_ref
     $Sql = "select ad_id,ad_text from attr_min natural join attr_def\n             natural join fiche_def_ref\n             where\n             frd_id= \$1";
     $Res = $this->cn->exec_sql($Sql, array($p_fiche_def_ref));
     $Num = Database::num_row($Res);
     // test the number of returned rows
     if ($Num == 0) {
         return null;
     }
     // Get Results & Store them in a array
     for ($i = 0; $i < $Num; $i++) {
         $f = Database::fetch_array($Res, $i);
         $array[$i]['ad_id'] = $f['ad_id'];
         $array[$i]['ad_text'] = $f['ad_text'];
     }
     return $array;
 }
コード例 #24
0
 /**
  *@brief check if a report exist
  *@param $p_id, optional, if given check the report with this fr_id
  *@return return true if the report exist otherwise false
  */
 function exist($p_id = 0)
 {
     $c = $this->id;
     if ($p_id != 0) {
         $c = $p_id;
     }
     $ret = $this->db->exec_sql("select fr_label from formdef where fr_id=\$1", array($c));
     if (Database::num_row($ret) == 0) {
         return false;
     }
     return true;
 }
コード例 #25
0
 public function load()
 {
     $sql = "select fc_desc, f_id,fc_order from forecast_cat where fc_id=\$1";
     $res = $this->cn->exec_sql($sql, array($this->fc_id));
     if (Database::num_row($res) == 0) {
         return;
     }
     $row = Database::fetch_array($res, 0);
     foreach ($row as $idx => $value) {
         $this->{$idx} = $value;
     }
 }
コード例 #26
0
ファイル: param_sec.inc.php プロジェクト: Kloadut/noalyss_ynh
 $Res = $cn->exec_sql("select jrn_def_id,jrn_def_name  from jrn_def " . " order by jrn_def_name");
 $sec_User = new User($cn, $_GET['user_id']);
 echo '<form method="post">';
 $sHref = sprintf('export.php?act=PDF:sec&user_id=%s&' . $str_dossier, $_GET['user_id']);
 echo dossier::hidden();
 echo HtmlInput::hidden('action', 'sec');
 echo HtmlInput::hidden('user_id', $_GET['user_id']);
 $i_profile = new ISelect('profile');
 $i_profile->value = $cn->make_array("select p_id,p_name from profile\n\t\t\torder by p_name");
 $i_profile->selected = $sec_User->get_profile();
 echo "<p>";
 echo _("Profil") . " " . $i_profile->input();
 echo "</p>";
 echo '<Fieldset><legend>Journaux </legend>';
 echo '<table>';
 $MaxJrn = Database::num_row($Res);
 $jrn_priv = new ISelect();
 $array = array(array('value' => 'R', 'label' => 'Uniquement lecture'), array('value' => 'W', 'label' => 'Lecture et écriture'), array('value' => 'X', 'label' => 'Aucun accès'));
 for ($i = 0; $i < $MaxJrn; $i++) {
     /* set the widget */
     $l_line = Database::fetch_array($Res, $i);
     echo '<TR> ';
     if ($i == 0) {
         echo '<TD class="num"> <B> Journal </B> </TD>';
     } else {
         echo "<TD></TD>";
     }
     echo "<TD class=\"num\"> {$l_line['jrn_def_name']} </TD>";
     $jrn_priv->name = 'jrn_act' . $l_line['jrn_def_id'];
     $jrn_priv->value = $array;
     if ($admin != 1) {
コード例 #27
0
        case 'W':
            $pdf->SetTextColor(54, 233, 0);
            $pdf->Cell(30, 6, 'Ecriture');
            break;
    }
    $pdf->SetTextColor(0);
    $pdf->Ln();
}
//-----------------------------------------------------
// Follow_Up
$pdf->SetFont('DejaVu', 'B', 9);
$pdf->Cell(0, 7, 'Accès action', 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('DejaVu', '', 6);
$Res = $cn->exec_sql("select ac_id, ac_description from action   order by ac_description ");
$Max = Database::num_row($Res);
for ($i = 0; $i < $Max; $i++) {
    $l_line = Database::fetch_array($Res, $i);
    $pdf->Cell(90, 6, $l_line['ac_description']);
    $right = $SecUser->check_action($l_line['ac_id']);
    switch ($right) {
        case 0:
            $pdf->SetTextColor(255, 0, 34);
            $pdf->Cell(30, 6, "Pas d'accès");
            break;
        case 1:
        case 2:
            $pdf->SetTextColor(54, 233, 0);
            $pdf->Cell(30, 6, "Accès");
            break;
    }
コード例 #28
0
ファイル: fid_card.php プロジェクト: Kloadut/noalyss_ynh
    echo "<ul>";
    $sql_get = $cn->prepare('get_name', "select ad_value from fiche_detail where f_id = \$1 and ad_id=\$2");
    for ($i = 0; $i < 12 && $i < count($sql); $i++) {
        $name = '';
        $quick_code = '';
        $desc = '';
        $sql_name = $cn->execute('get_name', array($sql[$i]['f_id'], 1));
        if (Database::num_row($sql_name) == 1) {
            $name = Database::fetch_result($sql_name, 0, 0);
        }
        $sql_name = $cn->execute('get_name', array($sql[$i]['f_id'], 9));
        if (Database::num_row($sql_name) == 1) {
            $desc = Database::fetch_result($sql_name, 0, 0);
        }
        $sql_name = $cn->execute('get_name', array($sql[$i]['f_id'], 23));
        if (Database::num_row($sql_name) == 1) {
            $quick_code = Database::fetch_result($sql_name, 0, 0);
        }
        /* Highlight the found pattern with bold format */
        $name = str_ireplace($_REQUEST['FID'], '<em>' . $_REQUEST['FID'] . '</em>', h($name));
        $qcode = str_ireplace($_REQUEST['FID'], '<em>' . $_REQUEST['FID'] . '</em>', h($quick_code));
        $desc = str_ireplace($_REQUEST['FID'], '<em>' . $_REQUEST['FID'] . '</em>', h($desc));
        printf('<li id="%s">%s <span class="informal"> %s %s</span></li>', $quick_code, $quick_code, $name, $desc);
    }
    echo '</ul>';
    if (count($sql) > 12) {
        printf('<i>...' . _('Résultat limité à 12') . '  ...</i>');
    }
} else {
    echo "<ul><li>" . _("Non trouvé") . "</li></ul>";
}
コード例 #29
0
 function show_detail($p_ret)
 {
     if (Database::num_row($p_ret) > 0) {
         echo '<tr class="odd">';
         echo '<td></td>';
         echo '<td colspan="5" style="border:1px solid black;width:auto">';
         include 'template/impress_reconciliation_detail.php';
         echo '</td>';
         echo '</tr>';
     }
 }
コード例 #30
0
ファイル: dossier.inc.php プロジェクト: Kloadut/noalyss_ynh
            $compteur++;
        }
        echo "</TR>";
    }
    echo '</table>';
}
?>
<div id="folder_add_id" class="inner_box" style="display:none;top:50px">
    <?php 
//---------------------------------------------------------------------------
// Add a new folder
echo HtmlInput::title_box(_("Ajout d'un dossier"), 'folder_add_id', "hide");
$repo = new Database();
// Load the available Templates
$Res = $repo->exec_sql("select mod_id,mod_name,mod_desc from\n                       modeledef order by mod_name");
$count = Database::num_row($Res);
if ($count == 0) {
    echo _("pas de modèle disponible");
} else {
    $template = '<SELECT NAME=FMOD_ID>';
    for ($i = 0; $i < $count; $i++) {
        $mod = Database::fetch_array($Res, $i);
        $template .= '<OPTION VALUE="' . $mod['mod_id'] . '"> ' . h($mod['mod_name'] . " - " . mb_substr($mod['mod_desc'], 0, 30));
    }
    // for
    $template .= '<option value="0" >' . _('Aucun modèle (dossier vide, devant être restauré manuellement)');
    $template .= "</SELECT>";
}
// if count = 0
$m_date = date('Y');
?>