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


PHP Teacher::data方法代碼示例

本文整理匯總了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>
開發者ID:ChenXL581X,項目名稱:distributedcourse,代碼行數:31,代碼來源:course.php

示例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('刪除失敗!');
            }
     });
  });
開發者ID:ChenXL581X,項目名稱:distributedcourse,代碼行數:31,代碼來源:taskList.php

示例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;
開發者ID:ChenXL581X,項目名稱:distributedcourse,代碼行數:31,代碼來源:insertTask_run.php

示例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", "編輯失敗");
        }
    }
}
開發者ID:ChenXL581X,項目名稱:distributedcourse,代碼行數:27,代碼來源:updateTask_run.php

示例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 = '';
開發者ID:ChenXL581X,項目名稱:distributedcourse,代碼行數:31,代碼來源:uploadware_run.php


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