}
foreach ($arr_paytype as $key => $value) {
    $paymoney = changenum('2', $arr_allmoney[$key]['paymoney']);
    $agentmoney = changenum('2', $arr_allmoney[$key]['agentmoney']);
    $cbmoney = changenum('2', $arr_allmoney[$key]['cbmoney']);
    $payfee = changenum('2', $arr_allmoney[$key]['payfee']);
    $showall .= ' <td class="right"><a href="payment_detail.php?type=year&' . '&paytype=' . $key . '">' . $paymoney . '</a></td>
              <td class="right"><a href="payment_detail.php?type=year&' . '&paytype=' . $key . '">' . $agentmoney . '</a></td>
              <td class="right"><a href="payment_detail.php?type=year&' . '&paytype=' . $key . '">' . $cbmoney . '</a></td>
              <td class="right" style="border-right:1px #222 solid"><a href="payment_detail.php?type=year&' . '&paytype=' . $key . '">' . $payfee . '</a></td>';
}
$t->set_var("showall", $showall);
$allmoney = changenum('2', $allmoney);
$allagentmoney = changenum('2', $allagentmoney);
$allcbmoney = changenum('2', $allcbmoney);
$allpayfee = changenum('2', $allpayfee);
$allmoney = '<a href="payment_detail.php?type=year">' . $allmoney . '</a>';
$allcbmoney = '<a href="payment_detail.php?type=year">' . $allcbmoney . '</a>';
$allpayfee = '<a href="payment_detail.php?type=year">' . $allpayfee . '</a>';
$allagentmoney = '<a href="payment_detail.php?type=year">' . $allagentmoney . '</a>';
$t->set_var("count", $count);
$t->set_var("error", $error);
$t->set_var("startmonth", $startmonth);
$t->set_var("endmonth", $endmonth);
$t->set_var("authorname", $authorname);
$t->set_var("paycarnum", count($arrPaycardData));
$t->set_var("allmoney", $allmoney);
$t->set_var("allagentmoney", $allagentmoney);
$t->set_var("allcbmoney", $allcbmoney);
$t->set_var("allpayfee", $allpayfee);
$t->set_var("bgcolor", $bgcolor);
$str_startday = $arr_startday[0] . "-" . $arr_startday[1];
$str_endday = $arr_endday[0] . "-" . $arr_endday[1];
if ($str_endday == $str_startday) {
    $curData = $str_endday;
} else {
    $curData = $str_startday . "@@" . $str_endday;
}
$allmoney = '<a href="payment_detail.php?type=day&datetime=' . $curData . '&collect=day">' . $allmoney . '</a>';
$allcbmoney = '<a href="payment_detail.php?type=day&datetime=' . $curData . '&collect=day">' . $allcbmoney . '</a>';
$allpayfee = '<a href="payment_detail.php?type=day&datetime=' . $curData . '&collect=day">' . $allpayfee . '</a>';
$allagentmoney = '<a href="payment_detail.php?type=day&datetime=' . $curData . '&collect=day">' . $allagentmoney . '</a>';
foreach ($arr_paytype as $key => $value) {
    $paymoney = changenum('2', $arr_allmoney[$key]['paymoney']);
    $agentmoney = changenum('2', $arr_allmoney[$key]['agentmoney']);
    $cbmoney = changenum('2', $arr_allmoney[$key]['cbmoney']);
    $payfee = changenum('2', $arr_allmoney[$key]['payfee']);
    $showall .= ' <td class="right"><a href="payment_detail.php?type=day&datetime=' . $curData . '&paytype=' . $key . '&collect=day">' . $paymoney . '</a></td>
              <td class="right"><a href="payment_detail.php?type=day&datetime=' . $curData . '&paytype=' . $key . '&collect=day">' . $agentmoney . '</a></td>
              <td class="right"><a href="payment_detail.php?type=day&datetime=' . $curData . '&paytype=' . $key . '&collect=day">' . $cbmoney . '</a></td>
              <td class="right" style="border-right:1px #222 solid"><a href="payment_detail.php?type=day&datetime=' . $curData . '&paytype=' . $key . '&collect=day">' . $payfee . '</a></td>';
}
$query = "select fd_sdcr_id as sdcrid ,fd_sdcr_name as sdcrname   from tb_sendcenter";
$db->query($query);
$arr_data = $db->getFiledData();
foreach ($arr_data as $value) {
    $arr_sdcrid[] = $value['sdcrid'];
    $arr_sdcrname[] = $value['sdcrname'];
}
$sdcrname = makeselect($arr_sdcrname, $sdcrname, $arr_sdcrid);
$t->set_var("sdcrname", $sdcrname);
$t->set_var("type", $type);