<div class=mobi_top>
</div>
<div id="team_list">
	<h3>请选择一个团队</h3>
	<div class="team_select">
		<li class="add_li"><a href="javascript:void(0)" onclick="add();" style="color: white"><i class="fa fa-plus"></i> 新增团队</a></li>
		<?php
		if ($result) {
			foreach ($result as $row) {
				if ($row['mount'] < $team_mount) {
		?>
					<li class="list_li">
						<a href="index.php?c=race&action=reg&race_id=<?php echo $race_id ?>&group_id=<?php echo $group_id ?>&team_name=<?php echo $row['team_name'] ?>&team_id=<?php echo $row['id'] ?>"><b><?php echo $row['team_name'] ?></b>(<?php echo $team_mount ?>/<?php echo $row['mount'] ?>)

						</a>
					</li>
				<?php
				} else {
				?>
					<li class="list_li_f">
						<b><?php echo $row['team_name'] ?>(满员)<br />
							<!--	<font color="#666666"><?php echo $row['team_content'] ?></font><br/>-->
					</li>
		<?php
				}
			}
		}
		?>
	</div>
</div>
<div id="add_team">
	<h3>请新增一个团队</h3>
	<form action="index.php?c=race&action=team_add&race_id=<?php echo $race_id ?>&group_id=<?php echo $group_id ?>" method="post">
		<table class="table">
			<tr>
				<td width="100">团队名称</td>
				<td><input type="text" name="team_name" id="tn"> * 必填</td>
			</tr>

			<tr>
				<td width="100">团队介绍</td>
				<td><input type="text" name="team_content" id="tc"> * 选填</td>
			</tr>

			<tr>
				<td colspan="2">
					<input type="submit" name="增加" class="btn_sussess" onclick="return check();"> <a href="javascript:void(0)" onclick="back()">返回>></a>
				</td>
			</tr>
		</table>
	</form>
</div>
<style type="text/css">
	#team_list {
		width: 100%;
		max-width: 600px;
		margin-left: auto;
		margin-right: auto;
		margin-top: 80px;
	}

	.team_select {
		width: 100%;
		max-width: 1200px;
		margin-left: auto;
		margin-right: auto;
	}

	.team_select li {
		width: 200px;
		height: 50px;
		border: 1px solid #f0f0f0;
		line-height: 50px;
		border-radius: 10px;
		text-align: center;
		float: left;
		margin: 4px;
	}

	#add_team {
		display: none;
		width: 400px;
		margin-left: auto;
		margin-right: auto
	}

	.btn_sussess {
		width: 100%;
		background-color: #34aadc;
		padding: 10px;
		color: white
	}

	.list_li {
		line-height: 1.3em;
		text-align: left;
		padding: 3px;
		background: white
	}

	.list_li_f {
		line-height: 1.3em;
		text-align: left;
		padding: 3px;
		color: #999999
	}

	.add_li {
		background: #34aadc
	}
</style>
<script type="text/javascript">
	function add() {
		$('#add_team').css('display', 'block');
		$('#team_list').css('display', 'none');
	}

	function back() {
		$('#add_team').css('display', 'none');
		$('#team_list').css('display', 'block');
	}

	function check() {
		team_name = $('#tn').val();

		if (team_name == '') {
			alert('请输入团队名称');
			return false;
		}

		return true;
	}
</script>