1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
<? session_start(); ?> <? if(( $id == "" ) && ( $sid == "" )) { ?> <script> alert("e¼ö¹ßÁÖ ·Î±×ÀÎ ÈÄ¿¡ À̿밡´ÉÇÕ´Ï´Ù."); location.href = "../onlinecs/intro.php"; </script> <? }
include("../onlinecs/commonST.php"); $idqry = "SELECT loginid FROM customer WHERE loginid ='$nid'"; $idresult = mysql_query($idqry) or die (mysql_error()); if(mysql_num_rows($idresult) > 0){ // Áߺ¹ ?> <script> parent.alert(' »ç¿ëÁßÀÎ ¾ÆÀ̵ð ÀÔ´Ï´Ù.');
</script> <? } else { $saqry = "SELECT compsn FROM customer WHERE compsn ='$sa'"; $saresult = mysql_query($saqry) or die (mysql_error()); if(mysql_num_rows($saresult) > 0){ // Áߺ¹ ?> <script> parent.alert('ÀÌ¹Ì µî·ÏµÈ Áֹεî·Ï¹øÈ£ ¶Ç´Â »ç¾÷ÀÚ¹øÈ£°¡ ÀÖ½À´Ï´Ù'); </script> <? } else { $maxqry ="SELECT LPAD(MAX(CODE), 6, 0) AS maxcode FROM customer"; $maxresult = mysql_query($maxqry) or die (mysql_error()); $maxrow = mysql_fetch_array($maxresult); $maxcode = "$maxrow[maxcode]" + 1; $newmaxcode = str_pad($maxcode,6,"0",STR_PAD_LEFT); //¾ÕÀÚ¸® 0ä¿ì±â 6ÀÚ¸®·Î ±¸¼º
$tqry = "INSERT INTO customer ( code, compname, compalias, ceoname, compsn, telno1, fax, hpno, taxmode, status, item, regdate, part, gcode, whatcode, loginid, loginpwd, email, bigo) VALUES ( '$newmaxcode','$cname', '$cnick', '$name', '$sa', '$tel', '$fax', '$hp', '1', '$upte', '$jong', '$date', '1', '1', '1', '$nid', '$npw', '$email', '$bigo') "; mysql_query($tqry); echo $tqry; ?> <script> parent.alert('½Å±Ô°Å·¡Ã³ µî·ÏÀÌ ¿Ï·á µÇ¾ú½À´Ï´Ù.'); parent.location.href = "../onlinecs/newadd.php"; </script> <?
}
}
?>
|