File name: addrbook/adminsert.wel (1,922 bytes) Text file viewer v1.2
    1 : #!/bin/wel
    2 : 
    3 : /* file: adminsert.wel
    4 : 
    5 :    주소록 사용자 등록 프로그램 (author: 서광현)
    6 : 
    7 :    Copyright (c) 2001/02/22 by Wesoft
    8 :    All Rights Reserved.
    9 : */
   10 : 
   11 : htmlquery("GET");
   12 : htmlquery("POST");
   13 : include("common.inc");
   14 : if(mysql_connection()==MYSQL_ERR) return;
   15 : login= 0, admin= 1; // 로긴 상태가 아니며 관리자 메뉴 사용가능
   16 : if(include("chkuser.sub")!=OK) return disconnect();
   17 : 
   18 : if(writeflag!=1)
   19 :  {
   20 :     pagerec= 10;
   21 :     fm= formdump("form/adminsert.fom");
   22 :     if(fm==FORM_OPENERR) return err_form("adminsert.fom");
   23 :     return disconnect();
   24 : }
   25 : 
   26 : id= strchange(tolower(left(id,12)), fch~"| ", rch~"|");
   27 : recnt= get_recount(mysql, myustable, "id='" ~ id ~ "'");
   28 : if(recnt>0)
   29 :  {
   30 :     MSG1= "ID 중복 등록 오류";
   31 :     MSG2= "주소록 ID: " ~ id ~ " 는 이미 등록되어 있습니다!" ~ BACK_BUTTON;
   32 :     formdump(message_form);
   33 :     return disconnect();
   34 :  }
   35 : 
   36 : wdtime= date(1) ~ " " ~ left(time(1),5);
   37 : pass= encode(tolower(left(pass,12)), encodekey(), "", decode_variable);
   38 : title= strchange(lrtrim(title), fch, rch);
   39 : name= strchange(lrtrim(name), fch, rch);
   40 : phone= strchange(lrtrim(phone), fch, rch);
   41 : hdphone= strchange(lrtrim(hdphone), fch, rch);
   42 : email= strchange(lrtrim(email), fch, rch);
   43 : 
   44 : qstr= "insert into " ~ myustable
   45 :     ~ " (wdtime,id,pass,title,class,kind,useflag,name,phone,hdphone,email,pagerec) "
   46 :     ~ strform("values('{$wdtime}','{$id}','{$pass}','{$title}','U','{$kind}',",
   47 :               "'{$useflag}','{$name}','{$phone}','{$hdphone}','{$email}','{$rpp}')");
   48 : 
   49 : if(mysql_query(mysql, qstr)==MYSQL_ERR) return err_query();
   50 : 
   51 : include("adminsert.sub");
   52 : if(mysql_query(mysql, create_addrtable)==MYSQL_ERR)
   53 :  {
   54 :     MSG1= "주소록 ID: " ~ id ~ " 테이블 생성 오류";
   55 :     MSG2= "주소록 ID: " ~ id ~ " 테이블을 생성할 수 없습니다!" ~ BACK_BUTTON;
   56 :     formdump(message_form);
   57 :     return disconnect();
   58 :  }
   59 : 
   60 : url= strform("admin.wel?list=w&k={$k}",
   61 :              "&ps={$ps}&pw=1&pS={$pS}&pN={$pN}&pl={$pl}&pr={$pr}");
   62 : replace_location(url);
   63 : return disconnect();
File name: addrbook/adminsert.wel (1,922 bytes) Wesoft Corp. ⓒ 2001 All rights reserved.