Пример #1
0
if (strchr($_REQUEST['id'], '_')) {
    list($_REQUEST['id'], $revision_id) = explode('_', $_REQUEST['id']);
}
$datafile = new FileData($_REQUEST['id'], $pdo);
// verify
if ($datafile->getError() != null) {
    header('Location:error.php?ec=2');
    exit;
} else {
    // obtain data from resultset
    $owner_full_name = $datafile->getOwnerFullName();
    $owner = $owner_full_name[1] . ', ' . $owner_full_name[0];
    $real_name = $datafile->getRealName();
    $category = $datafile->getCategoryName();
    $created = $datafile->getCreatedDate();
    $description = $datafile->getDescription();
    $comments = $datafile->getComment();
    $status = $datafile->getStatus();
    $id = $_REQUEST['id'];
    // corrections
    if ($description == '') {
        $description = msg('message_no_description_available');
    }
    if ($comments == '') {
        $comments = msg('message_no_author_comments_available');
    }
    if ($datafile->isArchived()) {
        $filename = $GLOBALS['CONFIG']['archiveDir'] . e::h($id) . '.dat';
    } else {
        $filename = $GLOBALS['CONFIG']['dataDir'] . e::h($id) . '.dat';
    }
Пример #2
0
 $department_stmt->execute();
 $result = $department_stmt->fetchAll();
 if ($department_stmt->rowCount() != 1) {
     header('Location:error.php?ec=14');
     exit;
     //non-unique error
 }
 $filedata = new FileData($data_id, $pdo);
 // error check
 if (!$filedata->exists()) {
     header('Location:error.php?ec=2');
     exit;
 } else {
     $category = $filedata->getCategory();
     $realname = $filedata->getName();
     $description = $filedata->getDescription();
     $comment = $filedata->getComment();
     $owner_id = $filedata->getOwner();
     $department = $filedata->getDepartment();
     //CHM
     $table_name_query = "SELECT table_name FROM {$GLOBALS['CONFIG']['db_prefix']}udf WHERE field_type = '4'";
     $table_name_stmt = $pdo->prepare($table_name_query);
     $table_name_stmt->execute();
     $result = $table_name_stmt->fetchAll();
     $num_rows = $table_name_stmt->rowCount();
     $t_name = array();
     $i = 0;
     foreach ($result as $data) {
         $explode_v = explode('_', $data['table_name']);
         $t_name = $explode_v[2];
         $i++;