@extends('layouts.admin')
@section('content')

        <!--左侧菜单栏-->

@include('admin.left-sidebar')

<!-- 内容 -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            用户管理
            <small></small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{ url('/ ')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
            <li><a href="#">征拆局系统维护</a></li>
            <li class="active">用户管理</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">添加用户</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
                        <i class="fa fa-minus"></i></button>
                </div>
            </div>
            <div class="box-body">
                <form action="{{ url("/user") }}" method="post">
                    {{csrf_field()}}
                    @include('admin.errors', ['errors' => $errors])

                    <table id="example2" class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
                        <tbody>
                        <tr>
                            <td>登陆名</td>
                            <td><input name="name" class="form-control" value="" ></td>
                        </tr>
                        <tr>
                            <td>密码</td>
                            <td><input type="password" name="pswd" class="form-control"  value="" ></td>
                        </tr>
                        <tr>
                            <td>姓名</td>
                            <td><input name="surname" class="form-control" value=""  ></td>
                        </tr>
                        <tr>
                            <td>头像</td>
                            <td>
                                <input hidden name="thumb" class="form-control">
                                <input id="file_upload" name="file_upload" type="file" multiple="true">
                                <script src="{{ asset('uploadify/jquery.uploadify.min.js') }}" type="text/javascript"></script>
                                {{--<link rel="stylesheet" type="text/css" href="{{ asset('uploadify/uploadify.css') }}">--}}
                                <script type="text/javascript">
                                    <?php $timestamp = time();?>
                                    $(function() {
                                        $('#file_upload').uploadify({
                                            'buttonText' : '头像上传',
                                            'formData'     : {
                                                'timestamp' : '<?php echo $timestamp;?>',
                                                '_token'     : '{{ csrf_token() }}'
                                            },
                                            'swf'      : "{{asset('uploadify/uploadify.swf')}}",
                                            'uploader' : "{{url('/upload')}}",
                                            'onUploadSuccess' : function(file,data,response){
                                                $('input[name=thumb]').val(data);
//                                                $('#art_thumb_img').attr('src','/'+data);
                                            }
                                        });
                                    });
                                </script>
                            </td>
                        </tr>
                        {{--<tr>--}}
                            {{--<td>预览</td>--}}
                            {{--<td><img src="" alt="" id="art_thumb_img"  style="max-width: 350px;max-height: 100px;"></td>--}}
                        {{--</tr>--}}
                        <tr>
                            <td>职位</td>
                            <td>
                                <select class="form-control" name="role_id">
                                    <option value=""></option>
                                    @foreach($user_job as $value)
                                        <option value="{{$value->id}}">{{$value->display_name}}</option>
                                    @endforeach
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>学历</td>
                            <td><input name="education" class="form-control" value=""  ></td>
                        </tr>
                        <tr>
                            <td>单位</td>
                            <td>
                                <select class="form-control" name="department_id">
                                    <option value=""></option>
                                    @foreach( $department as $dep)
                                        <option value="{{ $dep->id }}">{{ $dep->department_name }}</option>
                                        @endforeach
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>证件名称</td>
                            <td><input name="cardname" class="form-control" value=""  ></td>
                        </tr>
                        <tr>
                            <td>证件编号</td>
                            <td><input name="cardid" class="form-control" value=""  ></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <button class="btn btn-primary" type="submit">提交</button>
                                <a href="{{ url('/user_list') }}" class="btn">返回</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->

    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->

@endsection