当前位置: 首页>>代码示例>>PHP>>正文


PHP Document::insert方法代码示例

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


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

示例1: insert

 /**
  * Insert new document
  * @param  [type] $document [description]
  * @param  array  $options  [description]
  * @return [type] [description]
  */
 public function insert(&$data, array $options = array())
 {
     $document = new Document($data, $this);
     $insert = $document->insert($options);
     $data = $document->data;
     return $insert;
 }
开发者ID:marcqualie,项目名称:mongominify,代码行数:13,代码来源:Collection.php

示例2: logMessage

    logMessage("WorkerDocumentUploadPage", "upload error:{$errorMessage}");
    $_SESSION[PARAM_PAGE_MESSAGE] = $errorMessage;
    header('Location: WorkerDocumentUploadPage.php');
    include 'WorkerDocumentUploadPage.php';
    return;
}
// else we are good to go
$expo = getExpoCurrent();
$worker = getWorkerCurrent();
$doc = new Document();
$doc->workerid = $worker->workerid;
$doc->expoid = $expo->expoid;
try {
    $fileString = file_get_contents($_FILES[PARAM_DOCUMENT]['tmp_name']);
    $doc->docType = $_SESSION[PARAM_DOCTYPE];
    $doc->docMime = $_FILES[PARAM_DOCUMENT]['type'];
    $doc->docName = $_FILES[PARAM_DOCUMENT]['name'];
    $doc->content = $fileString;
    ${$fileString} = NULL;
    $doc->insert();
    // can throw PDOException
    $_SESSION[PARAM_PAGE_MESSAGE] = "Your document has uploaded successfully.";
} catch (Exception $ex) {
    $msg = $ex->getMessage();
    logMessage("WorkerDocumentUploadAction", "file error:{$msg}");
    $_SESSION[PARAM_PAGE_MESSAGE] = "Your document has failed to upload.";
}
$doc = NULL;
// gc hint
header('Location: WorkerDocumentUploadPage.php');
include 'WorkerDocumentUploadPage.php';
开发者ID:ConSked,项目名称:scheduler,代码行数:31,代码来源:WorkerDocumentUploadAction.php

示例3: array

if ($mode == "Add") {
    # echo "<pre>";  print_r($_FILES) ; exit;
    $redirect_file = "index.php?file=m-documentadd" . $qs . "&iLibCategoryId=" . $iLibCategoryId;
    $GeneralObj->checkDuplicate('iDocumentId', 'Document', array('vDocumentName', 'iLibCategoryId'), $redirect_file, "Document Name Already Exists ", $vVideoName, ' AND ');
    // $documentObj->setdCreated($dCreated);
    if (isset($_FILES['vDocumentpath']['name']) && $_FILES['vDocumentpath']['name'] != "") {
        $pdf_name = date('Ymdhis') . $_FILES['vDocumentpath']['name'];
        if (copy($_FILES['vDocumentpath']['tmp_name'], $CFG->datadirroot . "/pdf/" . $pdf_name)) {
            if ($pdf_name != '') {
                $documentObj->setvDocumentpath($pdf_name);
            }
        }
    }
    #echo $pdf_name.'##'; exit;
    //$documentObj->setiSGroupId($iSGroupId);
    $id1 = $documentObj->insert();
    $msg = MSG_ADD;
    if ($eStatus == 'Active') {
        // for Notification of users
        $sql_Category_select = "select vCategoryName FROM LibraryCategory WHERE  iLibCategoryId = " . $iLibCategoryId;
        $catagery_Array = $obj->select($sql_Category_select);
        $user_emails = $userObj->getNotificationUsers($iSGroupId);
        if (is_Array($user_emails) && count($user_emails) > 0) {
            for ($i = 0; $i < count($user_emails); $i++) {
                //	$emailObj->send_add_documentmail($user_emails[$i]['vUsername'],$vDocumentName,$user_emails['admin_email'],$user_emails[$i]['vEmail'],$catagery_Array[0]['vCategoryName']);
                $sql_insert = "INSERT INTO `cron_email` (`vEmail` ,`vUsername` ,`vName` ,`vAdmin_email` ,`vCategoryName` ,`eType` ,`iID`)\n\t\t\t\t\t\tVALUES ('" . $user_emails[$i]['vEmail'] . "', '" . $user_emails[$i]['vUsername'] . "', '" . $vDocumentName . "', '" . $user_emails['admin_email'] . "', '" . $catagery_Array[0]['vCategoryName'] . "', 'Document', '" . $id1 . "')";
                //echo  $sql_insert;exit;
                $id = $obj->insert($sql_insert);
                /*
                 $to = ''.$user_emails[$i]['vEmail'].'';
                $subject = 'New Document added - Check it out';
开发者ID:redeyes1024,项目名称:medlii_mlm_backend,代码行数:31,代码来源:documentadd_a.php

示例4: showDocs

function showDocs()
{
    global $connector;
    global $result;
    $course = new Course();
    $doc = new Document();
    $course->setConnector($connector);
    $doc->setConnector($connector);
    if (isset($_POST['operation'])) {
        list($operation, $params) = explode("#", $_POST['operation']);
        switch ($operation) {
            case 'saveChanges':
                $doc->storeFormValues($_POST, BASE_PATH . "/upload/");
                $error_msg = $doc->insert();
                break;
            case 'delete':
                $error_msg = $doc->delete($params);
                break;
            default:
                $error_msg = "Operazione non valida";
        }
        if ($error_msg != "") {
            $result["errorMessage"] = $error_msg;
        } elseif ($operation != 'edit') {
            $result["statusMessage"] = "Operazione completata!";
        }
    }
    $result["courses"] = $course->getList("nome");
    $result['docs'] = $doc->getList();
    $page = "document.php";
    include_once BASE_PATH . "template.php";
}
开发者ID:christian-rizza,项目名称:sis-portal,代码行数:32,代码来源:index.php

示例5: Document

<?php

/**
 * Classe de test pour l'entité Document
 */
include_once '../Database.php';
include_once '../Document.php';
// Création d'un document
echo "Création d'un document ... ";
$document = new Document();
$document->debut = "2015-12-28";
$document->fin = "2015-12-29";
$document->id_appartement = 1;
// Ajout dans la base
echo "OK<br/>Ajout du document dans la base ... ";
$document->insert();
echo "OK<br/>";
// Liste de tous les documents
listerTout();
// Apport d'une modification
$document->fin = "2015-12-30";
echo "Modification de la fin ! Mise à jour dans la base ... ";
$document->update();
echo "OK<br/>";
// Sélection de l'appartement
$selectionDocument = Document::findById($document->id_document);
$selectionDocument->afficher();
// Suppression du document
echo "Suppression du document de la base ... ";
$selectionDocument->delete();
echo "OK<br/>";
开发者ID:Epimanjr,项目名称:S7-Millenary42,代码行数:31,代码来源:DocumentTest.php


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