@extends('admin.layouts.app')

@section('content')

    <?php
    if (!isset($data)) $data = array();
    if (!$data && session("data")) {
        $data = session("data");
    }
    if (!$data && session('_old_input')) {
        $data = session("_old_input");
    }
    ?>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>通话纪录</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    @if(role('Call/Records/index'))
                        <div class="row">
                            <div class="col-sm-10 pull-right">
                                <a href="{{ U('Call/Records/index')}}"
                                   class="btn btn-sm btn-primary pull-right">返回列表</a>
                            </div>
                        </div>
                    @endif

                    <div class="row">
                        <div class="col-lg-10">
                            <form name="form_product" id="form-validation" action=""
                                  class="form-horizontal form-validation" accept-charset="UTF-8" method="post">


                                <div class="form-group row">

                                    <label class="col-form-label col-sm-3">电话号码</label>

                                    <div class="col-sm-9">
                                        <input id="data_phone" name="data[phone]" class="form-control"
                                               value="{{ $data['phone'] or ''}}" required="" aria-required="true"
                                               placeholder="">
                                    </div>

                                </div>
                                <div class="form-group row">

                                    <label class="col-form-label col-sm-3">拨打时间</label>

                                    <div class="col-sm-9">
                                        <input name="data[start_time]"
                                               class="form-control laydate-icon help-block m-b-none"
                                               style="width:200px; height:34px;" value="{{ $data['start_time'] or ''}}"
                                               placeholder="拨打时间"
                                               onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                                               aria-invalid="false">
                                    </div>

                                </div>
                                <div class="form-group row">

                                    <label class="col-form-label col-sm-3">结束时间</label>

                                    <div class="col-sm-9">
                                        <input name="data[end_time]"
                                               class="form-control laydate-icon help-block m-b-none"
                                               style="width:200px; height:34px;" value="{{ $data['end_time'] or ''}}"
                                               placeholder="结束时间"
                                               onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                                               aria-invalid="false">
                                    </div>

                                </div>
                                <div class="form-group row">

                                    <label class="col-form-label col-sm-3">录音地址</label>

                                    <div class="col-sm-9">
                                        <input id="data_record_path" name="data[record_path]" class="form-control"
                                               value="{{ $data['record_path'] or ''}}" required="" aria-required="true"
                                               placeholder="">
                                    </div>

                                </div>
                                <div class="form-group row">

                                    <label class="col-form-label col-sm-3">挂断原因</label>

                                    <div class="col-sm-9">
                                        <input id="data_hangup_dispostion" name="data[hangup_dispostion]"
                                               class="form-control" value="{{ $data['hangup_dispostion'] or ''}}"
                                               required="" aria-required="true" placeholder="">
                                    </div>

                                </div>
                                <div class="form-group row">

                                    <label class="col-form-label col-sm-3">拨打IP</label>

                                    <div class="col-sm-9">
                                        <input id="data_ip" name="data[ip]" class="form-control"
                                               value="{{ $data['ip'] or ''}}" required="" aria-required="true"
                                               placeholder="">
                                    </div>

                                </div>

                                <div class="form-group row">
                                    <label class="col-form-label col-sm-3">&nbsp;</label>
                                    <div class="col-sm-9">
                                        <input type="hidden" name="_referer"
                                               value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
                                        <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
                                        <input type="submit" class="btn btn-success" style="margin-right:20px;">
                                        <input type="reset" class="btn btn-default">
                                    </div>
                                </div>

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

@endsection