@extends('adminlte::page') @section('content')
<?php Fun::lang() ?>
<div class="title-page">
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li><a href="#">Construction</a></li>
            <li><a href="#">Set Up Information</a></li>
            <li><a href="#">Project</a></li>
            <li><a href="#">Create</a></li>
        </ul>
    </div>
</div>
<div class="page">
    <div class="top-content">
        <div class="row">
            <div class="col-sm-12 col-xs-12">
                <div class="title-page">
                    <div class="pull-left">
                        <h3>Create project</h3>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12 col-xs-12">

            <div class="form-wrapper">
                {!! Form::open(array('route' => 'project_construction.store','method'=>'POST', 'enctype'=>'multipart/form-data')) !!}
                <div class="row">
                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">Project Code</label>
                        {!! Form::text('project_code', null, array('placeholder' => 'Project Code','class' => 'form-control','required')) !!}

                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">Project Name</label>
                        {!! Form::text('project_name', null, array('placeholder' => 'Project Name','class' => 'form-control','required')) !!}

                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">Project Phone</label>
                        {!! Form::text('project_phone', null, array('placeholder' => 'Project Phone','class' => 'form-control','required')) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12 display-none">

                        <label class="required">Project Type</label>
                        <select class="form-control select2" name="project_type" required>
                            <option value="">Please Select</option>
                            <option value="1">Internal</option>
                            <option value="2" selected="">External</option>
                        </select>

                    </div>
                    <div class="form-group col-sm-4 col-xs-12">
                        <label class="required">Branches </label>
                        {!! Form::select('branch_id', $branches, null, ['class' => 'form-control select2','required']) !!}
                    </div>

                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="">Commission type</label>
                        {!! Form::select('commission_type', array('1'=>'Amount($)','2'=>" Percentage(%)"), null, ['class' => 'form-control comm_type select2','']) !!}

                    </div>
                    <div class="form-group col-sm-4 col-xs-12 commission_amount_con">

                        <label class="commission_amount_con">Commission Amount($)</label>
                        {!! Form::text('commission_amount', 0, array('placeholder' => 'commission amount','class' => 'form-control commission_amount commission_amount_con number-only','')) !!}

                    </div>
                    <div class="form-group col-sm-4 col-xs-12 commission_con">

                        <label class="commission_con">Commission(%)(/sale price)</label>
                        {!! Form::text('commission', 0, array('placeholder' => 'commission percentage','class' => 'form-control commission commission_con number-only','')) !!}

                    </div>

                    {{--<div class="form-group col-sm-4 col-xs-12">--}}

                    {{--<label>Condition %</label><span class="text-danger"> (Condition percentage can get commission from external project)</span>--}}
                    {{--{!! Form::text('condition', null, array('placeholder' => 'Condition Percentage','class' => 'form-control number-only')) !!}--}}

                    {{--</div>--}}


                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">Province </label>
                        {!! Form::select('p_province', $provinces, null, ['class' => 'form-control select2','id'=>'p_province','required']) !!}

                    </div>

                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">District </label>
                        <select class="select2 form-control" id="p_district" name="p_district" required>
                            <option value="" disabled selected>Please Choose</option>

                        </select>
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">Commune </label>
                        <select class="select2 form-control" id="p_commune" name="p_commune" required>
                            <option value="" disabled selected>Please Choose</option>

                        </select>
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label class="required">Village </label>
                        <select class="select2 form-control" id="p_village" name="p_village" required>
                            <option value="" disabled selected>Please Choose</option>
                        </select>
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label>House No.</label>
                        {!! Form::text('house_number', null, array('placeholder' => 'House No.','class' => 'form-control')) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label>Street No.</label>
                        {!! Form::text('street_number', null, array('placeholder' => 'Street No.','class' => 'form-control')) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">

                        <label>Description</label>
                        {!! Form::textarea('project_des', null, array('placeholder' => 'Description','class' => 'form-control','rows'=>'2')) !!}

                    </div>

                    <div class="form-group col-sm-12 col-xs-12">
                        <div class="form-group col-sm-2 col-xs-12">
                            <label>Feature Image </label>
                            <div class="imageupload panel panel-default">
                                <img src="{{asset('assets/images/default.png')}}" class="hide_img" width="100px">
                                <div class="file-tab panel-body">
                                    <label class="btn button_warning btn-file">
                                        <span>Browse</span>
                                        <input type="file" name="project_feature">
                                    </label>
                                    <button type="button" class="btn button_danger">Remove</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 col-xs-12" style="margin-bottom: 10px;">
                        <div class="form-group">
                            <button type="submit" class="button_sm button_primary pull-right"><span class="fa fa-save"></span> Save</button>
                            <button type="button" onClick="javascript:history.go(-1)" class="button_sm button_warning pull-right">
                                <span class=" fa fa-arrow-circle-left"></span> Back</button>
                        </div>
                    </div>
                </div>

                {!! Form::close() !!}
            </div>
        </div>
    </div>
</div>
@endsection @section('js')
<script type="text/javascript" src="{{asset('assets/controller/location.js')}}"></script>
<script>
    $(document).ready(function() {
        $(".commission_con").hide();
        $(document).on("change", ".comm_type", function() {
            var type = 1;
            type = $(this).val();
            if (type == 1) {
                $(".commission_amount_con").show();
                $(".commission_con").hide();
            } else {
                $(".commission_amount_con").hide();
                $(".commission_con").show();
            }
        });
    });
</script>
<style>
    .form-group {
        margin-bottom: 32px;
    }
</style>
@endsection