本文整理汇总了PHP中Classes::updateClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP Classes::updateClassName方法的具体用法?PHP Classes::updateClassName怎么用?PHP Classes::updateClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Classes
的用法示例。
在下文中一共展示了Classes::updateClassName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: go
public function go()
{
$this->setViewTemplate('showclass.tpl');
if (!isset($_GET['id'])) {
header('Location: ' . SOURCE_ROOT_PATH . "admin/pages/manageclass.php");
}
$class_id = $_GET['id'];
if (isset($_POST['submit'])) {
if (isset($_POST['updateclassname'])) {
if ($_POST['updateclassname'] == '') {
header('Location: ' . SOURCE_ROOT_PATH . "admin/pages/showclass.php?id={$class_id}&action=editerror");
} else {
$this->name = $_POST['updateclassname'];
Classes::updateClassName($class_id, $this->name);
header('Location: ' . SOURCE_ROOT_PATH . "admin/pages/showclass.php?id={$class_id}&action=editsuccess");
}
}
}
if (isset($_GET['action']) && $_GET['action'] == "editerror") {
$this->addErrorMessage("Class name should not be empty");
}
if (isset($_GET['action']) && $_GET['action'] == "editsuccess") {
$this->addSuccessMessage("Class name updated successfully");
}
if (isset($_GET['action']) && $_GET['action'] == "del") {
if (isset($_GET['uid'])) {
ClassMemberships::deleteMembership($_GET['uid'], $class_id);
$this->addSuccessMessage("User has been deleted from the class succesfully");
} else {
if (isset($_GET['cid'])) {
ClassChallenges::deleteMembership($_GET['cid'], $class_id);
$this->addSuccessMessage("Challenge has been deleted from the class succesfully");
}
}
}
$class = Classes::getClass($class_id);
$user_members = ClassMemberships::getAllMemberships($class_id);
$challenges_assigned = ClassChallenges::getAllMemberships($class_id);
$this->addToView('class', $class);
$this->addToView('users', $user_members);
$this->addToView('challenges', $challenges_assigned);
return $this->generateView();
}