/** * 会员财务中心 * * 作者:Kim * 模块定制QQ: 800083075 * 后台体验地址: http://www.012wz.com */ defined('IN_IA') or exit('Access Denied'); global $_W, $_GPC; checklogin(); $_W['page']['title'] = "消费记录"; $ops = array("record", "cz"); $op = in_array($_GPC["op"], $ops) ? $_GPC["op"] : "record"; if ("record" == $op) { $type = $_GPC["type"]; $types = array("credit1", "credit2"); if (in_array($type, $types)) { list($list, $pager) = getAllRecords("users_credits_record", array("credittype" => array("op" => "=", "val" => $type), "num" => array("op" => ">", "val" => 0))); } else { list($list, $pager) = getAllRecords("users_credits_record"); } } elseif ("cz" == $op) { $index = max(1, intval($_GPC['page'])); $size = 15; $page = ($index - 1) * $size; $list = pdo_fetchall("SELECT * FROM " . tablename("uni_payorder") . " WHERE uid=:uid ORDER BY order_time DESC LIMIT {$page},{$size}", array(":uid" => $_W["uid"])); $total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename("uni_payorder") . " WHERE uid=:uid", array(":uid" => $_W["uid"])); $pager = pagination($total, $index, $size); } include $this->template('financial_record');
if (!$_W['isfounder']) { message('不能访问, 需要创始人权限才能访问.'); } $ops = array("xf", "cz"); $op = in_array($_GPC["op"], $ops) ? $_GPC["op"] : "display"; if ($op == "xf") { $uid = $_GPC["uid"]; if (intval($uid) <= 0) { message("用户ID不存在."); } $sql = 'SELECT * FROM ' . tablename('users') . " WHERE uid=:uid LIMIT 1"; $user = pdo_fetch($sql, array(":uid" => $uid)); if (empty($user)) { message("用户不存在"); } list($list, $pager) = getAllRecords("users_credits_record", array("credittype" => array("op" => "=", "val" => "credit2")), $uid); include $this->template('financial_users'); exit; } elseif ($op == "cz") { $uid = $_GPC["uid"]; if (intval($uid) <= 0) { message("用户ID不存在."); } $sql = 'SELECT * FROM ' . tablename('users') . " WHERE uid=:uid LIMIT 1"; $user = pdo_fetch($sql, array(":uid" => $uid)); if (empty($user)) { message("用户不存在"); } $index = max(1, intval($_GPC['page'])); $size = 15; $page = ($index - 1) * $size;
//---------------------------------------------------------------------- // MySQL Connection $db = new mysqli('localhost', $username, $password, $database); if ($db->connect_errno > 0) { die('Unable to connect to database [' . $db->connect_error . ']'); } // Check list $lists = getAllLists($db); //---------------------------------------------------------------------- // Compile XML (for API) //---------------------------------------------------------------------- if ($list != "NA") { if (!in_array($list, $lists)) { die("This list does not exist!"); } $data = getAllRecords($db, $list); header('Content-Type: application/xml; charset=utf-8'); echo '<?xml version="1.0" encoding="utf-8" ?>' . "\n"; echo '<?xml-stylesheet type="text/xsl" href="/show.xsl" ?>' . "\n"; echo '<qalist name="' . $list . '" updated="' . $date . " " . $time . '" >' . "\n"; // Entries foreach ($data as $key => $row) { echo '<entry id="' . $row['id'] . '">' . "\n"; echo "<question><![CDATA[" . $row['question'] . "]]></question>\n"; echo "<answer><![CDATA[" . $row['answer'] . "]]></answer>\n"; echo "</entry>\n\n"; } echo "</qalist>"; } else { ?>