本文整理匯總了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 {