Пример #1
0
function attachment($attachment)
{
    if (is_pdf($attachment)) {
        add_attachment($attachment);
    }
    return $attachment;
}
function alc_add_adminpanel()
{
    global $theme_name, $shortname, $options, $wpdb;
    $upload_tracking = array();
    $options_array = array();
    if (isset($_REQUEST['caction']) && $_REQUEST['caction'] == 'save') {
        foreach ($options as $value) {
            if (isset($value['id']) && isset($_REQUEST[$value['id']])) {
                if (!preg_match("/^[\\s]{1,1000}\$/D", $_REQUEST[$value['id']])) {
                    $options_array[$value['id']] = stripslashes($_REQUEST[$value['id']]);
                }
            }
            // Upload
            if ($value['type'] == 'upload') {
                $id = $value['id'];
                $override['test_form'] = false;
                $override['action'] = 'save';
                if (!empty($_FILES['attachment_' . $id]['name'])) {
                    $file = wp_handle_upload($_FILES['attachment_' . $id], $override);
                    $file['upload_name'] = $value['name'];
                    $upload_tracking[] = $file;
                    // Check if not error
                    if (!isset($file['error'])) {
                        // Update option
                        $options_array[$id] = $file['url'];
                        // Add attachment
                        add_attachment($file);
                    }
                } elseif (empty($_FILES['attachement_' . $id]['name']) && $_REQUEST[$id] != '') {
                    $options_array[$value['id']] = $_REQUEST[$value['id']];
                }
            }
            update_option('alc_tracking', $upload_tracking);
        }
        update_option('alc_general_settings', $options_array);
        redirect('adminpanel');
    }
    // Load admin menu
    require_once TEMPLATEPATH . '/library/admin/admin-panel/menu.php';
}
Пример #3
0
    save_single_examination($sample_id, 1008, $str);
}
if (!login_varify()) {
    exit;
}
main_menu();
read_sample_id();
if (isset($_POST['action'])) {
    if ($_POST['action'] == 'list_attachment') {
        list_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'edit_attachment') {
        edit_attachment($_POST['sample_id'], $_POST['attachment_id']);
    }
    if ($_POST['action'] == 'add_attachment') {
        add_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'save_attachment') {
        if (isset($_FILES)) {
            save_attachment($_POST, $_FILES);
        }
        list_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'insert_attachment') {
        if (isset($_FILES)) {
            insert_attachment($_POST, $_FILES);
        }
        update_cross_reference($_POST['sample_id']);
        list_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'delete_attachment') {
Пример #4
0
             if (!ereg("^[-A-Za-z0-9_\\.]+\$", trim($arr["name"]))) {
                 $IsError = "{$lInvalidFile} ({$arr['name']})";
             } elseif (!empty($ForumUploadTypes) && !strstr($ForumUploadTypes, strtolower(substr($arr["name"], strrpos($arr["name"], ".") + 1)))) {
                 $IsError = $lInvalidType . strtoupper(ereg_replace(";", " ", $ForumUploadTypes));
             } elseif ($min_size > 0 && $arr["size"] > $min_size) {
                 $IsError = $lInvalidSize1 . $arr["name"] . "<br>" . $lInvalidSize2 . (string) min($ForumUploadSize, $AttachmentSizeLimit) . "k";
             }
         }
     }
 }
 reset($attachments);
 // Attachment handling:
 if (!empty($attachments) && is_array($attachments) && empty($IsError)) {
     while (list($key, $attachment) = each($attachments)) {
         if ($attachment["name"]) {
             $IsError = add_attachment($attachment, $id);
         }
         if ($IsError) {
             break;
         }
     }
 }
 if (empty($IsError) && @is_array($attachments)) {
     // if it is not a new message and not float to top
     // send them to the message.
     initvar("more");
     if ($thread != $id && $ForumMultiLevel != 2) {
         $more = $thread + 1;
         $more = "&a=2&t={$more}";
     }
     Header("Location: {$forum_url}/{$list_page}.{$ext}?f={$num}{$more}{$GetVars}");
Пример #5
0
        //everything is ok return 0
        echo 0;
        //everyone involved should get an email
        $angebot = fetch_one_ride($angebot_id);
        $f_name = $angebot['name'];
        $f_tel = $angebot['tel'];
        $f_email = $angebot['email'];
        $von = $angebot['von'];
        $nach = $angebot['nach'];
        $datum = show_date($angebot['time']);
        $zeit = show_time($angebot['time']);
        $treffpunkt = $angebot['treffpunkt'];
        $dtstart = make_dtcomponent($angebot['time']);
        $dtend = make_dtcomponent($angebot['time'] + 30 * 60);
        //duration 30 minutes
        $ics = make_ics($dtstart, $dtend, $treffpunkt, $von, $nach);
        $mitfahrer_msg = make_mitfahrer_message($mf_name, $von, $nach, $datum, $zeit, $f_name, $f_tel, $f_email);
        $subject = "Mitfahrgelegenheit ({$von} -> {$nach}) am {$datum}, {$zeit}";
        $from = "*****@*****.**";
        $mitfahrer_email = make_email($mf_email, $from, $subject, $mitfahrer_msg);
        $mitfahrer_email = add_attachment($mitfahrer_email, $ics);
        send_mail($mitfahrer_email);
        $fahrer_msg = make_neuer_mitfahrer_message($f_name, $von, $nach, $datum, $zeit, $mf_name, $mf_tel, $mf_email);
        $fahrer_email = make_email($f_email, $from, $subject, $fahrer_msg);
        $fahrer_email = add_encoding($fahrer_email);
        send_mail($fahrer_email);
    }
} else {
    //no free seats, return 1
    echo 1;
}
Пример #6
0
        if ($Mode == 'UPDATE_ITEM') {
            $row = get_attachment($selected_id);
            if ($row['filename'] == "") {
                exit;
            }
            $unique_name = $row['unique_name'];
            if ($filename && file_exists($dir . "/" . $unique_name)) {
                unlink($dir . "/" . $unique_name);
            }
        } else {
            $unique_name = uniqid('');
        }
        //save the file
        move_uploaded_file($tmpname, $dir . "/" . $unique_name);
        if ($Mode == 'ADD_ITEM') {
            add_attachment($_POST['filterType'], $_POST['trans_no'], $_POST['description'], $filename, $unique_name, $filesize, $filetype);
            display_notification(_("Attachment has been inserted."));
        } else {
            update_attachment($selected_id, $_POST['filterType'], $_POST['trans_no'], $_POST['description'], $filename, $unique_name, $filesize, $filetype);
            display_notification(_("Attachment has been updated."));
        }
    }
    refresh_pager('trans_tbl');
    $Ajax->activate('_page_body');
    $Mode = 'RESET';
}
if ($Mode == 'Delete') {
    $row = get_attachment($selected_id);
    $dir = company_path() . "/attachments";
    if (file_exists($dir . "/" . $row['unique_name'])) {
        unlink($dir . "/" . $row['unique_name']);
Пример #7
0
include 'mf-core.php';
$name = $_POST['name'];
$anzahl = $_POST['anzahl'];
$von = $_POST['von'];
$nach = $_POST['nach'];
$treffpunkt = $_POST['treffpunkt'];
$fahrzeug = $_POST['fahrzeug'];
$preis = $_POST['preis'];
$tel = $_POST['tel'];
$email = $_POST['email'];
$timestamp = $_POST['timestamp'];
add_ride($name, $von, $nach, $treffpunkt, $anzahl, $fahrzeug, $preis, $tel, $email, $timestamp);
$angebot_id = find_ride($name, $timestamp);
echo $angebot_id == 0 ? '0' : '1';
$datum = show_date($timestamp);
$zeit = show_time($timestamp);
//send email to fahrer
//send ics with it
//recipient, subject, separator
$to = $email;
$subject = "Mitfahrgelegenheit ({$von} -> {$nach}) am {$datum}, {$zeit}";
$from = "*****@*****.**";
$fahrer_msg = make_fahrer_msg($name, $datum, $zeit, $von, $nach, $treffpunkt, $anzahl, $preis);
$fahrer_mail = make_email($to, $from, $subject, $fahrer_msg);
$dtstart = make_dtcomponent($timestamp);
$dtend = make_dtcomponent($timestamp + 30 * 60);
//duration 30 minutes
$ics = make_ics($dtstart, $dtend, $treffpunkt, $von, $nach);
$fahrer_mail = add_attachment($fahrer_mail, $ics);
send_mail($fahrer_mail);