<?php
include_once "../../mainfile.php";
$xoopsOption['template_main'] = "view_tpl.html";
define("_DIR",XOOPS_ROOT_PATH."/uploads/tad_contact");
$sn=(empty($_REQUEST['sn']))?"0":intval($_REQUEST['sn']);
$main=show_data($sn);
include_once XOOPS_ROOT_PATH."/header.php";
//echo $main;
$xoopsTpl->assign("content" , $main);
include_once XOOPS_ROOT_PATH.'/footer.php';
//顯示結果
function show_data($sn=""){
global $xoopsDB;
$sql="select * from `x233_contact` where `sn`='$sn'";
$result=$xoopsDB->query($sql) or die(mysql_error());
$data=mysql_fetch_array($result);
$sex=($data['sex']=="m")?"先生":"女士";
//$_POST['note']=stripslashes($_POST['note']);
$data= "<table border=1 style='width:auto;'>
<tr><th>姓名</th><td>{$data['name']}</td></tr>
<tr><th>性別</th><td>{$sex}</td></tr>
<tr><th>Email</th><td>{$data['email']}</td></tr>
<tr><th>電話</th><td>{$data['tel']}</td></tr>
<tr><th>手機</th><td>{$data['mtel']}</td></tr>
<tr><th>地址</th><td>
{$data['zip']}{$data['city']}{$data['town']}{$data['address']}
</td></tr>
<tr><th>服務單位</th><td>{$data['company']}</td></tr>
<tr><th>職稱</th><td>{$data['job']}</td></tr>
<tr><th>大頭照</th><td></td></tr>
<tr><th>可秀出資料</th><td>{$data['show_data']}</td></tr>
<tr><th>其他說明</th><td>{$data['note']}</td></tr>
</table>";
return $data;
}
?>