当前位置: 首页>>代码示例>>PHP>>正文


PHP Student::count方法代码示例

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


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

示例1: filter

 public function filter()
 {
     $string = '%' . $this->input->post('string') . '%';
     $a = array();
     if ($string) {
         $a = Student::find('all', array('conditions' => array('nombre LIKE ? OR apellido LIKE ?', $string, $string)));
     } else {
         $a = Student::find('all');
     }
     $this->table->set_heading('Nombre', 'Apellido', 'Fecha de nacimiento', 'Documento', 'Telefono', 'Celular', 'Acciones');
     foreach ($a as $al) {
         $this->table->add_row($al->nombre, $al->apellido, $al->fecha_nacimiento->format('d/m/Y'), $al->tipo_documento . ' ' . $al->nro_documento, $al->telefono, $al->celular, anchor('alumnos/ver/' . $al->id, img('static/img/icon/doc_lines.png'), 'class="tipwe" title="Ver detalles de alumno"') . ' ' . anchor('alumnos/editar/' . $al->id, img('static/img/icon/pencil.png'), 'class="tipwe" title="Editar alumno"') . ' ' . anchor('alumnos/eliminar/' . $al->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar alumno"'));
     }
     echo $this->table->generate();
     $config['base_url'] = site_url('alumnos/index');
     $config['total_rows'] = Student::count();
     $config['per_page'] = '10';
     $config['num_links'] = '10';
     $config['first_link'] = '← primero';
     $config['last_link'] = 'último →';
     $this->load->library('pagination', $config);
     echo '<div class="pagination">';
     echo $this->pagination->create_links();
     echo '</div>';
 }
开发者ID:ricardocasares,项目名称:Cobros,代码行数:25,代码来源:alumnos.php

示例2: actionIndex

 /**
  * 首页
  *
  */
 public function actionIndex()
 {
     parent::_acl();
     $model = new Student();
     $criteria = new CDbCriteria();
     $criteria->condition = $condition;
     $criteria->order = 't.id ASC';
     //$criteria->with = array ( 'catalog' );
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 13;
     //$pageParams = XUtils::buildCondition( $_GET, array ( 'title' , 'catalogId','titleAlias' ) );
     //$pages->params = is_array( $pageParams ) ? $pageParams : array ();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     //审核
     //$id = $_POST('id');
     //$status = $_POST('status');
     //$count = Student::model()->updateByPk($id, ,'status=:status',array(':status'=>$status));
     $string = '审核更新失败';
     function errorInfo($count, $string)
     {
         if ($count) {
             echo "<b>{$string}</b>";
         } else {
             echo "<b>成功</b>";
         }
     }
     set_error_handler("errorInfo");
     $this->render('student_index', array('datalist' => $result, 'pagebar' => $pages));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:36,代码来源:StudentController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $error = Session::get('error');
     $success = Session::get('success');
     $tclass = ClassModel::count();
     $tsubject = Subject::count();
     $tstudent = Student::count();
     return View::Make('dashboard', compact('error', 'success', 'tclass', 'tsubject', 'tstudent'));
 }
开发者ID:hrshadhin,项目名称:school-management-system,代码行数:14,代码来源:DashboardController.php

示例4: render

 public function render()
 {
     if (isset($this->config['course_id'])) {
         $course = new Course();
         $course->include_related('period');
         $course->get_by_id((int) $this->config['course_id']);
         $this->parser->assign('course', $course);
         if ($course->exists()) {
             $task_sets = new Task_set();
             $task_sets->where_related($course);
             $task_sets->where('published', 1);
             $task_sets->where('content_type', 'task_set');
             $task_sets_count = $task_sets->count();
             $this->parser->assign('task_sets_count', $task_sets_count);
             $task_sets->where_related($course);
             $task_sets->where('published', 1);
             $task_sets->where('content_type', 'project');
             $projects_count = $task_sets->count();
             $this->parser->assign('projects_count', $projects_count);
             $groups = new Group();
             $groups->where_related($course);
             $groups_count = $groups->count();
             $this->parser->assign('groups_count', $groups_count);
             $students = new Student();
             $students->where_related('participant/course', 'id', $course->id);
             $students->where_related('participant', 'allowed', 1);
             $students_count = $students->count();
             $this->parser->assign('students_count', $students_count);
             $task_set_permissions = new Task_set_permission();
             $task_set_permissions->select_func('COUNT', '*', 'count');
             $task_set_permissions->where('enabled', 1);
             $task_set_permissions->where_related('task_set', 'id', '${parent}.id');
             $now = date('Y-m-d H:i:s');
             $plus_two_weeks = date('Y-m-d H:i:s', strtotime($now . ' + 2 weeks'));
             $minus_one_week = date('Y-m-d H:i:s', strtotime($now . ' - 1 week'));
             $task_sets->select('id, name, upload_end_time AS min_upload_end_time, upload_end_time AS max_upload_end_time');
             $task_sets->where_related($course);
             $task_sets->where('published', 1);
             $task_sets->where_subquery('0', $task_set_permissions);
             $task_sets->where('upload_end_time >=', $minus_one_week);
             $task_sets->where('upload_end_time <=', $plus_two_weeks);
             $task_sets_2 = new Task_set();
             $task_sets_2->select('id, name');
             $task_sets_2->where_related($course);
             $task_sets_2->where('published', 1);
             $task_sets_2->select_min('task_set_permissions.upload_end_time', 'min_upload_end_time');
             $task_sets_2->select_max('task_set_permissions.upload_end_time', 'max_upload_end_time');
             $task_sets_2->where_related('task_set_permission', 'enabled', 1);
             $task_sets_2->having('(MAX(`task_set_permissions`.`upload_end_time`) >= ' . $this->db->escape($minus_one_week) . ' AND MAX(`task_set_permissions`.`upload_end_time`) <= ' . $this->db->escape($plus_two_weeks) . ')');
             $task_sets_2->or_having('(MIN(`task_set_permissions`.`upload_end_time`) >= ' . $this->db->escape($minus_one_week) . ' AND MIN(`task_set_permissions`.`upload_end_time`) <= ' . $this->db->escape($plus_two_weeks) . ')');
             $task_sets_2->group_by('id');
             $task_sets->union_iterated($task_sets_2, FALSE, 'min_upload_end_time DESC, max_upload_end_time DESC', isset($this->config['number_of_task_sets']) ? (int) $this->config['number_of_task_sets'] : 5);
             $this->parser->assign('task_sets', $task_sets);
         }
     }
     $this->parser->parse('widgets/admin/course_overview/main.tpl');
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:57,代码来源:course_overview.php

示例5: surveylistAction

 public function surveylistAction()
 {
     $manager = $this->session->get("Manager");
     $tests = Test::find(array("school_id = :school_id:", "bind" => array("school_id" => $manager["school_id"]), "sort" => "id desc"));
     $now = date("Y-m-d H:i:s");
     $list = array();
     foreach ($tests as $index => $test) {
         /*
          * status
          * 0: 测试未开始
          * 1: 测试正在进行中
          * 2: 测试已经过期
          */
         $import = Student::count(array("test_id= :test_id:", "bind" => array("test_id" => $test->t_id)));
         $status = 0;
         if ($now >= $test->begin_time && $now <= $test->end_time) {
             $status = 1;
         } else {
             if ($now > $test->end_time) {
                 $status = 2;
             }
         }
         $item = array("test_id" => $test->t_id, "people" => $test->people, "begin" => substr($test->begin_time, 0, strlen($test->begin_time) - 3), "end" => substr($test->end_time, 0, strlen($test->end_time) - 3), "description" => $test->description, "status" => $status, "import" => $import);
         $list[$index] = $item;
     }
     $this->view->setVar("tests", $list);
     // 设置url
     $url = $this->makeurl();
     $this->view->setVar("url", $url);
     $this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_ACTION_VIEW);
 }
开发者ID:sify21,项目名称:Question,代码行数:31,代码来源:IndexController.php

示例6: _email_available

 public function _email_available($str, $student_id)
 {
     $student = new Student();
     $student->where('email', $str)->where('id !=', $student_id);
     $count = $student->count();
     return $count == 0;
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:7,代码来源:students.php


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