<?php $__env->startSection('main-content'); ?>
<?php
$mytime = Carbon\Carbon::now('Asia/Kolkata');
 use Carbon\Carbon;
?>
<style>
    /* Add your CSS styles here */



    input[type="submit"] {
        padding: 10px;
        background-color: #4CAF50;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

    input[type="submit"]:hover {
        background-color: #45a049;
    }
</style>
<main>
    <div class="container">
        <div class="row">
            <div class="card-body">
                <table width="420" border="1" cellspacing="2" cellpadding="1" class="tdrow4" align="center">

                    <tbody>
                        <tr align="center">
                            <td colspan="2" class="txt">Attendance Entry Form <strong>(Coming time <?php if(isset($attendance)): ?>
                                    <?php echo e(date("H:i:s A", strtotime($attendance->in_time))); ?>

                                    <?php else: ?>
                                    <?php echo e($mytime->format('H:i:s A')); ?>

                                    <?php endif; ?>)</strong>
                            </td>
                        </tr>
                    </tbody>
                </table>

                <table id="ContentPlaceHolder1_tblGMGN" width="420" border="1" cellspacing="2" cellpadding="1"
                    class="tdrow4" align="center">
                    <form action=" <?php if(isset($attendance)): ?>
                        <?php echo e(route('branch.attendance.post.night')); ?>

                        <?php else: ?>
                        <?php echo e(route('branch.attendance.post.morning')); ?>

                    <?php endif; ?>" method="post">
                        <?php echo csrf_field(); ?>
                        <tbody>
                            <tr class="rowDate">
                                <td width="199" align="right" class="Tab3"><strong>Date</strong></td>
                                <td width="185">

                                    <input name="date" type="text" value="<?php echo e($mytime->format('Y-m-d H:i:s')); ?>"
                                        readonly="readonly" id="ContentPlaceHolder1_txt_date" size="30">
                                    <span id="ContentPlaceHolder1_RequiredFieldValidator4"
                                        style="color:Red;display:none;">*</span>
                                </td>
                            </tr>
                            <tr align="center" class="rowMessage">
                                <td width="199" align="right" class="Tab3"></td>
                                <td width="185">
                                    <textarea name="message" rows="5" cols="50" id="ContentPlaceHolder1_txtmessage"
                                        placeholder="Enter Message,If Any?" size="30"></textarea>
                                </td>
                            </tr>
                            <tr align="center">
                                <td colspan="2">
                                    <span id="ContentPlaceHolder1_lberror" style="color:Red;"></span>

                                    <br>
                                    <?php if(isset($attendance)): ?>
                                    <input type="submit" <?php if($attendance->out_time): ?>
                                    disabled
                                    <?php endif; ?> name="ctl00$ContentPlaceHolder1$btnnight" title="I have completed my all
                                    today's assigned work, should I leave now?"
                                    value="I have completed my all today's assigned work, should I leave now?"
                                    id="ContentPlaceHolder1_btnnight" class="Tab2"
                                    >
                                    <?php else: ?>
                                    <input type="submit" name="ctl00$ContentPlaceHolder1$btnnight" value="Good Morning"
                                        id="ContentPlaceHolder1_btnnight" title="Submit" class="Tab2"
                                        style="cursor: pointer;">
                                    <?php endif; ?>
                                    <br>

                                    <span id="ContentPlaceHolder1_lblmsg" style="color:Red;"></span>



                                    <span id="ContentPlaceHolder1_txtmsg" class="txtmsgg"
                                        style="color:Green;"></span><br>

                                    <span id="ContentPlaceHolder1_txtmsg1" class="txtmsgg1" style="color:Green;"></span>



                                </td>
                            </tr>
                        </tbody>
                    </form>
                </table>
            </div>
            <div class="col-md-12">
                <div class="card card-primary">
                    <div class="card-header">
                        <h6 class="card-title"></h6>
                    </div>
                    <div class="card-body" id="demo">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped" width="100%" cellspacing="0">
                                <thead>
                                    <tr>
                                        <th width="5%">S.No.</th>
                                        <th width="8%">Date</th>                                          
                                        <th width="10%">In Time</th>
                                        <th width="10%">In message</th>
                                        <th width="10%">Out Time</th>                                        
                                        <th width="10%">Out message</th>                                        
                                    </tr>
                                </thead>
                                <tbody>

                                    <?php $__empty_1 = true; $__currentLoopData = $attendances; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key =>$val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                       
                                        <td><?php echo e($key+1); ?>.</td>
                                        <td><?php echo e(Carbon::parse($val->date)->format('d-M-Y')); ?></td>                                        
                                        <td><?php echo e(date("h:i:s A", strtotime($val->in_time))); ?></td>
                                        <td><?php echo e($val->message_morning); ?></td>
                                        <td><?php echo e(isset($val->out_time) ? date("h:i:s A", strtotime($val->out_time)) : ''); ?></td>
                                        <td><?php echo e($val->message_night); ?></td>                                        
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

                                    <tr>
                                        <td colspan="6">No Record Found !!</td>
                                    </tr>

                                    <?php endif; ?>



                                </tbody>
                            </table>
                           
                        </div>
                    </div>
                    <!-- /.card-body -->
                </div>
                <!-- /.card -->

                <!-- end -->
            </div>
        </div>
    </div>
</main>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('branch.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/aks5g/public_html/aadhar.aks.5g.in/resources/views/branch/attendance/index.blade.php ENDPATH**/ ?>