<!--{include file="<!--{$oapath}-->public/ins_page.tpl"}-->
<block name="content">
	<div class="page-header">
	<h1> <!--{if $opmode=='edit'}-->编辑<!--{else}-->新建<!--{/if}-->账户</h1>
</div>
	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
		<input type="hidden" id="ajax" name="ajax" value="1">		
		<input type="hidden" id="opmode" name="opmode" value="<!--{$opmode}-->">
                <!--{if $opmode=='edit'}-->
                 <input type="hidden" id="id" name="id" value="<!--{$vo.id}-->">
                <!--{/if}-->
		<div class="form-group">
			<label class="col-sm-2 control-label" for="name">名称：</label>
			<div class="col-sm-10">
                            <input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称" value="<!--{$vo.name}-->">
			</div>
		</div>
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="bank" >开户银行：</label>
			<div class="col-sm-8">
				<input  class="form-control" type="text" id="bank" name="bank" check="require" msg="请输入开户银行" value="<!--{$vo.bank}-->">
			</div>
		</div>
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="no">帐号：</label>
			<div class="col-sm-8">
				<input  class="form-control" type="text" id="no" name="no" check="require" msg="请输入帐号" value="<!--{$vo.no}-->">
			</div>
		</div>
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="init">初始金额：</label>
			<div class="col-sm-8">
				<input type="text" name="init" id="init" class="form-control" value="<!--{$vo.init}-->">
			</div>
		</div>
		<div class="form-group col-sm-6">
			<label class="col-sm-4 control-label" for="balance">当前余额：</label>
			<div class="col-sm-8">
				<input type="text" id="balance" name="balance" readonly="readonly" class="form-control" value="<!--{$vo.balance}-->">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="remark">摘要：</label>
			<div class="col-sm-10">
				<textarea name="remark" rows="4" style="width: 100%;" class="form-control"><!--{$vo.remark}--></textarea>
			</div>
		</div>
		<div class="form-group">
			<div class="action col-sm-10 col-sm-offset-2">
				<input class="btn btn-sm btn-primary" type="button" value="保存" onclick="save();">
				<input class="btn btn-sm btn-default" type="button" value="取消" onclick="go_return_url();">
			</div>
		</div>
	</form>
</block>

                                		</div>
		<!-- Mainly scripts -->
		<script src="<!--{$oapath}-->Ins/js/jquery-2.1.1.js"></script>
		<script src="<!--{$oapath}-->Ins/js/bootstrap.min.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="<!--{$oapath}-->Ins/js/inspinia.js"></script>
		<script src="<!--{$oapath}-->Ins/js/common.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/pace/pace.min.js"></script>
                
		<script src="<!--{$oapath}-->Ins/js/plugins/toastr/toastr.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/gritter/jquery.gritter.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/bootbox/bootbox.min.js"></script>
                
                    <script src="<!--{$oapath}-->Ins/js/plugins/date-time/moment-with-locales.js"></script>
	<script src="<!--{$oapath}-->Ins/js/plugins/date-time/bootstrap-datetimepicker.js"></script>

		<block name="js"></block>
		<script>
			$(document).ready(function() {
				$(".popup-container").width($("#dialog", parent.document).width());
				if (is_mobile()) {
					$(".popup-container").height(window.screen.height - 40);
					$(".popup-container").css('overflow', 'auto');
				}
			});
		</script>
        <block name="js">
             <script type="text/javascript">
	$(document).ready(function() {
		$('.input-date').datetimepicker({
			format : 'YYYY-MM-DD',
			locale : 'zh-cn',
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});
		
		$(".input-daterange input").datetimepicker({
			format : "YYYY-MM-DD",
			locale : 'zh-cn',
			showTodayButton : true,
			showClose : true,
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});

		$("#start_date").on("dp.change", function(e) {
			if ($("#end_date").length > 0) {
				$('#end_date').data("DateTimePicker").minDate(e.date);
			}
		});
		
		$("#end_date").on("dp.change", function(e) {
			if ($("#start_date").length > 0) {
				$('#start_date').data("DateTimePicker").maxDate(e.date);
			}
		});

		$(".input-date-time").datetimepicker({
			format : 'YYYY-MM-DD HH:mm',
			locale : 'zh-cn',
			sideBySide : true,
			showTodayButton : true,
			showClose : true,
			ignoreReadonly : true,
			widgetPositioning : {
				horizontal : 'auto',
				vertical : 'bottom'
			},
		});		 
	}); 
</script>
                <script type="text/javascript">
                        function save() {
                             sendForm("form_data", "oa.php?c=Finance&a=save_account", fix_url("oa.php?c=Finance&a=account_list"));
                        }
                </script>
        </block>
	</body>
</html>