<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<link rel="stylesheet" type="text/css" href="template/default/content/css/style.css">
<script type="text/javascript" src="<?php echo style2015;?>content/js/jquery.min.js"></script>
<title>Office 515158 2011 OA办公系统</title>
 
</head>
<body class="bodycolor">
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="small">
  <tr>
    <td class="Big"><img src="template/default/content/images/notify_new.gif" align="absmiddle"><span class="big3">考勤配置信息<?php echo $_title['name'];?></span>&nbsp;&nbsp;&nbsp;&nbsp;
	<span style="font-size:12px; float:right; margin-right:20px;">
	
	<a href="admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>" style="font-size:12px;"><<返回列表页</a></span>
    </td>
  </tr>
</table>
<script Language="JavaScript"> 
function CheckForm()
{
   if(document.save.name.value=="")
   { alert("名称不能为空！");
     document.save.name.focus();
     return (false);
   }
   if(document.save.sdate.value=="")
   { alert("上班时间不能为空！");
     document.save.sdate.focus();
     return (false);
   }
   if(document.save.edate.value=="")
   { alert("下班时间不能为空！");
     document.save.edate.focus();
     return (false);
   }
   return true;
}
function sendForm()
{
   if(CheckForm())
      document.save.submit();
}



</script>


<form name="save" method="post" action="?ac=<?php echo $ac?>&do=add&fileurl=<?php echo $fileurl?>">
<input type="hidden" name="view" value="list" />
<input type="hidden" name="id" value="<?php echo $row['id'];?>" />
<table class="TableBlock" border="0" width="90%" align="center">
 
	<tr>
      <td nowrap class="TableContent" width="15%"> 名称：<? get_helps()?></td>
      <td class="TableData">
      <input type="text" name="name" class="BigInput" style="width:268px;" size="20" value="<?php echo $row['name'];?>" /></td>
    </tr>
	<?php if($row['type']!='1'){?>
	<tr>
      <td nowrap class="TableContent" width="15%"> 控制人员：</td>
      <td class="TableData">
	  <?php
	  get_pubuser(2,"user",get_realname($row['user']),"+选择人员",50,3)
	  ?>	  </td>
    </tr>
	<?php }else{?>
	<input type="hidden" name="user" value="0" />
	<?php }?>
	<tr>
      <td nowrap class="TableContent" width="15%"> 工作时间：<? get_helps()?></td>
      <td class="TableData">
      <select name="sdate" style="width:80px;">
			<?php 
			for($i=0;$i<=23;$i++){
				if($i<10){
					$i='0'.$i;
				}
				echo '<option value="'.$i.':00"  ';
				if ($row['sdate']==$i.':00'){
					echo 'selected="selected"';
				}
				echo '>'.$i.':00</option>';
				echo '<option value="'.$i.':30"  ';
				if ($row['sdate']==$i.':30'){
					echo 'selected="selected"';
				}
				echo '>'.$i.':30</option>';
			}
			?>
			  </select>
			到：
			
		  <select name="edate" style="width:80px;">
			<?php 
			for($i=0;$i<=23;$i++){
				if($i<10){
					$i='0'.$i;
				}
				echo '<option value="'.$i.':00"  ';
				if ($row['edate']==$i.':00'){
					echo 'selected="selected"';
				}
				echo '>'.$i.':00</option>';
				echo '<option value="'.$i.':30"  ';
				if ($row['edate']==$i.':30'){
					echo 'selected="selected"';
				}
				echo '>'.$i.':30</option>';
			}
			?> </select> </td>
    </tr>
	
	<tr>
      <td nowrap class="TableContent" width="15%"> 设定打卡位置：</td>
      <td class="TableData"><input type="text" name="getlocation" class="BigInput" style="width:268px;" size="20" value="<?php echo $row['getlocation'];?>" /> 注：100米内<div id="address"></div></td>
    </tr>
	<tr>
      <td nowrap class="TableContent" width="15%"> 查询</td>
      <td class="TableData"><input type="text" name="pname" class="BigInput" style="width:268px;" size="20" value="" /> <input type="button" value="查询" class="BigButtonBHover" onClick="searchs();"></td>
    </tr>
	<tr>
      <td colspan="2" nowrap class="TableContent"> 
	  <style type="text/css">
		#allmap{width:100%;height:360px;}
	</style>
	  <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=vSoT0e54emgjq3vmGwM0PBSa6FyndNOC"></script>
	  
	  <div id="allmap"></div>
	  
	  <script type="text/javascript">
	  allmap('');
	  function allmap($name){
		// 百度地图API功能
		var map = new BMap.Map("allmap"); 
		//获取位置
		<?php 
		if($row['getlocation']){
			$loc=$row['getlocation'];
		}else{
			$loc='116.331398,39.897445';
		}
		?>   
		map.centerAndZoom(new BMap.Point(<?php echo $loc;?>),13);
		var local = new BMap.LocalSearch(map, {
			renderOptions:{map: map}
		});
		
		local.search($name);
		function showInfo(e){
			//alert(e.point.lng + ", " + e.point.lat);
			$('input[name="getlocation"]').val(e.point.lng + "," + e.point.lat)
		}
		map.addEventListener("click", showInfo);
		var point = new BMap.Point(<?php echo $loc;?>);
		var marker = new BMap.Marker(point);  // 创建标注
		map.addOverlay(marker);               // 将标注添加到地图中
		marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
	 }
	 function searchs(){
		 if($('input[name="pname"]').val()){
		 	allmap($('input[name="pname"]').val());
		 }
	 }
	</script>
	  
	  </td>
    </tr>
    <tr align="center" class="TableControl">
      <td colspan="2" nowrap height="35">

		<input type="button" value="保存" class="BigButtonBHover" onClick="sendForm();">      </td>
    </tr>
  </table>
</form>

 
</body>
</html>
