{template nheader.html}
<script type="text/javascript">
$(function() {
	{if $data.uid}
	$.getScript("{$service}?c=check&uid={$data.uid}&key={$data.key}");
	{/if}
});
</script>
<form class="form-horizontal" action="" method="post" id="myform" name="myform">
	<div class="page-bar">
		<ul class="page-breadcrumb mylink">
			{$menu.link}

		</ul>
		<ul class="page-breadcrumb myname">
			{$menu.name}
		</ul>
		<div class="page-toolbar">
			<div class="btn-group pull-right">
				<button type="button" class="btn green btn-sm btn-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false" data-hover="dropdown"> {fc_lang('操作菜单')}
					<i class="fa fa-angle-down"></i>
				</button>
				<ul class="dropdown-menu pull-right" role="menu">
					{loop $menu.quick $t}
					<li>
						<a href="{$t.url}">{$t.icon} {$t.name}</a>
					</li>
					{/loop}
					<li class="divider"> </li>
					<li>
						<a href="javascript:window.location.reload();">
							<i class="icon-refresh"></i> {fc_lang('刷新页面')}</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<h3 class="page-title">
		<small></small>
	</h3>
	<div class="portlet light bordered myfbody">

		<div class="portlet-title">
			<div class="caption">
				<span class="caption-subject font-green sbold uppercase">{fc_lang('发送短信')}</span>
			</div>
		</div>
		<div class="portlet-body">

			<div class="row">
				<div class="portlet-body form">

					<div class="form-group">
						<label class="col-md-2 control-label" style="padding-top: 10px;">{fc_lang('类型')}：</label>
						<div class="col-md-9">
							<div class="radio-list">
								<label class="radio-inline"><input name="is_all" type="radio" value="0" onclick="$('.dr_0').show();$('.dr_1').hide();" checked="checked" /> {fc_lang('单发')}</label>
								<label class="radio-inline"><input name="is_all" type="radio" value="1" onclick="$('.dr_1').show();$('.dr_0').hide();" /> {fc_lang('指定群发')}</label>
							</div>
						</div>
					</div>
					<div class="form-group dr_0">
						<label class="col-md-2 control-label">{fc_lang('手机号码')}：</label>
						<div class="col-md-9">
							<label><input class="form-control" type="text" name="data[mobile]" ></label>
						</div>
					</div>
					<div class="form-group dr_1" style="display:none">
						<label class="col-md-2 control-label">{fc_lang('手机号码')}：</label>
						<div class="col-md-9">
							<textarea class="form-control" style="height:100px" name="data[mobiles]" ></textarea>
							<span class="help-block">多个手机号码按“回车符号”分隔，一行一个号码</span>
						</div>
					</div>
					<div class="form-group ">
						<label class="col-md-2 control-label">{fc_lang('发送内容')}：</label>
						<div class="col-md-9">
							<textarea class="form-control" style="height:100px" name="data[content]" ></textarea>
							<span class="help-block">字数控制在40字以内，请勿发布非法信息，一经发现账户会被禁用</span>
						</div>
					</div>


				</div>
			</div>
		</div>
	</div>

	<div class="myfooter">
		<div class="row">
			<div class="portlet-body form">
				<div class="form-body">
					<div class="form-actions">
						<div class="row">
							<div class="col-md-12 text-center">
								<button type="button" class="btn green" onclick="dr_send()"> <i class="fa fa-save"></i> {fc_lang('发送')}</button>
								<label id="dr_send_note"></label>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</form>
<script type="text/javascript">
<!--
function dr_send() {
	$("#dr_send_note").html('<img src="{THEME_PATH}admin/images/loading.gif">');
	var data = $("#myform").serialize();
	$.ajax({type: "POST",dataType:"json", url: "{dr_url('sms/ajaxsend')}&"+Math.random(), data: data,
		success: function(data) {
			if (data.status == 1) {
				$("#dr_send_note").html('<font color=green>'+data.code+'</font>');
			} else {
				$("#dr_send_note").html('<font color=red>'+data.code+'</font>');
			}
		},
		error: function(HttpRequest, ajaxOptions, thrownError) {
			$("#dr_send_note").html('');
			alert(thrownError + "\r\n" + HttpRequest.statusText + "\r\n" + HttpRequest.responseText);
		}
	});
	return false;
}
//-->
</script>
{template nfooter.html}