Пример #1
0
 $current_user_dept = $user_perms_obj->user_obj->getDeptId();
 $data_id = $_REQUEST['id'];
 // includes
 $department_query = "SELECT department FROM {$GLOBALS['CONFIG']['db_prefix']}user WHERE id=:user_id";
 $department_stmt = $pdo->prepare($department_query);
 $department_stmt->bindParam(':user_id', $_SESSION['uid']);
 $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();