• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP FileData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中FileData的典型用法代码示例。如果您正苦于以下问题:PHP FileData类的具体用法?PHP FileData怎么用?PHP FileData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FileData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Set base meta data and read the comment lines from the file head
  *
  * Usage example:
  * <code>
  * <?php
  * $file = '/phpdoc/en/reference/array/functions/next.xml';
  * $FDEn = new FileData($file, false);
  * $file = '/phpdoc/de/reference/array/functions/next.xml';
  * $FDTrans = new FileData($file, true);
  * ?>
  * </code>
  *
  * @param  string $file     File name to inspect
  * @param  bool   $isTrans  Define if the specified file is a translation
  * @return void
  */
 public function __construct($file, $isTrans)
 {
     self::$tags = implode('|', array('EN-Revision', 'Revision', 'Maintainer', 'Status', 'Credits', 'Rev-Revision', 'Reviewer'));
     $this->isTranslation = (bool) $isTrans;
     $this->data = array();
     $handle = fopen($file, 'r');
     for ($i = 0; $i <= 9 || feof($handle); ++$i) {
         $rawFile = trim(fgets($handle));
         switch (substr($rawFile, 0, 4)) {
             case '<!--':
                 $this->setMetaData($rawFile);
                 break;
             case '<?xm':
                 break;
             default:
                 $i = 9;
                 break;
         }
     }
     fclose($handle);
     $this->data['size'] = round(filesize($file) / 1024, 0);
     $this->data['mtime'] = filemtime($file);
     clearstatcache();
     return;
 }
开发者ID:marczych,项目名称:hack-hhvm-docs,代码行数:42,代码来源:FileData.class.php


示例2: serve

 protected function serve($file_info)
 {
     $cache = new sfFileCache(array('cache_dir' => sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . 'cache'));
     if ($file_info->getIsCached() && $cache->has($file_info->getId(), 'uploaded_files')) {
         $file_data = new FileData();
         $file_data->setBinaryData($cache->get($file_info->getId(), 'uploaded_files'));
     } else {
         $file_data = $file_info->getFileData();
         $cache->set($file_info->getId(), 'uploaded_files', fread($file_data->getBinaryData(), $file_info->getSize()));
         $file_info->setIsCached(true);
         $file_info->save();
     }
     sfConfig::set('sf_web_debug', false);
     //              $this->getResponse()->addHttpMeta('content-type', $file_info->getMime());
     //              $this->getResponse()->addHttpMeta('content-length', $file_info->getSize());
     return $file_data;
 }
开发者ID:jmather,项目名称:majaxDoctrineMediaPlugin,代码行数:17,代码来源:actions.class.php


示例3: filesize

 public static function filesize($id)
 {
     $file = ORM::factory('Storage', $id);
     if (!$file->loaded()) {
         return '';
     }
     $size = filesize($file->file_path);
     return FileData::size($size);
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:9,代码来源:FileData.php


示例4: header

<?php

$file = FileData::getByCode($_GET["code"]);
$url = "storage/data/" . $file->user_id . "/";
$filename = $file->filename;
if (!$file->is_folder) {
    $fullurl = $url . $filename;
    header("Content-Disposition: attachment; filename='{$filename}'");
    readfile($fullurl);
    // or echo file_get_contents($filename);
}
开发者ID:proyectoseb,项目名称:inventarios,代码行数:11,代码来源:action-default.php


示例5: paste_from_file

/**
 * Paste_from_file
 * Parses a named uploaded file of html or txt type
 * The function identifies title, head and body for html files,
 * or body for text files.
 * 
 * @return FileData object
 */
function paste_from_file()
{
    $fileData = new FileData();
    if ($_FILES['uploadedfile_paste']['name'] == '') {
        $fileData->setErrorMsg(_AT('TR_ERROR_FILE_NOT_SELECTED'));
    } elseif ($_FILES['uploadedfile_paste']['type'] == 'text/plain' || $_FILES['uploadedfile_paste']['type'] == 'text/html') {
        $path_parts = pathinfo($_FILES['uploadedfile_paste']['name']);
        $ext = strtolower($path_parts['extension']);
        if (in_array($ext, array('html', 'htm'))) {
            $contents = file_get_contents($_FILES['uploadedfile_paste']['tmp_name']);
            /* get the <title></title> of this page             */
            $start_pos = strpos(strtolower($contents), '<title>');
            $end_pos = strpos(strtolower($contents), '</title>');
            if ($start_pos !== false && $end_pos !== false) {
                $start_pos += strlen('<title>');
                $fileData->setTitle(trim(substr($contents, $start_pos, $end_pos - $start_pos)));
            }
            unset($start_pos);
            unset($end_pos);
            $fileData->setHead(trim(get_html_head_by_tag($contents, array("link", "style", "script"))));
            $fileData->setBody(trim(get_html_body($contents)));
        } else {
            if ($ext == 'txt') {
                $fileData->setBody(trim(file_get_contents($_FILES['uploadedfile_paste']['tmp_name'])));
            }
        }
    } else {
        $fileData->setErrorMsg(_AT('TR_ERROR_BAD_FILE_TYPE'));
    }
    return $fileData;
}
开发者ID:harriswong,项目名称:AContent,代码行数:39,代码来源:pastefromfile.php


示例6: intval

<?php

include '../../includes/inc.main.php';
if ($_GET['action'] == 'newimage') {
    if (count($_FILES['image']) > 0) {
        $TempDir = $Admin->ImgGalDir();
        $Name = "user" . intval(rand() * rand() / rand()) . "__" . $Admin->AdminID;
        $Img = new FileData($_FILES['image'], $TempDir, $Name);
        echo $Img->BuildImage(200, 200);
        die;
    }
}
switch (strtolower($_POST['action'])) {
    //////////////////////////////////////////// NEW TEST USER ///////////////////////////////////////////////////////////////
    case 'generate':
        $curl = curl_init();
        curl_setopt_array($curl, array(CURLOPT_URL => "https://api.mercadolibre.com/users/test_user?access_token=" . $_SESSION['access_token'], CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\n    \"site_id\":\"MLA\"\n}", CURLOPT_HTTPHEADER => array("cache-control: no-cache", "conten: application/json", "content-type: application/json")));
        $response = curl_exec($curl);
        $err = curl_error($curl);
        curl_close($curl);
        if ($err) {
            echo "cURL Error #:" . $err;
        } else {
            echo $response;
            //$Data = json_decode($response,true);
            //$DB->execQuery('INSERT','test_user','id,nickname,password,site_status,email,creation_date',$Data['id']",'".$Data['nickname']."','".$Data['password']."','".$Data['site_status']."','".$Data['email']."',NOW()");
        }
        die;
        break;
        //////////////////////////////////////////// EDIT ///////////////////////////////////////////////////////////////
    //////////////////////////////////////////// EDIT ///////////////////////////////////////////////////////////////
开发者ID:javzero,项目名称:admin,代码行数:31,代码来源:process.php


示例7: session_start

session_start();
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
    header('Location:error.php?ec=2');
    exit;
}
draw_header(msg('area_view_history'), $last_message);
//revision parsing
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'];
开发者ID:msusoko,项目名称:opendocman,代码行数:31,代码来源:history.php


示例8: dirname

require_once dirname(__FILE__) . "/../../PaygateApiClient.class.php";
require_once dirname(__FILE__) . "/../config.php";
$client = new PaygateApiClient(INVIPAY_API_URL, INVIPAY_API_KEY, INVIPAY_SIGNATURE_KEY);
$repository = dirname(__FILE__) . "/repository/";
$payments = scandir($repository);
Logger::info('Scanning payments repository');
foreach ($payments as $paymentFile) {
    if ($paymentFile != '.' && $paymentFile != '..') {
        Logger::info('Found payment data {0}', $paymentFile);
        $paymentData = unserialize(file_get_contents($repository . $paymentFile));
        $paymentId = $paymentData->getPaymentId();
        Logger::info('Payment {0} has status {1}', $paymentId, $paymentData->getStatus());
        if ($paymentData->getStatus() == PaymentRequestStatus::COMPLETED) {
            Logger::info('Finalizing payment {0}', $paymentId);
            $request = new PaymentManagementData();
            $request->setPaymentId($paymentId);
            $request->setDoConfirmDelivery(true);
            $conversionData = new OrderToInvoiceData();
            $conversionData->setInvoiceDocumentNumber("TestInvoice/1/2/3/" . uniqid());
            $conversionData->setIssueDate(date('Y-m-d', time()));
            $conversionData->setDueDate(date('Y-m-d', time() + 14 * 24 * 60 * 60));
            $request->setConversionData($conversionData);
            $document = new FileData();
            $document->setFromFile(dirname(__FILE__) . '/../test.pdf');
            $request->setDocument($document);
            $result = $client->managePayment($request);
            Logger::info('Result is: {0}', $result);
        }
    }
}
开发者ID:invipay,项目名称:invipay-php-api,代码行数:30,代码来源:Manage.example.php


示例9: FileData


<?php 
$data = new FileData();
if (isset($_GET['idsp'])) {
    $idsp = $_GET['idsp'];
    //id спецификации
    echo '<h3><p align="center">Спецификация</p></h3>';
    include 'interf/view_specif.php';
} else {
    echo '<h3><p align="center">Таблица метериалы и услуги</p></h3>';
    if ($curent_user->QwestPriwilege('VEIW_OLL_TABLE_MATERIAL')) {
        $data->ViweMaterialTable($data->GetArrayOrganizationIDfinsek(), $curent_user->GetUsersIdViewname());
    }
    if ($curent_user->QwestPriwilege('VIEW_MY_TABLE_MATERIAL')) {
        $data->ViweMaterialTableFoUsers($data->GetArrayOrganizationIDfinsek(), $curent_user->GetOrganizationID());
    }
}
开发者ID:antbut,项目名称:my_site_php,代码行数:17,代码来源:material_table3.tmp.php


示例10: msg

    $mail_subject = msg('email_subject_review_status');
    $mail_greeting = msg('email_greeting') . ":\n\r\t" . msg('email_i_would_like_to_inform');
    $mail_body = msg('email_was_declined_for_publishing_at') . ' ' . $time . ' on ' . $date . ' ' . msg('email_because_you_did_not_revise') . ' ' . $GLOBALS['CONFIG']['revision_expiration'] . ' ' . msg('days');
    $mail_salute = "\n\r\n\r" . msg('email_salute') . ",\n\r{$full_name}";
    foreach ($data_result as $row) {
        $file_obj = new FileData($row['id'], $pdo);
        $user_obj = new User($file_obj->getOwner(), $pdo);
        $mail_to = $user_obj->getEmailAddress();
        if ($GLOBALS['CONFIG']['demo'] == 'False') {
            mail($mail_to, $mail_subject . $file_obj->getName(), $mail_greeting . $file_obj->getName() . ' ' . $mail_body . $mail_salute, $mail_headers);
        }
    }
}
//do not show file
if ($GLOBALS['CONFIG']['file_expired_action'] == 1) {
    $reviewer_comments = 'To=' . msg('author') . ';Subject=' . msg('message_file_expired') . ';Comments=' . msg('email_file_was_rejected_because') . ' ' . $GLOBALS['CONFIG']['revision_expiration'] . ' ' . msg('days');
    foreach ($data_result as $row) {
        $file_obj = new FileData($row['id'], $pdo);
        $file_obj->Publishable(-1);
        $file_obj->setReviewerComments($reviewer_comments);
    }
}
//lock file, not check-outable
if ($GLOBALS['CONFIG']['file_expired_action'] == 2) {
    foreach ($data_result as $row) {
        $file_obj = new FileData($row['id'], $pdo);
        $file_obj->setStatus(-1);
    }
}
echo msg('message_all_actions_successfull');
draw_footer();
开发者ID:scdogan,项目名称:opendocman,代码行数:31,代码来源:check_exp.php


示例11: trim

<?php

require_once "Math.php";
require_once "File.php";
$job = !isset($_REQUEST["job"]) ? '' : trim($_REQUEST["job"]);
$evenNumbers = array();
$oddNumbers = array();
$fiboNumbers = array();
$file = array();
if ($job == "uploadFile") {
    $file = new FileData($_FILES["aNumbers"]);
    //assign data from file to $file object
    //get even, odd and fibonacci numbers from file and store in respective arrays
    $evenNumbers = $file->GetEvenNumbers();
    $oddNumbers = $file->GetOddNumbers();
    $fiboNumbers = $file->GetFibonacciNumbers();
    if (!isset($_SESSION['file'])) {
        $_SESSION['file'] = $file;
    }
}
$job = !isset($_GET["job"]) ? '' : trim($_GET["job"]);
if ($job == "exportnumbers") {
    //If a valid file was submitted with the submit button, then its details are saved in a session
    if (isset($_SESSION['file'])) {
        $file = $_SESSION['file'];
        $file->ExportNumbers($_SESSION["filename"] . ".csv");
        //call ExportNumbers function using the filename stored in a session and adding .csv as an extension
    }
}
if ($job == "reset") {
    session_destroy();
开发者ID:BryanRam,项目名称:PHPStuff,代码行数:31,代码来源:fibonacci.php


示例12: strlen

<?php

//print_r($_SESSION);
if (!empty($_POST) && isset($_SESSION["user_id"])) {
    $alphabeth = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ1234567890_-";
    $code = "";
    for ($i = 0; $i < 12; $i++) {
        $code .= $alphabeth[rand(0, strlen($alphabeth) - 1)];
    }
    $f = new FileData();
    $f->code = $code;
    $f->is_public = isset($_POST["is_public"]) ? 1 : 0;
    $f->folder_id = $_POST["folder_id"] != "" ? $_POST["folder_id"] : "NULL";
    $f->user_id = $_SESSION["user_id"];
    $f->description = $_POST["description"];
    $handle = new Upload($_FILES['filename']);
    if ($handle->uploaded) {
        $url = "storage/data/" . $_SESSION["user_id"];
        $handle->Process($url);
        if ($handle->processed) {
            $f->filename = $handle->file_dst_name;
            $f->add();
            Core::alert("Agregado exitosamente!");
            Core::redir("./?view=home");
        }
    }
}
开发者ID:proyectoseb,项目名称:inventarios,代码行数:27,代码来源:action-default.php


示例13: getAuthority

 function getAuthority($data_id)
 {
     $data_id = (int) $data_id;
     $fileData = new FileData($data_id, $GLOBALS['connection'], DB_NAME);
     if ($this->user_obj->isAdmin() || $this->user_obj->isReviewerForFile($data_id)) {
         return $this->ADMIN_RIGHT;
     }
     if ($fileData->isOwner($this->uid) && $fileData->isLocked()) {
         return $this->WRITE_RIGHT;
     }
     $uperm = $this->userperm_obj->getPermission($data_id);
     $dperm = $this->deptperm_obj->getPermission($data_id);
     if ($uperm >= $this->userperm_obj->NONE_RIGHT and $uperm <= $this->userperm_obj->ADMIN_RIGHT) {
         return $uperm;
     } else {
         return $dperm;
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:18,代码来源:UserPermission_class.php


示例14: display_smarty_template

        $GLOBALS['smarty']->assign('lmode', '');
        display_smarty_template('deleteview.tpl');
    }
} elseif (isset($_POST['submit']) && $_POST['submit'] == 'Delete file(s)') {
    isset($_REQUEST['checkbox']) ? $_REQUEST['checkbox'] : '';
    foreach ($_REQUEST['checkbox'] as $value) {
        if (!pmt_delete($value)) {
            header('Location: error.php?ec=21');
            exit;
        }
    }
    header('Location:' . urlencode($redirect) . '?last_message=' . urlencode(msg('undeletepage_file_permanently_deleted')));
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'Undelete') {
    if (isset($_REQUEST['checkbox'])) {
        foreach ($_REQUEST['checkbox'] as $fileId) {
            $file_obj = new FileData($fileId, $pdo);
            $file_obj->undelete();
            fmove($GLOBALS['CONFIG']['archiveDir'] . $fileId . '.dat', $GLOBALS['CONFIG']['dataDir'] . $fileId . '.dat');
        }
    }
    header('Location:' . urlencode($redirect) . '?last_message=' . urlencode(msg('undeletepage_file_undeleted')));
}
draw_footer();
/*
 * Permanently Delete A File
 * @param integer $id The file ID to be deleted permanently
 */
function pmt_delete($id)
{
    global $pdo;
    $userperm_obj = new User_Perms($_SESSION['uid'], $pdo);
开发者ID:watsonad,项目名称:opendocman,代码行数:31,代码来源:delete.php


示例15: confirmDeliveryAndSendInvoice

 public function confirmDeliveryAndSendInvoice($order)
 {
     $invoices = array();
     $invoiceNumbers = array();
     if ($order->hasInvoices()) {
         foreach ($order->getInvoiceCollection() as $invoiceItem) {
             $invoices[] = $invoiceItem;
             $invoiceNumbers[] = $invoiceItem->getIncrementId();
         }
     }
     $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf($invoices);
     $pdfData = $pdf->render();
     $documentNumber = join(', ', $invoiceNumbers);
     $issueDate = strtotime($order->getCreatedAt());
     $dueDateDays = intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_base_duedate'));
     $dueDate = $issueDate + $dueDateDays * 60 * 60 * 24;
     $client = $this->getApiClient();
     $request = new PaymentManagementData();
     $request->setPaymentId($order->getInvipayPaymentId());
     $request->setDoConfirmDelivery(true);
     $conversionData = new OrderToInvoiceData();
     $conversionData->setInvoiceDocumentNumber($documentNumber);
     $conversionData->setIssueDate(date('Y-m-d', $issueDate));
     $conversionData->setDueDate(date('Y-m-d', $dueDate));
     $request->setConversionData($conversionData);
     $document = new FileData();
     $document->setName('Zamowienie_nr_' . $order->getEntityId() . '.pdf');
     $document->setMimeType('application/pdf');
     $document->setContentFromBin($pdfData);
     $request->setDocument($document);
     $result = $client->managePayment($request);
     $order->setInvipayDeliveryConfirmed(true);
     $order->setInvipayCompleted(true);
     $order->save();
 }
开发者ID:invipay,项目名称:invipay-magento,代码行数:35,代码来源:Data.php


示例16: redirect_visitor

include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
require_once "AccessLog_class.php";
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
$secureurl_obj = new phpsecureurl();
$lrequest_id = $_REQUEST['id'];
//save an original copy of id
if (strchr($_REQUEST['id'], '_')) {
    list($_REQUEST['id'], $lrevision_id) = explode('_', $_REQUEST['id']);
    $lrevision_dir = $GLOBALS['CONFIG']['revisionDir'] . '/' . $_REQUEST['id'] . '/';
}
if (!isset($_GET['submit'])) {
    draw_header(msg('view') . ' ' . msg('file'), $last_message);
    $file_obj = new FileData($_REQUEST['id'], $GLOBALS['connection'], DB_NAME);
    $file_name = $file_obj->getName();
    $file_id = $file_obj->getId();
    $realname = $file_obj->getName();
    // Get the suffix of the file so we can look it up
    // in the $mimetypes array
    $suffix = '';
    if (strchr($realname, '.')) {
        // Fix by blackwes
        $prefix = substr($realname, 0, strrpos($realname, "."));
        $suffix = strtolower(substr($realname, strrpos($realname, ".") + 1));
    }
    $lmimetype = File::mime_by_ext($suffix);
    //echo "Realname is $realname<br>";
    //echo "prefix = $prefix<br>";
    //echo "suffix = $suffix<br>";
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:31,代码来源:view_file.php


示例17:

<?php

if (!empty($_GET)) {
    $fp = PermisionData::getById($_GET["id"]);
    //	print_r($fp);
    $file = FileData::getById($fp->file_id);
    $fp->del();
    Core::redir("./?view=filepermisions&id=" . $file->code);
}
开发者ID:proyectoseb,项目名称:inventarios,代码行数:9,代码来源:action-default.php


示例18: getAuthority

 /**
  * getAuthority
  * Return the authority that this user have on file data_id
  * by combining and prioritizing user and department right
  * @param int $data_id
  * @return int
  */
 public function getAuthority($data_id)
 {
     $data_id = (int) $data_id;
     $fileData = new FileData($data_id, $this->connection);
     if ($this->user_obj->isAdmin() || $this->user_obj->isReviewerForFile($data_id)) {
         return $this->ADMIN_RIGHT;
     }
     if ($fileData->isOwner($this->uid) && $fileData->isLocked()) {
         return $this->WRITE_RIGHT;
     }
     $user_permissions = $this->user_perms_obj->getPermission($data_id);
     $department_permissions = $this->dept_perms_obj->getPermission($data_id);
     if ($user_permissions >= $this->user_perms_obj->NONE_RIGHT and $user_permissions <= $this->user_perms_obj->ADMIN_RIGHT) {
         return $user_permissions;
     } else {
         return $department_permissions;
     }
 }
开发者ID:vzool,项目名称:opendocman,代码行数:25,代码来源:UserPermission_class.php


示例19: session_start

// Deprecated
// check for session and $id
session_start();
include_once 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (!isset($id) || $id == '') {
    header('Location:error.php?ec=2');
    exit;
}
// includes
// in case file is accessed directly
// verify again that user has view rights
$filedata = new FileData($id, $pdo);
$filedata->setId($id);
if ($filedata->getError() != '') {
    header('Location:error.php?ec=2');
    ob_end_flush();
    // Flush buffer onto screens
    ob_end_clean();
    // Clean up buffer
    exit;
} else {
    // all checks completed
    /* to avoid problems with some browsers,
          download script should not include parameters on the URL
          so let's use a form and pass the parameters via POST
       */
    // form not yet submitted
开发者ID:chaitanyar1,项目名称:opendocman,代码行数:31,代码来源:view.php


示例20: intval

 // update revision log
 $query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision='" . intval(intval($lrevision_num) - 1) . "' WHERE id = '{$id}' and revision = 'current'";
 mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
 $query = "INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}log (id, modified_on, modified_by, note, revision) VALUES('{$id}', NOW(), '" . addslashes($username) . "', '" . addslashes($_POST['note']) . "', 'current')";
 $result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
 // update file status
 $query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}data SET status = '0', publishable='{$lpublishable}', realname='{$filename}' WHERE id='{$id}'";
 $result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
 // rename and save file
 $newFileName = $id . '.dat';
 copy($_FILES['file']['tmp_name'], $GLOBALS['CONFIG']['dataDir'] . $newFileName);
 AccessLog::addLogEntry($id, 'I');
 /**
  * Send out email notifications to reviewers
  */
 $file_obj = new FileData($id, $GLOBALS['connection'], DB_NAME);
 $get_full_name = $user_obj->getFullName();
 $full_name = $get_full_name[0] . ' ' . $get_full_name[1];
 $department = $file_obj->getDepartment();
 $reviewer_obj = new Reviewer($id, $GLOBALS['connection'], DB_NAME);
 $reviewer_list = $reviewer_obj->getReviewersForDepartment($department);
 $date = date('Y-m-d H:i:s T');
 // Build email for general notices
 $mail_subject = msg('checkinpage_file_was_checked_in');
 $mail_body2 = msg('checkinpage_file_was_checked_in') . "\n\n";
 $mail_body2 .= msg('label_filename') . ':  ' . $file_obj->getName() . "\n\n";
 $mail_body2 .= msg('label_status') . ': ' . msg('addpage_new') . "\n\n";
 $mail_body2 .= msg('date') . ': ' . $date . "\n\n";
 $mail_body2 .= msg('addpage_uploader') . ': ' . $full_name . "\n\n";
 $mail_body2 .= msg('email_thank_you') . ',' . "\n\n";
 $mail_body2 .= msg('email_automated_document_messenger') . "\n\n";
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:31,代码来源:check-in.php



注:本文中的FileData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP FileDataManager类代码示例发布时间:2022-05-23
下一篇:
PHP FileCtl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap