Example #1
0
     echo $return;
     $action = "";
     return;
 }
 //--------------------------------------------------------------------------------
 // Show access for journal
 //--------------------------------------------------------------------------------
 $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>';
Example #2
0
if (isset($_REQUEST['gDossier']) && $_REQUEST['gDossier'] != 0) {
    $g_user->load_global_pref();
    $msg = "";
    $cn = new Database($_REQUEST['gDossier']);
    $g_user->cn = $cn;
    $inside_dossier = true;
    $local_pref = $g_user->get_preference();
}
//////////////////////////////////////////////////////////////////////////
// Theme
//////////////////////////////////////////////////////////////////////////
$repo = new Database();
// charge tous les styles
$res = $repo->exec_sql("select the_name from theme\n                    order by the_name");
$style = new ISelect('style_user');
$style->value = $repo->make_array("select the_name,the_name\n\tfrom theme\n\torder by the_name");
$style->selected = $_SESSION['g_theme'];
?>

<div class="content" >

    <FORM  METHOD="POST">
	<fieldset style="margin: 1%"><legend><?php 
echo _('Options Générales');
?>
</legend>
	    <table>
                <tr>
                    <td>
                        <?php 
echo _('Email');
Example #3
0
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_fiche.php';
require_once NOALYSS_INCLUDE . '/class_lettering.php';
$gDossier = dossier::id();
$cn = new Database($gDossier);
global $g_user, $g_failed;
/**
 * Show first the form
 */
/* category */
$categorie = new ISelect('cat');
$categorie->value = $cn->make_array('select fd_id,fd_label from fiche_def order by fd_label');
$categorie->selected = isset($_GET['cat']) ? $_GET['cat'] : 0;
$str_categorie = $categorie->input();
$icall = new ICheckBox("allcard", 1);
$icall->selected = isset($_GET['allcard']) ? 1 : 0;
$str_icall = $icall->input();
/* periode */
$exercice = $g_user->get_exercice();
$iperiode = new Periode($cn);
list($first, $last) = $iperiode->get_limit($exercice);
$periode_start = new IDate('start');
$periode_end = new IDate('end');
$periode_start->value = isset($_GET['start']) ? $_GET['start'] : $first->first_day();
$periode_end->value = isset($_GET['end']) ? $_GET['end'] : $last->last_day();
$str_start = $periode_start->input();
$str_end = $periode_end->input();
Example #4
0
devrait avoir une meilleure gestion des erreurs, vérifier les attaques SQL Inject,...
Ce code n'est là QUE pour expliquer le concept
*/
// se connecter au dossier courant
$cn = new Database(dossier::id());
// dans extension.php on vérifie la sécurité, en ajoutez une ici n'est en général
// pas nécessaire
// Ce form permet de choisir dans quel cat de fiche je veux intégrer les
// enregistrements.
echo '<form METHOD="get" action="extension.php">';
echo dossier::hidden();
// Ceci vous permet de revenir ici (voir extension.php)
echo HtmlInput::extension();
echo "Choix de la catégorie de fiche";
$select_cat = new ISelect('fd_id');
$select_cat->value = $cn->make_array('select fd_id,fd_label from fiche_def where frd_id=' . FICHE_TYPE_CLIENT);
echo $select_cat->input();
echo HtmlInput::submit('display_prop', 'Afficher les propriétés');
echo '</FORM>';
// on choisit d'afficher les propriétés avant de confirmer l'import
// get parce qu'on interroge
if (isset($_GET['display_prop'])) {
    $a = new Fiche($cn);
    $prop = $a->to_array($_GET['fd_id']);
    foreach ($prop as $key => $value) {
        echo "Index : {$key} valeur {$value} <br/>";
    }
    echo '<form method="POST" action="extension.php"  enctype="multipart/form-data">';
    echo dossier::hidden();
    echo HtmlInput::extension();
    echo HtmlInput::hidden('fd_id', $_GET['fd_id']);
Example #5
0
 /**
  * @brief zoom the calendar
  */
 function zoom_calendar($notitle)
 {
     global $g_user;
     $exercice_user = $g_user->get_exercice();
     /* day */
     $cell = array();
     for ($i = 0; $i < 42; $i++) {
         $cell[$i] = "";
     }
     $this->set_month_year();
     /* weekday */
     $week = array(_('Dimanche'), _('Lundi'), _('Mardi'), _('Mercredi'), _('Jeudi'), _('Vendredi'), _('Samedi'));
     $this->fill_from_action($cell, "long");
     $this->fill_from_todo($cell, "long");
     $wMonth = new ISelect('per_div');
     $cn = new Database(dossier::id());
     $wMonth->value = $cn->make_array("select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = '{$exercice_user}' order by p_start");
     $wMonth->selected = $this->default_periode;
     $wMonth->javascript = sprintf("onchange=calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s',notitle:%d})", dossier::id(), 'per_div', 'calendar_zoom_div', 'cal', $notitle);
     $wMonth->set_attribute('gDossier', dossier::id());
     $month_year = $wMonth->input() . $wMonth->get_js_attr();
     ob_start();
     $zoom = 1;
     $notitle = HtmlInput::default_value_get('notitle', 0);
     require_once NOALYSS_INCLUDE . '/template/calendar.php';
     if (count($this->action_div) > 0) {
         foreach ($this->action_div as $day) {
             echo $day;
         }
     }
     $ret = ob_get_contents();
     ob_end_clean();
     return $ret;
 }
Example #6
0
    $per->set_jrn($jrn_def_id);
    $per->set_periode($_GET['p_per']);
    $per->reopen();
    $choose = "yes";
}
if ($choose == "yes") {
    echo '<p>';
    echo HtmlInput::button_anchor('Autre Journal ?', '?choose=no&ac=' . $_REQUEST['ac'] . '&gDossier=' . dossier::id());
    echo '</p>';
    $per = new Periode($cn);
    $jrn = isset($_GET['jrn_def_id']) ? $_GET['jrn_def_id'] : 0;
    $per->set_jrn($jrn);
    $per->display_form_periode();
    $nb_exercice = new ISelect("nb_exercice");
    $nb_exercice->value = array(array('value' => 12, 'label' => "12 périodes"), array('value' => 13, 'label' => "13 périodes"));
    require_once NOALYSS_INCLUDE . '/template/periode_add_exercice.php';
} else {
    echo '<form method="GET" >';
    echo dossier::hidden();
    $sel_jrn = $cn->make_array("select jrn_def_id, jrn_def_name from " . " jrn_def order by jrn_def_name");
    $sel_jrn[] = array('value' => 0, 'label' => 'Global : periode pour tous les journaux');
    $wSel = new ISelect();
    $wSel->value = $sel_jrn;
    $wSel->name = 'jrn_def_id';
    echo "Choisissez global ou uniquement le journal à fermer" . $wSel->input();
    echo HtmlInput::submit('choose', 'Valider');
    echo HtmlInput::hidden('ac', $_REQUEST['ac']);
    echo "</form>";
    echo '<p class="info"> Pour ajouter, effacer ou modifier une p&eacute;riode, il faut choisir global</p>';
}
echo '</div>';
Example #7
0
    echo '</div>';
    echo '</div>';
    return;
}
/* --------------------------------------------------
 * Step 2 choose now the exercice of this folder
 */
$back = 'do.php?ac=' . $_REQUEST['ac'] . '&' . dossier::get();
if ($sa == 'step2') {
    echo '<div class="content">' . '<div><h1 class="legend">Etape 2</h1>' . '<h2 class="info">' . dossier::name($_REQUEST['f']) . '</h2>' . '<form class="print" method="post">' . ' Choisissez l\'exercice du dossier ';
    echo dossier::hidden();
    echo HtmlInput::hidden('ac', $_REQUEST['ac']);
    echo HtmlInput::hidden('sa', 'step3');
    echo HtmlInput::hidden('f', $_REQUEST['f']);
    $cn = new Database($_REQUEST['f']);
    $periode = $cn->make_array("select distinct p_exercice,p_exercice from parm_periode order by p_exercice");
    $w = new ISelect();
    $w->table = 0;
    $w->label = 'Periode';
    $w->readonly = false;
    $w->value = $periode;
    $w->name = "p_periode";
    echo 'P&eacute;riode : ' . $w->input();
    echo HtmlInput::submit('ok', 'Continuer');
    echo dossier::hidden();
    echo "</form>";
    echo HtmlInput::button_anchor('Retour', $back);
    exit(0);
}
/* --------------------------------------------------
 * select the ledger where we will import the data
Example #8
0
 static function test_me()
 {
     $cn = new Database(dossier::id());
     $a = new Fiche($cn);
     $select_cat = new ISelect('fd_id');
     $select_cat->value = $cn->make_array('select fd_id,fd_label from fiche_def where frd_id=' . FICHE_TYPE_CLIENT);
     echo '<FORM METHOD="GET"> ';
     echo dossier::hidden();
     echo HtmlInput::hidden('test_select', $_GET['test_select']);
     echo 'Choix de la catégorie';
     echo $select_cat->input();
     echo HtmlInput::submit('go_card', 'Afficher');
     echo '</form>';
     if (isset($_GET['go_card'])) {
         $empty = $a->to_array($_GET['fd_id']);
         print_r($empty);
     }
 }