| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <?php
- include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
- include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
- $mp = "00"; //set top nav
- ?>
- <? include("../inc/inc_top.php") ?>
- <? include("../inc/inc_header.php") ?>
- <?
- $sql ="SELECT
- cd_seq, cd_userid , nm_name ,nm_pass , ds_level , ds_open
- , nm_info1, nm_info2, nm_info3, ds_company_bp, ds_branch, dt_insert, nm_insert, dt_update, nm_update, ds_delind
- , auth1, auth2, auth3, auth4, auth5, auth6, auth7, auth8, auth9
- , ds_alimtalk
- FROM admin_info
- WHERE cd_userid='$cd_userid' AND ds_delind='N'";
- $mode = "Insert";
- $col=mysql_fetch_array(mysql_query($sql));
- if (!empty($col['cd_userid'])){
- $cd_seq = $col['cd_seq'];
- $cd_userid = $col['cd_userid'];
- $nm_name = $col['nm_name'];
- $nm_pass = $col['nm_pass'];
- $ds_level = $col['ds_level'];
- $ds_open = $col['ds_open'];
- $nm_info1 = $col['nm_info1'];
- $nm_info2 = $col['nm_info2'];
- $nm_info3 = $col['nm_info3'];
- $ds_company_bp = $col['ds_company_bp'];
- $ds_branch = $col['ds_branch'];
- $auth1 = $col['auth1'];
- $auth2 = $col['auth2'];
- $auth3 = $col['auth3'];
- $auth4 = $col['auth4'];
- $auth5 = $col['auth5'];
- $auth6 = $col['auth6'];
- $auth7 = $col['auth7'];
- $auth8 = $col['auth8'];
- $auth9 = $col['auth9'];
- $ds_alimtalk = $col['ds_alimtalk'];
- $arr_nm_info1 = explode("-",$nm_info1);
- if(count($arr_nm_info1) == 3){
- $nm_info11 = $arr_nm_info1[0];
- $nm_info12 = $arr_nm_info1[1];
- $nm_info13 = $arr_nm_info1[2];
- }else{
- $nm_info11 = "";
- $nm_info12 = "";
- $nm_info13 = "";
- }
- $arr_nm_info3 = explode("@",$nm_info3);
- if(count($arr_nm_info3) == 2){
- $nm_info31 = $arr_nm_info3[0];
- $nm_info32 = $arr_nm_info3[1];
- }else{
- $nm_info31 = "";
- $nm_info32 = "";
- }
- $nm_info3 = $col['nm_info3'];
- $mode = "Update";
- }else{
- $ds_level = "1";
- }
- $totalrows = @mysql_result(mysql_query("select count(*) from admin_info WHERE ds_delind='N'"),0,0);
- ?>
- <section id="contents">
- <h2>관리자 관리</h2>
- <h3><em>▶</em> 관리자 수정</h3>
- <form id="frmMember" name="frmMember" method="post" action="<?=ADMIN_PATH?>admin/admin_proc.php">
- <input type="hidden" name="mode" id="mode" value="Update"/>
- <input type="hidden" name="validate" id="validate" value=""/>
- <input type="hidden" name="ds_level" id="ds_level" value="1"/>
- <input type="hidden" name="ds_open" id="ds_open" value="Y"/>
- <input type="hidden" name="nm_info1" id="nm_info1" value=""/>
- <input type="hidden" name="nm_info3" id="nm_info3" value=""/>
- <div class="tbl_wrap">
- <table class="tbl_list2">
- <colgroup>
- <col width="13%">
- <col width="*">
- </colgroup>
- <tr>
- <th>아이디</th>
- <td><input type="text" class="inp_txt" style="width:40%;" name="cd_userid" id="cd_userid" maxlength="20" value="<?=$cd_userid?>"<? if($mode=="Update"){?> readonly<?}?>></td>
- </tr>
- <tr>
- <th>비밀번호</th>
- <td><input type="password" class="inp_txt" style="width:40%;" name="nm_pass" id="nm_pass" maxlength="20"></td>
- </tr>
- <tr>
- <th>이름</th>
- <td><input type="text" class="inp_txt" style="width:40%;" name="nm_name" id="nm_name" maxlength="20" value="<?=$nm_name?>"></td>
- </tr>
- <tr>
- <th>연락처</th>
- <td>
- <span class="select2" style="margin-right:5px;width:12%;">
- <select name="nm_info11" id="nm_info11"></select>
- </span>
- <input type="text" class="inp_txt" style="width:12%;" name="nm_info12" id="nm_info12" maxlength="4" value="<?=$nm_info12?>"> - <input type="text" class="inp_txt" style="width:12%;" name="nm_info13" id="nm_info13" maxlength="4" value="<?=$nm_info13?>">
- <span class="check_wrap" style='vertical-align: middle;'><input type="checkbox" name="ds_alimtalk" id="ds_alimtalk" value="Y" <?=($ds_alimtalk == "Y" ? "checked" : "" ) ?>><i></i><label for="ds_alimtalk">카톡알림</label></span>
- </td>
- </tr>
- <tr>
- <th>이메일</th>
- <td>
- <input type="text" class="inp_txt" style="margin-right:5px;width:25%;" name="nm_info31" id="nm_info31" value="<?=$nm_info31?>"> @
- <input type="text" class="inp_txt" style="margin-right:5px;width:25%;" name="nm_info32" id="nm_info32" value="<?=$nm_info32?>">
- <span class="select2" style="margin-left:5px;min-width:12%;">
- <select name="nm_info33" id="nm_info33" onChange="sel_1(this.value)"></select>
- </span>
- </td>
- </tr>
- <!-- <tr>
- <th>관계사</th>
- <td>
- <span class="select2" style="margin-right:5px;width:12%;">
- <select name="ds_company_bp" id="ds_company_bp" onchange="chg_ds_branch(this.value)"></select>
- </span>
- </td>
- </tr>
- <tr>
- <th>지점</th>
- <td>
- <span class="select2" style="margin-right:5px;width:12%;">
- <select name="ds_branch" id="ds_branch"></select>
- </span>
- </td>
- </tr> -->
- </table>
- </div>
- <h3><em>▶</em> 권한 설정</h3>
- <div class="box_check">
- <span class="check_wrap"><input type="checkbox" name="btn_authall" id="btn_authall"><i></i><label for="btn_authall">전체</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth1" id="auth1" value="Y"<?= ($auth1 == "Y") ? " checked":"" ?>><i></i><label for="auth1">관리자 관리</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth2" id="auth2" value="Y"<?= ($auth2 == "Y") ? " checked":"" ?>><i></i><label for="auth2">차량관리</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth3" id="auth3" value="Y"<?= ($auth3 == "Y") ? " checked":"" ?>><i></i><label for="auth3">회원관리</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth4" id="auth4" value="Y"<?= ($auth4 == "Y") ? " checked":"" ?>><i></i><label for="auth4">매입관리</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth5" id="auth5" value="Y"<?= ($auth5 == "Y") ? " checked":"" ?>><i></i><label for="auth5">정산관리</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth6" id="auth6" value="Y"<?= ($auth6 == "Y") ? " checked":"" ?>><i></i><label for="auth6">커뮤니티</label></span>
- <span class="check_wrap"><input type="checkbox" name="auth9" id="auth9" value="Y"<?= ($auth9 == "Y") ? " checked":"" ?>><i></i><label for="auth9">사고정보조회</label></span>
- </div>
- </form>
- <div class="btn_right">
- <a href="#" class="rnd_btn ty2 gray" onclick="location.replace('<?=ADMIN_PATH?>admin/admin_list.php?PageNo=<?=$PageNo?>');">목록</a>
- <a class="rnd_btn ty2 black" id="btn_update">저장</a>
- <?
- if($totalrows >1){
- ?>
- <a class="rnd_btn ty2 black" id="btn_delete">삭제</a>
- <?
- }
- ?>
- </div>
- </section>
- <!--tr>
- <td class="view01" height="30">계정사용여부</td>
- <td class="jcon">
- <select name="ds_open" id="ds_open" class="input">
- <option value="" <? if($ds_open ==""){?>selected<?}?>>선택하세요</option>
- <option value="Y" <? if($ds_open =="Y"){?>selected<?}?>>사용중</option>
- <option value="N" <? if($ds_open =="N"){?>selected<?}?>>사용중지</option>
- </select>
- </td>
- </tr-->
- <script language="javascript" type="text/javascript">
- $(document).ready(function() {
- setCodeSelectJqTransForm("listPhone","nm_info11","","","<?=$nm_info11?>","선택하세요","");
- setCodeSelectJqTransForm("listEmail","nm_info33","","","","직접입력","");
- // setCodeSelectJqTransForm("listcode","ds_company_bp", "member_master","ds_company_bp","<?=$ds_company_bp?>","선택하세요","");
- <? if (!empty($ds_branch)){ ?>
- // setCodeSelectJqTransForm("listcode","ds_branch", "member_master","ds_branch","<?=$ds_branch?>","선택하세요","<?=$ds_company_bp?>");
- <? } ?>
- $("#btn_delete").bind("click",function(){
- var custom_opts = {
- title : '정말로 삭제 하시겠습니까?',
- btn_close_show : false,
- }
- custom_modal_confirm(custom_opts, function(confirm) {
- if(confirm) {
- $("#mode").val("Delete");
- $("#btn_delete").hide();
- var data = $("#frmMember").serialize();
- $.ajax({
- url : 'admin_proc.php',
- type: 'POST',
- dataType : 'json',
- data: data,
- success: function(res) {
- custom_modal_confirm_close();
- $("#btn_delete").show();
- //세션 종료시 로그인 페이지로 이동
- if(res.CODE != "0000") {
- custom_opts.title = res.MSG;
- if(res.CODE == "4444") {
- window.location.href = res.DATAS.URL;
- }
- custom_modal_alert(custom_opts);
- return false;
- }
- custom_opts.title = '관리자가 삭제 되었습니다.';
- custom_opts.event_esc_key = false;
- custom_modal_alert(custom_opts, function() {
- link("<?=ADMIN_PATH?>/admin/admin_list.php");
- });
- },
- error:function(request,status,error){
- $("#btn_delete").show();
- custom_modal_confirm_close();
- alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
- }
- });
- }else {
- $("#btn_delete").show();
- return false;
- }
- });
- });
- $("#btn_update").bind("click",function(){
- var custom_opts = {
- title : '',
- btn_close_show : false,
- }
- var fieldlist = [["cd_userid","아이디"],["nm_name","이름"],["nm_info11","연락처"],["nm_info12","연락처"],["nm_info13","연락처"],["nm_info31","이메일"],["nm_info32","이메일"]]
- if (!fnCheckForm(fieldlist)){
- return false;
- }else{
- /*아이디 관련 처리*/
- // if(!fnCheckAlphaNumber($("#cd_userid").val())){
- // custom_opts.title = '아이디는 영문/숫자 조합으로 이루어져야 합니다.';
- //
- // custom_modal_alert(custom_opts);
- // return false;
- // }
- // if($("#cd_userid").val().length <4){
- // custom_opts.title = '4글자 이상 아이디를 입력하세요.';
- //
- // custom_modal_alert(custom_opts);
- // return false;
- // }
- /*이름 체크*/
- if(!isValid($("#nm_name").val(),"regKorean")){
- custom_opts.title = '이름은 한글만 가능합니다.';
- custom_modal_alert(custom_opts);
- return false;
- }
- /*패스워드 처리*/
- /*
- if($("#nm_pass").val().length > 0){
- if($("cd_userid").val()==$("#nm_pass").val()){
- alert("아이디와 변경할 패스워드를 다르게입력하세요");
- $("#nm_pass").focus();
- return false;
- }
- if($("#nm_pass").val()!=$("#nm_pass_2").val()){
- alert("입력하신 변경할 패스워드가 일치하지 않습니다.");
- $("#nm_pass").focus();
- return false;
- }
- if(!fnCheckAlphaNumber($("#nm_pass").val())){
- alert('변경할 패스워드는 영문/숫자 조합으로 이루어져야 합니다.');
- return false
- }
- if($("#nm_pass").val().length <6){
- alert("6글자 이상 변경할 패스워드를 입력하세요");
- $("#nm_pass").focus();
- return false;
- }
- }
- */
- /*연락처*/
- $("#nm_info1").val($("#nm_info11").val()+"-"+$("#nm_info12").val()+"-"+$("#nm_info13").val());
- /*이메일 체크*/
- $("#nm_info3").val($("#nm_info31").val()+"@"+$("#nm_info32").val());
- if(!isValid($("#nm_info3").val(),"regEmail")){
- custom_opts.title = '정확한 이메일을 입력하세요.';
- custom_modal_alert(custom_opts);
- return false;
- }
- custom_opts.title = '정보를 수정하시겠습니까?';
- custom_modal_confirm(custom_opts, function(confirm) {
- if(confirm) {
- $("#btn_update").hide();
- var data = $("#frmMember").serialize();
- $.ajax({
- url : 'admin_proc.php',
- type: 'POST',
- dataType : 'json',
- data: data,
- success: function(res) {
- custom_modal_confirm_close();
- $("#btn_update").show();
- //세션 종료시 로그인 페이지로 이동
- if(res.CODE != "0000") {
- custom_opts.title = res.MSG;
- if(res.CODE == "4444") {
- window.location.href = res.DATAS.URL;
- }
- custom_modal_alert(custom_opts);
- return false;
- }
- custom_opts.title = '관리자 수정이 완료되었습니다.';
- custom_opts.event_esc_key = false;
- custom_modal_alert(custom_opts, function() {
- reload();
- });
- },
- error:function(request,status,error){
- $("#btn_update").show();
- custom_modal_confirm_close();
- alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
- }
- });
- }else {
- $("#btn_update").show();
- return false;
- }
- });
- // var c=confirm("정보를 수정하시겠습니까?");
- // if(c){
- // $("#btn_update").hide();
- // $("#frmMember").submit();
- // }else{
- // $("#btn_update").show();
- // return false;
- // }
- }
- });
- $("#btn_authall").bind("click",function(){
- var checked = $(this).prop("checked");
- $("#auth1").prop('checked', checked);
- $("#auth2").prop('checked', checked);
- $("#auth3").prop('checked', checked);
- $("#auth4").prop('checked', checked);
- $("#auth5").prop('checked', checked);
- $("#auth6").prop('checked', checked);
- $("#auth9").prop('checked', checked);
- });
- });
- </script>
- <script language="javascript">
- <!--
- function chg_ds_branch(val) {
- if($.trim(val) == "") {
- val = "-1";
- }
- setCodeSelectJqTransForm("listcode","ds_branch", "member_master","ds_branch","<?=$ds_branch?>","선택하세요",val);
- }
- function sel_1(sltObj)
- {
- document.getElementById("nm_info32").value = sltObj;
- if (sltObj == "")
- {
- document.getElementById("nm_info32").readOnly = false;
- }else{
- document.getElementById("nm_info32").readOnly = true;
- }
- }
- //-->
- </script>
- <? include("../inc/inc_footer.php") ?>
- <? include("../inc/inc_bottom.php") ?>
- <?
- mysql_close($connect);
- ?>
|