<?php

if (! defined ( 'IN_DISCUZ' )) {

	exit ( 'Access Denied' );

}

$space = getuserbyuid ( $_G ['uid'] );

$type = trim ( $_GET ['type'] );



if ($type == 'total') {

	odz_result ( array (

			'total_credits' => $space [credits] == null ? '' : $space [credits],

			'url' => 'http://' . $_SERVER ["HTTP_HOST"] . dirname ( $_SERVER ["PHP_SELF"] ) . '/index.php?mod=space&do=credit&type=detail' 

	) );

} elseif ($type == 'detail') {

	$rulelist = array (

			odz_lang ( 'mobile_credit_rule1' ),

			odz_lang ( 'mobile_credit_rule2' ),

			odz_lang ( 'mobile_credit_rule3' ),

			odz_lang ( 'mobile_credit_rule4' ),

	);

	$rules = C::t ( 'common_credit_rule' )->fetch_all_rule ();

	foreach ( $rules as $k => $v ) {

		foreach ( $rulelist as $a => $rule ) {

			if ($v ['rulename'] == $rule) {

				$credit_rule [$v ['rid']] = $v;

			}

		}

	}

	include './template/credit.php';

}

 