if ($homeAddr['ADDRESS_ALLEY'] != '') { $addr_string .= ' ซ.' . $homeAddr['ADDRESS_ALLEY']; } else { $addr_string .= ' '; } if ($homeAddr['ADDRESS_ROAD'] != '') { $addr_string .= ' ถ.' . $homeAddr['ADDRESS_ROAD']; } else { $addr_string .= ' '; } echo '<br/>'; if ($addr_string != '') { echo $addr_string; echo '<br/>'; } echo get_district_string($homeAddr['ADDRESS_DISTRICT_ID']) . ' ' . get_amphur_string($homeAddr['ADDRESS_AMPHUR_ID']) . ' ' . get_province_string($homeAddr['ADDRESS_PROVINCE_ID']); echo '<br/>'; echo $homeAddr['ADDRESS_ZIPCODE']; echo '<br/>'; echo '<br/>'; // echo get_addr_string($homeAddr); ?> </div> <?php if ($count % 3 == 2) { ?> </div> <?php } $count++; }
<tr> <th><h3>รายการ</h3></th> <th style='text-align:right'><h3>จำนวน</h3></th> </tr> </thead> <tbody> <?php // for ($i = 1; $i < 77; $i++) { // $counts = count_person_by_provice_id($i); // $count = mysql_fetch_row($counts); // if ($count[0] != 0) { // ?> <!-- <tr> <td><h3>//<?php echo get_province_string($i); ?> </h3></td> <td style='text-align:right'><h3><a style="color: white;" onClick="javascript:window.location.assign('view/stat_detail.php?data=//<?php echo $i; ?> &type=province')"><?php echo $count[0]; ?> </a></h3></td> </tr>--> <?php // } // } ?> <?php
$objPHPExcel->getActiveSheet()->setCellValue('AA' . $i, $organization['ORGANIZATIONTYPE_NAME']); $objPHPExcel->getActiveSheet()->setCellValue('AB' . $i, $organization['ORGANIZATION_COMMENT']); $objPHPExcel->getActiveSheet()->setCellValue('AC' . $i, $organization['ORGANIZATION_NAME']); $objPHPExcel->getActiveSheet()->setCellValue('AD' . $i, $organization['ORGANIZATION_ROLE']); //-----ที่อยู่ที่ทำงาน---// $sql_addr_org = mysql_query("SELECT * FROM address " . "LEFT JOIN addresslist ON address.ID = addresslist.ADDRESSLIST_ADDRESS_ID " . "WHERE addresslist.ADDRESSLIST_OWNER_ID = {$organization_id} AND addresslist.ADDRESSLIST_TYPE_ID = 2 AND addresslist.ADDRESSLIST_THRU_DATE='' " . "ORDER BY addresslist.ADDRESSLIST_FROM_DATE LIMIT 1"); $org_addr = mysql_fetch_assoc($sql_addr_org); // print_r($org_addr); $objPHPExcel->getActiveSheet()->setCellValue('AE' . $i, $org_addr["ADDRESS_NUM"]); $objPHPExcel->getActiveSheet()->setCellValue('AF' . $i, $org_addr["ADDRESS_MOO"]); $objPHPExcel->getActiveSheet()->setCellValue('AG' . $i, $org_addr["ADDRESS_VILLAGE"]); $objPHPExcel->getActiveSheet()->setCellValue('AH' . $i, $org_addr["ADDRESS_ALLEY"]); $objPHPExcel->getActiveSheet()->setCellValue('AI' . $i, $org_addr["ADDRESS_ROAD"]); $objPHPExcel->getActiveSheet()->setCellValue('AJ' . $i, get_district_string($org_addr["ADDRESS_DISTRICT_ID"])); $objPHPExcel->getActiveSheet()->setCellValue('AK' . $i, get_amphur_string($org_addr["ADDRESS_AMPHUR_ID"])); $objPHPExcel->getActiveSheet()->setCellValue('AL' . $i, get_province_string($org_addr["ADDRESS_PROVINCE_ID"])); $objPHPExcel->getActiveSheet()->setCellValue('AM' . $i, $org_addr["ADDRESS_ZIPCODE"]); //----เบอร์โทรศัพท์ ที่ทำงาน----// $tels = mysql_query("SELECT * FROM contact WHERE CONTACT_OWNER_ID = {$organization_id} AND CONTACT_TYPE_ID = 6 AND CONTACT_THRU_DATE='' ORDER BY CONTACT_FROM_DATE LIMIT 1"); $tel = mysql_fetch_assoc($tels); $tel_res = ""; if (!empty($tel)) { $tel_res = $tel["CONTACT_ARER_CODE"] . "-" . $tel["CONTACT_STRING"]; if (!empty($tel['CONTACT_COMMENT'])) { $tel_res .= "ต่อ " . $tel['CONTACT_COMMENT']; } } $objPHPExcel->getActiveSheet()->setCellValue('AN' . $i, $tel_res); //----fax ที่ทำงาน----// $tels = mysql_query("SELECT * FROM contact WHERE CONTACT_OWNER_ID = {$organization_id} AND CONTACT_TYPE_ID = 9 AND CONTACT_THRU_DATE='' ORDER BY CONTACT_FROM_DATE LIMIT 1"); $tel = mysql_fetch_assoc($tels);
?> </h6> </div> </div> <?php $organizationAddrs = get_person_all_address($organization_id, 2); $count_addr = 1; while ($organizationAddr = mysql_fetch_assoc($organizationAddrs)) { ?> <div class="row"> <div class="col-sm-2"> <h5>ที่อยู่</h5> </div> <div class="col-sm-10"> <h6> <?php echo $organizationAddr['ADDRESS_NUM'] . ' ' . $organizationAddr['ADDRESS_VILLAGE'] . ' ' . $organizationAddr['ADDRESS_ALLEY'] . ' ' . $organizationAddr['ADDRESS_MOO'] . ' ' . $organizationAddr['ADDRESS_ROAD'] . ' ' . get_district_string($organizationAddr['ADDRESS_DISTRICT_ID']) . ' ' . get_amphur_string($organizationAddr['ADDRESS_AMPHUR_ID']) . ' ' . get_province_string($organizationAddr['ADDRESS_PROVINCE_ID']) . ' ' . $organizationAddr['ADDRESS_ZIPCODE']; ?> </h6> </div> </div> <?php $count_addr++; } if ($count_addr == 1) { ?> <div class="row"> <div class="col-sm-6"> <h5>ไม่พบข้อมูลที่อยู่</h5> </div> </div> <?php
<tr> <td><h3><?php echo get_province_string($province['PROVINCE_ID']); ?> </h3></td> <td style='text-align:right'><h3><a style="color: white;" onClick="javascript:window.location.assign('stat_detail.php?data=<?php echo $province['PROVINCE_ID']; ?> &type=province')"><?php echo $count[0]; ?> </a></h3></td> </tr> <?php } else { $noperson .= get_province_string($province['PROVINCE_ID']) . " "; } } ?> <tr> <td><h3>จังหวัดที่ไม่มีข้อมูลที่อยู่สมาชิก</h3></td> <td> <h3> <?php if ($noperson == '') { echo '-'; } else { echo $noperson; } ?> </h3>
<?php echo $org_addr['ADDRESS_NUM']; echo " "; echo $org_addr['ADDRESS_MOO']; echo " "; echo $org_addr['ADDRESS_VILLAGE']; echo " "; echo $org_addr['ADDRESS_ALLEY']; echo " "; echo $org_addr['ADDRESS_ROAD']; echo " "; echo get_district_string($org_addr['ADDRESS_DISTRICT_ID']); echo " "; echo get_amphur_string($org_addr['ADDRESS_AMPHUR_ID']); echo " "; echo get_province_string($org_addr['ADDRESS_PROVINCE_ID']); echo " "; echo $org_addr['ADDRESS_ZIPCODE']; ?> </div> </div> <?php // echo ($org_addr['ADDRESS_NUM']); // echo " "; // echo ($org_addr['ADDRESS_MOO']); // echo " "; // echo ($org_addr['ADDRESS_VILLAGE']); // echo " "; // echo ($org_addr['ADDRESS_ALLEY']); // echo " ";
} else { if ($_GET['s_id'] == 6) { $headder_str .= 'ใต้'; $add_str .= 'ใต้'; } } } } } } $querys = get_province_id_by_province_sector_id($data); } else { if ($_GET['type'] == "province") { $data = $_GET['p_id']; $s_id = $_GET['s_id']; $headder_str = "รายละเอียดข้อมูลอำเภอ/เขตของ จังหวัด" . get_province_string($data); $querys = get_amphur_id_by_province_id($data); } else { if ($_GET['type'] == "amphur") { $data = $_GET['a_id']; $p_id = $_GET['p_id']; $s_id = $_GET['s_id']; $headder_str = "รายละเอียดข้อมูลตำบล/แขวงของ อำเภอ" . get_amphur_string($data); $querys = get_district_id_by_province_id($data); } } } ?> <html> <head> <meta charset="utf-8">
function get_addr_string($addr) { $addr_string = $addr['ADDRESS_NUM']; if ($addr['ADDRESS_MOO'] != '') { $addr_string .= ' หมู่' . $addr['ADDRESS_MOO']; } if ($addr['ADDRESS_VILLAGE'] != '') { $addr_string .= ' ' . $addr['ADDRESS_VILLAGE']; } if ($addr['ADDRESS_ALLEY'] != '') { $addr_string .= ' ซ.' . $addr['ADDRESS_ALLEY']; } if ($addr['ADDRESS_ROAD'] != '') { $addr_string .= ' ถ.' . $addr['ADDRESS_ROAD']; } $addr_string .= get_district_string($addr['ADDRESS_DISTRICT_ID']) . ' ' . get_amphur_string($addr['ADDRESS_AMPHUR_ID']) . ' ' . get_province_string($addr['ADDRESS_PROVINCE_ID']) . ' ' . $addr['ADDRESS_ZIPCODE']; return $addr_string; }
if ($_GET['type'] == 3) { $s_id = 0; $p_id = $_GET['p_id']; $a_id = $_GET['a_id']; $headder_str .= "ตำบล/แขวง ของ อำเภอ/เขต " . get_amphur_string($a_id); } } } $current_data = 0; } else { if ($_GET['type'] == 1) { $s_id = $_GET['s_id']; $p_id = $_GET['p_id']; $a_id = 0; $headder_str = "แก้ไขข้อมูลจังหวัด"; $querys = get_province_string($p_id); // $query = mysql_fetch_assoc($querys); // print_r($querys); } else { if ($_GET['type'] == 2) { $s_id = 0; $p_id = $_GET['p_id']; $a_id = $_GET['a_id']; $headder_str = "แก้ไขข้อมูลอำเภอ/เขต"; $querys = get_amphur_string($a_id); } else { if ($_GET['type'] == 3) { $s_id = 0; $p_id = $_GET['p_id']; $a_id = $_GET['a_id']; $d_id = $_GET['d_id'];
} } //-----web ที่ทำงาน--------// $org_webs = mysql_query("SELECT * FROM contact WHERE CONTACT_OWNER_ID = {$organization_id} AND CONTACT_TYPE_ID = 7 AND CONTACT_THRU_DATE='' ORDER BY CONTACT_FROM_DATE LIMIT 1"); $org_web = mysql_fetch_assoc($org_webs); if (!empty($org_web)) { $org_web_res = $org_web['CONTACT_STRING']; } //-----Email ที่ทำงาน--------// $org_emails = mysql_query("SELECT * FROM contact WHERE CONTACT_OWNER_ID = {$organization_id} AND CONTACT_TYPE_ID = 8 AND CONTACT_THRU_DATE='' ORDER BY CONTACT_FROM_DATE LIMIT 1"); $org_email = mysql_fetch_assoc($org_emails); if (!empty($org_email)) { $org_email_res = $org_email['CONTACT_STRING']; } } $temp = array("ลำดับที่" => $count++, "คำนำหน้า" => $person["TITLE_NAME"], "ชื่อ" => $person["PERSONNAME_NAME"], "นามสกุล" => $person["PERSONNAME_SURNAME"], "สายรุ่นในตระกูล" => $person["GENERATION_TYPE"], "รุ่น" => $person["GENERATION_NAME"], "ชื่อจีน" => $person["CHINANAME_NAME"], "ชื่อจีน(PINYIN)" => $person["CHINANAME_PINYIN"], "ชื่อจีน(ไทย)" => $person["CHINANAME_TH"], "เพศ" => $person["GENDER_NAME"], "วันเกิด" => $person["BIRTHDAY"], "สถานะภาพ" => $status, "บ้านเลขที่" => $addr["ADDRESS_NUM"], "หมู่" => $addr["ADDRESS_MOO"], "หมู่บ้าน" => $addr["ADDRESS_VILLAGE"], "ซอย" => $addr["ADDRESS_ALLEY"], "ถนน" => $addr["ADDRESS_ROAD"], "ตำบล" => get_district_string($addr["ADDRESS_DISTRICT_ID"]), "อำเภอ" => get_amphur_string($addr["ADDRESS_AMPHUR_ID"]), "จังหวัด" => get_province_string($addr["ADDRESS_PROVINCE_ID"]), "รหัสไปรษณีย์" => $addr["ADDRESS_ZIPCODE"], "เบอร์โทรศัพท์บ้าน" => $tel_res, "เบอร์โทรศัทพ์มือถือ" => $moblie_res, "Email" => $email_res, "Facebook" => $fb_res, "Line" => $line_res, "ธุรกิจ" => $organization['ORGANIZATIONTYPE_NAME'], "ประเภทธุรกิจ" => $organization['ORGANIZATION_COMMENT'], "ชื่อธุรกิจ" => $organization['ORGANIZATION_NAME'], "ตำแหน่งงาน" => $organization['ORGANIZATION_ROLE'], "บ้านเลขที่ ที่ทำงาน" => $org_addr["ADDRESS_NUM"], "หมู่ ที่ทำงาน" => $org_addr["ADDRESS_MOO"], "หมู่บ้าน ที่ทำงาน" => $org_addr["ADDRESS_VILLAGE"], "ซอย ที่ทำงาน" => $org_addr["ADDRESS_ALLEY"], "ถนน ที่ทำงาน" => $org_addr["ADDRESS_ROAD"], "ตำบล ที่ทำงาน" => get_district_string($org_addr["ADDRESS_DISTRICT_ID"]), "อำเภอ ที่ทำงาน" => get_amphur_string($org_addr["ADDRESS_AMPHUR_ID"]), "จังหวัด ที่ทำงาน" => get_province_string($org_addr["ADDRESS_PROVINCE_ID"]), "รหัสไปรษณีย์ ที่ทำงาน" => $org_addr["ADDRESS_ZIPCODE"], "เบอร์โทรศัพท์ ที่ทำงาน" => $org_tel_res, "fax ที่ทำงาน" => $org_fax_res, "เว็บไซต์ ที่ทำงาน" => $org_web_res, "Email ที่ทำงาน" => $org_email_res, "อัพเดทข้อมูลล่าสุด" => $person['LASTUPDATE']); array_push($data, $temp); if ($count > 10) { break; } } print_r($data); //exit(); function cleanData(&$str) { $str = preg_replace("/\t/", "\\t", $str); $str = preg_replace("/\r?\n/", "\\n", $str); if (strstr($str, '"')) { $str = '"' . str_replace('"', '""', $str) . '"'; } }