/
home
/
sjslayjy
/
public_html
/
ccbfsoution
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('content'); ?> <style> /* General UI Enhancements */ body { background-color: #f0f2f5; } /* Enhanced Top Sticky Bar - Left-Right Layout */ .top-sticky-bar { background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); padding: 15px 25px; border-bottom: none; box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1); margin-bottom: 0; border-radius: 12px 12px 0 0; position: sticky; top: 10px; z-index: 100; backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.8); border-bottom: none; } /* Left-Right Form Layout */ .filter-controls { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 20px; } /* Left Side Controls */ .left-controls { display: flex; align-items: center; gap: 20px; flex: 0 0 auto; } /* Right Side Search */ .right-controls { display: flex; align-items: center; flex: 0 0 auto; } /* Form Groups - Compact */ .form-group-compact { display: flex; flex-direction: column; min-width: 160px; } .form-group-compact label { font-weight: 600; color: #2c3e50; margin-bottom: 6px; /*display: flex;*/ align-items: center; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; } .form-group-compact label i { margin-right: 6px; color: #3498db; font-size: 0.9rem; } /* Enhanced Input Styling */ .custom-select-enhanced { height: 42px; padding: 0.6rem 1rem; border: 2px solid #e1e8ed; border-radius: 8px; font-size: 0.9rem; color: #2c3e50; background: #ffffff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 500; min-width: 160px; } .custom-select-enhanced:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1); outline: 0; transform: translateY(-1px); } .custom-select-enhanced:hover { border-color: #74b9ff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); } /* Enhanced Search Box */ .search-box-enhanced { position: relative; min-width: 280px; } .search-box-enhanced input { width: 100%; height: 42px; padding: 0.6rem 3.5rem 0.6rem 2.5rem; border: 2px solid #e1e8ed; border-radius: 25px; font-size: 0.9rem; color: #2c3e50; background: #ffffff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 500; } .search-box-enhanced input:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1); outline: 0; transform: translateY(-1px); } .search-box-enhanced input:hover { border-color: #74b9ff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); } .search-box-enhanced .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #74b9ff; font-size: 1rem; z-index: 2; } .search-box-enhanced .btn { position: absolute; right: 6px; top: 6px; height: 30px; width: 30px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #3498db, #74b9ff); border: none; border-radius: 50%; color: white; font-size: 0.8rem; transition: all 0.3s ease; box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3); } .search-box-enhanced .btn:hover { background: linear-gradient(135deg, #2980b9, #3498db); transform: scale(1.05); box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4); } /* Select2 Enhanced Styling */ .select2-container .select2-selection--single { height: 42px !important; border: 2px solid #e1e8ed !important; border-radius: 8px !important; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; background: #ffffff !important; } .select2-container .select2-selection--single:hover { border-color: #74b9ff !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important; } .select2-container--open .select2-selection--single, .select2-container .select2-selection--single:focus { border-color: #3498db !important; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1) !important; transform: translateY(-1px) !important; } .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { line-height: 38px !important; padding-left: 15px !important; color: #2c3e50 !important; font-weight: 500 !important; font-size: 0.9rem !important; } .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow { height: 100% !important; width: 35px !important; right: 8px !important; } .select2-dropdown { border: 2px solid #3498db !important; border-radius: 8px !important; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important; } /* Table Styling Improvements */ .table-responsive { overflow-x: auto; overflow-y: auto; border-radius: 0 0 12px 12px; box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1); background-color: #ffffff; margin-top: 0; border: 1px solid rgba(255, 255, 255, 0.8); border-top: none; } .table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 0; } .table thead th { background: #6b8e23 !important; color: white; position: sticky; top: 0; z-index: 10; font-weight: 600; /*padding: 16px 20px;*/ border-bottom: 3px solid #5a7a1e; text-align: left; white-space: nowrap; font-size: 0.9rem; text-transform: capitalize;; letter-spacing: 0.5px; } .table tbody tr:nth-of-type(even) { background-color: #fafbf9; } .table tbody tr:hover { background-color: #f4f7ed; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; } .table td { padding: 14px 20px; vertical-align: middle; border-top: 1px solid #f0f3eb; font-size: 0.9rem; color: #2c3e50; font-weight: 500; } /* Badge Enhancements */ .badge { font-size: 0.75rem; font-weight: 600; padding: 6px 10px; border-radius: 12px; display: inline-flex; align-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.1); line-height: 1.2; white-space: nowrap; margin: 2px; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.3px; } .badge:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); } .badge .fas { margin-right: 4px; font-size: 0.7em; } .bg-success-subtle { background: linear-gradient(135deg, #d4edda, #c3e6cb); color: #155724; border: 1px solid #b8e6c1; } .bg-warning-subtle { background: linear-gradient(135deg, #fff3cd, #ffeaa7); color: #856404; border: 1px solid #f5d982; } .bg-info-subtle { background: linear-gradient(135deg, #d1ecf1, #bee5eb); color: #0c5460; border: 1px solid #a2d2ff; } /* Session Badge Styles */ .bg-kharif { background: linear-gradient(135deg, #27ae60, #2ecc71); color: white; border: 1px solid #229954; } .bg-rabi { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; border: 1px solid #d68910; } .bg-zaid { background: linear-gradient(135deg, #8e44ad, #9b59b6); color: white; border: 1px solid #7d3c98; } /* Export Button Styling */ .export-btn { height: 42px; padding: 0.6rem 1.2rem; border: 2px solid #28a745; border-radius: 8px; font-size: 0.9rem; color: white; background: linear-gradient(135deg, #28a745, #20c997); box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 600; min-width: 160px; display: flex; align-items: center; justify-content: center; gap: 8px; } .export-btn:hover { border-color: #20c997; background: linear-gradient(135deg, #20c997, #17a2b8); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4); } .export-btn:active { transform: translateY(0); } .export-btn i { font-size: 1rem; } /* Responsive Adjustments */ @media (max-width: 992px) { .filter-controls { flex-direction: column; align-items: stretch; gap: 15px; } .left-controls { justify-content: space-between; width: 100%; flex-wrap: wrap; } .right-controls { width: 100%; justify-content: center; } .search-box-enhanced { min-width: 100%; } .form-group-compact { min-width: 32%; } } @media (max-width: 768px) { .left-controls { flex-direction: column; gap: 15px; } .form-group-compact { min-width: 100%; } .top-sticky-bar { padding: 15px; border-radius: 8px; } } /* Pagination Styling */ .pagination { justify-content: center; margin-top: 30px; } .pagination .page-item .page-link { border-radius: 8px; margin: 0 4px; color: #3498db; border: 2px solid #e1e8ed; transition: all 0.3s ease; font-weight: 500; padding: 8px 12px; } .pagination .page-item.active .page-link { background: linear-gradient(135deg, #3498db, #74b9ff); border-color: #3498db; color: white; box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); } .pagination .page-item .page-link:hover { background-color: #ebf3fd; border-color: #74b9ff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); } </style> <div class="top-sticky-bar"> <form method="GET" class="w-100"> <div class="filter-controls"> <div class="left-controls"> <?php if($role == 1): ?> <div class="form-group-compact"> <label for="site_id" class="form-label"> <i class="fas fa-map-marker-alt"></i> Location </label> <select name="site_id" id="site_id" class="form-select custom-select-enhanced" onchange="this.form.submit()"> <option value="">All Sites</option> <?php $__currentLoopData = $sites; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($id); ?>" <?php echo e(($selectedSiteId == $id) ? 'selected' : ''); ?>> <?php echo e($name); ?> </option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <?php else: ?> <div class="form-group-compact"> <label class="form-label"> <i class="fas fa-map-marker-alt"></i> Location </label> <input type="text" class="form-control custom-select-enhanced" value="<?php echo e($sites[$selectedSiteId] ?? 'N/A'); ?>" readonly> </div> <?php endif; ?> <div class="form-group-compact"> <label for="blockSelect" class="form-label"> <i class="fas fa-th-large"></i> Block </label> <select id="blockSelect" name="block_name" class="form-select custom-select-enhanced" onchange="this.form.submit()"> <option value="">All Blocks</option> <?php $__currentLoopData = $blocks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $block): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($block); ?>" <?php echo e(request('block_name') == $block ? 'selected' : ''); ?>> Block <?php echo e($block); ?> </option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="form-group-compact"> <label for="sessionSelect" class="form-label"> <i class="fas fa-calendar-alt"></i> Season </label> <select id="sessionSelect" name="session" class="form-select custom-select-enhanced" onchange="this.form.submit()"> <option value="">All Seasons</option> <option value="kharif" <?php echo e(request('session') == 'kharif' ? 'selected' : ''); ?>> 🌾 Kharif </option> <option value="rabi" <?php echo e(request('session') == 'rabi' ? 'selected' : ''); ?>> 🌾 Rabi </option> <option value="zaid" <?php echo e(request('session') == 'zaid' ? 'selected' : ''); ?>> 🌾 Zaid </option> </select> </div> <div class="text-end mb-3" style="margin-top: 39px;"> <a href="<?php echo e(route('area_leveling.export', request()->all())); ?>" class="btn btn-success"> <i class="fas fa-file-csv"></i> Export CSV </a> </div> </div> <div class="right-controls"> <div class="search-box-enhanced"> <i class="fas fa-search search-icon"></i> <input type="text" name="search" class="form-control" placeholder="Search records..." value="<?php echo e(request('search')); ?>" > <button class="btn" type="submit"> <i class="fas fa-arrow-right"></i> </button> </div> </div> </div> </form> </div> <div class="table-responsive"> <table class="table table-bordered"> <thead> <tr> <th>Sr.No.</th> <!--<th>Season</th>--> <th>Block Name</th> <th>Plot No</th> <th>Area (Acre)</th> <th>Area Covered (Acre)</th> <th>Machine Used</th> <th>Tractor Used</th> <th>HSD Consumption (Ltr)</th> <th>Diesel Cost (Rs)</th> <th>Time (Hrs)</th> <th>Manpower Type</th> <th>Unskilled</th> <th>Semi Skilled 1</th> <th>Semi Skilled 2</th> <th>Major Maintenance (Rs)</th> <th>Total Cost (Rs)</th> <th>Supervisor Name</th> </tr> </thead> <tbody> <?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?> <?php // Determine season based on date $date = \Carbon\Carbon::parse($item->date); $month = $date->month; if ($month >= 6 && $month <= 10) { $season = 'kharif'; $seasonLabel = 'Kharif'; $seasonClass = 'bg-kharif'; } elseif ($month >= 11 || $month <= 3) { $season = 'rabi'; $seasonLabel = 'Rabi'; $seasonClass = 'bg-rabi'; } else { $season = 'zaid'; $seasonLabel = 'Zaid'; $seasonClass = 'bg-zaid'; } // Skip this row if session filter is applied and doesn't match $sessionFilter = request('session'); if ($sessionFilter && $sessionFilter !== $season) { continue; } ?> <tr> <td><?php echo e($data->firstItem() + $index); ?></td> <!--<td>--> <!-- <span class="badge <?php echo e($seasonClass); ?>">--> <!-- <i class="fas fa-seedling"></i> <?php echo e($seasonLabel); ?>--> <!-- </span>--> <!--</td>--> <td><?php echo e($item->block_name ?? 'N/A'); ?></td> <td><?php echo e($item->plot_name); ?></td> <td><?php echo e($item->area); ?></td> <td><?php echo e($item->area_leveling); ?></td> <td> <?php if(is_array($item->machine_names)): ?> <div class="d-flex flex-wrap justify-content-center gap-1"> <?php $__currentLoopData = $item->machine_names; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge bg-success-subtle"> <i class="fas fa-cogs"></i> <?php echo e(trim($name)); ?> </span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <?php elseif(is_string($item->machine_names) && !empty($item->machine_names)): ?> <div class="d-flex flex-wrap justify-content-center gap-1"> <?php $__currentLoopData = explode(',', $item->machine_names); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge bg-success-subtle"> <i class="fas fa-cogs"></i> <?php echo e(trim($name)); ?> </span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <?php else: ?> <span class="text-muted">N/A</span> <?php endif; ?> </td> <td> <?php if(is_array($item->tractor_names)): ?> <div class="d-flex flex-wrap justify-content-center gap-1"> <?php $__currentLoopData = $item->tractor_names; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge bg-warning-subtle"> <i class="fas fa-tractor"></i> <?php echo e(trim($name)); ?> </span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <?php elseif(is_string($item->tractor_names) && !empty($item->tractor_names)): ?> <div class="d-flex flex-wrap justify-content-center gap-1"> <?php $__currentLoopData = explode(',', $item->tractor_names); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge bg-warning-subtle"> <i class="fas fa-tractor"></i> <?php echo e(trim($name)); ?> </span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <?php else: ?> <span class="text-muted">N/A</span> <?php endif; ?> </td> <td><?php echo e($item->hsd_consumption); ?></td> <td> <?php if(is_numeric($item->diesel_cost)): ?> <?php echo e(number_format($item->diesel_cost, 2)); ?> <?php else: ?> <span class="text-danger"><?php echo e($item->diesel_cost); ?></span> <?php endif; ?> </td> <td><?php echo e($item->hours_used); ?> Hrs</td> <td><?php echo e($item->manpower_type); ?></td> <td><?php echo e($item->unskilled); ?></td> <td><?php echo e($item->semi_skilled_1); ?></td> <td><?php echo e($item->semi_skilled_2); ?></td> <?php $json = is_string($item->major_maintenance) ? $item->major_maintenance : json_encode($item->major_maintenance); $maintenanceData = json_decode($json, true); ?> <td> <?php if(is_array($maintenanceData)): ?> <?php $__currentLoopData = $maintenanceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $maintenance): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php echo e($maintenance['spare_part'] ?? '-'); ?> <?php echo e(number_format($maintenance['value'] ?? 0, 2)); ?><br> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php else: ?> No maintenance data available. <?php endif; ?> </td> <td><?php echo e(number_format($item->total_cost ?? 0, 2)); ?></td> <td><?php echo e($item->user_name); ?></td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?> <tr> <td colspan="18" class="text-center text-muted py-4">No data found for the selected filter.</td> </tr> <?php endif; ?> </tbody> </table> </div> <div class="d-flex justify-content-center mt-4"> <?php echo e($data->links('pagination::bootstrap-5')); ?> </div> <script> $(document).ready(function() { // Apply Select2 to all dropdowns with enhanced styling $('#blockSelect, #site_id, #sessionSelect').select2({ width: '100%', theme: 'bootstrap-5', dropdownCssClass: 'shadow-lg', selectionCssClass: 'shadow-none', minimumResultsForSearch: Infinity, placeholder: function() { return $(this).data('placeholder'); } }); // Add smooth animations to form elements $('.custom-select-enhanced, .search-box-enhanced input').on('focus', function() { $(this).parent().addClass('focused'); }).on('blur', function() { $(this).parent().removeClass('focused'); }); // Add loading state to search button $('.search-box-enhanced .btn').on('click', function() { const btn = $(this); const icon = btn.find('i'); icon.removeClass('fa-arrow-right').addClass('fa-spinner fa-spin'); setTimeout(() => { icon.removeClass('fa-spinner fa-spin').addClass('fa-arrow-right'); }, 1000); }); }); // Excel Export Function function exportToExcel() { // Show loading state const exportBtn = document.querySelector('.export-btn'); const originalContent = exportBtn.innerHTML; exportBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Exporting...'; exportBtn.disabled = true; // Get current filter parameters const params = new URLSearchParams(); // Get form values const siteId = document.getElementById('site_id')?.value; const session = document.getElementById('sessionSelect')?.value; const blockName = document.getElementById('blockSelect')?.value; const search = document.querySelector('input[name="search"]')?.value; // Add parameters if they exist if (siteId) params.append('site_id', siteId); if (session) params.append('session', session); if (blockName) params.append('block_name', blockName); if (search) params.append('search', search); params.append('export', 'excel'); // Create download link - Fixed URL const exportUrl = window.location.origin + window.location.pathname.replace('/area-leveling', '') + '/export?' + params.toString(); // Create invisible link and trigger download const link = document.createElement('a'); link.href = exportUrl; link.download = `area_leveling_data_${new Date().toISOString().split('T')[0]}.csv`; document.body.appendChild(link); link.click(); document.body.removeChild(link); // Reset button state setTimeout(() => { exportBtn.innerHTML = originalContent; exportBtn.disabled = false; }, 2000); } </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home3/pmmsanvp/public_html/ccbfsolution/resources/views/area_leveling/index.blade.php ENDPATH**/ ?>