Example #1
0
 /**
  * constructor
  *@param $p_init resource to database
  *@note by default start and end are the 1.1.exercice to 31.12.exercice
  */
 function __construct($p_init)
 {
     $this->db = $p_init;
     $a = new User($p_init);
     $exercice = $a->get_exercice();
     $this->start = '01.01.' . $exercice;
     $this->end = '31.12.' . $exercice;
     // available ledgers
     $this->sql_ledger = str_replace('jrn_def_id', 'jr_def_id', $a->get_ledger_sql('ALL', 3));
 }
Example #2
0
require_once NOALYSS_INCLUDE . '/ac_common.php';
require_once NOALYSS_INCLUDE . '/function_javascript.php';
require_once NOALYSS_INCLUDE . '/class_html_input.php';
require_once NOALYSS_INCLUDE . '/class_dossier.php';
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_user.php';
require_once NOALYSS_INCLUDE . '/class_periode.php';
html_page_start($_SESSION['g_theme']);
echo '<div style="float:left;">';
global $g_user;
if (basename($_GET['ajax']) == 'ajax_history.php') {
    $href = dossier::get();
    $cn = new Database(dossier::id());
    /* current year  */
    $g_user = new User($cn);
    $exercice = $g_user->get_exercice();
    /* get date limit */
    $periode = new Periode($cn);
    $limit = $periode->get_limit($exercice);
    $from_periode = 'from_periode=' . format_date($limit[0]->p_start);
    $to_periode = 'to_periode=' . format_date($limit[1]->p_end);
    if (isset($_GET['ex'])) {
        if ($exercice > $_GET['ex']) {
            $limit_periode = $periode->get_limit($_GET['ex']);
            $from_periode = 'from_periode=' . format_date($limit_periode[0]->p_start);
        } else {
            $limit_periode = $periode->get_limit($_GET['ex']);
            $to_periode = 'to_periode=' . format_date($limit_periode[1]->p_end);
        }
    }
    if (isset($_GET['pcm_val'])) {
Example #3
0
    fwrite($file_loginput, "\n");
    fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
    fwrite($file_loginput, "\n");
    fwrite($file_loginput, ' $_REQUEST=array_merge($_GET,$_POST);');
    fwrite($file_loginput, "\n");
    fwrite($file_loginput, "include '" . basename(__FILE__) . "';\n");
    fclose($file_loginput);
}
///////////////////////////////////////////////////////////////////////////
/* first detail for a card */
///////////////////////////////////////////////////////////////////////////
if (isset($_GET['f_id'])) {
    $exercice = new Exercice($cn);
    $old = '';
    $fiche = new Fiche($cn, $_GET['f_id']);
    $year = $g_user->get_exercice();
    if ($year == 0) {
        $html = _("erreur aucune période par défaut, allez dans préférence pour en choisir une");
    } else {
        $per = new Periode($cn);
        $limit_periode = $per->get_limit($year);
        $array['from_periode'] = $limit_periode[0]->first_day();
        $array['to_periode'] = $limit_periode[1]->last_day();
        if (isset($_GET['ex'])) {
            $limit_periode = $per->get_limit($_GET['ex']);
            if ($_GET['ex'] < $year) {
                $array['from_periode'] = $limit_periode[0]->first_day();
            } else {
                $array['to_periode'] = $limit_periode[1]->last_day();
            }
        }