137 lines
4.4 KiB
PHP
137 lines
4.4 KiB
PHP
|
|
<?php
|
||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/session.php");
|
||
|
|
if(!isset($_SESSION["level"]) || $_SESSION["level"]>5) {
|
||
|
|
sleep(1);
|
||
|
|
header("Location:" . $WebSite . "login/login_form.php");
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
ini_set('display_errors', 1);
|
||
|
|
ini_set('display_startup_errors', 1);
|
||
|
|
error_reporting(E_ALL);
|
||
|
|
|
||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
|
||
|
|
|
||
|
|
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
|
||
|
|
$num = isset($_REQUEST["num"]) ? $_REQUEST["num"] : "";
|
||
|
|
$id = isset($_REQUEST["id"]) ? $_REQUEST["id"] : "";
|
||
|
|
$tablename = isset($_REQUEST["tablename"]) ? $_REQUEST["tablename"] : "";
|
||
|
|
|
||
|
|
$title_message = "사용자 정보수정" ;
|
||
|
|
|
||
|
|
?>
|
||
|
|
<title> <?=$title_message?> </title>
|
||
|
|
|
||
|
|
<?
|
||
|
|
if($_SESSION["division"] == '경동')
|
||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/myheader.php';
|
||
|
|
else
|
||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/myheader1.php';
|
||
|
|
?>
|
||
|
|
|
||
|
|
</head>
|
||
|
|
<?
|
||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/mymodal.php';
|
||
|
|
|
||
|
|
// 첨부 이미지에 대한 부분
|
||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
|
||
|
|
$pdo = db_connect();
|
||
|
|
|
||
|
|
try{
|
||
|
|
$sql="select * from " . $DB . ".member where id=?";
|
||
|
|
$stmh=$pdo->prepare($sql);
|
||
|
|
$stmh->bindValue(1,$id,PDO::PARAM_STR);
|
||
|
|
$stmh->execute();
|
||
|
|
$count=$stmh->rowCount();
|
||
|
|
} catch (PDOException $Exception) {
|
||
|
|
print "오류: ".$Exception->getMessage();
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if($count<1) {
|
||
|
|
print "검색결과가 없습니다.<br>";
|
||
|
|
} else {
|
||
|
|
$row=$stmh->fetch(PDO::FETCH_ASSOC);
|
||
|
|
$id=$row["id"];
|
||
|
|
$name=$row["name"];
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
|
||
|
|
<body >
|
||
|
|
<div class="container-fluid">
|
||
|
|
<div class="d-flex mt-5 mb-5 justify-content-center">
|
||
|
|
<div class="card align-middle justify-content-center align-items-center" style="width:25rem; border-radius:20px;">
|
||
|
|
<div class="card-title" style="margin-top:30px;">
|
||
|
|
<h3 class="card-title text-center" style="color:#113366;"> 사용자 정보 수정 </h3>
|
||
|
|
</div>
|
||
|
|
<div class="card-body">
|
||
|
|
<form class="form-signin" name="member_form" method="get" action="../member/updatePro.php?id=<?=$id?>">
|
||
|
|
<h5 class="form-signin-heading">수정할 비밀번호를 입력하세요</h5>
|
||
|
|
<h4 class="form-signin-heading">사용자 ID : <?=$id?> </h4>
|
||
|
|
<h4 class="form-signin-heading">사용자 이름 : <?=$name?> </h4>
|
||
|
|
<label for="inputPassword" class="sr-only">수정할 Password </label>
|
||
|
|
<input type="password" name="pass" class="form-control" placeholder="수정할 Password" required autofocus ><br>
|
||
|
|
<label for="inputPassword" class="sr-only"> Password 확인 </label>
|
||
|
|
<input type="password" name="pass_confirm" class="form-control" placeholder="Password 확인" required><br>
|
||
|
|
|
||
|
|
<input type="hidden" id="id" name="id" value="<?=$id?>" size="5" >
|
||
|
|
<input type="hidden" id="name" name="name" value="<?=$name?>" size="5" >
|
||
|
|
<!-- <div class="checkbox">
|
||
|
|
<label>
|
||
|
|
<input type="checkbox" value="remember-me"> 기억하기
|
||
|
|
</label>
|
||
|
|
</div> -->
|
||
|
|
<button type="button" id="btn-Yes" class="form-control mt-2 mb-2 btn btn-primary btn-block" onclick="check_input();"> 정보수정 완료</button>
|
||
|
|
<button type="button" class="form-control btn btn-secondary btn-block " onclick="history.back(-1);"> 이전화면으로 돌아가기 </button>
|
||
|
|
</form>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
function check_id()
|
||
|
|
{
|
||
|
|
window.open("check_id.php?id="+document.member_form.id.value,"IDcheck","left=200, top=200,width=250,height=80,scrollbars=no, resizable=yes");
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_nick()
|
||
|
|
{
|
||
|
|
window.open("check_nick.php?nick="+document.member_form.nick.value,"NICKcheck", "left=200,top=200,width=250,height=80, scrollbars=no, resizable=yes");
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_input()
|
||
|
|
{
|
||
|
|
if(document.member_form.pass.value == '' )
|
||
|
|
{
|
||
|
|
alert("수정할password가 비어있습니다. \n다시 입력해주세요.");
|
||
|
|
document.member_form.pass.focus();
|
||
|
|
document.member_form.pass.select();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(document.member_form.pass.value != document.member_form.pass_confirm.value)
|
||
|
|
{
|
||
|
|
alert("비밀번호가 일치하지 않습니다.\n다시 입력해주세요.");
|
||
|
|
document.member_form.pass.focus();
|
||
|
|
document.member_form.pass.select();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
document.member_form.submit();
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
// 페이지 로딩
|
||
|
|
$(document).ready(function(){
|
||
|
|
var loader = document.getElementById('loadingOverlay');
|
||
|
|
loader.style.display = 'none';
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
|
||
|
|
|
||
|
|
</html>
|