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


PHP Batch::batch_exists方法代碼示例

本文整理匯總了PHP中Batch::batch_exists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Batch::batch_exists方法的具體用法?PHP Batch::batch_exists怎麽用?PHP Batch::batch_exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Batch的用法示例。


在下文中一共展示了Batch::batch_exists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Log

            $log->create();
            $message = "success";
        }
    } else {
        $log = new Log($session->user_id, $clientip, "WEB", "CREATE SCHOOL NOT FILLED");
        $log->create();
        $message = "All fields are required.";
    }
} else {
    if ($_POST['what'] == "batch") {
        if (isset($_POST['fromyear']) && $_POST['fromyear'] != "" && isset($_POST['about']) && $_POST['about'] != "") {
            if (strtotime(date("Y-m-d")) < strtotime($_POST['pubdate'])) {
                //$school = School::get_by_id($_POST['schoolselect']);
                $school = School::get_by_id(CSNTRID);
                if ($school != false && $school != null && $school != "") {
                    if (!Batch::batch_exists($_POST['fromyear'], $school->id)) {
                        $object = new Batch();
                        $object->fromyear = $_POST['fromyear'];
                        $object->about = $_POST['about'];
                        $object->comments = $_POST['comments'];
                        $object->fbcomments = $_POST['fbcomments'];
                        $object->schoolid = $school->id;
                        $object->enabled = 1;
                        $object->pending = 0;
                        $object->pubdate = $_POST['pubdate'];
                        $object->published = 0;
                        $file = new File($_FILES['cover']);
                        if ($file->valid) {
                            $object->picture = $file->data;
                        }
                        $object->create();
開發者ID:NemOry,項目名稱:Skoolyf,代碼行數:31,代碼來源:create.php

示例2: File

<?php

require_once "../initialize.php";
$message = "";
if (isset($_POST['batchid']) && $_POST['batchid'] != "" && isset($_POST['fromyear']) && $_POST['fromyear'] != "" && isset($_POST['about']) && $_POST['about'] != "") {
    if (strtotime(date("Y-m-d")) < strtotime($_POST['pubdate'])) {
        //$school = School::get_by_id($_POST['schoolselect']);
        $object = Batch::get_by_id($_POST['batchid']);
        $school = School::get_by_id(CSNTRID);
        if ($school != false && $school != null && $school != "") {
            if (!Batch::batch_exists($_POST['fromyear'], $school->id) || $object->fromyear == $_POST['fromyear']) {
                $file = new File($_FILES['cover']);
                if ($file->valid) {
                    $object->picture = $file->data;
                } else {
                    $object->picture = base64_decode($object->picture);
                }
                $object->fromyear = $_POST['fromyear'];
                $object->about = $_POST['about'];
                $object->comments = $_POST['comments'];
                $object->fbcomments = $_POST['fbcomments'];
                $object->enabled = $_POST['enabled'];
                if (isset($_POST['pubdate'])) {
                    $object->pubdate = $_POST['pubdate'];
                }
                //$object->schoolid  = $school->id;
                $object->update();
                $log = new Log($session->user_id, $clientip, "WEB", "UPDATED BATCH: " . $object->id);
                $log->create();
                $message = "success";
            } else {
開發者ID:NemOry,項目名稱:Skoolyf,代碼行數:31,代碼來源:updatebatch.php


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