本文整理汇总了PHP中Teacher::data方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::data方法的具体用法?PHP Teacher::data怎么用?PHP Teacher::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teacher
的用法示例。
在下文中一共展示了Teacher::data方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Teacher
<?php
require_once 'core/init.php';
include "includes/header.php";
$token = Token::generate();
if ($role == 'teacher') {
$user = new Teacher();
$data = $user->taskFindAll();
$name = $user->data()->name;
} else {
if ($role == 'student') {
$user = new Student();
$data = $user->taskFindAll();
} else {
$user = new User();
$data = $user->taskFindAll();
}
}
$nowtime = strtotime('now');
?>
<link rel="stylesheet" type="text/css" href="css/timeline/default.css" />
<link rel="stylesheet" type="text/css" href="css/timeline/component.css" />
<link rel="stylesheet" type="text/css" href="css/course.css">
<script src="js/ajaxfileupload.js"></script>
<div class="row main-box">
<div class="col-md-8 ">
<div class="main ">
<h3>
<i class="fa fa-list"></i> 本学期课程教学安排<a href="#" class="pull-right"><i class="fa fa-refresh"></i> </a>
示例2: Teacher
<?php
require_once 'core/init.php';
include "includes/header.php";
$token = Token::generate();
$teacher = new Teacher();
if ($teacher->data()->id) {
$data = $teacher->_taskOperation->taskFindAll($teacher->data()->id);
}
?>
<script type="text/javascript">
$(document).ready(function(){
$(".delete").click(function(){
var mark;
mark=$(this).val();
$.post("deltask.php",
{
'taskid':mark,
'token':$("[name$='token']").val()
},
function(data,status){
if(status=='success'){
alert(data);
window.location.reload();
}
else
{
alert('删除失败!');
}
});
});
示例3: Validate
<?php
require_once 'core/init.php';
if (Input::exists('post')) {
if (Token::check(Input::get('token'))) {
$validate = new Validate();
$validation = $validate->check($_POST, array('title' => array('required' => true, 'name' => 'title'), 'type' => array('required' => true, 'name' => 'title'), 'endtime' => array('required' => true, 'name' => 'endtime'), 'desc' => array('required' => true, 'name' => 'desc')));
if ($validation->passed()) {
$teacher = new Teacher();
try {
$teacher->_taskOperation->taskCreate(array('title' => Input::get('title'), 'teacher_id' => $teacher->data()->id, 'type' => Input::get('type'), 'end_time' => strtotime(Input::get('endtime')), 'context' => Input::get('desc')));
$validate->check($_POST, array('uploadfile' => array('required' => true, 'name' => 'uploadfile')));
if ($validation->passed()) {
$arr = Input::get('uploadfile');
$taskID = $teacher->_taskOperation->getLastId();
foreach ($arr as $file) {
echo $file;
$teacher->_taskOperation->insertFile(array('name' => $file, 'teacher_id' => $teacher->data()->id, 'url' => FileUtils::GetPath() . "/" . $file, 'task_id' => $taskID));
}
}
Redirect::to('taskdetail.php?taskmark=' . $taskID);
// Redirect::to('course.php');
} catch (Exception $e) {
die($e->getMessage());
}
} else {
$errorInfo = '';
foreach ($validation->errors() as $error) {
//echo $error;
$errorInfo .= $error . '<br>';
}
echo $errorInfo;
示例4: Validate
<?php
require_once 'core/init.php';
if (Input::exists('post')) {
if (Token::check(Input::get('token'))) {
Session::delete('home');
$validate = new Validate();
$validation = $validate->check($_POST, array('title' => array('required' => true, 'name' => 'title'), 'endtime' => array('required' => true, 'name' => 'endtime'), 'desc' => array('required' => true, 'name' => 'desc')));
if ($validation->passed()) {
$teacher = new Teacher();
$id = Input::get('taskId');
try {
$teacher->_taskOperation->taskUpdate(array('title' => Input::get('title'), 'teacher_id' => $teacher->data()->id, 'end_time' => strtotime(Input::get('endtime')), 'context' => Input::get('desc')), $id);
Session::flash("taskdetail", "编辑成功");
} catch (Exception $e) {
die($e->getMessage());
}
} else {
$errorInfo = '';
foreach ($validation->errors() as $error) {
//echo $error;
$errorInfo .= $error . '<br>';
}
Session::flash("taskdetail", "编辑失败");
}
}
}
示例5: Validate
<?php
require_once 'core/init.php';
if (Input::exists('post')) {
if (Token::check(Input::get('token'))) {
$validate = new Validate();
$validation = $validate->check($_POST, array('type' => array('required' => true, 'name' => 'type')));
if (1) {
$teacher = new Teacher();
try {
$file = Input::getFile('ware');
if ($file['error'] > 0) {
$res["error"] = "error";
} else {
echo FileUtils::GetWarePath() . "/" . $file['name'];
$rs = $teacher->_materialsOperation->uploadWare($file, array('title' => $file['name'], 'materialsType' => Input::get('type'), 'linkPDF' => FileUtils::GetWarePath() . "/" . $file['name'], 'teacher_id' => $teacher->data()->id));
$res["msg"] = "ok" . $rs;
}
if (Input::get('type') == 'C') {
Session::flash("courseware", "上传成功");
Redirect::to('courseware.php');
} else {
Session::flash("document", "上传成功");
Redirect::to('document.php');
}
} catch (Exception $e) {
$res["error"] = "error:" . $e->getMessage();
echo $res["error"];
}
} else {
$errorInfo = '';