<?php
    use Carbon\Carbon;
?>


<?php $__env->startSection('title', 'Create - Farmer Batch'); ?>

<?php $__env->startPush('css'); ?>
   <!--select2-->
   <link href="<?php echo e(asset('admin/assets/plugins/select2/css/select2.css')); ?>" rel="stylesheet" type="text/css" />
   <link href="<?php echo e(asset('admin/assets/plugins/select2/css/select2-bootstrap.min.css')); ?>" rel="stylesheet" type="text/css" />

   <!-- date time -->
   <link href="<?php echo e(asset('admin/assets/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css')); ?> " rel="stylesheet" media="screen">
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-bar">
        <div class="page-title-breadcrumb">

        </div>
    </div>
    <div class="row justify-content-center">
        <div class="col-md-6 col-sm-6">
            <div class="card card-box">
                <div class="card-head text-white " style="background-color:#3FCC7E;">
                    <header>Create Farmer Batch</header>
                </div>
                <div class="card-body" id="bar-parent">
                    <form method="post" action="<?php echo e(url('/farmer/'.$farmer->id.'/batch')); ?>">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <div class="col-md-12 col-sm-12">

                                
                                <div class="form-group">
                                    <label for="name">Farmer Name</label>
                                    <input type="text" value="<?php echo e($farmer->name); ?>" class="form-control" id="name" placeholder="Enter farmer name" value="<?php echo e(old('name')); ?>" readonly>
                                    <input type="hidden" name="farmer_id" value="<?php echo e($farmer->id); ?>">
                                </div>

                                
                                <div class="form-group">
                                    <label for="name">Previous Batch Balance</label>
                                    <input type="number" value="<?php echo e(\App\Helpers\Farmers::currentBalance($farmer->id)); ?>" class="form-control" id="previous_batch_balance" value="<?php echo e(old('name')); ?>" readonly />
                                </div>



                                
                                <div class="form-group">
                                    <label for="batch_name">Batch Name</label>
                                    <input type="text" name="batch_name" class="form-control" id="batch_name" placeholder="Enter Batch Name" required>
                                </div>

                                
                                <div class="form-group">
                                    <label for="batch_number">Batch Number</label>
                                    <input type="text" name="batch_number" value="<?php echo e(date("F").'-'); ?>" class="form-control" id="batch_number" required>
                                </div>
                                <div class="row">
                                    <div class="col-6">
                                        
                                        <div class="form-group">
                                            <label for="product_id">Chicks Name</label>
                                            <select name="product_id" id="product_id" class="form-control select2">
                                                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($product->id); ?>"><?php echo e($product->product_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-6">
                                        
                                        <div class="form-group">
                                            <label for="chicks">Chicks Quantity</label>
                                            <input type="text" name="chicks_quantity" value="0" class="form-control" id="chicks" >
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-6">
                                        
                                        <div class="form-group">
                                            <label for="simpleFormEmail">Status</label>
                                            <select class="form-control" name="status">
                                                <?php $__currentLoopData = ["active" => "Active", "inactive" => "Inactive", "disabled" => "Disabled"]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($key); ?>" <?php echo e($farmer->status == $key ? "selected" : ""); ?>><?php echo e($value); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-6">
                                        <div class="form-group">
                                            <label class="">Batch Date</label>
                                            <div class="input-group date form_date" data-date="<?php echo e(\Carbon\Carbon::now()); ?>" data-date-format="dd MM yyyy" data-link-field="dtp_input1">
                                                <input class="form-control" size="16" type="text" name="batch_date" value="<?php echo e(\Carbon\Carbon::now()->format('d M Y')); ?>">
                                                <span class="input-group-addon ml-2">
                                            <span class="fa fa-calendar"></span>
                                        </span>
                                            </div>
                                            <input type="hidden" id="dtp_input1" value="" />
                                        </div>
                                    </div>


                                </div>




                            </div>

                        </div>

                        <a class="btn deepPink-bgcolor m-t-15 waves-effect" href="<?php echo e(url('/farmer/'.$farmer->id)); ?>">BACK</a>
                        <button type="submit" class="btn btn-success m-t-15 waves-effect">SUBMIT</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
    <!--select2-->
    <script src="<?php echo e(asset('admin/assets/plugins/select2/js/select2.js')); ?>" ></script>
    <script src="<?php echo e(asset('admin/assets/js/pages/select2/select2-init.js')); ?>" ></script>

    <!-- data time -->
    <script src="<?php echo e(asset('admin/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js')); ?>"  charset="UTF-8"></script>
    <script src="<?php echo e(asset('admin/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker-init.js')); ?>"  charset="UTF-8"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('template.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/forazitradersbd/public_html/resources/views/admin/farmerbatch/create.blade.php ENDPATH**/ ?>