public function actionLogout()
 {
     if (\Yii::$app->shop_user->isGuest) {
         jump_error('您没未登录, 无法退出!', '/');
     }
     $model = new Users();
     if ($model->logout()) {
         jump_success('退出登录成功!');
     }
 }
 public function actionDelete()
 {
     $category_id = null;
     if (\Yii::$app->request->isGet && ($category_id = \Yii::$app->request->get('id'))) {
         if ($this->model->remove($category_id)) {
             jump_success(t_arr('app', ['delete', 'success'], '', '!'));
         } else {
             jump_error($this->model->getFirstError('category_id') ?: $this->model->getFirstError('error'));
         }
     }
 }
 public function actionLogout()
 {
     if (\Yii::$app->shop_admin_user->isGuest) {
         jump_error("您尚示登录,退出失败!", '/');
     } else {
         $model = new Admin_user();
         if ($model->logout()) {
             jump_success("退出成功!", '/');
         }
     }
 }
$empty = 0;
//判断两次密码是否一致
$equal_pwd = 1;
// var_dump($major);
// echo count($major)."</br>";
if ($name == '' && $password == '' && $repassword == '' && $telephone == '' && $email == '') {
    $empty = 1;
    //echo $empty."</br>";
} else {
    if ($password != $repassword) {
        $equal_pwd = 0;
    } else {
        $con = get_db();
        mysql_select_db("teacher_class_system", $con);
        //连接到数据库
        mysql_query("SET NAMES UTF8");
        mysql_query("UPDATE user_teaching_office SET name = '{$name}'               WHERE   workNumber = '{$workNumber}' AND '{$name}' != ''");
        mysql_query("UPDATE user_teaching_office SET telephone = '{$telephone}'     WHERE   workNumber = '{$workNumber}' AND '{$telephone}' != ''");
        mysql_query("UPDATE user_teaching_office SET email = '{$email}'               WHERE   workNumber = '{$workNumber}' AND '{$email}' != ''");
        mysql_query("UPDATE user_teaching_office SET password = '******'       WHERE   workNumber = '{$workNumber}' AND '{$password}' != ''");
        jump_success('修改信息成功!', "../html/index.php");
    }
}
//不合法的处理
if ($empty == 1) {
    jump_error('未填写内容,无信息修改!', "../html/teaching_office/teaching_office-information-change.php");
} else {
    if ($password != '' && $repassword != '' && $equal_pwd == 0) {
        jump_error("两次密码输入不一致!", "../html/teaching_office/teaching_office-information-change.php");
    }
}
示例#5
0
 public function actionDelete()
 {
     $id = \Yii::$app->request->get('id');
     $user = new User();
     if ($user->deleteOne($id)) {
         jump_success('删除成功!');
     } else {
         jump_error($user->getFirstError(User::DELETE_EFFOR_INFO));
     }
 }
    if ($password != $repassword) {
        $equal_pwd = 0;
    } else {
        $con = get_db();
        mysql_query("UPDATE user_department_head SET name = '{$name}'               WHERE   workNumber = '{$workNumber}' AND '{$name}' != ''");
        mysql_query("UPDATE user_department_head SET sex = '{$sex}'                 WHERE   workNumber = '{$workNumber}' AND '{$sex}' != ''");
        // mysql_query("UPDATE user_department_head SET birthday = '$birthday'       WHERE   workNumber = '$workNumber' AND '$birthday' != ''");
        mysql_query("UPDATE user_department_head SET department = '{$department}'   WHERE   workNumber = '{$workNumber}' AND '{$department}' != ''");
        mysql_query("UPDATE user_department_head SET telephone = '{$telephone}'     WHERE   workNumber = '{$workNumber}' AND '{$telephone}' != ''");
        mysql_query("UPDATE user_department_head SET email = '{$email}'               WHERE   workNumber = '{$workNumber}' AND '{$email}' != ''");
        mysql_query("UPDATE user_department_head SET password = '******'       WHERE   workNumber = '{$workNumber}' AND '{$password}' != ''");
        if (count($major) > 1) {
            mysql_query("DELETE FROM department_head_majors WHERE workNumber='{$workNumber}'");
            for ($i = 1; $i < count($major); $i++) {
                mysql_query("INSERT INTO  department_head_majors(workNumber,major)  VALUES('{$workNumber}','{$major[$i]}')");
                //echo "专业被选中".$i.":".$major[$i];//显示哪些复选框被选中
            }
        }
        jump_success("修改信息成功!", "../index.php");
    }
}
//不合法的处理
if ($empty == 1) {
    jump_error('未填写内容,无信息修改!', '../html/department_head/department_head-information-change.php');
} else {
    if ($password != '' && $repassword != '' && $equal_pwd == 0) {
        jump_error('两次密码输入不一致!', '../html/department_head/department_head-information-change.php');
    }
}
?>
  
示例#7
0
//判断表格是否未填写
$empty = 0;
//判断两次密码是否一致
$equal_pwd = 1;
if ($name == '' && $sex == '' && $password == '' && $repassword == '' && $birthday == '' && $department == '' && $telephone == '' && $email == '') {
    $empty = 1;
} else {
    if ($password != $repassword) {
        $equal_pwd = 0;
    } else {
        $con = get_db();
        mysql_query("UPDATE user_teacher SET name = '{$name}'               WHERE   workNumber = '{$workNumber}' AND '{$name}' != ''");
        mysql_query("UPDATE user_teacher SET sex = '{$sex}'                 WHERE   workNumber = '{$workNumber}' AND '{$sex}' != ''");
        mysql_query("UPDATE user_teacher SET birthday = '{$birthday}'       WHERE   workNumber = '{$workNumber}' AND '{$birthday}' != ''");
        mysql_query("UPDATE user_teacher SET department = '{$department}'   WHERE   workNumber = '{$workNumber}' AND '{$department}' != ''");
        mysql_query("UPDATE user_teacher SET telephone = '{$telephone}'     WHERE   workNumber = '{$workNumber}' AND '{$telephone}' != ''");
        mysql_query("UPDATE user_teacher SET email = '{$email}'               WHERE   workNumber = '{$workNumber}' AND '{$email}' != ''");
        mysql_query("UPDATE user_teacher SET password = '******'       WHERE   workNumber = '{$workNumber}' AND '{$password}' != ''");
        jump_success('修改信息成功!', '../html/index.php');
    }
}
//不合法的处理
if ($empty == 1) {
    jump_error('未填写内容,无信息修改!');
} else {
    if ($password != '' && $repassword != '' || $equal_pwd == 0) {
        jump_error('两次密码输入不一致!');
    }
}
?>
  
示例#8
0
    }
    if ($jud == 0) {
        jump_error('账号或密码错误!');
    }
}
if ($idf == "department_head") {
    $result = mysql_query("SELECT * FROM user_department_head");
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_array($result)) {
            if ($row['workNumber'] === $name && $row['password'] === $pwd) {
                jump_success("登录成功", '../html/department_head/department_head-index');
            }
        }
    }
    if ($jud == 0) {
        jump_error('账号或密码错误!');
    }
}
if ($idf == "teaching_office") {
    $result = mysql_query("SELECT * FROM user_teaching_office");
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_array($result)) {
            if ($row['workNumber'] === $name && $row['password'] === $pwd) {
                jump_success("登录成功", '../html/teaching_office/teaching_office-index.php');
            }
        }
    }
    if ($jud == 0) {
        jump_error('账号或密码错误!');
    }
}
示例#9
0
require dirname(__DIR__) . '/lib/functions.php';
$workNumber = $_POST["workNumber"];
$name = $_POST["name"];
$password = $_POST["password"];
$jud = $_POST["jud"];
header("Content-type: text/html; charset:utf-8");
$con = get_db();
if ($jud == 'cut') {
    $reque = mysql_query("SELECT * FROM user_teacher WHERE workNumber = '{$workNumber}'");
    $row = mysql_fetch_array($reque);
    //var_dump($row);
    $reque = mysql_query("DELETE FROM user_teacher WHERE workNumber='{$workNumber}' AND password='******'");
    if (!$row[0]) {
        jump_error('不存在该职工号,删除失败');
    } else {
        if ($row[1] != $password) {
            jump_error('密码错误,删除失败');
        } else {
            jump_success('删除成功');
        }
    }
} else {
    if ($jud == 'add') {
        $reque = mysql_query("INSERT INTO  user_teacher(workNumber,name,password)  VALUES('{$workNumber}','{$name}','{$password}')");
        if (!$reque) {
            jump_error('添加失败');
        } else {
            jump_success('添加成功');
        }
    }
}
示例#10
0
<?php

require dirname(__DIR__) . '/lib/functions.php';
?>


<?php 
session_start();
session_destroy();
jump_success("退出成功", '../html/index.php');
示例#11
0
 public function actionRole_child_delete()
 {
     $parent = $child = null;
     $model = new Auth_item_child();
     if (\Yii::$app->request->isGet && ($parent = \Yii::$app->request->get('parent')) && ($child = \Yii::$app->request->get('child'))) {
         $parent = urldecode($parent);
         $child = urldecode($child);
         if ($model->deleteChild($parent, $child)) {
             jump_success(t_arr('app', ['delete', 'success'], '', '!'));
         }
     }
     $error = $model->getFirstError('error') ?: t_arr('app', ['delete', 'fail'], '', '!');
     jump_error($error);
 }