<?php
include("CheckSession.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="馬戲團" />
<title>馬戲團</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<?php

require_once("class/DBConfig.php");
require_once("class/DBOperation.php");
require_once("class/MacOperation.php");

$action = $_GET["action"];

$CNickname = "";
$CArea = "";
$CSource = "";
$CGreenTel = "";
$CBlackTel = "";
$CRedTel = "";
$CMemo = "";
$CMiss = "";
$id = "";

$db = new DBOperation();

$actionid = $_GET["id"];
if($actionid == null || $actionid == "")
{
	echo '<script type="text/javascript">';
  echo 'alert("無明細資料，請重新查詢!!!");';
  echo 'history.go(-1);';
  echo '</script>';
  exit;
}

$FieldRights = $_SESSION['fieldRights'];
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$db->query("SELECT * FROM Customer where CId = '".$db->mysql_real_escape_string($actionid)."'");
$row = $db->fetch_row();
$CNickname = $row[1];
$CArea = $row[2];
$CSource = $row[3];
$CClass = $row[13];

$CTempArea = "";
if(str_indexof($CArea,"Taipei") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "台北";
	}
	else
	{
		$CTempArea = $CTempArea." "."台北";
	}
}
if(str_indexof($CArea,"Taoyuan") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "桃園";
	}
	else
	{
		$CTempArea = $CTempArea." "."桃園";
	}
}
if(str_indexof($CArea,"Zhongli") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "中壢";
	}
	else
	{
		$CTempArea = $CTempArea." "."中壢";
	}
}
if(str_indexof($CArea,"Hsinchu") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "新竹";
	}
	else
	{
		$CTempArea = $CTempArea." "."新竹";
	}
}
if(str_indexof($CArea,"Taichung") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "台中";
	}
	else
	{
		$CTempArea = $CTempArea." "."台中";
	}
}
if(str_indexof($CArea,"Zhanghua") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "彰投";
	}
	else
	{
		$CTempArea = $CTempArea." "."彰投";
	}
}
if(str_indexof($CArea,"Tainan") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "台南";
	}
	else
	{
		$CTempArea = $CTempArea." "."台南";
	}
}
if(str_indexof($CArea,"Kaohsiung") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "高雄";
	}
	else
	{
		$CTempArea = $CTempArea." "."高雄";
	}
}
if(str_indexof($CArea,"Hualien") >= 0)
{
	if($CTempArea == "")
	{
		$CTempArea = "花蓮";
	}
	else
	{
		$CTempArea = $CTempArea." "."花蓮";
	}
}

$CTempSource = "";
if(str_indexof($CSource,"L") >= 0)
{
	if($CTempSource == "")
	{
		$CTempSource = "Line";
	}
	else
	{
		$CTempSource = $CTempSource." "."Line";
	}
}

if(str_indexof($CSource,"W") >= 0)
{
	if($CTempSource == "")
	{
		$CTempSource = "微信";
	}
	else
	{
		$CTempSource = $CTempSource." "."微信";
	}
}

if(str_indexof($CSource,"T") >= 0)
{
	if($CTempSource == "")
	{
		$CTempSource = "電話";
	}
	else
	{
		$CTempSource = $CTempSource." "."電話";
	}
}

if(str_indexof($CSource,"G") >= 0)
{
	if($CTempSource == "")
	{
		$CTempSource = "即時通";
	}
	else
	{
		$CTempSource = $CTempSource." "."即時通";
	}
}

if(str_indexof($CSource,"S") >= 0)
{
	if($CTempSource == "")
	{
		$CTempSource = "Skype";
	}
	else
	{
		$CTempSource = $CTempSource." "."Skype";
	}
}

if(str_indexof($CSource,"O") >= 0)
{
	if($CTempSource == "")
	{
		$CTempSource = "其他";
	}
	else
	{
		$CTempSource = $CTempSource." "."其他";
	}
}

if(str_indexof($CClass,"A") >= 0)
{
	if($CTempClass == "")
	{
		$CTempClass = "A";
	}
	else
	{
		$CTempClass = $CTempClass." "."A";
	}
}

if(str_indexof($CClass,"B") >= 0)
{
	if($CTempClass == "")
	{
		$CTempClass = "B";
	}
	else
	{
		$CTempClass = $CTempClass." "."B";
	}
}

if(str_indexof($CClass,"C") >= 0)
{
	if($CTempClass == "")
	{
		$CTempClass = "C";
	}
	else
	{
		$CTempClass = $CTempClass." "."C";
	}
}

if(str_indexof($CClass,"D") >= 0)
{
	if($CTempClass == "")
	{
		$CTempClass = "D";
	}
	else
	{
		$CTempClass = $CTempClass." "."D";
	}
}


if(str_indexof($FieldRights,"CGreenTel") >= 0)
{
	$CGreenTel = $row[4];
}
else
{
	$CGreenTel = "";
}
if(str_indexof($FieldRights,"CBlackTel") >= 0)
{
	$CBlackTel = $row[5];
}
else
{
	$CBlackTel = "";
}
if(str_indexof($FieldRights,"CRedTel") >= 0)
{
	$CRedTel = $row[6];
}
else
{
	$CRedTel = "";
}
if(str_indexof($FieldRights,"CMemo") >= 0)
{
	$CMemo = nl2br($row[7]);
}
else
{
	$CMemo = "";
}

$CTempMemo = "";
if(str_indexof($CMemo,"01") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "高價";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."高價";
	}
}
if(str_indexof($CMemo,"02") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "好客";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."好客";
	}
}
if(str_indexof($CMemo,"03") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "常客";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."常客";
	}
}
if(str_indexof($CMemo,"04") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "固定";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."固定";
	}
}
if(str_indexof($CMemo,"05") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "新人";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."新人";
	}
}
if(str_indexof($CMemo,"06") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "不挑";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."不挑";
	}
}
if(str_indexof($CMemo,"07") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "年輕";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."年輕";
	}
}
if(str_indexof($CMemo,"08") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "臉蛋";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."臉蛋";
	}
}
if(str_indexof($CMemo,"09") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "學生";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."學生";
	}
}
if(str_indexof($CMemo,"10") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "高挑";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."高挑";
	}
}
if(str_indexof($CMemo,"11") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "骨感";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."骨感";
	}
}
if(str_indexof($CMemo,"12") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "美腿";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."美腿";
	}
}
if(str_indexof($CMemo,"13") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "氣質";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."氣質";
	}
}
if(str_indexof($CMemo,"14") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "清純";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."清純";
	}
}
if(str_indexof($CMemo,"15") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "可愛";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."可愛";
	}
}
if(str_indexof($CMemo,"16") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "OL";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."OL";
	}
}
if(str_indexof($CMemo,"17") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "大奶";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."大奶";
	}
}
if(str_indexof($CMemo,"18") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "要LG";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."要LG";
	}
}
if(str_indexof($CMemo,"19") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "無套BJ";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."無套BJ";
	}
}
if(str_indexof($CMemo,"20") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "主動";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."主動";
	}
}
if(str_indexof($CMemo,"21") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "不傳";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."不傳";
	}
}
if(str_indexof($CMemo,"22") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "很挑";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."很挑";
	}
}
if(str_indexof($CMemo,"23") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "無套做";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."無套做";
	}
}
if(str_indexof($CMemo,"24") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "絲襪";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."絲襪";
	}
}
if(str_indexof($CMemo,"25") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "不抽菸";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."不抽菸";
	}
}
if(str_indexof($CMemo,"26") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "熟女";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."熟女";
	}
}
if(str_indexof($CMemo,"27") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "服務好";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."服務好";
	}
}
if(str_indexof($CMemo,"28") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "膚白";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."膚白";
	}
}
if(str_indexof($CMemo,"29") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "加節";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."加節";
	}
}
if(str_indexof($CMemo,"30") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "嬌小";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."嬌小";
	}
}
if(str_indexof($CMemo,"31") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "漂亮";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."漂亮";
	}
}
if(str_indexof($CMemo,"32") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "要求高";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."要求高";
	}
}
if(str_indexof($CMemo,"33") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "注重身材";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."注重身材";
	}
}
if(str_indexof($CMemo,"34") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "女友FU";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."女友FU";
	}
}
if(str_indexof($CMemo,"35") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "無刺青";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."無刺青";
	}
}
if(str_indexof($CMemo,"36") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "長髮";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."長髮";
	}
}
if(str_indexof($CMemo,"37") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "大眼";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."大眼";
	}
}
if(str_indexof($CMemo,"38") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "活潑";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."活潑";
	}
}
if(str_indexof($CMemo,"39") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "兼職型";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."兼職型";
	}
}
if(str_indexof($CMemo,"40") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "不要大陸";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."不要大陸";
	}
}
if(str_indexof($CMemo,"41") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "要大陸";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."要大陸";
	}
}
if(str_indexof($CMemo,"42") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "要外國人";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."要外國人";
	}
}
if(str_indexof($CMemo,"43") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "奧客";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."奧客";
	}
}
if(str_indexof($CMemo,"44") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "注意";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."注意";
	}
}
if(str_indexof($CMemo,"45") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "帶朋友";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."空號";
	}
}
if(str_indexof($CMemo,"46") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "危險";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."危險";
	}
}
if(str_indexof($CMemo,"47") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "問題";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."問題";
	}
}
if(str_indexof($CMemo,"48") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "俄羅斯";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."俄羅斯";
	}
}
if(str_indexof($CMemo,"49") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "按摩";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."按摩";
	}
}
if(str_indexof($CMemo,"50") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "半套";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."半套";
	}
}

if(str_indexof($CMemo,"51") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "全套";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."全套";
	}
}

if(str_indexof($CMemo,"52") >= 0)
{
	if($CTempMemo == "")
	{
		$CTempMemo = "工作室";
	}
	else
	{
		$CTempMemo = $CTempMemo." "."工作室";
	}
}
$db->close_db();

$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$querySql = "select CId,CMiss,CPayDate from CMissContent where CCId = '".$actionid."' order by CPayDate desc";
$db->query($querySql);

while($myrow = $db->fetch_array())
{
	if($CMiss == "")
	{
		$CMiss = $myrow['CPayDate']." - ".$myrow['CMiss'];
	}
	else
	{
		$CMiss = $CMiss."<br>".$myrow['CPayDate']." - ".$myrow['CMiss'];
	}
}



$db->close_db();


?>
<body onload="MM_preloadImages('images/Back1.jpg')">
<form name="GroupRightsForm" method="post" action="CustomerBuyTimesQueryIndexW.php" id="GroupRightsForm">
<input type="hidden" name="actionid" id="actionid" value="<?php echo $actionid; ?>"/>
<table border="1" cellspacing="2" cellspadding="2" width="100%">
<?php
if(str_indexof($FieldRights,"CGreenTel") >= 0 && $CGreenTel != "")
{
?>
<tr>
<td align="left" width="16%">
<span class="t12g">
<b>電話</b>
</span>
</td>
<td align="left" width="70%">
<span class="t12">
<b><?php if($CGreenTel != "") echo $CGreenTel;else echo "&nbsp;" ?></b>
</span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CTel") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
</span>
<?php
}
?>
<?php
if(str_indexof($FieldRights,"CBlackTel") >= 0 && $CBlackTel != "")
{
?>
<tr>
<td align="left" width="16%">
<span class="t12">
<b>電話</b>
</span>
</td>
<td align="left" width="70%">
<span class="t12">
<b><?php if($CBlackTel != "") echo $CBlackTel;else echo "&nbsp;" ?></b>
</span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CTel") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
}
?>
<?php
if(str_indexof($FieldRights,"CRedTel") >= 0 && $CRedTel != "")
{
?>
<tr>
<td align="left" width="16%">
<span class="t12">
<b>電話</b>
</span>
</td>
<td align="left" width="75%">
<span class="t12">
<b><?php if($CRedTel != "") echo $CRedTel;else echo "&nbsp;" ?></b>
</span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CTel") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
}
?>

<tr>
<td align="left" width="16%">
<span class="t12">地區
</td>
<td align="left" width="75%">
<span class="t12"><?php echo $CTempArea ?></span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CArea") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
if(str_indexof($FieldRights,"CSource") >= 0)
{
?>
<tr>
<td align="left">
<span class="t12">來源</span>
</td>
<td align="left">
<span class="t12"><?php echo $CTempSource ?></span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CSource") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
}
?>

<?php
if(str_indexof($FieldRights,"CClass") >= 0)
{
?>
<tr>
<td align="left">
<span class="t12">類別</span>
</td>
<td align="left">
<span class="t12"><?php echo $CTempClass ?></span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CClass") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
}
?>

<tr>
<td align="left">
<span class="t12">暱稱/其他</span>
</td>
<td align="left" width="75%">
<span class="t12"><?php echo $CNickname ?></span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CNickname") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
if(str_indexof($FieldRights,"CMemo") >= 0)
{
?>
<tr>
<td align="left" width="16%">
<span class="t12">喜好<br>/備註</span>
</td>
<td align="left" width="75%">
<span class="t12"><?php if($CTempMemo != "") echo $CTempMemo;else echo "&nbsp;" ?></span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CMemo") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
}
?>
<?php
if(str_indexof($FieldRights,"CMiss") >= 0)
{
?>
<tr>
<td align="left" width="16%">
<span class="t12">
消費內容
</span>
</td>
<td align="left" width="75%">
<span class="t12">
<?php if($CMiss != "") echo $CMiss;else echo "&nbsp;" ?>
</span>
</td>
<?php
if($_SESSION['rightLevel'] == "2" && str_indexof($_SESSION['updateFields'],"CMissContent") >= 0)
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
elseif($_SESSION['rightLevel'] == "0" || $_SESSION['rightLevel'] == "1")
{
?>
<td align="center">
<a href="CustomerQueryBuyTimesInputUpdateW.php?id=<?php echo $actionid;?>"><span class="t12">修改</span></a>
</td>
<?php
}
else
{
?>
<td align="center">
&nbsp;
</td>
<?php
}
?>
</tr>
<?php
}
?>
<tr>
<td align="center" colspan="3">
<a href="javascript:GroupRightsForm.submit();">
<img src="images/Back1.jpg" ID="ImgLogIn" width="157" height="33" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('ImgLogIn','','images/Back2.jpg',1)">
</a>
<input type="button" name="btnSub" id="btnSub" value="返回查詢首頁" class="t16" onclick="javascript:location.href='CustomerBuyTimes.php'"/>
</td>
</tr>
</table>
</form>
</body>
</html>