/home/bjcompany/domains/benjabhorn.com/public_html/benjabhorn_group/form/form_estimate.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<?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`  ) "
                        
." 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']."' , '2' ) ";
                            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">
      <p align="center"> <span class="txt-project"><img src="../images/icon/icon_registration.jpg" alt="" width="67" height="67" /><strong>กรุณากรอกข้อมูลในแบบฟอร์มด้านล่าง เพื่อคำนวณงบประมาณและวงเงินสินเชื่อค่ะ</strong></span></p>
      <p class="L25 txt10">&nbsp;</p>
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="3">
        <tr>
          <td height="30" colspan="2" align="left" valign="top" class="line txt11-blue"><strong><img src="../images/icon/icon_system_manager.png" width="50" height="50">ข้อมูลสำหรับติดต่อ</strong></td>
          <td height="30" colspan="2"align="left" class="txt11-blue line"><strong><img src="../images/icon/Invoice.png" width="32" height="32">รายละเอียดเพื่อคำนวณวงเงินสินเชื่อ</strong></td>
        </tr>
        <tr>
          <td height="26" align="right" valign="top"><input type="hidden" name="action" id="action"></td>
          <td height="26" align="left" valign="top">&nbsp;</td>
          <td width="108" height="26" align="right" valign="top">&nbsp;</td>
          <td width="296" height="26" align="left" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td width="197" height="30" align="right" valign="top"><strong>ชื่อ-นามสกุล</strong></td>
          <td width="297" height="30" align="left" valign="top"><input name="name_sname" type="text" id="name_sname" size="40"/>
          **</td>
          <td height="30" align="right" valign="top"><strong>อาชีพ</strong></td>
          <td height="30" align="left" valign="top"><input name="Career" type="text" id="Career" size="40"/></td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>E-mail</strong></td>
          <td height="30" align="left" valign="top"><input name="email" type="text" id="email" size="40"/>
          **</td>
          <td height="30" align="right" valign="top"><strong>รายได้ต่อเดือน</strong></td>
          <td height="30" align="left" valign="top"><input name="income" type="text" id="income" size="40"/>
  &nbsp; บาท</td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>โทรศัพท์มือถือ</strong></td>
          <td height="30" align="left" valign="top"><input name="telephone" type="text" id="telephone" size="40"/>
          **</td>
          <td height="30" align="right" valign="top"><strong>ภาระหนี้ต่อเดือน</strong></td>
          <td height="30" align="left" valign="top"><input name="dept_per_month" type="text" id="dept_per_month" size="40"/>
  &nbsp; บาท</td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>ที่อยู่ปัจจุบัน</strong></td>
          <td height="30" align="left" valign="top"><textarea name="address" cols="40" rows="5" id="address"></textarea></td>
          <td height="30" align="right" valign="top"><strong>จำนวนปีที่กู้</strong></td>
          <td height="30" align="left" valign="top"><input name="year_to_loan" type="text" id="year_to_loan" size="40"/>
  &nbsp; ปี</td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>ท่านรู้จักเราจากสื่อใด</strong></td>
          <td height="30" colspan="3" 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" valign="top"><strong>ท่านต้องการรับข่าวสารโดยวิธี</strong></td>
          <td height="30" colspan="3" 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>
          <td align="left" valign="top">&nbsp;</td>
          <td align="left" valign="top">&nbsp;</td>
        </tr>
      </table>
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="3">

        <tr>
          <td height="30" colspan="2" align="left" valign="top" class="line txt11-blue"><strong><img src="../images/icon/icon_registration (1).png" width="50" height="50" align="absbottom">รายละเอียดเกี่ยวกับบ้าน</strong></td>
        </tr>
        <tr>
          <td width="257" height="26" align="right" valign="top">&nbsp;</td>
          <td width="257" height="26" align="left" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>ความต้องการซื้อที่อยู่อาศัยใหม่</strong> </td>
          <td height="30" align="left" valign="top"><table width="352" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td width="22"><input name="buy_new" type="radio" value="1" /></td>
                  <td width="115">มีความต้องการ</td>
                  <td width="20"><input name="buy_new" type="radio" value="0" /></td>
                  <td width="195">ไม่มี ซื้อแล้ว</td>
                </tr>
              </tbody>
          </table></td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>ต้องการซื้อบ้านภายใน</strong> </td>
          <td height="30" align="left" valign="top">
          <select name="buy_in" id="buy_in">
            <option value="">โปรดเลือก</option>
            <option value="1 เดือน">1 เดือน</option>
            <option value="3 เดือน">3 เดือน</option>
            <option value="6 เดือน">6 เดือน</option>
            <option value="1 ปี">1 ปี</option>
            <option value="2 ปี">2 ปี</option>
          </select>          </td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>ประเภทที่อยู่อาศัย</strong></td>
          <td height="30" align="left" valign="top"><table width="589" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td width="20"><input name="buy_single_hone" type="checkbox" id="buy_single_hone" value="1" /></td>
                  <td width="89">บ้านเดี่ยว</td>
                  <td width="20"><input name="buy_twin_home" type="checkbox" id="buy_twin_home" value="1" /></td>
                  <td width="85">บ้านแฝด</td>
                  <td width="20"><input name="buy_town_house" type="checkbox" id="buy_town_house" value="1" /></td>
                  <td width="95">ทาวน์เฮาส์</td>
                  <td width="20"><input name="buy_commercial_house" type="checkbox" id="buy_commercial_house" value="1" /></td>
                  <td width="110">อาคารพาณิชย์</td>
                  <td width="30"><input name="buy_condo" type="checkbox" id="buy_condo" value="1" /></td>
                  <td width="100">คอนโดมิเนียม</td>
                </tr>
              </tbody>
          </table></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ราคาบ้าน</strong></td>
          <td height="30" align="left" valign="top">
          
          <select name="price" id="price">
    <option value="">โปรดเลือก</option>
    <option value="&lt; 1,000,000">&lt; 1,000,000</option>
    <option value="1,000,000 – 1,500,000">1,000,000 – 1,500,000</option>
    <option value="1,500,001 – 2,000,000">1,500,001 – 2,000,000</option>
    <option value="2,000,001 – 3,000,000">2,000,001 – 3,000,000</option>
    <option value="3,000,001 – 5,000,000">3,000,001 – 5,000,000</option>
    <option value="5,000,001 – 7,000,000">5,000,001 – 7,000,000</option>
    <option value="7,000,001 – 10,000,000">7,000,001 – 10,000,000</option>
    <option value="&gt; 10,000,000">&gt; 10,000,000</option>
          </select></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>เงินผ่อนต่องวด</strong></td>
          <td height="30" align="left" valign="top"><select name="Installments" id="Installments">
            <option value="">โปรดเลือก</option>
            <option value="&lt; 7,000">&lt; 7,000</option>
            <option value="7,000 – 14,999">7,000 – 14,999</option>
            <option value="15,000 – 20,999">15,000 – 20,999</option>
            <option value="21,000 – 28,999">21,000 – 28,999</option>
            <option value="29,000 – 34,999">29,000 – 34,999</option>
            <option value="35,000 – 48,999">35,000 – 48,999</option>
            <option value="49,000 – 69,999">49,000 – 69,999</option>
            <option value="70,000 ขึ้นไป">70,000 ขึ้นไป</option>
          </select>          </td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ทำเลที่สนใจ</strong></td>
          <td height="30" align="left" valign="top"><select name="location" id="location">
              <option value="" selected>โปรดเลือก</option>
              <?php while($data=mysql_fetch_assoc($resultLocation)){ ?>
              <option value="<?php echo $data['location_name']?>"><?php echo $data['location_name']?></option>
             <?php ?>
              <option>อื่นๆ</option>
          </select></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>โครงการที่สนใจ</strong></td>
          <td height="30" align="left" valign="top">
          <select name="project_interest" id="project_interest">
              <option value="" selected>โปรดเลือก</option>
                           <?php while($data=mysql_fetch_assoc($resultProject)){ ?>
              <option value="<?php echo $data['project_name']?>"><?php echo $data['project_name']?></option>
             <?php ?>
          </select></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ขนาดพื้นที่ใช้สอย /
            ห้องที่ต้องการ</strong></td>
          <td height="30" align="left" valign="top">
          <select name="need_area_room" id="need_area_room">
            <option value="">โปรดเลือก</option>
            <option value="&lt;25 sq.m">&lt;25 sq.m</option>
            <option value="26-30 sq.m">26-30 sq.m</option>
            <option value="31-40 sq.m">31-40 sq.m</option>
            <option value="41-55 sq.m">41-55 sq.m</option>
            <option value="56-70 sq.m">56-70 sq.m</option>
            <option value="71-80 sq.m">71-80 sq.m</option>
            <option value="81-100 sq.m">81-100 sq.m</option>
            <option value="101-120 sq.m">101-120 sq.m</option>
            <option value="121-160 sq.m">121-160 sq.m</option>
            <option value="161-200 sq.m">161-200 sq.m</option>
            <option value="&gt;200 sq.m">&gt;200 sq.m</option>
          </select>          </td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ทำเลที่ตั้งที่ทำงาน</strong></td>
          <td height="30" align="left" valign="top"><input name="buyer_work_location" type="text" id="buyer_work_location" size="40"/></td>
        </tr>
        <tr>
          <td height="30" align="right"><strong>ชื่อสถานที่ทำงาน</strong></td>
          <td height="30" align="left" valign="top"><input name="buyer_work_name" type="text" id="buyer_work_name" size="40"/></td>
        </tr>
        <tr>
          <td height="30" align="right" valign="top"><strong>อบถามเพิ่มเติม /
            คำแนะนำอื่นๆ</strong></td>
          <td height="30" align="left" valign="top"><textarea name="buy_note" cols="40" rows="5" id="buy_note"></textarea></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>