Ejemplo n.º 1
0
    if ($error) {
        setEventMessage($langs->trans('ErrorAddEventToUserCP'), 'errors');
    } else {
        $nb_holiday = $holiday->getCPforUser($userCP);
        $add_holiday = $holiday->getValueEventCp($event);
        $new_holiday = $nb_holiday + $add_holiday;
        // On ajoute la modification dans le LOG
        $holiday->addLogCP($user->id, $userCP, $holiday->getNameEventCp($event), $new_holiday);
        $holiday->updateSoldeCP($userCP, $new_holiday);
        setEventMessage($langs->trans('AddEventToUserOkCP'));
    }
}
$langs->load('users');
$var = true;
$i = 0;
$cp_events = $holiday->fetchEventsCP();
if ($cp_events == 1) {
    print '<br><form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
    print '<input type="hidden" name="action" value="add_event" />';
    print_fiche_titre($langs->trans('DefineEventUserCP'), '', '');
    print $langs->trans('MotifCP') . ' : ';
    print $holiday->selectEventCP();
    print ' &nbsp; ' . $langs->trans('UserCP') . ' : ';
    print $form->select_dolusers('', "userCP", 1, "", 0, '');
    print ' <input type="submit" value="' . $langs->trans("addEventToUserCP") . '" name="bouton" class="button"/>';
    print '</form><br>';
}
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
print '<input type="hidden" name="action" value="update" />';
print '<table class="noborder" width="100%;">';
print "<tr class=\"liste_titre\">";
Ejemplo n.º 2
0
/*$var=!$var;
print $langs->trans('nbUserCP').': '."\n";
print $cp->getConfCP('nbUser')."<br>\n";
*/
$var = !$var;
print $langs->trans('LastUpdateCP') . ': ' . "\n";
if ($cp->getConfCP('lastUpdate')) {
    print dol_print_date($db->jdate($cp->getConfCP('lastUpdate')), 'dayhour', 'tzuser');
} else {
    print $langs->trans('None');
}
print "<br>\n";
print '<br>';
print_fiche_titre($langs->trans('TitleOptionEventCP'), '', '');
dol_fiche_head(array(), '', '');
$cp_events = $cp->fetchEventsCP();
if ($cp_events == 1) {
    $var = false;
    $i = 0;
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?leftmenu=setup" name="event_update">' . "\n";
    print '<input type="hidden" name="action" value="event" />' . "\n";
    print '<table class="noborder" width="100%">' . "\n";
    print '<tbody>' . "\n";
    print '<tr class="liste_titre">' . "\n";
    print '<td class="liste_titre" width="40%">' . $langs->trans('NameEventCP') . '</td>' . "\n";
    print '<td class="liste_titre" width="20%">' . $langs->trans('ValueOptionCP') . '</td>' . "\n";
    print '<td class="liste_titre">&nbsp;</td>' . "\n";
    print '<td class="liste_titre">&nbsp;</td>' . "\n";
    print '</tr>' . "\n";
    foreach ($cp->events as $infos_event) {
        $var = !$var;