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


PHP Documents::deleteDocument方法代码示例

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


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

示例1: actionIndex

	/**
	 * Lists all models.
	 */
	public function actionIndex()
	{
        if (isset($_POST['oper']) && $_POST['oper'] == 'edit') {
            $documentId = intval($_POST["id"]);
            $document = Documents::model()->with('images', 'user')->findByPk($documentId);

            if ($document) {
                $user = $document->user;
                $image = $document->image;

                if ($user) {
                    $person = $user->person;
                    $addresses = $person->adresses;

                    if (isset($addresses[0])) {
                        $address = $addresses[0];
                        $address->Address1 =  $_POST["Address1"];
                        $address->Address2 =  $_POST["Address2"];
                        $address->City =  $_POST["City"];
                        $address->State =  $_POST["State"];
                        $address->ZIP =  $_POST["ZIP"];
                        $address->Country =  $_POST["Country"];
                        $address->Phone =  $_POST["Phone"];
                        $address->Fax =  $_POST["Fax"];
                        if ($address->validate()) {
                            $address->save();
                            echo "adresses\n";
                        }
                    }

                    $user->User_Login = $_POST["User_Login"];
                    $user->User_Type = $_POST["User_Type"];
                    $user->Last_Login = $_POST["Last_Login"] ? $_POST["Last_Login"] : null;
                    $user->Active = intval($_POST["Active"]);
                    if ($user->validate()) {
                        $user->save();
                        echo "user\n";
                    }

                    $person->First_Name = $_POST["First_Name"];
                    $person->Last_Name = $_POST["Last_Name"];
                    $person->Email = $_POST["Email"];
                    $person->Mobile_Phone = $_POST["Mobile_Phone"];
                    $person->Direct_Phone = $_POST["Direct_Phone"];
                    $person->Direct_Fax = $_POST["Direct_Fax"];
                    if ($person->validate()) {
                        $person->save();
                        echo "person\n";
                    }
                }

                $document->Created = $_POST["Created"];
                if ($document->validate()) {
                    $document->save();
                    echo "document\n";
                }
/*
                $image->File_Name = $_POST["File_Name"];
                if ($image->validate()) {
                    $image->save();
                    echo "image\n";
                }
*/
            }

            die;
        }

        if (isset($_POST['oper']) && $_POST['oper'] == 'add') {
            die;
        }

        if (isset($_POST['oper']) && $_POST['oper'] == 'del') {
            $documentId = intval($_POST["id"]);
            $document = Documents::model()->findByPk($documentId);
            if ($document) {
                Documents::deleteDocument($documentId);
            }
            die;
        }

        $conn = mysql_connect(Yii::app()->params->dbhost, Yii::app()->params->dbuser, Yii::app()->params->dbpassword);
        mysql_select_db(Yii::app()->params->dbname);
        mysql_query("SET NAMES 'utf8'");

        Yii::import('ext.phpgrid.inc.jqgrid');

        // set columns
        $col = array();
        $col["title"] = "Document ID"; // caption of column
        $col["name"] = "Document_ID";
        $col["dbname"] = "documents.Document_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = false;
//.........这里部分代码省略.........
开发者ID:ranvijayj,项目名称:htmlasa,代码行数:101,代码来源:DocumentsController.php

示例2: __construct

 /**
  * [__construct description]
  * Stellt entsprechend der Anfrage das Dokument dar
  */
 public function __construct()
 {
     $doc = new Documents();
     // Neues Dokument erstellen
     if (isset($_POST["operation"])) {
         if ($_POST["operation"] == "create") {
             $current_user = wp_get_current_user();
             $doc->createNewDocument($this->saveInputs($_POST["project_name"]), $current_user->display_name, get_current_user_id(), $this->saveInputs($_POST["layout"]));
         } else {
             if ($_POST["operation"] == "delete") {
                 $doc->deleteDocument($this->saveInputs($_POST["id"]));
             } else {
                 if ($_POST["operation"] == "selectGroup") {
                     $group = new Groups();
                     $group->selectGroup($this->saveInputs($_POST["selectedGroup"]), $this->saveInputs($_POST["document_id"]));
                 } else {
                     if ($_POST["operation"] == "addAbschnitt") {
                         $doc->addAbschnitt(esc_textarea($_POST["content"]), $this->saveInputs($_POST["document_id"]));
                     } else {
                         if ($_POST["operation"] == "setContentAbschnitt") {
                             $doc->updateAbschnitt($this->saveInputs($_POST["document_id"]), $this->saveInputs($_POST["abschnitt_id"]), esc_textarea($_POST["content"]));
                         } else {
                             if ($_POST["operation"] == "deleteAbschnitt") {
                                 $doc->deleteAbschnitt($this->saveInputs($_POST["document_id"]), $this->saveInputs($_POST["abschnitt_id"]));
                             } else {
                                 if ($_POST["operation"] == "selectLayout") {
                                     $doc->selectLayout($this->saveInputs($_POST["document_id"]), $this->saveInputs($_POST["selectedLayout"]), $this->saveInputs($_POST["old_layout"]));
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (isset($_GET["id"])) {
         $document = $doc->getDocument($this->saveInputs($_GET["id"]));
         $document->abschnitte = array();
         $document->abschnitte = $doc->getAbschnitte($document->id);
         $downloadLinks = $doc->getDownloadLinks($document);
         $document->downloadZip = $downloadLinks["zip"];
         $document->downloadPdf = $downloadLinks["pdf"];
         $this->viewDocument($document);
     } else {
         if (isset($_GET["create"])) {
             $this->viewDocumentCreateForm($_GET["create"]);
         } else {
             $authDocs = $doc->getDocumentsCreatedByUser(get_current_user_id());
             $this->viewShortDoc($authDocs);
             $this->viewDocumentCreateForm();
         }
     }
 }
开发者ID:JanUrb,项目名称:Web-SystemeFL-WP,代码行数:57,代码来源:DokumentView.php


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