本文整理汇总了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();
示例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 {