<?php

if(! defined('OT_ROOT')) {
	exit('Access Denied');
}


class AppXcxLifeDay{
	public static $appName = '小程序天天测量';
	public static $appID = 176;

	public static function Jud(){
		return false;
	}

	public static function Show($str, $def=''){
			return $def;
	}

	public static function TypeArr(){
		return array(
			array('type'=>'xuetang',	'name'=>'血糖',		'color'=>'#be1919'),
			array('type'=>'xueya',		'name'=>'血压',		'color'=>'#2979ff'),
			array('type'=>'xuezhi',		'name'=>'血脂',		'color'=>'#e4500d'),
			array('type'=>'chiyao',		'name'=>'口服',		'color'=>'#aa359f'),
			array('type'=>'tiwen',		'name'=>'体温',		'color'=>'#ff8909'),
			array('type'=>'guaping',	'name'=>'挂瓶',		'color'=>'#00a68b'),
			array('type'=>'niaoliang',	'name'=>'尿量',		'color'=>'#aba059'),
			array('type'=>'dabian',		'name'=>'大便',		'color'=>'#6f3906'),
			array('type'=>'dazhen',		'name'=>'打针',		'color'=>'#cb500a'),
			array('type'=>'xizao',		'name'=>'洗澡',		'color'=>'#463d9d'),
			array('type'=>'shuimian',	'name'=>'睡眠',		'color'=>'#47413c'),
			array('type'=>'qita',		'name'=>'其他',		'color'=>'#0b6bb5')
			);
	}

	public static function TypeOption($def=''){
		$typeArr = self::TypeArr();

		$retStr = '';
		foreach ($typeArr as $val){
			$retStr .= '<option value="'. $val['type'] .'" '. Is::Selected($val['type'], $def) .'>'. $val['name'] .'</option>';
		}
		return $retStr;
	}

	public static function TypeItem($str, $type='name'){
		$typeArr = self::TypeArr();

		foreach ($typeArr as $val){
			if ($val['type'] == $str){
				if ($type == 'nameColor'){
					return '<span style="color:'. $val['color'] .';">'. $val['name'] .'</span>';
				}else{
					if (! in_array($type, array('name','color'))){ $type = 'name'; }
					return $val[$type];
				}
			}
		}
		return '['. $str .','. $type .']';
	}

	public static function TypeJud($str){
		$typeArr = self::TypeArr();

		foreach ($typeArr as $val){
			if ($val['type'] == $str){
				return true;
			}
		}
		return false;
	}

	public static function ListData(){
		$dataArr	= array('res' => false, 'note' => '', 'size' => 0, 'page' => 0, 'pageCount' => 0, 'count' => 0, 'dataCount' => 0, 'data' => array());
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['size']	= 0;
		$dataArr['page']	= 0;

		die( json_encode($dataArr) );
	}

	public static function Send(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= null;

		die( json_encode($dataArr) );
	}

	public static function Deal(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= null;

		die( json_encode($dataArr) );
	}

	public static function Del(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');

		die( json_encode($dataArr) );
	}
}
?>