/home/bjcompany/domains/benjabhorn.com/public_html/benjabhorn_group/form/form_register.php


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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php include("../phpconfig.php")?>
<?php 
        
if($_POST['action']=='Add'){
                        
$_POST['date_regis']=date("Y-m-d H:i:s");
                        
$query="INSERT INTO`tbl_member` "
                        
." (`id` ,`name_sname` ,`Career` ,`email` ,`income` ,`telephone` ,`dept_per_month` ,`address` ,`year_to_loan` ,`know_web` "
                        
." ,`know_direct` ,`know_newspaper` ,`know_radio` ,`know_brochure` ,`know_other` ,`know_other_note` ,`need_news` "
                        
." ,`need_letter` ,`need_sms` ,`buy_new` ,`buy_in` ,`buy_single_hone` ,`buy_twin_home` ,`buy_town_house`  "
                        
." ,`buy_commercial_house` ,`buy_condo` ,`price` ,`Installments` ,`location` ,`project_interest` ,`need_area_room` "
                        
.",`buyer_work_location` ,`buyer_work_name` ,`buy_note` ,`date_regis`, `registerType`,`password`  ) "
                        
." VALUES "
                        
." ( '' , '".$_POST['name_sname']."',  '".$_POST['Career']."' ,  '".$_POST['email']."'  , '".$_POST['income']."' ,  '".$_POST['telephone']."' , '".$_POST['dept_per_month']."'  ,  '".$_POST['address']."',    '".$_POST['year_to_loan']."' ,  '".$_POST['know_web']."' "
                        
." ,  '".$_POST['know_direct']."',  '".$_POST['know_newspaper']."' ,  '".$_POST['know_radio']."'  , '".$_POST['know_brochure']."' ,  '".$_POST['know_other']."' , '".$_POST['know_other_note']."'  ,  '".$_POST['need_news']."' "
                        
." ,  '".$_POST['need_letter']."',  '".$_POST['need_sms']."' ,  '".$_POST['buy_new']."'  , '".$_POST['buy_in']."' ,  '".$_POST['buy_single_hone']."' , '".$_POST['buy_twin_home']."'  ,  '".$_POST['buy_town_house']."' "
                            
." ,  '".$_POST['buy_commercial_house']."',  '".$_POST['buy_condo']."' ,  '".$_POST['price']."'  , '".$_POST['Installments']."' ,  '".$_POST['location']."' , '".$_POST['project_interest']."'  ,  '".$_POST['need_area_room']."' "
                            
." ,  '".$_POST['buyer_work_location']."',  '".$_POST['buyer_work_name']."' ,  '".$_POST['buy_note']."'  , '".$_POST['date_regis']."' , '1' ,  '".$_POST['password']."') ";
                            if(
mysql_query($query)){ ?>
                                        <script language="javascript">
                                                alert('ขอบคุณค่ะ ท่านได้สมัครสมาชิกเรียบร้อยแล้ว \r \n')    ;
                                                 window.top.location.href='../index.php';
                                        </script>
                                <?php }
            }

        
//--------------------select location &&& project------------------------//
        
$query="SELECT * FROM `tbl_project` ORDER BY  project_name ASC ";
        
$resultProject=mysql_query($query);
        
        
$query="SELECT * FROM `tbl_location` ORDER BY  location_name ASC ";
        
$resultLocation=mysql_query($query);        
?><!DOCTYPE html>
<html>
  <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="jquery.uniform.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
      $(function(){
        $("input, textarea, select, button").uniform();
      });
    </script>
    <link rel="stylesheet" href="css/uniform.default.css" type="text/css" media="screen">
    <style type="text/css" media="screen">
      body {
        padding: 0px;
      }
      h1 {
        margin-top: 0;
      }
      ul {
        list-style: none;
        padding: 0;
        margin: 0;
      }
      li {
        margin-bottom: 20px;
        clear: both;
      }
      label {
        font-size: 10px;
        font-weight: bold;
        text-transform: uppercase;
        display: block;
        margin-bottom: 3px;
        clear: both;
      }
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
}
    </style>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <link href="../style.css" rel="stylesheet" type="text/css">
  <script language="javascript">
         function checkForm(){
                    if(document.form1.name_sname.value==''){
                                alert('กรุณาใส่ชื่อ-นามสกุล')    ;
                                return false;
                        }else if(document.form1.email.value==''){
                                alert('กรุณาใส่อีเมล์')    ;
                                return false;
                        }else if(document.form1.telephone.value==''){
                                alert('กรุณาใส่หมายเลขโทรศัพท์มือถือ')    ;
                                return false;
                        }else {
                                document.form1.action.value='Add';
                            }
            }
   </script>
</head>
  <body>
  <form action="<?php $_SERVER['PHP_SELF']?>" method="post" name="form1" onSubmit="return checkForm()">
    <div align="center" class="drop-shadow curved curved-hz-2">
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="3">
        <tr>
          <td height="30" colspan="2" align="center" valign="top" class="line txt-project"><img src="../images/icon/icon_registration.jpg" alt="" width="67" height="67" align="absbottom" /><strong>กรุณากรอกข้อมูลในแบบฟอร์มด้านล่าง เพื่อสมัครสมาชิกค่ะ</strong></td>
        </tr>
        <tr>
          <td width="337" height="26" align="right" valign="top"><input type="hidden" name="action" id="action"></td>
          <td height="26" align="left" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ชื่อ-นามสกุล</strong></td>
          <td width="572" height="30" align="left" valign="top"><input name="name_sname" type="text" id="name_sname" size="40"/></td>
        </tr>
        <tr>
          <td height="13" align="right"><strong>E-mail</strong></td>
          <td height="13" align="left" valign="top"><input name="email" type="text" id="email" size="40"/></td>
        </tr>
        <tr>
          <td height="14" align="right"><strong>Password</strong></td>
          <td height="14" align="left" valign="top"><input name="password" type="text" id="password" size="40"/></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>โทรศัพท์มือถือ</strong></td>
          <td height="30" align="left" valign="top"><input name="telephone" type="text" id="telephone" size="40"/></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ที่อยู่ปัจจุบัน</strong></td>
          <td height="30" align="left" valign="top"><textarea name="address" cols="40" rows="5" id="address"></textarea></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ท่านรู้จักเราจากสื่อใด</strong></td>
          <td height="30" align="left" valign="top"><table width="311" border="0" cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td width="24"><input name="know_web" type="checkbox" id="know_web" value="1" /></td>
                <td width="90">เว็บไซต์</td>
                <td width="23"><input name="know_direct" type="checkbox" id="know_direct" value="1" /></td>
                <td width="101">มีผู้แนะนำ</td>
                <td width="20"><input name="know_newspaper" type="checkbox" id="know_newspaper" value="1" /></td>
                <td width="194">หนังสือพิมพ์</td>
              </tr>
              <tr>
                <td><input name="know_radio" type="checkbox" id="know_radio" value="1" /></td>
                <td>วิทยุ</td>
                <td><input name="know_brochure" type="checkbox" id="know_brochure" value="1" /></td>
                <td>แผ่นพับ</td>
                <td><input name="know_other" type="checkbox" id="know_other" value="1" /></td>
                <td>อื่น ๆ </td>
              </tr>
            </tbody>
          </table></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ท่านต้องการรับข่าวสารโดยวิธี</strong></td>
          <td height="30" align="left" valign="top"><table width="304" border="0" cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td width="26"><input name="need_news" type="checkbox" id="need_news" value="1" /></td>
                <td width="87">อีเมล์</td>
                <td width="22"><input name="need_letter" type="checkbox" id="need_letter" value="1" /></td>
                <td width="103">จดหมาย</td>
                <td width="24"><input name="need_sms" type="checkbox" id="need_sms" value="1" /></td>
                <td width="77">SMS</td>
              </tr>
            </tbody>
          </table></td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top">&nbsp;</td>
          <td height="30" align="left" valign="top">&nbsp;</td>
        </tr>
      </table>
      <p align="center">
        <input type="submit" />
      </p>
    </div>
    </form>
</body>
</html>