 
<?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="#">Construction</a></li>
            <li><a href="#">Set Up Information</a></li>
            <li><a href="#">Project</a></li>
            <li><a href="#">Edit</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>Edit project</h3>
                    </div>
                </div>
               
            </div>
        </div>
    </div>
	 <div class="row">
	   <div class="col-sm-12 col-xs-12">
		 
		   <div class="form-wrapper">      
				<?php echo Form::model($project, ['method' => 'PATCH', 'enctype'=>'multipart/form-data','route' => ['project_construction.update', $project->id]]); ?>

					<div class="row">

						<div class="form-group col-sm-4 col-xs-12">
	                        
	                            <label class="required">Project Code</label>
	                            <?php echo Form::text('project_code', null, array('placeholder' => 'Project Code','class' => 'form-control')); ?>

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

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


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

							<label class="required">Project Phone</label>
							<?php echo 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">
	                            	<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>
                            <?php echo Form::select('branch_id', $branches, null, ['class' => 'form-control select2']); ?>


                        </div>
						<!-- <div class="form-group col-sm-4 col-xs-12">
							<label class="">Commission type</label>
							<?php echo 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($)</label>
                            <?php echo Form::text('commission_amount', null, 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 %</label>
                            <?php echo Form::text('commission', null, array('placeholder' => 'Commission Percentage','class' => 'form-control commission commission_con number-only')); ?>

                        </div> -->
                        
                            
                            
                        
						
	                   
	                    <div class="form-group col-sm-4 col-xs-12">
						   
							   <label class="required">Province </label>
							   <?php echo Form::select('p_province', $provinces, null, ['class' => 'form-control select2','id'=>'p_province']); ?>

							   <span class="focus-border"></span>	
						 
					   </div>
					   <div class="form-group col-sm-4 col-xs-12">
						   
							   <label class="required">District </label>
							   <?php echo Form::select('p_district', $districts, null, ['class' => 'form-control select2','id'=>'p_district']); ?>

						   
					   </div>
					   <div class="form-group col-sm-4 col-xs-12">
						   
							   <label class="required">Commune </label>
							   <?php echo Form::select('p_commune', $communes, null, ['class' => 'form-control select2','id'=>'p_commune']); ?>

						   
					   </div>
					   <div class="form-group col-sm-4 col-xs-12">
						   
							   <label class="required">Village </label>
							   <?php echo Form::select('p_village', $villages, null, ['class' => 'form-control select2','id'=>'p_village']); ?>

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

	                        <label>House No.</label>
	                        <?php echo 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>
	                        <?php echo 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>
								<?php echo Form::textarea('project_des', null, array('placeholder' => 'Description','class' => 'form-control','rows'=>'2')); ?>

						</div>

                        <div class="form-group col-sm-2 col-xs-12">
                            <div class="form-group">
                                <label for="required">Feature Image</label>
                                 <p class="text-danger"></p>
                                <input type="hidden" name="project_feature_old" value='<?php echo e($project->feature); ?>'>
	                            <img src='/assets/images/resize/768x768/<?php echo e($project->feature); ?>' width="100px" class="hide_img">
	                            <div class="imageupload panel panel-default">
	                                <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">
							<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>
					
				<?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/location.js')); ?>"></script>
	<script>
        $(document).ready(function(){
            $(".commission_con").hide();
            $(document).on("change",".comm_type",function(){
                var type=$(".commission_amount_con").val();
                if(type > 0){
                    $(".commission_amount_con").show();
                    $(".commission_con").hide();
                }
                else{
                    $(".commission_amount_con").hide();
                    $(".commission_con").show();
                }
            });
            $(".commission_con").hide();
            $(document).on("change",".comm_type",function(){
				var type1=1;
				type1=$(this).val();
				if(type1==1){
					$(".commission_amount_con").show();
					$(".commission_con").hide();
				}
				else{
					$(".commission_amount_con").hide();
					$(".commission_con").show();
				}
            });
        });
	</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(); ?>