• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Course类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Course的典型用法代码示例。如果您正苦于以下问题:PHP Course类的具体用法?PHP Course怎么用?PHP Course使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Course类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getInitData

 public function getInitData($req)
 {
     $data = array();
     $employees = new Employee();
     $data['numberOfEmployees'] = $employees->Count("1 = 1");
     $company = new CompanyStructure();
     $data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
     $user = new User();
     $data['numberOfUsers'] = $user->Count("1 = 1");
     $project = new Project();
     $data['numberOfProjects'] = $project->Count("status = 'Active'");
     $attendance = new Attendance();
     $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
     if (empty($data['numberOfAttendanceLastWeek'])) {
         $data['numberOfAttendanceLastWeek'] = 0;
     }
     $empLeave = new EmployeeLeave();
     $data['numberOfLeaves'] = $empLeave->Count("date_start > '" . date("Y-m-d") . "'");
     $timeEntry = new EmployeeTimeEntry();
     $data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
     $candidate = new Candidate();
     $data['numberOfCandidates'] = $candidate->Count("1 = 1");
     $job = new Job();
     $data['numberOfJobs'] = $job->Count("status = 'Active'");
     $course = new Course();
     $data['numberOfCourses'] = $course->Count("1 = 1");
     return new IceResponse(IceResponse::SUCCESS, $data);
 }
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:28,代码来源:DashboardActionManager.php


示例2: create_course

/**
 * @brief create course
 * @param  type  $public_code
 * @param  type  $lang
 * @param  type  $title
 * @param string $description
 * @param  array $departments
 * @param  type  $vis
 * @param  type  $prof
 * @param  type  $password
 * @return boolean
 */
function create_course($public_code, $lang, $title, $description, $departments, $vis, $prof, $password = '') {

    $code = strtoupper(new_code($departments[0]));
    if (!create_course_dirs($code)) {
        return false;
    }
    if (!$public_code) {
        $public_code = $code;
    }
    $q = Database::get()->query("INSERT INTO course
                         SET code = ?s,
                             lang = ?s,
                             title = ?s,
                             keywords = '',
                             description = ?s,
                             visible = ?d,
                             prof_names = ?s,
                             public_code = ?s,
                             created = " . DBHelper::timeAfter() . ",
                             password = ?s,
                             glossary_expand = 0,
                             glossary_index = 1", $code, $lang, $title, $description, $vis, $prof, $public_code, $password);
    if ($q) {
        $course_id = $q->lastInsertID;
    } else {
        return false;
    }       

    require_once 'include/lib/course.class.php';
    $course = new Course();
    $course->refresh($course_id, $departments);

    return array($code, $course_id);
}
开发者ID:nikosv,项目名称:openeclass,代码行数:46,代码来源:functions.php


示例3: grab

function grab()
{
    //提交表单
    $grab = new Course($_POST['username']);
    $url = "http://jw.gdufs.edu.cn/" . $_POST['type'] . "&xh=" . $_POST['username'] . "&xm=" . urlencode($_POST['name']);
    $course = explode(",", $_POST['course']);
    $input = $_POST['input'];
    $tempReg = "/=>|&/";
    $arr = preg_split($tempReg, $input);
    $from = array();
    for ($i = 0; $i < count($arr); $i += 2) {
        $form[$arr[$i]] = $arr[$i + 1];
    }
    $form['ddl_ywyl'] = "";
    //有无余量
    $form['ddl_kcgs'] = "";
    //课程归属
    $form['ddl_sksj'] = "";
    //上课时间
    $form['ddl_xqbs'] = 2;
    //1:北校区,2:南校区
    $form['Button1'] = "提交";
    for ($i = 0; $i < count($course); $i++) {
        $form[$course[$i]] = "on";
    }
    $res = my_iconv($grab->submitForm($url, $form));
    echo json_encode($res);
}
开发者ID:zjy01,项目名称:grab,代码行数:28,代码来源:grab.php


示例4: approve

 function approve($id, $data = null)
 {
     $training = new Training();
     $course_obj = new Course();
     $request = $this->get(array('id' => $id));
     $course = $course_obj->get(array('id' => $request['course_id']));
     $data['course_id'] = $request['course_id'];
     $data['start'] = $request['planned_date'];
     $date = new DateTime($data['start']);
     if ($course['duration'] > 8) {
         $date->add(new DateInterval('P' . ceil($course['duration'] / 8) . 'DT' . $course['duration'] % 8 . 'H'));
     } else {
         $date->add(new DateInterval('PT' . $course['duration'] . 'H'));
     }
     $data['finish'] = $date->format('Y-m-d H:i');
     $data['user_id'] = $request['user_id'];
     $data['status_id'] = Training::CREATED;
     if ($course['format_id'] == Course::ONLINE || $course['format_id'] == Course::WEBCAST) {
         $data['course_hash'] = md5($data['user_id'] . $data['course_id'] . $data['start']);
     }
     $data['tries'] = 0;
     if ($course['exam'] == 't') {
         $data['exam_hash'] = md5($data['user_id'] . $data['course_id'] . $data['start'] . $data['tries']);
     }
     $data['request_id'] = $id;
     $data['active'] = 'true';
     $training->add($data);
     $this->disable($id);
 }
开发者ID:jedaika,项目名称:Trainings,代码行数:29,代码来源:request.php


示例5: newEntry

 public function newEntry($scholar_no, $course_code, $course_dep, $classes_attended, $classes_total)
 {
     if (!loggedIn() || privilege() == NULL || privilege() == 'admin') {
         return 0;
     }
     $c = new Course();
     if (!$c->appointError(Session::get('teacher_id'), $course_code, $course_dep)) {
         unset($c);
         return 0;
     }
     $this->_connect();
     $scholar_no = $this->_db->real_escape_string(escape($scholar_no));
     $course_code = $this->_db->real_escape_string(escape($course_code));
     $classes_attended = $this->_db->real_escape_string(escape($classes_attended));
     $classes_total = $this->_db->real_escape_string(escape($classes_total));
     $percentage = $classes_attended * 100 / $classes_total;
     $check = $this->getEntry($scholar_no, $course_code);
     if (empty($check)) {
         $query = "INSERT INTO attendance_data (scholar_no, course_code, classes_attended, classes_total, percentage) VALUES ('" . $scholar_no . "','" . $course_code . "','" . $classes_attended . "','" . $classes_total . "','" . $percentage . "')";
     } else {
         $query = "UPDATE attendance_data SET classes_attended = '" . $classes_attended . "', classes_total = '" . $classes_total . "', percentage = '" . $percentage . "' WHERE scholar_no='" . $scholar_no . "' AND course_code='" . $course_code . "' AND timestamp>='" . Session::get('semester_timestamp') . "'";
     }
     $result = $this->_db->query($query);
     if ($this->_db->error != '') {
         die('Database error!');
     }
     if ($this->_db->affected_rows) {
         return 1;
     } else {
         return 0;
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:32,代码来源:Attendance.php


示例6: getList

 public function getList($order = "didascalia")
 {
     $order = trim(filter_var($order, FILTER_SANITIZE_STRING));
     //interrogazione tabella
     $sql = "SELECT * FROM upload ORDER BY {$order}";
     $auth = $this->connector->query($sql);
     $list = array();
     // controllo sul risultato dell'interrogazione
     if (mysql_num_rows($auth) > 0) {
         $doc = new Document();
         $doc->setConnector($this->connector);
         $course = new Course();
         $course->setConnector($this->connector);
         while ($res = $this->connector->getObjectResult($auth)) {
             $doc = new Document($res->id, $res->path, $res->tipo, $res->didascalia);
             //Calcolo le informazioni di servizio
             if ($res->tipo == 1) {
                 $doc->course_name = "TUTTI";
             } else {
                 $doc->course_name = $course->getById($res->tipo)->name;
             }
             $list[] = $doc;
         }
     }
     return $list;
 }
开发者ID:christian-rizza,项目名称:sis-portal,代码行数:26,代码来源:Document.php


示例7: render

 public function render()
 {
     $course = new Course();
     $course->include_related('period');
     $course->get_by_id((int) @$this->config['course_id']);
     $this->parser->assign('course', $course);
     if ($course->exists()) {
         $solutions = new Solution();
         $solutions->select_func('COUNT', '@id', 'count');
         $solutions->where('revalidate', 1);
         $solutions->where_related('task_set', 'id', '${parent}.id');
         $solutions->where_related('student/participant/course', 'id', $course->id);
         $solutions->where_related('student/participant', 'allowed', 1);
         $task_sets = new Task_set();
         $task_sets->select('*');
         $task_sets->select_subquery($solutions, 'solutions_count');
         $task_sets->where_related($course);
         $task_sets->where_related('solution', 'revalidate', 1);
         $task_sets->where_related('solution/student/participant/course', 'id', $course->id);
         $task_sets->where_related('solution/student/participant', 'allowed', 1);
         $task_sets->group_by('id');
         $task_sets->order_by_with_overlay('name', 'ASC');
         $task_sets->get_iterated();
         $this->parser->assign('task_sets', $task_sets);
     }
     $this->parser->parse('widgets/admin/unevaluated_solutions/main.tpl');
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:27,代码来源:unevaluated_solutions.php


示例8: get_student_courses

 public function get_student_courses($order = null)
 {
     LoadHelper::model('course');
     $student_list = array();
     //connect to database
     $this->db->connect();
     //query
     $sql = "SELECT s.id,s.first_name,s.last_name,s.email,s.contact_no,c.id as course_id,c.course_name ";
     $sql .= " FROM students s JOIN courses c on s.course_id=c.id";
     if (isset($order)) {
         $sql = $sql . " ORDER BY " . $order;
     }
     //fetchquery
     $result = $this->db->fetchquery($sql);
     while ($row = $result->fetch_assoc()) {
         $student = new Students();
         $student->set_id($row['id']);
         $student->set_first_name($row['first_name']);
         $student->set_last_name($row['last_name']);
         $student->set_email($row['email']);
         $student->set_contact_no($row['contact_no']);
         $course = new Course();
         $course->set_id($row['course_id']);
         $course->set_course_name($row['course_name']);
         $student->set_course($course);
         array_push($student_list, $student);
     }
     $this->db->close();
     return $student_list;
 }
开发者ID:pratishshr,项目名称:leapfrog,代码行数:30,代码来源:studentrepository.class.php


示例9: displayBody

    function displayBody()
    {
        parent::displayBody();
        $translator = new Translator();
        $course = new Course();
        $data = $course->get(array('id' => $this->id));
        foreach ($data as $key => $val) {
            $data[$key] = htmlspecialchars($val, ENT_QUOTES);
        }
        echo <<<EOF
<h2  class="page-header">{$data[name]}</h2>
<h4>{$data[category_name]}</h4>
<div class="col-lg-8">
    <ul class="list-group category-list" index="{$this->id}/">

EOF;
        $root = $_SERVER['DOCUMENT_ROOT'] . '/../files/courses/' . $this->id;
        $this->put_list($root);
        echo <<<EOF
    </ul>
    <div class="row">
\t
\t<a href="#"  data-toggle="toggler" parent-id="{$this->id}/" title="{$translator->addfile}" type="file">
\t\t\t<span class="glyphicon glyphicon-file"></span> </a>
\t\t\t<a href="#"  data-toggle="toggler" parent-id="{$this->id}/" title="{$translator->addfolder}" type="folder">
\t\t\t<span class="glyphicon glyphicon-folder-open"></span> </a>
\t
    </div>

</div>
EOF;
    }
开发者ID:jedaika,项目名称:Trainings,代码行数:32,代码来源:admin_manager.php


示例10: map_data

 private function map_data()
 {
     $Course = new Course();
     $Course->set_course_name($_POST['course_name']);
     $Course->set_status($_POST['status']);
     return $Course;
 }
开发者ID:pratishshr,项目名称:leapfrog,代码行数:7,代码来源:coursecontroller.php


示例11: displayDisciplinesOfSyllabus

 public function displayDisciplinesOfSyllabus($syllabusId, $courseId)
 {
     $syllabusDisciplines = $this->getSyllabusDisciplines($syllabusId);
     $course = new Course();
     $foundCourse = $course->getCourseById($courseId);
     $data = array('syllabusDisciplines' => $syllabusDisciplines, 'syllabusId' => $syllabusId, 'course' => $foundCourse);
     loadTemplateSafelyByGroup("secretario", 'syllabus/course_syllabus_disciplines', $data);
 }
开发者ID:kailIII,项目名称:SiGA,代码行数:8,代码来源:syllabus.php


示例12: getCoursesByCategory

 public function getCoursesByCategory()
 {
     $conn = new Course($this->_config);
     $result = $conn->getCourseBy($this->_data['target'], $this->_data['value']);
     $encodedResult = $this->utf8_converter($result);
     $courses = json_encode($encodedResult);
     echo $courses;
 }
开发者ID:camelcasetechsd,项目名称:training-careers,代码行数:8,代码来源:Main.php


示例13: testListCoursesShouldReturnAnIterator

 public function testListCoursesShouldReturnAnIterator()
 {
     $stub = $this->getClientStub();
     $stub->expects($this->once())->method('request')->with($this->equalTo('GET'), $this->equalTo('/courses/all'))->willReturn([]);
     $provider = new Course($stub);
     $data = $provider->listCourses();
     $this->assertEquals([], $data);
 }
开发者ID:pixelazul,项目名称:sdk-php,代码行数:8,代码来源:CourseTest.php


示例14: delete

function delete(Course $obj)
{
    $output = array('code' => '000', 'message' => 'Something gone wrong. Please try again', 'type' => 'danger');
    if ($obj->delete($_REQUEST['id'])) {
        $output = array('code' => '200', 'message' => 'Course deleted successfully.', 'type' => 'success');
    }
    return $output;
}
开发者ID:janruls1,项目名称:OnlineTestSystem,代码行数:8,代码来源:courses.php


示例15: specific_definition

 protected function specific_definition($mform)
 {
     global $CFG;
     global $COURSE;
     $Course = new Course();
     $course_notification_setting = $Course->get_registration($COURSE->id);
     // Fields for editing HTML block title and contents.
     $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
     $attributes = array();
     $attributes['disabled'] = 'disabled';
     $attributes['group'] = 'moodle_notifications_settings';
     if ($CFG->block_moodle_notifications_email_channel == 1) {
         $mform->addElement('checkbox', 'notify_by_email', get_string('notify_by_email', 'block_moodle_notifications'));
     } else {
         $mform->addElement('advcheckbox', 'notify_by_email', get_string('notify_by_email', 'block_moodle_notifications'), null, $attributes);
     }
     if (isset($course_notification_setting->notify_by_email) and $course_notification_setting->notify_by_email == 1) {
         $mform->setDefault('notify_by_email', 1);
     }
     if ($CFG->block_moodle_notifications_sms_channel == 1 and class_exists('SMS')) {
         $mform->addElement('checkbox', 'notify_by_sms', get_string('notify_by_sms', 'block_moodle_notifications'));
     } else {
         $mform->addElement('advcheckbox', 'notify_by_sms', get_string('notify_by_sms', 'block_moodle_notifications'), null, $attributes);
     }
     if (isset($course_notification_setting->notify_by_sms) and $course_notification_setting->notify_by_sms == 1) {
         $mform->setDefault('notify_by_sms', 1);
     }
     if ($CFG->block_moodle_notifications_rss_channel == 1) {
         $mform->addElement('checkbox', 'notify_by_rss', get_string('notify_by_rss', 'block_moodle_notifications'));
     } else {
         $mform->addElement('advcheckbox', 'notify_by_rss', get_string('notify_by_rss', 'block_moodle_notifications'), null, $attributes);
     }
     if (isset($course_notification_setting->notify_by_rss) and $course_notification_setting->notify_by_rss == 1) {
         $mform->setDefault('notify_by_rss', 1);
     }
     if ($CFG->block_moodle_notifications_email_channel == 1 or $CFG->block_moodle_notifications_sms_channel == 1) {
         $options = array();
         for ($i = 1; $i < 25; ++$i) {
             $options[$i] = $i;
         }
         $mform->addElement('select', 'notification_frequency', get_string('notification_frequency', 'block_moodle_notifications'), $options);
         $mform->setDefault('notification_frequency', $course_notification_setting->notification_frequency / 3600);
     }
     $mform->addElement('html', '<br /><div class="qheader">' . get_string('course_configuration_presets_comment', 'block_moodle_notifications') . '</div>');
     $mform->addElement('checkbox', 'email_notification_preset', get_string('email_notification_preset', 'block_moodle_notifications'));
     if (isset($course_notification_setting->email_notification_preset) and $course_notification_setting->email_notification_preset == 1) {
         $mform->setDefault('email_notification_preset', 1);
     } else {
         $mform->setDefault('email_notification_preset', 0);
     }
     $mform->addElement('checkbox', 'sms_notification_preset', get_string('sms_notification_preset', 'block_moodle_notifications'));
     if (isset($course_notification_setting->sms_notification_preset) and $course_notification_setting->sms_notification_preset == 1) {
         $mform->setDefault('sms_notification_preset', 1);
     } else {
         $mform->setDefault('sms_notification_preset', 0);
     }
 }
开发者ID:nadavkav,项目名称:Moodle2-Hebrew-plugins,代码行数:57,代码来源:edit_form.php


示例16: retrieveForCourseCriteria

 /**
  * This static method retrieves all the subjects for a course.
  *
  * @param Course $course
  * @return Criteria
  */
 public static function retrieveForCourseCriteria(Course $course)
 {
     $c = new Criteria();
     $c->add(CourseSubjectPeer::COURSE_ID, $course->getId());
     $c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID, Criteria::INNER_JOIN);
     $c->addJoin(CareerSubjectSchoolYearPeer::CAREER_SUBJECT_ID, CareerSubjectPeer::ID, Criteria::INNER_JOIN);
     $c->addJoin(CareerSubjectPeer::SUBJECT_ID, self::ID, Criteria::INNER_JOIN);
     $c->setDistinct();
     return $c;
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:16,代码来源:SubjectPeer.php


示例17: displayBody

    function displayBody()
    {
        parent::displayBody();
        $translator = new Translator();
        $request = new Request();
        try {
            $id = array_shift($this->param);
            $course = new Course();
            $c_data = $course->get(array('id' => $id));
            $data['course_id'] = $id;
            $data['user_id'] = $_SESSION['user_id'];
            $data['active'] = true;
            $data['planned_date'] = $_GET['planned_date'] != '' ? $_GET['planned_date'] : date('Y-m-d H:i:s', time());
            $r_id = $request->add($data);
            if ($c_data['need_approve'] == 'f') {
                $request->approve($r_id);
                echo <<<EOF
<div class="container">
   <div class="page-header">
        <h1>{$translator->Request_updated}</h1>
      </div>
   <p class="lead">{$translator->Request_updated_Desc}</p>
      <p >{$translator->Error_Backcourses}</p>
</div>
<script type="text/javascript">
window.location.href='/mycourses';
</script>

EOF;
            } else {
                echo <<<EOF
<div class="container">
   <div class="page-header">
        <h1>{$translator->Request_updated}</h1>
      </div>
   <p class="lead">{$translator->Request_need_approve_Desc}</p>
      <p >{$translator->Error_Backcourses}</p>
</div>

EOF;
            }
        } catch (Exception $e) {
            echo <<<EOF
<div class="container">
   <div class="page-header">
        <h1>{$translator->Request_error}</h1>
      </div>
   <p class="lead">{$translator->Request_error_Desc}</p>
      <p >{$translator->Error_Backcourses}</p>
</div>

EOF;
        }
    }
开发者ID:jedaika,项目名称:Trainings,代码行数:54,代码来源:enroll.php


示例18: sandbox

 public static function sandbox()
 {
     // Testaa koodiasi täällä
     $course = new Course(array('name' => '', 'city' => ''));
     $errors = $course->errors();
     Kint::dump($errors);
     $hole = new Hole(array('hole_num' => 'yksi', 'par' => 'kolme'));
     $errors = $hole->errors();
     Kint::dump($errors);
     echo Course::next_courseid();
 }
开发者ID:rryanburton,项目名称:Tsoha-Bootstrap,代码行数:11,代码来源:hello_world_controller.php


示例19: deleteIfNotFound

 /**
  * If no training associations, delete course. 
  */
 public static function deleteIfNotFound($training_title_option_id, $training_id = 0)
 {
     $tableObj = new Course();
     $select = $tableObj->select()->from('training', array('COUNT(id) AS training_count'))->setIntegrityCheck(false)->where("course_id = {$training_title_option_id} AND id != {$training_id}");
     $row = $tableObj->fetchRow($select);
     if (!$row->training_count) {
         $tableObj = new Course();
         $tableObj->delete("training_title_option_id = {$training_title_option_id}");
         $tableObj = new ITechTable(array('name' => 'training_title_option'));
         $tableObj->delete("id = {$training_title_option_id}");
     }
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:15,代码来源:Course.php


示例20: course_GET

/**
 * @author  ryan <[email protected]>
 */
function course_GET($id)
{
    $course = new Course($id);
    $teacher = $course->teacher();
    $comments = $course->comments();
    $has_login = $GLOBALS['has_login'];
    $data = compact('course', 'teacher', 'canStar', 'has_login', 'comments');
    if ($has_login) {
        $data['myStar'] = $course->starBy($GLOBALS['user']);
    }
    render_view('master', $data);
}
开发者ID:TheDenisNovikov,项目名称:teacher,代码行数:15,代码来源:course.php



注:本文中的Course类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CourseManager类代码示例发布时间:2022-05-23
下一篇:
PHP Coupon类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap