Exemple #1
0
        $vals['force_time'] = Times::dateConvert($_POST['data']['force_time']);
    }
    $allowed_ext = array(".zip", ".rar", ".pdf", ".doc", ".xls", ".txt", ".ppt");
    $attachment->allowed_file_ext = am($attachment->allowed_file_ext, $allowed_ext);
    $attachment->rename_file = "standard-" . md5($time_stamp);
    $attachment->description = trim($vals['title']);
    if (!empty($id)) {
        $attachment->rename_file = "standard-" . md5($id);
    }
    if (!empty($_FILES['attach']['name'])) {
        $attachment->upload_process();
        $vals['attachment_id'] = $attachment->id;
    }
    if (!empty($id)) {
        $vals['modified'] = $time_stamp;
        $result = $standard->save($vals, "update", $id);
    } else {
        $vals['created'] = $vals['modified'] = $time_stamp;
        $result = $standard->save($vals);
    }
    if (!$result) {
        flash();
    }
}
if (isset($_REQUEST['del']) && !empty($_REQUEST['id'])) {
    $deleted = false;
    $deleted = $standard->del($_REQUEST['id']);
}
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    if ($do == "save_standardtype") {