本文整理汇总了PHP中FileData::setDepartment方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::setDepartment方法的具体用法?PHP FileData::setDepartment怎么用?PHP FileData::setDepartment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileData
的用法示例。
在下文中一共展示了FileData::setDepartment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
}
// Check to make sure the file is available
$status = $filedata->getStatus($fileId);
if ($status != 0) {
header('Location:error.php?ec=2');
exit;
}
// update category
$filedata->setCategory($_REQUEST['category']);
$filedata->setDescription($_REQUEST['description']);
$filedata->setComment($_REQUEST['comment']);
if (isset($_REQUEST['file_owner'])) {
$filedata->setOwner($_REQUEST['file_owner']);
}
if (isset($_REQUEST['file_department'])) {
$filedata->setDepartment($_REQUEST['file_department']);
}
// Update the file with the new values
$filedata->updateData();
udf_edit_file_update();
// clean out old permissions
$del_user_perms_query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}user_perms WHERE fid = :file_id";
$del_user_perms_stmt = $pdo->prepare($del_user_perms_query);
$del_user_perms_stmt->bindParam(':file_id', $fileId);
$del_user_perms_stmt->execute();
// clean out old permissions
$del_dept_perms_query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}dept_perms WHERE fid = :file_id";
$del_dept_perms_stmt = $pdo->prepare($del_dept_perms_query);
$del_dept_perms_stmt->bindParam(':file_id', $fileId);
$del_dept_perms_stmt->execute();
$result_array = array();
示例2: header
}
// Check to make sure the file is available
$status = $filedata->getStatus($fileId);
if ($status != 0) {
header('Location:error.php?ec=2');
exit;
}
// update category
$filedata->setCategory(mysql_real_escape_string($_REQUEST['category']));
$filedata->setDescription(mysql_real_escape_string($_REQUEST['description']));
$filedata->setComment(mysql_real_escape_string($_REQUEST['comment']));
if (isset($_REQUEST['file_owner'])) {
$filedata->setOwner(mysql_real_escape_string($_REQUEST['file_owner']));
}
if (isset($_REQUEST['file_department'])) {
$filedata->setDepartment(mysql_real_escape_string($_REQUEST['file_department']));
}
// Update the file with the new values
$filedata->updateData();
udf_edit_file_update();
// clean out old permissions
$query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}user_perms WHERE fid = '{$fileId}'";
$result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
$result_array = array();
// init;
foreach ($_REQUEST['user_permission'] as $user_id => $permission) {
$query = "INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}user_perms (fid, uid, rights) VALUES({$fileId}, {$user_id}, {$permission})";
//echo $query."<br>";
$result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}" . mysql_error());
}
//UPDATE Department Rights into dept_perms