<?php

class Form extends Module{

	/*
		处理数据扩展
		$fied		当前扩展属性
		$row		当前数据行
		$data		当前数据集
		$config		当前表单配置
	*/
	public static function parse_value( $fied, $row, $data, $config ){
		global $_G;
		
		if( !$_G['setting']['payment'] && file_exists( VI_ROOT.'module/payment/' ) ){
			require_once VI_ROOT.'module/payment/config.php';
			require_once VI_ROOT.'module/payment/setting.php';
		}
		
		switch($fied){
			
			case "MODIFY":		
				return '<a href="../form/form.value.php?fid='.$row["fid"].'&id='.$row['id'].'" target="_blank" onclick="new parent.Mo.Dialog(\'dialog\',\'修改用户提交数据\' , \'<iframe src=\'+this.href+\' frameborder=0></iframe>\' ,\'60%\',\'65%\',{ \'remove\' : true, \'draged\' : true, \'create\' : true }); return false;">编辑</a>';
			break;
			
			case "PAYMENT":
				if( $config['PAYMENT_MONEY'] ){
					$pr = System :: $db -> getValue( "SELECT pr FROM `mod:trade` WHERE appid='".$row["appid"]."' and fid='".$row["fid"]."' and sid='".$row["id"]."'" );
					return $pr > 0 ? '<span class="text-yes">'.$_G['module']['payment']['currency'][$_G['setting']['payment']['currency']].$pr.'</span>' : '';
				}
			break;
		}
	}

}

?>