/home/bjcompany/domains/benjabhorn.com/public_html/BJconcrete/control/member_export.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
<?php
            
require_once("config.inc.php");
            require(
"function.inc.php");
            
$link mysql_connect($cfgServers['host'],$cfgServers['stduser'],$cfgServers['stdpass'])or die("Can't connect Server");
            
mysql_select_db($cfgServers['selectdb']) or die("Can't connect databases");
$query="SELECT * FROM tbl_member_data ORDER BY id DESC  "
$result=mysql_query($query);

header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename="memberList.xls"');#ชื่อไฟล์


?>

<html xmlns:o="urn:schemas-microsoft-com:office:office"

xmlns:x="urn:schemas-microsoft-com:office:excel"

xmlns="http://www.w3.org/TR/REC-html40">

<HTML>

<HEAD>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</HEAD><BODY>

<table width="100%"   x:str BORDER="1" cellspacing="0" cellpadding="0">
      <tr class="txt10-black">
        <td width="22%" height="25" align="center" nowrap="nowrap">ชื่อ-นามสกุล</td>
        <td width="12%" align="center" nowrap="nowrap">วันเดือนปีเกิด</td>
        <td width="16%" align="center" nowrap="nowrap">เลขบัตรประชาชน</td>
        <td width="15%" align="center" nowrap="nowrap">โทรศัพท์</td>
        <td width="13%" align="center" nowrap="nowrap">อีเมล์</td>
        <td width="15%" align="center" nowrap="nowrap">วันที่สมัคร</td>
      </tr>
      <?php while($data=mysql_fetch_assoc($result)){ ?>
      <tr class="txt10-black">
        <td nowrap="nowrap">&nbsp;<?php echo $data['name']?> <?php echo $data['sname']?></td>
        <td nowrap="nowrap"><?php GetThaiDate($data['birthDay'])?></td>
        <td nowrap="nowrap"><?php echo $data['id_card_number']?></td>
        <td nowrap="nowrap">&nbsp;<?php echo $data['telephone']?></td>
        <td nowrap="nowrap">&nbsp;<?php echo $data['email']?></td>
        <td nowrap="nowrap">&nbsp;<?php GetThaiDateTime($data['date_register'])?></td>
      </tr>
      <?php ?>
    </table>
</BODY>

</html>