{load(fhead)}
<body class="mainbg">
	<div id="mainhearder"><span>您的位置：<a href="{$vd['root']}index.php?m=mod_b2b&a=Home">直销商管理系统</a> >> 服务与支持 >> 平台内部短信</span></div>
	
	<div id="hearder"><span>发送新短信</span></div>
	<form name="messenger" method="post" action="index.php?m=mod_agent&c=Messenger&a=MessengerSave" onSubmit="return Validator.Validate(this,3)">
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table1">
		<tr>
		<td width="22%" height="30" class="tableleft1">收 信 人：</td>
		<td width="78%" class="tableright1">
		<select name="msgto" dataType="Require" msg="必须要选择收件人" onchange="settr(this)">
		<option value="0" selected>平台管理员</option>
		<option value="2">您的所有下级客户</option>
		<!--if(count($vd['agents']) > 0){-->
    <option value="3" >指定下级</option>
    <!--}-->
		</select></td>
		</tr>
		<tr id="underling" style="display:none">
      <td height="30" class="tableleft1">下级编号：</td>
      <td class="tableright1">
        <select name="underlingid">
        <option value="0">请选择您的下级编号</option>
        <!--foreach($vd['agents'] as $item){-->
        <option value="{$item['aid']}">{$item['company']}({#DisplayCode($item['aid'])})</option>
        <!--}-->
        </select>
      </td>
    </tr>
		<tr>
		<td height="30" class="tableleft1">短信标题：</td>
		<td class="tableright1"><input type='text' size='55' maxlength='100' name='title' class='input' datatype="LimitB" min="1" max="90" msg="短信标题未填写或过长" value="{$vd['msgtitle']}"></td>
		</tr>
		<tr>
		<td class="tableleft1">短信内容：</td>
		<td class="tableright1"><textarea name="content" cols="60" rows="8" class='input' datatype="LimitB" min="1" max="450" msg="短信内容未填写或过长"></textarea></td>
		</tr>
		<tr>
		<td height="30" class="tableleft1">&nbsp;</td>
		<td class="tableright1">
		<input name="submit" type="submit" class="button" value="确认发送">
		<input name="reset" type="reset" class="button" value="重新填写"></td>
		</tr>
		</table>
	</td>
	</tr>
	</table>
	</form>
	
</body>
</html>
<script type="text/javascript">
  var $ = function(id){
    return document.getElementById(id);
  }
  
  function settr(obj){
  	v = obj.options[obj.selectedIndex].value;

    if(v == 3)
    {
      $("underling").style.display = "";
    }
    else
    {
      $("underling").style.display = "none";
    }
  }
</script>
