@extends('adminlte::page') @section('content')
@section('css')
<style>
    table thead tr th{
        white-space: nowrap;
    }
</style>
@stop
<?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="#">BOQ & Purchase Order</a></li>
            <li><a href="#">Request BOQ</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 BOQ</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' => 'construction-boq.store','method'=>'POST', 'enctype'=>'multipart/form-data','autocomplete')) !!}
                <div class="row">
                    <div class="form-group col-sm-4 col-xs-12">
                        <label class="required">Prepared By</label>
                        {!! Form::text('prepared_by', null, array('placeholder' => 'Name','class' => 'form-control','required')) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">
                        <label class="required">Project Name </label>
                        {!! Form::select('project_id', $projects, null, ['class' => 'form-control select2','required','id'=>'category-id']) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12" style="display: none;">
                        <label class="required">Zone</label>
                        {!! Form::select('zone_id',$zones, null, ['class' => 'form-control select2']) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">
                        <label>Category House</label>
                        {!! Form::select('sub_category_house_id', $house_categories, null, ['class' => 'form-control select2']) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">
                        <label class="required">Amount used (units) </label>
                        {!! Form::text('amount_of_house_used', null, array('placeholder' => 'Number','class' => 'form-control number-only','required','id'=>'amount_all_house_used')) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">
                        <label class="required">Date</label>
                        {!! Form::text('date', date('d-m-Y'), array('laceholder'=>'Date','class' => 'form-control date_picker','required')) !!}
                    </div>
                    <div class="form-group col-sm-4 col-xs-12">
                        <label class="required">Other Type</label>
                        {!! Form::text('building_type', null, array('placeholder' => 'Type','class' => 'form-control','required')) !!}
                    </div>
                    <div class="form-group col-sm-8 col-xs-12">
                        <label class="required">Title</label>
                        {!! Form::textarea('title_boq', null, array('placeholder' => 'Title','class' => 'form-control','rows'=>'2','required')) !!}
                    </div>
                </div>
                <div class="row">
                    <div style="border: 1px solid gray;padding: 15px;margin:15px;" id="boq-table-form">
                        <p style="color: #045FB4 !important;font-size: 90%;margin-top: -25px;background-color: white !important;
                        width: 90px !important;text-align: center;font-family: 'Khmer OS Muol Light'">
                            <a href="javascript:void(0)" onclick="add_table_boq(this)">ADD NEW</a>
                        </p>
                        <div class="row table-responsive" style="padding:15px;">
                            <div class="col-sm-4" style="padding: 0px;"> <label>Title : </label><input class="form-control" name="t[]" placeholder="Title" id="title-resultbody1" onkeyup="title_press_key(this)" onchange="title_press_key(this)">
                                <br />
                            </div>
                            <table class="table table-striped table-bordered nowrap" width="100%">
                                <thead>
                                    <tr>
                                        <th>No</th>
                                        <th>
                                            <label class="required">
                                                Product Name
                                            </label>
                                        </th>
                                        <th style="min-width: 110px;">
                                            <label class="required">
                                                Sub Category
                                            </label>
                                        </th>
                                        <th style="min-width: 80px;">
                                            <label class="required">
                                                Unit
                                            </label>
                                        </th>
                                        <th>
                                            <label class="required">
                                                Qty of using for one house
                                            </label>
                                        </th>
                                        <th>
                                            <label class="required">
                                                Loss Percentage(%)
                                            </label>
                                        </th>
                                        <th>
                                            <label class="required">
                                                Qty of using for <span class="amount-house-used"></span>
                                            </label>

                                        </th>
                                        <th style="min-width: 200px;">Other</th>
                                        <th>Specific</th>
                                        <th>
                                            <span class="pull-right button_primary btn-sm plus_ens fa fa-plus" onclick="add_row_product(this)"></span>
                                        </th>
                                    </tr>
                                </thead>
                                <tbody class="resultbody1">
                                    <tr>
                                        <td width="4%">
                                            <span>1</span>
                                        </td>
                                        <td width="12%">
                                            <select name="product_id[]" class="form-control select2" onchange="selected_product(this)">
                                                {!! $products !!}
                                            </select>
                                        </td>
                                        <td width="8%">
                                            <input type="text" class="form-control" name="subcategory[]" readonly="readonly">
                                        </td>
                                        <td width="6%">
                                            <input type="text" class="form-control" name="unit[]" readonly="readonly">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control number-only" required name="qty_used_one_house[]" value="" onchange="calculate_qty_using_all_house(this,'one_house_press_key')">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control number-only" required name="loss_percentage[]" value="" onchange="calculate_qty_using_all_house(this,'loss_press_key')">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control number-only" required name="qty_used_all_amount_of_house[]" value="">
                                        </td>
                                        <td>
                                            <input type="hidden" class="form-control" name="title[]">
                                            {!! Form::textarea('description[]', null, array('placeholder' => 'Description','class' => 'form-control','rows'=>'2')) !!}
                                        </td>
                                        <td>
                                            <input type="hidden" name="specific_status[]" value="1" class="input-status">
                                            <label class="checkbox-list">
                                                {!! Form::checkbox('specific[]',1,true, array('class' =>'specific')) !!}
                                                <span class="checkmark"></span>
                                            </label>
                                        </td>
                                        <td>
                                            <button class="btn btn-sm btn-danger" disabled> <span class="fa fa-trash"></span></button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12 col-xs-12">
                        <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')
@include('administrator.construction.boq.script')
@endsection