  <?php $__env->startSection('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="#">Manage Stock</a></li>
            <li><a href="#">Create Item</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 Item (House)</h3>
                        </div>
                    </div>
                   
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12 col-xs-12">
                
                <div class="form-wrapper">
                    <?php echo Form::open(array('route' => 'items.store','method'=>'POST','enctype'=>'multipart/form-data')); ?>

                    <div class="row" style="height: 30px !important;">
                        <div class="form-group col-sm-3 col-xs-12">

                            <label class="required">Project</label>
                            <?php echo Form::select('item_projectid', $projects, null, ['class' => 'form-control project_id select2 change_prefix_code ','required']); ?>


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

                            <label class="required">Category</label>
                            <?php echo Form::select('item_categoryid', $categories, null, ['class' => 'form-control category_id select2 change_prefix_code ','required']); ?>


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

                            <label class="required">Sub Category</label>
                            <?php echo Form::select('item_sub_categoryid', $sub_categories, null, ['class' => 'form-control select2 sub_cat','required']); ?>


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

                            <label class="required">Group Item</label>
                            <?php echo Form::select('item_groupid', $item_group, null, ['class' => 'form-control group_id select2','required']); ?>


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

                            <label class="required">Item Zone</label>
                            <?php echo Form::select('item_zone_id', $item_zone, null, ['class' => 'form-control zone_id select2 change_zone_item','required']); ?>


                        </div>                 
                        <?php echo Form::hidden('item_name', null, array('placeholder' => 'Prefix Code','class' => 'form-control profix_code','id'=>'profix_code')); ?>

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

                            <label class="required">Prefix Code Start From</label>
                            <?php echo Form::text('code_start_from', null, array('placeholder' => 'Prefix Code Start From','class' => 'form-control code_start_from','readonly')); ?>


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

                            <label class="required">Block Time</label>
                            <?php echo Form::text('item_block_time', null, array('placeholder' => 'Block Time : 4...','class' => 'form-control number-only')); ?>


                        </div>

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

                            <label>Title</label>
                            <?php echo Form::text('item_title', null, array('placeholder' => 'Title','class' => 'form-control item_title')); ?>


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

                            <label class="required">Item Cost</label>
                            <?php echo Form::text('item_cost', null, array('placeholder' => 'Item Cost','class' => 'form-control sale_price number-only','required')); ?>


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

                            <label class="required">Sale Price</label>
                            <?php echo Form::text('item_price', null, array('placeholder' => 'Sale Price','class' => 'form-control price number-only','required')); ?>


                        </div>

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

                            <label class="required">Width (House)</label>
                            <?php echo Form::text('item_width_house', null, array('placeholder' => 'Width','class' => 'form-control width_house','id'=>'width_house','required')); ?>


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

                            <label class="required">Length (House)</label>
                            <?php echo Form::text('item_length_house', null, array('placeholder' => 'Length','class' => 'form-control length_house','id'=>'length_house','required')); ?>


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

                            <label class="required">Size (House)</label>
                            <?php echo Form::text('item_size_house', null, array('placeholder' => 'Size','class' => 'form-control size_house','required','id'=>'size_house')); ?>


                        </div>

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

                            <label>Width (Land For House)</label>
                            <?php echo Form::text('item_width_land', null, array('placeholder' => 'Width','class' => 'form-control width_land','id'=>'width_land')); ?>


                        </div>


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

                            <label>Length (Land For House)</label>
                            <?php echo Form::text('item_length_land', null, array('placeholder' => 'Length','class' => 'form-control length_land','id'=>'length_land')); ?>


                        </div>

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

                            <label class="required">Size (Land For House)</label>
                            <?php echo Form::text('item_size_land', null, array('placeholder' => 'Size','class' => 'form-control size_land','required','id'=>'size_land')); ?>


                        </div>

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

                            <label for="">Number of Bedroom</label>
                            <?php echo Form::text('item_bedroom', null, array('placeholder' => 'Number of Bedroom','class' => 'form-control item_bedroom number-only')); ?>


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

                            <label for="">Number of Bathroom</label>
                            <?php echo Form::text('item_bathroom', null, array('placeholder' => 'Number of bathroom','class' => 'form-control item_bathroom number-only')); ?>


                        </div>

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

                            <label for="">Sq FP</label>
                            <?php echo Form::text('item_sq_fp', null, array('placeholder' => 'Sq FP','class' => 'form-control item_sq_fp number-only')); ?>


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

                            <label for="">Parking</label>
                            <?php echo Form::text('item_parking', null, array('placeholder' => 'Parking','class' => 'form-control item_parking number-only')); ?>


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

                            <label for="">Number of Floor</label>
                            <?php echo Form::text('item_floor', null, array('placeholder' => 'Number of floor','class' => 'form-control item_floor number-only')); ?>


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

                            <label class="required">Develop By</label>
                            <?php echo Form::text('item_develop_by', null, array('placeholder' => 'Develop By','class' => 'form-control item_develop_by')); ?>


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

                            <label for="">Completed Year</label>
                            <?php echo Form::text('item_completed_year', null, array('placeholder' => 'Completed Year','class' => 'form-control date_picker item_completed_year')); ?>


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

                            <label class="required">Type</label>
                            <?php echo e(Form::select('item_type', ['Sales' => 'Sales', 'Rent' => 'Rent'],null, ['class' => 'form-control select2'])); ?>


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

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


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

                            <label class="commission_amount_con">Commission Amount($)</label>
                            <?php echo Form::text('commission_amount', 0, array('placeholder' => 'commission amount','class' => 'form-control commission_amount commission_amount_con number-only','id' => 'commission_amount commission_amount_con','')); ?>


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

                            <label class="commission_con">Commission(%)(/sale price)</label>
                            <?php echo Form::text('commission_percentage', 0, array('placeholder' => 'commission percentage','class' => 'form-control commission commission_con number-only','')); ?>


                        </div>
                        

                            
                            

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

                            <label class="required">Complatation</label>
                            <?php echo e(Form::select('item_omplatation', ['YES' => 'YES', 'NO' => 'NO'],null, ['class' => 'form-control select2'])); ?>


                        </div>
                        

                            
                            

                        
                        

                            
                            

                        
                        

                            
                            

                        
                        

                            
                            

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

                            <label class="required">Street No </label><span class="text-danger">(Street Number Of Item require number only.)</span>
                            <?php echo Form::text('item_street', null, array('placeholder' => 'Street Number','class' => 'form-control item_street number-only')); ?>


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

                            <label class="required">Prefix House No </label><span class="text-danger">(A letter placed before another.)</span>
                            <?php echo Form::text('prefix_house', null, array('placeholder' => 'House Prefix Number','class' => 'form-control prefix_house','readonly')); ?>


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

                            <label class="required">Start House No </label><span class="text-danger">(Odd or Even)</span>
                            <?php echo Form::text('item_house', null, array('placeholder' => 'Start House Number','class' => 'form-control item_house number-only')); ?>


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

                            <label class="required">Number of Item </label><span class="text-danger">(we are allow create small than 161 Items)</span>
                            <?php echo Form::text('number_of_properties', null, array('placeholder' => 'Number of item','class' => 'form-control number_of_properties number-only')); ?>


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

                            <label class="required">Count Item </label>
                            <?php echo Form::text('item_count', null, array('placeholder' => 'Count Item','class' => 'form-control number_of_properties number-only')); ?>


                        </div>
                        <!--<div class="col-sm-12 col-xs-12">
                            <strong for="">Image (525x300px)</strong>
                            <p class="text-danger">Maximum width and height to upload is 525x300 pixcel</p>
                            <div class="row">
                                <?php for($i=0; $i
                                <8; $i++): ?> <div class="col-sm-1">
                                    <a href="#" class="thumbnail">
                                        <input class="file-upload-image" name="image<?php echo e($i); ?>" type="file" id="A<?php echo e($i); ?>">
                                        <span class="close" id="A<?php echo e($i); ?>">x</span>
                                        <img src="<?php echo e(asset('assets/images/default.png')); ?>" id="A<?php echo e($i); ?>" class="img-thumbnail img-responsive" width="100%" alt="loading...">
                                        <?php echo '<small style="color:red">'.$errors->first('image'.$i).'</small>'; ?>
                                    </a>
                                </div>
                            <?php endfor; ?>
                            </div>
                        </div>
                        <div class="form-group col-sm-2 col-xs-12">
                            <div class="form-group">
                                <label for="required" class="required">Slide Image </label>
                                <p class="text-danger">Maximum width and height to upload is 1920x680 pixcel</p>
                                <a href="#" class="thumbnail">
                                    <input class="file-upload-image" name="item_slide" type="file" id="A" >
                                    <span class="close" id="A">x</span>
                                    <img src="<?php echo e(asset('assets/images/default.png')); ?>" id="A" class="img-thumbnail img-responsive" width="100%" alt="loading...">
                                    <?php echo '<small style="color:red">'.$errors->first('item_slide').'</small>'; ?>
                                </a>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12">
                            <div class="col-xs-12 col-sm-12 col-md-12">
                                <div class="bgc-midnightblue padding5 fontc-white">

                                    <label class="checkbox-list">
                                        <input type="checkbox" class="" id="select_allb" value="checked" name="checkbox_1[]"> Check All
                                        <span class="checkmark"></span>
                                    </label>

                                </div>

                                <div class="form-group">
                                    <?php if(!$assessories->isEmpty()): ?> <?php $__currentLoopData = $assessories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <label class="checkbox-list"><?php echo e(Form::checkbox('accessory[]', $value->id, false, array('class' => 'name checkbox'))); ?> <?php echo e($value->title); ?>

                                        <span class="checkmark"></span>
                                    </label>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?>
                                </div>

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

                            <label for="required">Description</label>
                            <?php echo Form::textarea('item_des', null, array('placeholder' => 'Description','class' => 'form-control summernote','rows'=>'2')); ?>


                        </div>
                        <div class="col-sm-12 col-xs-12 form-group">
                            <div class="form-group">
                                <input type="button" value="Generate" class="Generate button_warning pull-right">
                            </div>
                        </div>
                        <div class="col-sm-12 col-xs-12 generate_item">
                        <div class="row">
                            <div class="col-sm-1">
                                <label>Item Code</label>
                            </div>
                            
                                
                            
                            <div class="col-sm-1">
                                <label>House No</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Item Cost</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Sale Price</label>
                            </div>
                            <div class="col-sm-1" id="com_am">
                                <label>commission($)</label>
                            </div>
                            <div class="col-sm-1" id="com_ra">
                                <label>commission(%)</label>
                            </div>
                            <div class="col-sm-1" id="com_co">
                                <label>condition</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Size House</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Size Lend</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Title Number</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Available</label>
                            </div>
                            <div class="col-sm-1">
                                <label>Remove</label>
                            </div>
                        </div>
                    </div>
                </div>

                <?php echo Form::close(); ?>

            </div>
        </div>
    </div>
    </div>
    <?php $__env->stopSection(); ?> 
    <?php $__env->startSection('js'); ?>
    <script type="text/javascript" src="<?php echo e(asset('assets/controller/items.js')); ?>"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $(".commission_con").hide();
            $("#length_house").keyup(function(){
                var length_house = Number($(this).val());
                var width_house = Number($('#width_house').val());
                var total=width_house*length_house;
                $('#size_house').val(total);

            });
            $("#width_house").keyup(function(){
                var width_house = Number($(this).val());
                var length_house = Number($('#length_house').val());
                var total=width_house*length_house;
                $('#size_house').val(total);

            });
            
            $("#length_land").keyup(function(){
                var length_land = Number($(this).val());
                var width_land = Number($('#width_land').val());
                var total=width_land*length_land;
                $('#size_land').val(total);

            });
            $("#width_land").keyup(function(){
                var width_land = Number($(this).val());
                var length_land = Number($('#length_land').val());
                var total=width_land*length_land;
                $('#size_land').val(total);

            });
        });
        $(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();
            }
        });
        $(document).on("keyup",".commission_amount",function(){
            $(".commission").val(0);
        });
        $(document).on("keyup",".commission",function(){
            $(".commission_amount").val(0);
        });

        $('.sub_cat').change(function(){
            var sub_cat_id = $("select[name='item_sub_categoryid']").val();
            $.ajax({
                type: 'GET',
                url: '/realty/items-get-sub-cat-item-name',
                dataType:'json',
                data: {
                    'sub_cat_id': sub_cat_id
                },
                success: function(data){
                    $('.prefix_house').val(data.sub_category_name);
                }
            });

        });

    </script>
    <style>
        .form-group {
            margin-bottom: 32px;
        }
    </style>
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>