<?php require_once ykfile("source/mooc_service.php"); require_once ykfile("source/tag_service.php"); // 判断是否有id 如果有 就是编辑 否则就是添加 $mooc_id = intval($_GET['mooc_id']); $moocSer = new MoocService(); $mooc = $moocSer->get_by_id($mooc_id); // 获取所有的标签对象 $tagSer = new TagService(); $tag_list = $tagSer->get_all(); if ($mooc == NULL || $mooc == 3001) { $mooc = new ActivityModule(); $mooc->type = ActivityModel::type_mooc; $mooc->author = new UserModel(); } include ykfile('pages/admin/edit_mooc.php');
<?php require_once "config.php"; require_once ykfile("source/mooc_service.php"); header("Content-type: text/html; charset=utf-8"); $page_title = "公开课"; $moocService = new MoocService(); $mooc_list = $moocService->get_all(@$next_id, @$pagesize, STAGE_INDEX); if ($mooc_list != 1000) { include ykfile("pages/mooc/moocList.php"); } else { echo "没有有效的数据!"; }
<?php // 查询公开课列表 require_once ykfile('source/mooc_service.php'); $next_id = intval($_GET['next_id']); $count = intval($_GET['count']); if ($count <= 0) { $count = 10; } //活动的列表页 $moocSer = new MoocService(); $mooc_list = $moocSer->get_all($next_id, $count, STAGE_ADMIN); $mooc_total = $moocSer->get_activity_count(NULL); // 以下4个参数,必须计算出来,分页器要使用 // page_cur: 当前页, 从1开始计算 // page_count: 总页数 // page_prefix: 点页数后,取数据的url前缀 // next_id: 下一页超始数据 $page_cur = intval(($next_id + 1 + 9) / 10); $page_count = intval(($mooc_total + 9) / 10); $page_prefix = "/m/admin.php?mod=mooc"; $next_id += $count; include ykfile('pages/admin/mooc_list.php');
<?php $act_id = intval($_GET['act_id']); $type = intval($_GET['type']); $is_delete = intval($_GET['is_delete']); if ($type == 0) { // 演讲 $talkSer = new TalkService(); $ret = $talkSer->remove_talk($act_id, $is_delete); } else { if ($type == 1) { // 沙龙活动 $acticitySer = new ActivityService(); $ret = $acticitySer->remove_activity($act_id, $is_delete); } else { //mooc $moocSer = new MoocService(); $ret = $moocSer->remove_mooc($act_id, $is_delete); } } if ($ret == 0) { echo json_encode(array("status" => 0, "message" => "删除成功")); } else { echo json_encode(array("status" => $ret, "message" => "删除失败")); }
<?php require_once "../config.php"; include_once ykfile("source/mooc_service.php"); header("application/json;charset=utf-8"); $next_id = intval($_GET['next_id']); if (!$next_id) { $next_id = 0; } $count = intval($_GET['count']); if ($count <= 0 || $count > 500) { $count = 10; } $moocsrv = new MoocService(); $mooc = $moocsrv->get_all($next_id, $count, STAGE_INDEX); echo json_encode(array("activities" => $mooc));