当前位置: 首页>>代码示例>>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;未经允许,请勿转载。