コード例 #1
0
$endyear = $HTTP_POST_VARS["endyear"];
$endmonth = $HTTP_POST_VARS["endmonth"];
$endday = $HTTP_POST_VARS["endday"];
$modyear = $HTTP_POST_VARS["modyear"];
$modmonth = $HTTP_POST_VARS["modmonth"];
$modday = $HTTP_POST_VARS["modday"];
mt_srand((double) microtime() * 1000000);
if (empty($id)) {
    $id = "all";
}
if ($format == "ical") {
    transmit_header('text/ical', "webcalendar-{$id}.ics");
    export_ical($id);
} elseif ($format == "vcal") {
    transmit_header('text/vcal', "webcalendar-{$id}.vcs");
    export_vcal($id);
} elseif ($format == "pilot-csv") {
    transmit_header('text/csv', "webcalendar-{$id}.csv");
    export_pilot_csv($id);
} elseif ($format == "pilot-text") {
    transmit_header('text/plain', "webcalendar-{$id}.txt");
    export_install_datebook($id);
} else {
    //exit;
    print_header();
    echo "<h2>";
    etranslate("Export");
    echo " ";
    etranslate("Error");
    echo "</h2>\n";
    echo "<span style=\"font-weight:bold;\">";
コード例 #2
0
// recup des parametres reçus :
// SERVER
$PHP_SELF = $_SERVER['PHP_SELF'];
// GET	/ POST
$action = getpost_variable('action');
$user_login = getpost_variable('user_login');
$date_debut = getpost_variable('date_debut');
$date_fin = getpost_variable('date_fin');
$choix_format = getpost_variable('choix_format');
/*************************************/
//connexion mysql
if ($action == "export") {
    if ($choix_format == "ical") {
        export_ical($user_login, $date_debut, $date_fin, $DEBUG);
    } else {
        export_vcal($user_login, $date_debut, $date_fin, $DEBUG);
    }
    $comment_log = "export ical/vcal ({$date_debut} -> {$date_fin}) ";
    log_action(0, "", $user_login, $comment_log, $DEBUG);
} else {
    form_saisie($user_login, $date_debut, $date_fin, $DEBUG);
}
/*******************************************************************************/
/**********  FONCTIONS  ********************************************************/
function form_saisie($user, $date_debut, $date_fin, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    $date_today = date("d-m-Y");
    if ($date_debut == "") {
        $date_debut = $date_today;