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


PHP student::count_records方法代码示例

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


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

示例1: action_default

 /**
  *
  * @global <type> $CFG
  */
 function action_default()
 {
     global $CFG;
     $clsid = $this->required_param('id', PARAM_INT);
     $sort = $this->optional_param('sort', 'name', PARAM_ALPHANUM);
     $dir = $this->optional_param('dir', 'ASC', PARAM_ALPHA);
     $page = $this->optional_param('page', 0, PARAM_INT);
     $perpage = $this->optional_param('perpage', 30, PARAM_INT);
     // how many per page
     $namesearch = trim($this->optional_param('search', '', PARAM_TEXT));
     $alpha = $this->optional_param('alpha', '', PARAM_ALPHA);
     $cls = new cmclass($clsid);
     $columns = array('idnumber' => get_string('student_idnumber', 'block_curr_admin'), 'name' => get_string('student_name_1', 'block_curr_admin'), 'enrolmenttime' => get_string('enrolment_time', 'block_curr_admin'), 'completetime' => get_string('completion_time', 'block_curr_admin'), 'completestatusid' => get_string('student_status', 'block_curr_admin'), 'grade' => get_string('student_grade', 'block_curr_admin'), 'credits' => get_string('student_credits', 'block_curr_admin'), 'locked' => get_string('student_locked', 'block_curr_admin'), 'buttons' => '');
     $stus = student::get_listing($clsid, $sort, $dir, $page * $perpage, $perpage, $namesearch, $alpha);
     $numstus = student::count_records($clsid, $namesearch, $alpha);
     $this->print_num_items($clsid, $cls->maxstudents);
     $this->print_alpha();
     $this->print_search();
     $this->print_list_view($stus, $columns, array(), 'users');
     // TBD: students ?
     print_paging_bar($numstus, $page, $perpage, "index.php?s=stu&amp;section=curr&amp;id={$clsid}&amp;sort={$sort}&amp;" . "dir={$dir}&amp;perpage={$perpage}&amp;alpha={$alpha}&amp;namesearch=" . urlencode(stripslashes($namesearch)) . "&amp;");
     echo "<form>";
     // TODO: pass in query parameters
     if ($this->can_do('bulkedit')) {
         echo "<input type=\"button\" onclick=\"document.location='index.php?s=stu&amp;section=curr&amp;" . "action=bulkedit&amp;id={$clsid}&amp;sort={$sort}&amp;dir={$dir}&amp;perpage={$perpage}&amp;alpha={$alpha}&amp;search=" . urlencode(stripslashes($namesearch)) . "';\" value=\"Bulk Edit\" />";
     }
     if ($this->can_do('add')) {
         echo "<input type=\"button\" onclick=\"document.location='index.php?s=stu&amp;section=curr&amp;" . "action=add&amp;id={$clsid}';\" value=\"" . get_string('enrolstudents', 'block_curr_admin') . "\" />";
     }
     echo "</form>";
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:35,代码来源:studentpage.class.php


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