<title>My Jobs - Best Leearning</title>

<?php $__env->startSection('css'); ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700">
    <link rel="stylesheet" href="https://moneyupwork.com/resources/css/argon.css?v=1.1.0" type="text/css">
    <link rel="stylesheet" href="https://moneyupwork.com/resources/css/myapp.css" type="text/css">
    <link rel="stylesheet" href="https://moneyupwork.com/resources/css/bttn.css" type="text/css">
    <style>
        .shadow-sm {
            display: none !important;
        }

        .table th {
            background-color: rgba(250, 250, 250, 1); 
            color: #000066; 
            font-size: 12px;
        }
    
        .table-no-vertical-border th,
        .table-no-vertical-border td {
            border-left: none;  
            border-right: none; 
            border-color: rgba(0, 0, 0, 0.1); 
        }
        .table tbody tr:hover {
            cursor: pointer;
            opacity: 0.6;
        }
        
        .arv-job {
           color: blue;
           font-weight:bold;
        }
        
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('user-content'); ?>
    <?php if(session('resume_success')): ?>
        <div class="alert alert-success" style="font-weight:bold;">
            <i class="fas fa-check"></i>
            <span id="resumeSuccessMessage" class="ms-3">Resume Success</span>
            <button type="button" class="close" onclick="closeResumeMessage()">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    <?php endif; ?>

<section>
    <div class="card mt-2">
        <div class="card-header">
    <div class="card-title text-center" style="font-weight: 500; color: #2ECC71; font-size: 20px;">My Posted Jobs</div>
   
        </div>
        <div class="card-body">
            <!--<div class="notice-box mb-3">
                <marquee bgcolor="transparent" style="padding: 5px;border-radius: 5px;border: 1px solid blue;margin-top: 5px" behavior="scroll">
                    <a style="font-size:15px; color: #000066">
                        <i class="fe fe-link me-2" aria-hidden="true"></i>Please review all proves within 48 hours or proves will be approved automatically
                    </a>
                </marquee>
            </div>-->
            
            <?php if($datas->isEmpty()): ?>
                <div class="text-center py-3">
                    <p>You Have No Job</p>
                </div>
            <?php else: ?>
            <div class="table-responsive active">
                <table class="table table-bordered text-nowrap table-no-vertical-border table-flush" id="example1">
                    <thead class="thead-light">
                        <tr>
                            <th scope="col border-bottom-0" width="5%">JOB ID</th>
                            <th scope="col border-bottom-0">JOB NAME</th>
                            
                            <th scope="col border-bottom-0" width="8%">PROGRESS</th>
                            <!--<th scope="col border-bottom-0" width="8%">TASK PRICE</th>-->
                            
                            <th scope="col border-bottom-0" width="8%">COST</th>
                                                        <!--<th scope="col border-bottom-0" width="5%">Work Proof</th>-->
                            
                            <th scope="col border-bottom-0" width="8%">STATUS</th>
                            
                            <th scope="col border-bottom-0" width="8%">ACTION</th>
                        </tr>
                    </thead>
                    <tbody>
                        
                        <?php $__currentLoopData = $datas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td style="vertical-align: middle;"><?php echo e($data->code); ?></td>
                                <?php if($data->status == 1): ?>
                                <td class="arv-job" style="vertical-align: middle;"><a href="<?php echo e(route('user.job-working-proves', $data->code)); ?>"><?php echo e($data->title); ?></a></td>
                                <?php else: ?>
                                <td style="vertical-align: middle;"><?php echo e($data->title); ?></td>
                                <?php endif; ?>
                                <td style="vertical-align: middle;"><?php echo e(complete_work_this_job($data->id)); ?> OF <?php echo e($data->worker_need); ?></td>
                                <!--<td><?php echo e($data->each_worker_earn); ?>$</td>-->
                               
                                <td style="vertical-align: middle;"><?php echo e($data->budget); ?>$</td>
                                    
                                <td style="vertical-align: middle;">
                                    <?php if($data->pause == 1): ?>
                                        <span class="badge badge-dot mr-4">
                                            <i class="bg-gradient-red"></i>
                                            <span class="text-black">Paused</span>
                                        </span>
                                    <?php elseif($data->worker_need <= $data->worker_confirmed): ?>
                                        <span class="badge badge-dot mr-4">
                                            <i class="bg-gradient-blue"></i>
                                            <span class="text-black">Complete</span>
                                        </span>
                                    <?php elseif($data->status == 1): ?>
                                        <span class="badge badge-dot mr-4">
                                            <i class="bg-gradient-green"></i>
                                            <span class="text-black">Active</span>
                                        </span>
                                    <?php elseif($data->status == 2): ?>
                                        <span class="badge badge-dot mr-4">
                                            <i class="bg-gradient-red"></i>
                                            <span class="text-black">Rejected</span>
                                        </span>
                                    <?php else: ?>
                                        <span class="badge badge-dot mr-4">
                                            <i style="background-color: #F1C40F;"></i>
                                            <span class="text-black">Pending</span>
                                        </span>
                                    <?php endif; ?>
                                </td>
                                
                                <td style="vertical-align: middle;">
                                    <!--<?php if($data->status == 1): ?>
                                        <?php if($data->worker_need != $data->worker_confirmed && $data->pause != 1): ?>
                                            <?php if(job_ready_for_boost($data->id) == 1): ?>
                                                <a href="javascript:;" class="btn btn-sm btn-primary" onclick="boostJob(<?php echo e($data->id); ?>)">Boost</a>
                                            <?php else: ?>
                                                <a href="javascript:;" class="btn btn-sm btn-primary" onclick="boostJob(<?php echo e($data->id); ?>)"><?php echo e(remain_interval_for_boost($data->id)); ?>m</a>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>-->
                                    <?php if($data->status == 1): ?>
                                        <a href="<?php echo e(route('user.job-working-proves', $data->code)); ?>" class="btn btn-sm btn-info bttn">Proves</a>
                                    <?php endif; ?>
                                    
                                    <!--<?php if($data->worker_need <= $data->worker_confirmed): ?>
                                        <a href="javascript:;" class="btn btn-sm btn-warning" onclick="updateJobWorker(<?php echo e($data->id); ?>)">Update</a>
                                        <!--<a href="#" class="btn btn-sm btn-danger" onclick="confirmDelete('<?php echo e(route('user.job-delete', $data->id)); ?>')">Delete</a>
                                    <?php endif; ?>-->
                                    
                                    <?php if($data->pause == 1): ?>
                                        <a href="<?php echo e(route('user.start-job', $data->id)); ?>" class="btn btn-sm btn-twitter bttn">Resume</a>
                                    <?php endif; ?>
                                        <a href="<?php echo e(route('user.my-job-details', $data->code)); ?>" class="btn btn-sm btn-primary bttn">Details</a>
                                   <!-- <?php if($data->status == 2): ?>
                                        <a href="#" class="btn btn-sm btn-danger" onclick="confirmDelete('<?php echo e(route('user.job-delete', $data->id)); ?>')">Delete</a>
                                    
                                    <?php endif; ?>-->
                                </td>
                            </tr>
                            
                            <?php if(job_ready_for_boost($data->id) == 1): ?>
                                <div class="modal fade" id="boost_job_<?php echo e($data->id); ?>" tabindex="-1" role="dialog" aria-labelledby="divisionEditModalLabel" aria-hidden="true">
                                    <div class="modal-dialog modal-dialog-centered" role="document">
                                        <form action="<?php echo e(route('user.job-boosting-update', $data->id)); ?>" method="POST" enctype="multipart/form-data">
                                            <?php echo csrf_field(); ?>
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title" id="exampleModalLabel">Boost For "<?php echo e($data->title); ?>"</h5>
                                                </div>
                                                <div class="modal-body">
                                                    <div class="form-group">
                                                        <select class="form-control" name="boost_charge" required>
                                                            <option value="">Select One</option>
                                                            <?php $__currentLoopData = boost_charges(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $boost_charge): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <option value="<?php echo e($boost_charge->id); ?>"><?php echo e($boost_charge->duration); ?> Minutes - $<?php echo e($boost_charge->charge); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                    </div>
                                                </div>
    
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="boostJobModalClose(<?php echo e($data->id); ?>)">Close</button>
                                                    <button type="submit" class="btn btn-primary">Submit</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            <?php endif; ?>

                            <?php if($data->worker_need <= $data->worker_confirmed): ?>
                                <div class="modal fade" id="worker_need_<?php echo e($data->id); ?>" tabindex="-1" role="dialog" aria-labelledby="divisionEditModalLabel" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <form action="<?php echo e(route('user.job-work-need-update', $data->id)); ?>" method="POST" enctype="multipart/form-data">
                                            <?php echo csrf_field(); ?>
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title" id="exampleModalLabel">Update Worker Need</h5>
                                                </div>
                                                <div class="modal-body">
                                                    <p class="text-green"><h5 style="color:blue;">Worker Earn=$<?php echo e(number_format($data->each_worker_earn, 4)); ?></p>
                                                    <div class="form-group col-lg-12 col-md-12 col-12">
                                                        <input type="number" class="form-control" id="worker_input_<?php echo e($data->id); ?>" name="worker" value="0" min="0" required>
                                                        <br>
                                                        <p id="cost_display_<?php echo e($data->id); ?>" class="" style="padding: 5px;font-weight:bold"></p> 
                                                    </div>
                                                </div>
                                
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="updateJobWorkerMosdalClose(<?php echo e($data->id); ?>)">Close</button>
                                                    <button type="submit" class="btn btn-primary bttn">Submit</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            <?php endif; ?>
                       <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
               
            </div>
            <?php endif; ?>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script>
        function updateJobWorker(id){
            $('#worker_need_'+id).modal('show');
        }

        function updateJobWorkerMosdalClose(id){
            $('#worker_need_'+id).modal('hide');
        }
        
        function boostJob(id){
            $('#boost_job_'+id).modal('show');
        }

        function boostJobModalClose(id){
            $('#boost_job_'+id).modal('hide');
        }
        

        function confirmDelete(url) {
            var result = confirm("Are you sure you want to delete?");
            if (result) {
                // If the user clicks "OK" in the confirmation dialog, redirect to the delete URL
                window.location.href = url;
            }
        }
        
        function closeResumeMessage() {
            var resumeMessage = document.querySelector('.alert-success');
            resumeMessage.style.display = 'none';
        }
        
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('user.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/dealruom/microjob.dealingwork.com/resources/views/user/pages/job-list.blade.php ENDPATH**/ ?>