當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileData::setDepartment方法代碼示例

本文整理匯總了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();
開發者ID:watsonad,項目名稱:opendocman,代碼行數:31,代碼來源:edit.php

示例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
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:31,代碼來源:edit.php


注:本文中的FileData::setDepartment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。