Showing AI reviews for army
Project AI Score ?
67%
Quality Avg ?
72%
Security Avg ?
54%
Reviews ?
37

Review Result ?

jattin01/army · 25aeb2a5
The commit adds new functionality and fixes related to exporting data, number-to-words conversion, and staff management including listing, creating, editing, updating, and deleting staff with image uploads. The code covers key business needs but has some issues like unclear commit message, lack of input validation details visible in the diff, no explicit error handling, and potential security improvements for file handling and data filtering.
Quality ?
70%
Security ?
50%
Business Value ?
60%
Maintainability ?
70%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Very Short And Unclear
Where commit message
Issue / Evidence very short and unclear
Suggested Fix provide a descriptive meaningful commit message summarizing changes
Exclusion Of Columns As Simple Array
Where app/Exports/McoScaleDataExport.php:11
Issue / Evidence exclusion of columns as simple array
Suggested Fix consider parametrizing or documenting exclusion rationale
Possible Failure If Getcolumnnames Returns...
Where app/Exports/McoScaleDataExport.php:20
Issue / Evidence possible failure if getColumnNames returns empty and columns become ['*']
Suggested Fix add safeguards for empty tables
Querying First Row Without Ordering
Where app/Exports/McoScaleDataExport.php:39
Issue / Evidence querying first row without ordering
Suggested Fix add orderBy to guarantee consistent column order
Missing Validation
Where app/Http/Controllers/Admin/StaffController.php:54
Issue / Evidence validation method call present but not shown
Suggested Fix ensure robust validation rules especially for file types and sizes
Security Issue
Where app/Http/Controllers/Admin/StaffController.php:56-58
Issue / Evidence file upload lacks security checks (e.g. file type, size)
Suggested Fix add validation to protect against malicious uploads
Delete Old Image Without Error Handling
Where app/Http/Controllers/Admin/StaffController.php:101-104
Issue / Evidence delete old image without error handling
Suggested Fix add try-catch or verify deletion result
Reporttos Excludes Self By Query
Where app/Http/Controllers/Admin/StaffController.php:73
Issue / Evidence reportTos excludes self by query
Suggested Fix add explicit check to prevent circular reporting relationships
Fallback Returns Number As String
Where app/Helpers/NumberToWords.php:33
Issue / Evidence fallback returns number as string
Suggested Fix consider extending to support larger numbers or define behavior clearly
Code Change Preview · app/Exports/McoScaleDataExport.php ?
Removed / Before Commit
- class McoScaleDataExport implements FromCollection, WithHeadings
- {
- protected $table;
- 
- public function __construct($table)
- {
- $this->table = $table;
- }
- 
-     public function collection()
-     {
-         return DB::table($this->table)->get();
-     }
- 
-     public function headings(): array
-     {
-         $firstRow = DB::table($this->table)->first();
-         return $firstRow ? array_keys((array) $firstRow) : [];
Added / After Commit
+ class McoScaleDataExport implements FromCollection, WithHeadings
+ {
+ protected $table;
+     protected $exclude = ['id', 'created_at', 'updated_at','percentage','target'];
+ 
+ public function __construct($table)
+ {
+ $this->table = $table;
+ }
+ 
+    public function collection()
+ {
+     $columns = array_diff($this->getColumnNames(), $this->exclude);
+ 
+     if (empty($columns)) {
+         // If no columns left, select all
+         $columns = ['*'];
+ }
Removed / Before Commit
- 
- $header = [];
- foreach ($columns as $column) {
- $header[] = $column->column_name;
- }
Added / After Commit
+ 
+ $header = [];
+ foreach ($columns as $column) {
+             if (in_array($column->column_name, ['percentage', 'target'])) {
+                 continue; // Skip unwanted columns
+             }
+ 
+ $header[] = $column->column_name;
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Helpers;
+ 
+ class NumberToWords
+ {
+     public static function convert($number)
+     {
+         $words = [
+             0 => 'ZERO',
+             1 => 'ONE',
+             2 => 'TWO',
+             3 => 'THREE',
+             4 => 'FOUR',
+             5 => 'FIVE',
+             6 => 'SIX',
+             7 => 'SEVEN',
+             8 => 'EIGHT',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers\Admin;
+ 
+ use App\Http\Controllers\Controller;
+ use Illuminate\Http\Request;
+ use App\Models\Staff;
+ use App\Models\Location;
+ use App\Models\Shift;
+ use App\Models\Department;
+ use App\Models\Designation;
+ use App\Models\SalaryGroup;
+ use App\Models\EmployeeStatus;
+ use Illuminate\Support\Facades\Storage;
+ 
+ class StaffController extends Controller
+ {
+     // List all staff
Removed / Before Commit
- 'name'       => 'required|string|max:255',
- 'telephone'  => 'required|string|max:20',
- 'tno'        => 'required|string|max:255',
-             'innol'      => 'required|string|max:255',
- 'username'   => 'required|string|max:255|unique:users,username',
- 'verticals'  => 'required|integer',
- 'groups'     => 'required|integer',
Added / After Commit
+ 'name'       => 'required|string|max:255',
+ 'telephone'  => 'required|string|max:20',
+ 'tno'        => 'required|string|max:255',
+ 'username'   => 'required|string|max:255|unique:users,username',
+ 'verticals'  => 'required|integer',
+ 'groups'     => 'required|integer',
Removed / Before Commit
- {
- public function index()
- {
-         $bdes = Bde::all();
- return view('bdes.index', compact('bdes'));
- }
Added / After Commit
+ {
+ public function index()
+ {
+         $bdes = Bde::paginate(10);
+ return view('bdes.index', compact('bdes'));
+ }
Removed / Before Commit
- {
- public function index()
- {
-         $corps = Corp::all();
- return view('corps.index', compact('corps'));
- }
Added / After Commit
+ {
+ public function index()
+ {
+         $corps = Corp::paginate(10);
+ return view('corps.index', compact('corps'));
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ // app/Http/Controllers/DemandController.php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Demand;
+ use App\Models\McoDemand;
+ use Illuminate\Http\Request;
+ 
+ class DemandController extends Controller
+ {
+     public function index(Request $request)
+     {
+         $query = McoDemand::query();
+ 
+         if ($request->os_ser_no) {
+             $query->where('os_ser_no', 'like', '%' . $request->os_ser_no . '%');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Department;
+ use Illuminate\Http\Request;
+ 
+ class DepartmentController extends Controller
+ {
+     public function index()
+     {
+         $departments = Department::all();
+         return view('departments.index', compact('departments'));
+     }
+ 
+     public function create()
+     {
+         return view('departments.create');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Designation;
+ use App\Models\LeaveType;
+ use Illuminate\Http\Request;
+ 
+ class DesignationController extends Controller
+ {
+     public function index()
+     {
+         $designations = Designation::all();
+         return view('designations.index', compact('designations'));
+     }
+ 
+     public function create()
+     {
Removed / Before Commit
- {
- public function index()
- {
-         $divs = Div::all();
- return view('divs.index', compact('divs'));
- }
Added / After Commit
+ {
+ public function index()
+ {
+         $divs = Div::paginate(10);
+ return view('divs.index', compact('divs'));
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use Illuminate\Http\Request;
+ use App\Models\EqptTarget;
+ use App\Models\Equipment;
+ use App\Models\Group;
+ use App\Models\ProductionYear;
+ 
+ class EqptTargetController extends Controller
+ {
+     public function index(Request $request)
+     {
+         $targets = EqptTarget::query()
+             ->when($request->group, fn($q) => $q->where('group', $request->group))
+             ->when($request->main_eqpt, fn($q) => $q->where('main_eqpt', $request->main_eqpt))
+             ->when($request->year, fn($q) => $q->where('production_year', $request->year))
Removed / Before Commit
- {
- public function index()
- {
-         $equipments = Equipment::with('subgroup.group')->get();
- $groups = Group::with('subgroups')->get();
- 
- return view('equipment.index', compact('equipments', 'groups'));
Added / After Commit
+ {
+ public function index()
+ {
+         $equipments = Equipment::with('subgroup.group')->paginate(10);
+ $groups = Group::with('subgroups')->get();
+ 
+ return view('equipment.index', compact('equipments', 'groups'));
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Holiday;
+ use Illuminate\Http\Request;
+ 
+ class HolidayController extends Controller
+ {
+     public function index()
+     {
+         $holidays = Holiday::all();
+         return view('holidays.index', compact('holidays'));
+     }
+ 
+     public function create()
+     {
+         return view('holidays.create');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use Illuminate\Http\Request;
+ use App\Models\McoDemand;
+ use App\Models\InventoryCart;
+ use DB;
+ 
+ class InventoryController extends Controller
+ {
+    public function index()
+ {
+     $demands = McoDemand::select('demand_no')->groupBy('demand_no')->pluck('demand_no')->toArray();
+     return view('inventory.index', compact('demands'));
+ }
+ 
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ namespace App\Http\Controllers;
+ 
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\DB;
+ use App\Models\IssueGroup;
+ use App\Models\Issue;
+ 
+ class IssueController extends Controller
+ {
+     // Show unique regn_no groups
+     public function index()
+ {
+     // Get all regn_no values already in issue_group
+     $existingRegnNos = IssueGroup::pluck('regn_no')->toArray();
+ 
+     // Select regn_no from issue table excluding those already in issue_group
+     $regnNos = Issue::select('regn_no')
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\LeaveType;
+ use Illuminate\Http\Request;
+ 
+ class LeaveTypeController extends Controller
+ {
+     public function index()
+     {
+         $leaveTypes = LeaveType::all();
+         return view('leave_types.index', compact('leaveTypes'));
+     }
+ 
+     public function create()
+     {
+         return view('leave_types.create');
Removed / Before Commit
- class MasterCommandController extends Controller
- {
- public function index()
-     {
-         $commands = MasterCommand::latest()->get();
-         return view('master_command.index', compact('commands'));
-     }
- 
- public function store(Request $request)
- {
Added / After Commit
+ class MasterCommandController extends Controller
+ {
+ public function index()
+ {
+     $commands = MasterCommand::latest()->paginate(10);
+     return view('master_command.index', compact('commands'));
+ }
+ 
+ 
+ public function store(Request $request)
+ {
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\McoAdminDemandApproval;
+ use App\Models\McoDemand;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\Crypt;
+ use DB;
+ 
+ class McoAdminDemandApprovalController extends Controller
+ {
+    public function index(Request $request)
+ {
+     // Base query for demands
+     $query = McoDemand::with(['workEquipment.Equipments'])
+         ->select('work_equipment_id', 'job_no', 'demand_no')
+         ->where('status', 'approved')
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ namespace App\Http\Controllers;
+ 
+ use App\Models\McoDemand;
+ use App\Models\McoDemandUpdate;
+ use Illuminate\Http\Request;
+ use App\Models\McoSubmission;
+ use App\Models\WorkEquipment;
+ 
+ class McoDemandController extends Controller
+ {
+     public function index(Request $request)
+     {
+         $query = McoDemand::select('work_equipment_id', 'job_no', 'demand_no')
+         ->where('status', 'approved');
+ 
+         if ($request->filled('job_no')) {
+             $query->where('job_no', $request->job_no);
Removed / Before Commit
- return Excel::download(new McoScaleDataExport($tableName), $fileName);
- }
- 
- }
Added / After Commit
+ return Excel::download(new McoScaleDataExport($tableName), $fileName);
+ }
+ 
+ public function showData(McoScale $scale)
+ {
+     $table = $scale->table_name;
+ 
+     if (!Schema::hasTable($table)) {
+         return redirect()->back()->withErrors('Table does not exist.');
+     }
+ 
+     // Get all columns and remove unwanted ones
+     $columns = Schema::getColumnListing($table);
+     $columns = array_diff($columns, ['created_at', 'updated_at','percentage','target']);
+ 
+     // Fetch rows but only for the required columns
+     $rows = DB::table($table)->select($columns)->get();
+ 
Removed / Before Commit
- $menu = Menu::findOrFail($id);
- $roles = Role::all();
- $menusdata = Menu::where('id', '!=', $id)->get(); // Exclude current menu from parent list to avoid circular parent
-     return view('menus.edit', compact('menu', 'roles', 'menusdata'));
- }
- 
- public function update(Request $request, $id)
Added / After Commit
+ $menu = Menu::findOrFail($id);
+ $roles = Role::all();
+ $menusdata = Menu::where('id', '!=', $id)->get(); // Exclude current menu from parent list to avoid circular parent
+     // $icons = Menu::pluck('icon')->toarray();
+     // dd($icons);
+    $icons = [
+     0 => '<i class="fa-solid fa-gauge"></i>',
+     1 => '<i class="fa-solid fa-gear"></i>',
+     2 => '<i class="fa-solid fa-shield-halved"></i>',
+     3 => '<i class="fa-solid fa-bars"></i>',
+     4 => '<i class="fa-solid fa-user"></i>',
+     5 => '<i class="fas fa-user-tie"></i>',
+     6 => '<i class="fa-solid fa-users-cog"></i>',
+     7 => '<i class="fas fa-users"></i>',
+     8 => '<i class="fas fa-layer-group"></i>',
+     9 => '<i class="fas fa-calendar-alt"></i>',
+     10 => '<i class="fas fa-tag"></i>',
+     11 => '<i class="fas fa-building-columns"></i>',
Removed / Before Commit
- 'repair_class' => $mrEquipment->repair_class,
- 'group_id' => $mrEquipment->group_id,
- 'main_eqpt' => $mrEquipment->main_eqpt, // from MR table
-         'quantity' => $mrEquipment->quantity ?? null,
- 'work_order_id' => $mrEquipment->work_order_id ?? null,
- ]);
Added / After Commit
+ 'repair_class' => $mrEquipment->repair_class,
+ 'group_id' => $mrEquipment->group_id,
+ 'main_eqpt' => $mrEquipment->main_eqpt, // from MR table
+         'quantity' => $equipment->quantity ?? null,
+ 'work_order_id' => $mrEquipment->work_order_id ?? null,
+ ]);
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ namespace App\Http\Controllers;
+ 
+ use Illuminate\Http\Request;
+ use App\Models\WorkOrder;
+ use App\Models\WorkEquipment;
+ use App\Models\Group;
+ use App\Models\Equipment;
+ use App\Models\RepairClass;
+ use App\Models\McoScale;
+ use App\Models\DemandApproval;
+ use App\Models\IssueGroup;
+ use App\Models\Issue;
+ use App\Models\Demand;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Support\Str;
+ use Illuminate\Support\Facades\Schema;
+ 
Removed / Before Commit
- {
- public function index()
- {
-         $repairClasses = RepairClass::all();
- return view('repair_class.index', compact('repairClasses'));
- }
Added / After Commit
+ {
+ public function index()
+ {
+         $repairClasses = RepairClass::paginate(10);
+ return view('repair_class.index', compact('repairClasses'));
+ }
Removed / Before Commit
- 'role' => 'required|string|unique:roles,name',
- 'parent_ids' => 'nullable|array',
- 'parent_ids.*' => 'exists:roles,id',
-         'group_id' => 'required',
- ]);
- 
- $role = Role::create([
- 'role' => 'required|string|unique:roles,name,' . $role->id,
- 'parent_ids' => 'nullable|array',
- 'parent_ids.*' => 'exists:roles,id',
-         'group_id' => 'required',
- ]);
- 
- $role->update([
Added / After Commit
+ 'role' => 'required|string|unique:roles,name',
+ 'parent_ids' => 'nullable|array',
+ 'parent_ids.*' => 'exists:roles,id',
+ ]);
+ 
+ $role = Role::create([
+ 'role' => 'required|string|unique:roles,name,' . $role->id,
+ 'parent_ids' => 'nullable|array',
+ 'parent_ids.*' => 'exists:roles,id',
+ ]);
+ 
+ $role->update([
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Shift;
+ use Illuminate\Http\Request;
+ 
+ class ShiftController extends Controller
+ {
+     public function index()
+     {
+         $shifts = Shift::all();
+         return view('shifts.index', compact('shifts'));
+     }
+ 
+     public function create()
+     {
+         return view('shifts.create');
Removed / Before Commit
- });
- }
- 
-     $subAssys = $query->get();
- 
- $equipments = Equipment::all();
- $groups = Group::all();
Added / After Commit
+ });
+ }
+ 
+     $subAssys = $query->paginate(10);
+ 
+ $equipments = Equipment::all();
+ $groups = Group::all();
Removed / Before Commit
- {
- public function index()
- {
-         $units = Unit::orderBy('id', 'desc')->get();
- return view('units.index', compact('units'));
- }
Added / After Commit
+ {
+ public function index()
+ {
+         $units = Unit::orderBy('id', 'desc')->paginate(10);
+ return view('units.index', compact('units'));
+ }
Removed / Before Commit
- // Get unique control numbers
- $controlNumbers = $workOrders->pluck('control_no')->unique()->values();
- 
- 
- // 🔍 Apply Filters
-     if ($request->filled('control_no')) {
-         $workOrders = $workOrders->filter(function ($wo) use ($request) {
-             return str_contains($wo->control_no, $request->control_no);
-         });
-     }
- 
-     $alreadycreatedjobno = $workOrders = WorkOrder::with([
- 'workUnit',
- 'workUser',
- 'equipments.vir', // eager load VIR on each equipment
Added / After Commit
+ // Get unique control numbers
+ $controlNumbers = $workOrders->pluck('control_no')->unique()->values();
+ 
+         // dd($workOrders);
+ // 🔍 Apply Filters
+     if ($request->filled('control_number')) {
+     $workOrders = $workOrders->filter(function ($wo) use ($request) {
+         return str_contains($wo->control_no, $request->control_number);
+     })->values(); // 👈 This resets the keys to start from 0
+ }
+ 
+     $alreadycreatedjobno = WorkOrder::with([
+ 'workUnit',
+ 'workUser',
+ 'equipments.vir', // eager load VIR on each equipment
Removed / Before Commit
- {
- public function index()
- {
-         $wksps = Wksp::all();
- return view('wksps.index', compact('wksps'));
- }
Added / After Commit
+ {
+ public function index()
+ {
+         $wksps = Wksp::paginate(10);
+ return view('wksps.index', compact('wksps'));
+ }
Removed / Before Commit
- 'main_eqpt'      => 'required|string',
- ];
- 
- // Require assy, qty, regd_no only if NOT (M&R + LM/MOS)
- if (!($isMRGroup && $isLMorMOS)) {
- $rules['assy']     = 'required|array';
- }
- 
- DB::commit();
-         return response()->json([
- 'control_no' => $controlNo,
- 'control_date' => date('d-M-Y'),
- 'redirect_url' => route('work-orders.listing'),
- ]);
- // return redirect()->route('work-orders.listing')->with('success', 'Work order and equipment saved.');
- 
- } catch (\Exception $e) {
Added / After Commit
+ 'main_eqpt'      => 'required|string',
+ ];
+ 
+ 
+ // Require assy, qty, regd_no only if NOT (M&R + LM/MOS)
+ if (!($isMRGroup && $isLMorMOS)) {
+ $rules['assy']     = 'required|array';
+ }
+ 
+ DB::commit();
+         if ($isMRGroup && $isLMorMOS) {
+              return response()->json([
+             'job_no'     => $jobNumber,
+                     'job_date'   => now()->format('d-M-Y'),
+                     'job_head'   => $jobHead,
+                     'control_no' => null,
+                     'control_date' => null,
+                      'redirect_url' => route('work-orders.listing'),
Removed / Before Commit
- 
- public function collection(Collection $rows)
- {
- foreach ($rows as $row) {
-             DB::table($this->tableName)->insert($row->toArray());
- }
- }
- }
Added / After Commit
+ 
+ public function collection(Collection $rows)
+ {
+        // Step 1: Get scale info
+         $scale = DB::table('mco_scales')->where('table_name', $this->tableName)->first();
+         $totalItems = $scale->no_of_items ?? 1;
+ 
+         // Step 2: Get equipment name from equipment_id
+         $equipmentName = DB::table('equipments')->where('id', $scale->equipment_id ?? null)->value('name');
+ 
+         // Step 3: Get target from eqpt_targets
+         $target = DB::table('eqpt_targets')->where('main_eqpt', $equipmentName)->value('target') ?? 0;
+ 
+ foreach ($rows as $row) {
+             $data = $row->toArray();
+ 
+             // Step 4: Calculate percentage
+             // $authorization = isset($data['authorization']) ? (float) $data['authorization'] : 0;
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class Demand extends Model
+ {
+    
+     protected $fillable = [
+         'work_equipment_id',
+         'job_no',
+         'item_id',
+         'scale_id',
+         'demand_no',
+         'qty_required',
+         'status',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ 
+ class DemandApproval extends Model
+ {
+     use HasFactory;
+ 
+     protected $table = 'demand_approvals';
+ 
+     protected $fillable = [
+         'equipment_id',
+         'job_no',
+         'demand_no',
+         'remark',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class Department extends Model
+ {
+     protected $fillable = [
+         'name',
+         'code',
+         'description',
+         'is_active'
+     ];
+ 
+     public function employees()
+     {
+         return $this->hasMany(User::class); // or Employee model
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class Designation extends Model
+ {
+     use HasFactory;
+ 
+     protected $fillable = ['name','code','description','is_active'];
+ 
+     public function leaveTypes()
+     {
+         return $this->belongsToMany(LeaveType::class, 'designation_leave_type')
+                     ->withPivot('annual_limit')
+                     ->withTimestamps();
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class EqptTarget extends Model
+ {
+     protected $fillable = [
+         'group', 'main_eqpt', 'production_year', 'target'
+     ];
+ }
+ 
Removed / Before Commit
- {
- return $this->hasMany(SubGroup::class);
- }
- }
Added / After Commit
+ {
+ return $this->hasMany(SubGroup::class);
+ }
+ public function equipments()
+ {
+     return $this->hasMany(Equipment::class, 'group_id', 'id');
+ }
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class Holiday extends Model
+ {
+     use HasFactory;
+ 
+     protected $fillable = [
+         'name', 'start_date','end_date', 'type', 'applicable_for', 'description', 'recurring', 'is_active'
+     ];
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class InventoryCart extends Model
+ {
+     protected $fillable = [
+         'work_equipment_id',
+         'demand_no',
+         'job_no',
+         'spares',
+         'user_id',
+     ];
+     protected $casts = [
+     'spares' => 'array',
+ ];
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class Issue extends Model
+ {
+     // If your table name is not the plural 'issues', specify it
+     protected $table = 'issue';
+ 
+     // Fillable fields for mass assignment
+     protected $fillable = [
+         'scale_id',
+         'item_id',
+         'qty_required',
+         'qty_issue',
+         'voucher_no',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class IssueGroup extends Model
+ {
+     protected $table = 'issue_group';
+     protected $fillable = ['regn_no', 'work_equipment_id', 'demand_no', 'job_no', 'remark'];
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class LeaveType extends Model
+ {
+     use HasFactory;
+ 
+     protected $fillable = [
+         'name',
+         'category',
+         'unit',
+         'annual_limit',
+         'carry_forward',
+         'encashable',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class McoAdminDemandApproval extends Model
+ {
+     protected $fillable = [
+         'equipment_id',
+         'job_no',
+         'demand_no',
+         'remark',
+         'submitted_at',
+         'submitted_by',
+     ];
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class McoDemand extends Model
+ {
+    
+     protected $fillable = [
+         'work_equipment_id',
+         'job_no',
+         'os_ser_no',
+         'table_id',
+         'cat_part_no',
+         'nomenclature',
+         'account_unit',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class McoSubmission extends Model
+ {
+     protected $fillable = [
+         'work_equipment_id',
+         'job_no',
+         'demand_no',
+         'remark',
+         'submitted_by',
+     ];
+ 
+     public function submittedBy()
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class Shift extends Model
+ {
+     use HasFactory;
+ 
+     protected $fillable = [
+         'name', 'start_time', 'end_time', 'grace_early', 'grace_late', 'is_active'
+     ];
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ use Illuminate\Support\Facades\Hash;
+ 
+ class Staff extends Model
+ {
+     use HasFactory;
+ 
+     protected $table = 'staff';
+ 
+     protected $fillable = [
+         // Profile & Personal Details
+         'profile_image', 'name', 'employee_number', 'email', 'phone', 'allow_login', 'joining_date', 'status', 'address',
+         'gender', 'dob', 'personal_email', 'personal_phone', 'is_married',
Removed / Before Commit
- {
- return $this->hasMany(MR::class, 'equipment_id');
- }
- 
- 
- }
Added / After Commit
+ {
+ return $this->hasMany(MR::class, 'equipment_id');
+ }
+ // In App\Models\WorkEquipment.php
+ public function demands()
+ {
+     return $this->hasMany(Demand::class, 'work_equipment_id');
+ }
+ public function mcodemands()
+ {
+     return $this->hasMany(McoDemand::class, 'work_equipment_id');
+ }
+ 
+ 
+ 
+ }
Removed / Before Commit
- use Illuminate\Support\Facades\Auth;
- use App\Models\Menu;
- use Illuminate\Support\Facades\DB;
- 
- class AppServiceProvider extends ServiceProvider
- {
- }
- 
- $view->with('menus', $menus);
- });
- }
Added / After Commit
+ use Illuminate\Support\Facades\Auth;
+ use App\Models\Menu;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Pagination\Paginator;
+ 
+ class AppServiceProvider extends ServiceProvider
+ {
+ }
+ 
+ $view->with('menus', $menus);
+         Paginator::useBootstrapFive();
+ });
+ }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up()
+ {
+     Schema::create('staff', function (Blueprint $table) {
+         $table->id();
+         $table->string('name');
+         $table->string('email')->unique();
+         $table->string('phone')->nullable();
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+        Schema::create('eqpt_targets', function (Blueprint $table) {
+     $table->id();
+     $table->string('group');
+     $table->string('main_eqpt');
+     $table->string('production_year');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     
+         public function up()
+ {
+     Schema::create('demands', function (Blueprint $table) {
+         $table->id();
+         $table->unsignedBigInteger('work_equipment_id');
+         $table->string('os_ser_no')->index();
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('mco_submissions', function (Blueprint $table) {
+     $table->id();
+     $table->unsignedBigInteger('demand_id'); // optional if needed
+     $table->unsignedBigInteger('work_equipment_id');
+     $table->string('job_no');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+        Schema::create('mco_admin_demand_approvals', function (Blueprint $table) {
+     $table->id();
+     $table->unsignedBigInteger('equipment_id');
+     $table->string('job_no');
+     $table->string('demand_no');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('inventory_carts', function (Blueprint $table) {
+     $table->id();
+     $table->unsignedBigInteger('user_id');
+     $table->unsignedBigInteger('work_equipment_id');
+     $table->string('demand_no');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('leave_types', function (Blueprint $table) {
+             $table->id();
+             $table->string('name'); // Earned Leave, Casual Leave, etc.
+             $table->enum('category', ['full_day', 'half_day', 'hourly']);
+             $table->enum('unit', ['days', 'half_day', 'hours']);
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('departments', function (Blueprint $table) {
+             $table->id();
+             $table->string('name')->unique();
+             $table->string('code')->nullable(); // Short code like HR, IT, ADM
+             $table->text('description')->nullable();
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+ 
+     public function up(): void
+     {
+         Schema::create('designations', function (Blueprint $table) {
+             $table->id();
+             $table->string('name');
+             $table->string('code')->nullable();
+             $table->text('description')->nullable();
+             $table->boolean('is_active')->default(1);
+             $table->timestamps();
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('shifts', function (Blueprint $table) {
+             $table->id();
+             $table->string('name');
+             $table->time('start_time');
+             $table->time('end_time');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('holidays', function (Blueprint $table) {
+     $table->id();
+     $table->string('name');
+     $table->date('date');
+     $table->enum('type', ['public','restricted','special'])->default('public');
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Database\Schema\Blueprint;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration {
+     public function up(): void
+     {
+         Schema::create('staff', function (Blueprint $table) {
+             $table->id();
+ 
+             // Basic Info
+             $table->string('profile_image')->nullable();
+             $table->string('name');
+             $table->string('employee_number')->unique();
+             $table->string('email')->unique();
+             $table->string('phone')->nullable();
Removed / Before Commit
- \ No newline at end of file
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+     .form-control,
+ .form-select {
+     border-radius: 0.5rem;
+     box-shadow: none;
+     transition: all 0.2s ease-in-out;
+ }
+ 
+ .form-control:focus,
+ .form-select:focus {
+     box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
+     border-color: #198754;
+ }
+ 
+ .nav-tabs .nav-link {
Removed / Before Commit

                                                
Added / After Commit
+ <!-- resources/views/employee/basic-info.blade.php -->
+ <div class="row">
+     <!-- Profile Image Upload -->
+     <div class="col-md-3 mb-3">
+         <label for="profile_image" class="form-label">Profile Image</label>
+         <input type="file" class="form-control" id="profile_image" name="profile_image" accept="image/*">
+         @error('profile_image')
+             <div class="text-danger">{{ $message }}</div>
+         @enderror
+     </div>
+ 
+     <!-- Name -->
+     <div class="col-md-6 mb-3">
+         <label for="name" class="form-label">Name</label>
+         <input type="text" id="name" name="name" class="form-control" placeholder="Please Enter Name" value="{{ old('name') }}">
+         @error('name')
+             <div class="text-danger">{{ $message }}</div>
+         @enderror
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header py-3">
+         <div class="row align-items-center">
+             <div class="col-md-5">
+                 <h4><b>Staff Management</b></h4>
+             </div>
+             <div class="col-md-7">
+                 <div class="d-flex justify-content-end">
+                     <a href="{{ route('admin.staff.create') }}">
+                         <button class="btn btn-primary mb-3">Add Staff</button>
+                     </a>
+                 </div>
+             </div>
+         </div>
+     </div>
Removed / Before Commit
- 									<input type="text" class="form-control" id="name" name="name" placeholder="John Doe" required value="{{ old('name') }}">
- 								</div>
- 
- 								<div class="col-6 mb-2">
- 									<label for="innol" class="form-label">In Nol</label>
- 									<input type="text" class="form-control" id="innol" name="innol" placeholder="In nol" required value="{{ old('innol') }}">
- 								</div>
- 
- 								<div class="col-6 mb-2">
- 										title="Password must be at least 8 characters and include uppercase, lowercase, number, and special character."
- 									>
- 								</div>
- 
- 								<div class="col-6">
- 									<div class="d-grid">
Added / After Commit
+ 									<input type="text" class="form-control" id="name" name="name" placeholder="John Doe" required value="{{ old('name') }}">
+ 								</div>
+ 
+ 								<div class="col-6 mb-2" style="display:none">
+ 									<label for="innol" class="form-label">In Nol</label>
+ 									<input type="text" class="form-control" id="innol" name="innol" placeholder="In nol" value="{{ old('innol') }}">
+ 								</div>
+ 
+ 								<div class="col-6 mb-2">
+ 										title="Password must be at least 8 characters and include uppercase, lowercase, number, and special character."
+ 									>
+ 								</div>
+ 								<div class="col-6 mb-2"></div>
+ 
+ 								<div class="col-6">
+ 									<div class="d-grid">
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $bdes->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+  <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $corps->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit
- data-crc-serial="0001" data-crc-date="{{ date('Y-m-d') }}">
- @csrf
- 
-     <div class="d-flex justify-content-between align-items-center mb-4">
-         <h2 class="mb-0">Create CRC Entry</h2>
-         <button type="submit" class="btn btn-success">Final Submit</button>
-     </div>
- 
-     {{-- 🔹 General Info --}}
-     <div class="card p-3 mb-4">
-         <h5 class="mb-3">General Info</h5>
-         <div class="row g-3">
-             <div class="col-md-6">
-                 <label for="unit_id">Unit Name:</label>
-                 <select name="unit_id" class="form-control select2-single" id="unit_id" required>
-                     <option value="">-- Select Unit --</option>
-                     @foreach($units as $unit)
-                         <option value="{{ $unit->id }}">{{ $unit->name }}</option>
Added / After Commit
+ data-crc-serial="0001" data-crc-date="{{ date('Y-m-d') }}">
+ @csrf
+ 
+     <div class="card">
+         <div class="card-header">
+             <h4 class="mb-0"><b>Create CRC Entry</b></h4>
+         </div>
+ 
+         <hr>
+ 
+         <div class="card-body">
+ 
+             <div class="row">
+                 <div class="col-md-4">
+                     {{-- 🔹 General Info --}}
+         
+                         <h5 class="mb-3"><b>General Info</b></h5>
+                         
Removed / Before Commit
- </a>
- </div>
- 
- 
- <div class="card-body">
- {{-- 🔍 Filter Form --}}
-         <form method="GET" action="{{ route('crc.entries.index') }}" class="row g-3 mb-4">
-             <div class="col-md-3">
- <label><b>CRC No</b></label>
- <select name="crc_no" class="form-select select2" data-placeholder="Select CRC No">
- <option value="">-- All CRC No --</option>
- </select>
- </div>
- 
-             <div class="col-md-3">
- <label><b>Job No</b></label>
- <input type="text" name="job_no" class="form-control" value="{{ request('job_no') }}">
- </div>
Added / After Commit
+ </a>
+ </div>
+ 
+ <hr>
+ 
+ 
+ <div class="card-body">
+ {{-- 🔍 Filter Form --}}
+         <form method="GET" action="{{ route('crc.entries.index') }}" class="row g-3 mb-4 align-items-end">
+             <div class="col-md-2">
+ <label><b>CRC No</b></label>
+ <select name="crc_no" class="form-select select2" data-placeholder="Select CRC No">
+ <option value="">-- All CRC No --</option>
+ </select>
+ </div>
+ 
+             <div class="col-md-2">
+ <label><b>Job No</b></label>
Removed / Before Commit
- @extends('layouts.app')
- 
- @section('content')
- <div class="card">
- <div class="card-header py-3">
- <h4><b>CRC Entry Details</b></h4>
- <!-- 🔸 IV Units & Parts -->
- @foreach ($entry->ivUnits as $index => $iv)
- <div class="card mb-4 shadow-sm">
-                 <div class="card-header bg-primary text-white">
- <strong>IV Unit #{{ $index + 1 }}</strong> — IV No: {{ $iv->iv_no }} ({{ \Carbon\Carbon::parse($iv->iv_date)->format('d-m-Y') }})
- </div>
- <div class="card-body p-0">
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ 
+ <style>
+     .card-header {
+     background: #f4f4f4;
+     padding-bottom: 10px !important;
+     padding-top: 10px !important;
+ }
+ </style>
+ 
+ <div class="card">
+ <div class="card-header py-3">
+ <h4><b>CRC Entry Details</b></h4>
+ <!-- 🔸 IV Units & Parts -->
+ @foreach ($entry->ivUnits as $index => $iv)
+ <div class="card mb-4 shadow-sm">
Removed / Before Commit
- \ No newline at end of file
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ 
+   <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
+   <style>
+     .info-box {
+       background: white;
+       padding: 15px;
+       border-radius: 8px;
+       box-shadow: 0 1px 3px rgba(0,0,0,0.1);
+       text-align: center;
+     }
+     .chart-container, .table-container {
+       background: white;
+       padding: 20px;
+       border-radius: 8px;
+       height: 100%;
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
+     display: flex;
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="container">
+ <div class="d-flex align-items-center justify-content-between mb-3">
+     <h4 class="mb-0">Requisition Approval Details</h4>
+     
+     @if($demands[0]->status == 'submitted')
+         <form method="POST" action="{{ route('demand.approve.submit') }}" class="d-inline">
+             @csrf
+             <input type="hidden" name="equipment_id" value="{{ $demands[0]->work_equipment_id }}">
+             <input type="hidden" name="job_no" value="{{ $demands[0]->job_no }}">
+             <input type="hidden" name="demand_no" value="{{ $demands[0]->demand_no }}">
+             <button type="submit" class="btn btn-success">
+                 Approve Demand
+             </button>
+         </form>
+     @else
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+     .select2-container {
+         width: 100% !important;
+     }
+     .select2-selection {
+         min-height: 32px;
+     }
+     .select2-results__option {
+         padding-left: 10px;
+         display: flex;
+         align-items: center;
+     }
+ </style>
+ 
+ <div class="card">
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ 
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="container">
+     <h4>Preview Requisition</h4>
+ 
+     @if($drafts->count())
+         <form method="POST" action="{{ route('demand.submit', $equipmentId) }}">
+             @csrf
+             <table class="table table-bordered">
+                 <thead>
+                     <tr>
+                         <th>Cos Sec</th>
+                         <th>Cat/Part No</th>
+                         <th>Nomenclature</th>
+                         <th>A/U</th>
+                         <th>No Off</th>
+                         <th>Qty Demanded</th>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
+     display: flex;
+     align-items: center;
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8">
+   <title>Requirements of Spares</title>
+   <style>
+     body {
+       font-family: Arial, sans-serif;
+       font-size: 12px;
+       margin: 30px;
+     }
+ 
+     .header {
+       text-align: center;
+       margin-bottom: 10px;
+     }
+ 
+     .top-meta {
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header">
+         <h4>Create Department</h4>
+     </div>
+     <div class="card-body">
+         <form action="{{ route('departments.store') }}" method="POST">
+             @csrf
+             <div class="row mb-3">
+                 <div class="col-md-6">
+                     <label>Department Name <span class="text-danger">*</span></label>
+                     <input type="text" name="name" class="form-control" value="{{ old('name') }}" required>
+                 </div>
+ 
+                 <div class="col-md-6">
+                     <label>Code</label>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header">
+         <h4>Edit Department</h4>
+     </div>
+     <div class="card-body">
+         <form action="{{ route('departments.update', $department->id) }}" method="POST">
+             @csrf
+             @method('PUT')
+ 
+             <div class="row mb-3">
+                 <div class="col-md-6">
+                     <label>Department Name <span class="text-danger">*</span></label>
+                     <input type="text" name="name" class="form-control" value="{{ old('name', $department->name) }}" required>
+                 </div>
+ 
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+     /* Simple toggle style */
+ .form-check-input {
+     width: 30px!important;
+     height: 15px!important;
+     cursor: pointer!important;
+     transition: all 0.3s ease;  /* smooth animation */
+ }
+ 
+ </style>
+ <div class="card">
+     <div class="card-header d-flex justify-content-between align-items-center">
+         <h4>Departments</h4>
+         <a href="{{ route('departments.create') }}" class="btn btn-primary btn-sm">Add Department</a>
+     </div>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="card">
+     <div class="card-header">
+         <h4>{{ isset($designation) ? 'Edit' : 'Create' }} Designation</h4>
+     </div>
+     <div class="card-body">
+         <form action="{{ isset($designation) ? route('designations.update', $designation->id) : route('designations.store') }}" method="POST">
+             @csrf
+             @if(isset($designation)) @method('PUT') @endif
+             <div class="row">
+                 <div class="col-md-6 mb-3">
+                     <label>Name <span class="text-danger">*</span></label>
+                     <input type="text" name="name" class="form-control" value="{{ old('name',$designation->name ?? '') }}" required>
+                 </div>
+                 <div class="col-md-3 mb-3">
+                     <label>Code</label>
+                     <input type="text" name="code" class="form-control" value="{{ old('code',$designation->code ?? '') }}">
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between align-items-center">
+         <h4>Designations</h4>
+         <a href="{{ route('designations.create') }}" class="btn btn-primary btn-sm">Add Designation</a>
+     </div>
+     <div class="card-body">
+         <table class="table table-bordered table-hover">
+             <thead>
+                 <tr>
+                     <th>#</th>
+                     <th>Name</th>
+                     <th>Code</th>
+                     <th>Status</th>
+                     <th>Leave Types</th>
+                     <th width="120">Actions</th>
+                 </tr>
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $divs->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit
- position: relative;
- margin-bottom: 100px; /* ya jitna space chahiye footer se */
- }
- 
- </style>
- @if ($errors->any())
- <div class="alert alert-danger">
- <!-- Toggle Buttons -->
- <div class="mb-3 text-end">
- <button type="button" id="btnChart" class="btn btn-outline-primary btn-sm me-2">Chart View</button>
-                             <button type="button" id="btnList" class="btn btn-outline-secondary btn-sm">List View</button>
-                             <a href="{{ url('table-report') . '?' . http_build_query(request()->query()) }}"><button type="button"
-                                     class="btn btn-outline-secondary btn-sm">Table View</button></a>
- </div>
- <!-- Div-based List View -->
- <div id="listContainer" style="position: relative; z-index: 1050;">
Added / After Commit
+ position: relative;
+ margin-bottom: 100px; /* ya jitna space chahiye footer se */
+ }
+ #btnChart {
+   color: #008cff;
+ }
+ 
+ #btnChart:hover {
+   color: white;
+   background-color: #008cff;
+ }
+ .btnt{
+ color:#6c757d!important;
+ }
+ .btnt:hover{
+ color:white!important;
+ }
+ </style>
Removed / Before Commit
- form { margin-bottom: 40px; }
- .select2-results__option { padding-left: 10px; display: flex; align-items: center; }
- .stat-box { padding: 15px; background: #f1f5f9; border-left: 5px solid #0d6efd; border-radius: 4px; margin-bottom: 15px; }
- </style>
- @if ($errors->any())
- <div class="alert alert-danger">
- <!-- Toggle Buttons -->
- <div class="mb-3 text-end">
- <a href="{{ url('eq-report') . '?' . http_build_query(request()->query()) }}" ><button type="button" id="btnChart" class="btn btn-outline-primary btn-sm me-2">Chart View</button></a>
-                     <a href="{{ url('eq-report') . '?' . http_build_query(request()->query()) }}" ><button type="button" id="btnList" class="btn btn-outline-secondary btn-sm">List View</button></a>
-                     <button type="button" class="btn btn-outline-secondary btn-sm">Table View</button>
- </div>
- @if($equipments && $equipments->count())
- <div class="table-responsive">
Added / After Commit
+ form { margin-bottom: 40px; }
+ .select2-results__option { padding-left: 10px; display: flex; align-items: center; }
+ .stat-box { padding: 15px; background: #f1f5f9; border-left: 5px solid #0d6efd; border-radius: 4px; margin-bottom: 15px; }
+ #btnChart {
+   color: #008cff;
+ }
+ 
+ #btnChart:hover {
+   color: white;
+   background-color: #008cff;
+ }
+ .btnt{
+ color:#6c757d!important;
+ }
+ .btnt:hover{
+ color:white!important;
+ }
+ </style>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="row">
+     <div class="col">
+         <div class="card">
+             <div class="card-header py-3">
+                 <div class="row align-items-center">
+                     <div class="col-md-3">
+                         <h4><b>Eqpt Targets</b></h4>
+                     </div>
+                     <div class="col-md-9 text-end">
+                         <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#equipmentModal">Add Target</button>
+                     </div>
+                 </div>
+             </div>
+             <hr>
+             <div class="card-body">
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $equipments->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header">
+         <h4>{{ isset($holiday) ? 'Edit Holiday' : 'Create Holiday' }}</h4>
+     </div>
+     <div class="card-body">
+         <form action="{{ isset($holiday) ? route('holidays.update', $holiday->id) : route('holidays.store') }}" method="POST">
+             @csrf
+             @if(isset($holiday)) @method('PUT') @endif
+ 
+             <div class="row">
+                 <div class="col-md-6 mb-3">
+                     <label>Holiday Name <span class="text-danger">*</span></label>
+                     <input type="text" name="name" class="form-control" value="{{ old('name', $holiday->name ?? '') }}" required>
+                 </div>
+ 
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between align-items-center">
+         <h4>Holidays</h4>
+         <a href="{{ route('holidays.create') }}" class="btn btn-primary btn-sm">Add Holiday</a>
+     </div>
+     <div class="card-body">
+         <div class="table-responsive">
+             <table class="table table-bordered table-striped">
+                 <thead class="table-light">
+                     <tr>
+                         <th>#</th>
+                         <th>Name</th>
+                         <th>Start Date</th>
+                         <th>End Date</th>
+                         <th>Type</th>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="container">
+     
+     @if($cartItems->isEmpty())
+         <p>No items in cart.</p>
+     @else
+         <form action="{{ route('inventory.cart.issue.store') }}" method="POST">
+             @csrf
+ 
+             {{-- Common Regn No --}}
+             <div class="mb-3">
+                 <label for="regn_no" class="form-label">Regn No</label>
+                 <input type="text" class="form-control" name="regn_no" id="regn_no" required>
+             </div>
+ 
+             <table class="table table-bordered">
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
+     display: flex;
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ 
+ <div class="container">
+     <h4>My Cart</h4>
+ 
+     @foreach($cartItems as $item)
+         <div class="card mb-2">
+             <div class="card-body">
+                 <strong>Demand No:</strong> {{ $item->demand_no }} <br>
+                 <strong>Job No:</strong> {{ $item->job_no }} <br>
+                 <strong>Equipment ID:</strong> {{ $item->work_equipment_id }} <br>
+                 <strong>Spares:</strong>
+                 <ul>
+                     @foreach($item->spares ?? [] as $spare)
+                         <li>{{ $spare }}</li>
+                     @endforeach
+                 </ul>
Removed / Before Commit

                                                
Added / After Commit
+ <table class="table">
+     <thead>
+         <tr>
+             <th>Ser No</th>
+             <th>Cos Sec</th>
+             <th>Cat Part No</th>
+             <th>Nomenclature</th>
+             <th>A/U</th>
+             <th>No Off</th>
+             <th>Qty Demanded</th>
+             <th>Qty Issued</th>
+             <th>Select</th>
+         </tr>
+     </thead>
+     <tbody>
+         @foreach($demands as $index => $item)
+             @php
+                 $key = $item->demand_no.'_'.$item->job_no.'_'.$item->work_equipment_id;
Removed / Before Commit

                                                
Added / After Commit
+ @if($spares->count())
+     <table class="table table-bordered">
+         <thead>
+             <tr>
+                 <th>OS Part No</th>
+                 <th>OS Ser No</th>
+                 <th>Cat Part No</th>
+                 <th>Nomenclature</th>
+                 <th>Account Unit</th>
+                 <th>No Off</th>
+                 <th>Qty Required</th>
+                 <th>Select</th>
+             </tr>
+         </thead>
+         <tbody>
+             @foreach($spares as $spare)
+                 <tr>
+                     <td>{{ $spare->os_part_no }}</td>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+     .select2-container {
+         width: 100% !important;
+     }
+     .select2-selection {
+         min-height: 32px;
+     }
+     form {
+         margin-bottom: 40px;
+     }
+     .select2-results__option {
+         padding-left: 10px;
+         display: flex;
+         align-items: center;
+     }
Removed / Before Commit
- }, 3000); // Hide after 3 seconds
- }
- });
- </script>
- 
- </html>
Added / After Commit
+ }, 3000); // Hide after 3 seconds
+ }
+ });
+     
+ </script>
+ 
+ 
+ </html>
Removed / Before Commit
- 		table.table-bordered.dataTable {
- 		margin-top:0pX!important;
- 		}
- 	</style>
- 
- 	
- \ No newline at end of file
Added / After Commit
+ 		table.table-bordered.dataTable {
+ 		margin-top:0pX!important;
+ 		}
+ 		.pagination li {
+     margin-left: 5px;
+ }
+ 	</style>
+ 
+ 	
+ \ No newline at end of file
Removed / Before Commit
- <div class="overlay toggle-icon"></div>
- 		<!--end overlay-->
- 		<!--Start Back To Top Button--> <a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a>
- 		<!--End Back To Top Button-->
- 		<footer class="page-footer">
- 			<p class="mb-0">Copyright © 2025 <a herf="#" style="color:blue;">509 Army Workshop</a>. All Rights Reserved.</p>
Added / After Commit
+ <div class="overlay toggle-icon"></div>
+ 		<!--end overlay-->
+ 		<!--Start Back To Top Button--> <a href="javaScript:;" class="back-to-top"><i class='fas fa-arrow-up'></i></a>
+ 		<!--End Back To Top Button-->
+ 		<footer class="page-footer">
+ 			<p class="mb-0">Copyright © 2025 <a herf="#" style="color:blue;">509 Army Workshop</a>. All Rights Reserved.</p>
Removed / Before Commit
- 	<!-- Required meta tags -->
- 	<meta charset="utf-8">
- 	<meta name="viewport" content="width=device-width, initial-scale=1">
- 	<!--favicon-->
- 	<link rel="icon" href="assets/images/509logo.png" type="image/png">
- \ No newline at end of file
- \ No newline at end of file
Added / After Commit
+ @php
+ $data = \App\Models\MasterLogo::first();
+ @endphp
+ <!-- Required meta tags -->
+ 	<meta charset="utf-8">
+ 	<meta name="viewport" content="width=device-width, initial-scale=1">
+ 	<!--favicon-->
+ \ No newline at end of file
+ 	<link rel="icon" href="{{asset('storage/'.$data->favicon_path)}}" type="image/png">
+ \ No newline at end of file
Removed / Before Commit
- <div class="sidebar-wrapper" data-simplebar="true">
- <div class="sidebar-header">
-         <div><img src="{{url('assets/images/arm_logo.JPG')}}" class="logo-icon" alt="logo icon"></div>
-         <div><h4 class="logo-text">509 Army Workshop</h4></div>
- <div class="mobile-toggle-icon ms-auto"><i class='bx bx-x'></i></div>
- </div>
Added / After Commit
+ @php
+ $data = \App\Models\MasterLogo::first();
+ @endphp
+ <div class="sidebar-wrapper" data-simplebar="true">
+ <div class="sidebar-header">
+         <div><img src="{{asset('storage/'.$data->logo_path)}}" class="logo-icon" alt="logo icon"></div>
+         <div><h4 class="logo-text">{{$data->title}}</h4></div>
+ <div class="mobile-toggle-icon ms-auto"><i class='bx bx-x'></i></div>
+ </div>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header">
+         <h4>{{ isset($leaveType) ? 'Edit Leave Type' : 'Create Leave Type' }}</h4>
+     </div>
+     <div class="card-body">
+         <form action="{{ isset($leaveType) ? route('leave-types.update', $leaveType->id) : route('leave-types.store') }}" method="POST">
+             @csrf
+             @if(isset($leaveType))
+                 @method('PUT')
+             @endif
+ 
+             <div class="row">
+                 <div class="col-md-6 mb-3">
+                     <label>Leave Name <span class="text-danger">*</span></label>
+                     <input type="text" name="name" class="form-control" value="{{ old('name', $leaveType->name ?? '') }}" required>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between align-items-center">
+         <h4>Leave Types</h4>
+         <a href="{{ route('leave-types.create') }}" class="btn btn-primary">Add Leave Type</a>
+     </div>
+     <div class="card-body">
+         
+ 
+         <div class="table-responsive">
+             <table class="table table-bordered table-hover">
+                 <thead class="table-light">
+                     <tr>
+                         <th>#</th>
+                         <th>Name</th>
+                         <th>Category</th>
Removed / Before Commit
- </div>
- 
- <!-- Table -->
-                 <table id="example" class="table table-bordered table-striped">
-                     <thead>
-                         <tr>
-                             <th>Serial No</th>
-                             <th>Command</th>
-                             <th>Status</th>
-                             <th>Actions</th>
-                         </tr>
-                     </thead>
-                     <tbody>
-                         @foreach($commands as $index => $cmd)
-                         <tr>
-                             <td>{{ $index + 1 }}</td>
-                             <td>{{ $cmd->name }}</td>
-                             <td>
Added / After Commit
+ </div>
+ 
+ <!-- Table -->
+                 <div class="table-responsive">
+                     <table class="table table-bordered table-striped" id="example">
+                         <thead class="table-primary">
+                             <tr>
+                                 <th>Serial No</th>
+                                 <th>Command</th>
+                                 <th>Status</th>
+                                 <th>Actions</th>
+                             </tr>
+                         </thead>
+                         <tbody>
+                             @foreach($commands as $index => $cmd)
+                             <tr>
+                                 <td>{{ $index + 1 }}</td>
+                                 <td>{{ $cmd->name }}</td>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="container">
+     <h4>Requisition Details</h4>
+      @php
+         $equipment = \App\Models\WorkEquipment::with(['Equipments', 'group', 'RepairClass'])
+         ->find($demands[0]->work_equipment_id);
+ 
+     @endphp
+ 
+     <div class="d-flex flex-wrap align-items-center mb-3">
+         <div class="me-3"><strong>Equipment Name:</strong> {{ $equipment->Equipments?->name ?? 'N/A' }}</div>
+         <div class="me-3"><strong>Job No:</strong> {{ $demands[0]->job_no }}</div>
+         <div class="me-3"><strong>Class Name:</strong> {{ $equipment->RepairClass?->name ?? 'N/A' }}</div>
+         <div class="me-3"><strong>Group Name:</strong> {{ $equipment->group->name ?? 'N/A' }}</div>
+ 
+         <div class="ms-auto">
+             @if($alreadySubmitted)
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
+     display: flex;
+     align-items: center;
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8">
+   <title>Requisition of Demands</title>
+   <style>
+     body {
+       font-family: Arial, sans-serif;
+       font-size: 12px;
+       margin: 30px;
+     }
+     h3{
+       text-decoration: underline;
+     }
+     table.info-table {
+     border: unset;
+ }
+     .header {
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="container">
+     @php
+     $equipment = \App\Models\WorkEquipment::with(['Equipments', 'group', 'RepairClass'])
+         ->find($demands[0]->work_equipment_id);
+ 
+     $isSubmitted = \App\Models\McoSubmission::where('demand_no', $demands[0]->demand_no)
+         ->exists();
+ @endphp
+ 
+ <h4 class="mb-3">Requisition Details</h4>
+ 
+ <div class="d-flex flex-wrap align-items-center mb-3">
+     <div class="me-3"><strong>Equipment Name:</strong> {{ $equipment->Equipments?->name ?? 'N/A' }}</div>
+     <div class="me-3"><strong>Job No:</strong> {{ $demands[0]->job_no }}</div>
+     <div class="me-3"><strong>Class Name:</strong> {{ $equipment->RepairClass?->name ?? 'N/A' }}</div>
Removed / Before Commit
- \ No newline at end of file
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
+     display: flex;
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="container">
+     <h4><b>Edit Data: {{ $scale->equipment->name }}</b></h4>
+ 
+     @if($errors->any())
+         <div class="alert alert-danger">
+             <ul class="mb-0">
+                 @foreach($errors->all() as $error)
+                     <li>{{ $error }}</li>
+                 @endforeach
+             </ul>
+         </div>
+     @endif
+ 
+     <div class="table-responsive">
+         <table class="table table-bordered table-striped">
Removed / Before Commit
- 
- <div id="columns" class="mt-3">
- @php
-                             $columns = old('columns') ?? [['name' => '', 'type' => '', 'length' => '']];
- @endphp
- 
-                         @foreach($columns as $i => $col)
-                         <div class="row mb-2 column-row">
- <div class="col-md-4">
-                                 <input type="text" name="columns[{{ $i }}][name]" class="form-control column-name @error("columns.$i.name") is-invalid @enderror"
-                                     value="{{ $col['name'] ?? '' }}" placeholder="Column Name" required>
-                                 @error("columns.$i.name")
-                                     <div class="invalid-feedback">{{ $message }}</div>
-                                 @enderror
- </div>
- <div class="col-md-4">
-                                 <select name="columns[{{ $i }}][type]" class="form-control column-type @error("columns.$i.type") is-invalid @enderror" required>
-                                     <option value="">Type</option>
Added / After Commit
+ 
+ <div id="columns" class="mt-3">
+ @php
+                             $defaultColumns = [
+                                 ['name' => 'os_ser_no', 'type' => 'int', 'length' => 11],
+                                 ['name' => 'cos_sec', 'type' => 'varchar', 'length' => 255],
+                                 ['name' => 'cat_part_no', 'type' => 'varchar', 'length' => 255],
+                                 ['name' => 'nomenclature', 'type' => 'text', 'length' => ''],
+                                 ['name' => 'account_unit', 'type' => 'varchar', 'length' => 255],
+                                 ['name' => 'no_off', 'type' => 'varchar', 'length' => 255],
+                                 ['name' => 'authorization', 'type' => 'varchar', 'length' => 255],
+                                 ['name' => 'percentage', 'type' => 'varchar', 'length' => 255],
+                                 ['name' => 'target', 'type' => 'varchar', 'length' => 255],
+                             ];
+ @endphp
+ 
+                         @foreach($defaultColumns as $i => $col)
+                         <div class="row mb-2 column-row" @if($col['name'] == 'percentage' || $col['name'] == 'target') style="display:none" @endif>
Removed / Before Commit
- @method('PUT')
- 
- <div id="columns" class="mt-3">
-                         @php $oldColumns = old('columns', $columns->toArray()); @endphp
- 
- @foreach($oldColumns as $i => $col)
-                         <div class="row mb-2 column-row">
- <div class="col-md-4">
- <input type="text" name="columns[{{ $i }}][name]" class="form-control column-name @error("columns.$i.name") is-invalid @enderror"
-                                     value="{{ $col['column_name'] ?? $col['name'] }}" placeholder="Column Name" required>
- @error("columns.$i.name")
- <div class="invalid-feedback">{{ $message }}</div>
- @enderror
- </div>
- <div class="col-md-4">
-                                 <select name="columns[{{ $i }}][type]" class="form-control column-type @error("columns.$i.type") is-invalid @enderror" required>
-                                     <option value="">Type</option>
-                                     @foreach(['varchar', 'int', 'bigint', 'decimal', 'float', 'double', 'text', 'longtext', 'date', 'datetime', 'timestamp', 'boolean'] as $type)
Added / After Commit
+ @method('PUT')
+ 
+ <div id="columns" class="mt-3">
+                         @php
+                             $oldColumns = old('columns', $columns->toArray());
+                             $allowedTypes = ['int', 'varchar', 'decimal', 'text', 'float', 'date'];
+                             $typeDefaults = ['int' => 11, 'varchar' => 255, 'decimal' => 10, 'text' => '', 'float' => 12, 'date' => ''];
+                             $fixedNames = ['os_ser_no', 'cos_sec', 'cat_part_no', 'nomenclature', 'account_unit', 'no_off', 'authorization','percentage','target'];
+                         @endphp
+ 
+ @foreach($oldColumns as $i => $col)
+                         @php
+                             $type = $col['type'] ?? '';
+                             $name = strtolower($col['column_name'] ?? $col['name']);
+                             $length = $col['length'] ?? ($typeDefaults[$type] ?? '');
+                             $isFixed = in_array($name, $fixedNames);
+                         @endphp
+                         <div class="row mb-2 column-row" @if($name  == 'percentage' || $name  == 'target') style="display:none" @endif>
Removed / Before Commit
- @extends('layouts.app')
- 
- @section('content')
- @if(session('success'))
-     <div class="alert alert-success">{{ session('success') }}</div>
- @endif
- 
- @if($errors->any())
- <div class="alert alert-danger">
- <div class="card">
- <div class="card-header py-3">
- <div class="row align-items-center">
-                     <div class="col-md-3">
- <h4><b>MCO Scale Management</b></h4>
- </div>
-                     <div class="col-md-9 text-end">
- <a href="{{ route('mco.scales.create') }}"><button type="button" class="btn btn-primary">Add Scale</button></a>
- </div>
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ 
+ 
+ @if($errors->any())
+ <div class="alert alert-danger">
+ <div class="card">
+ <div class="card-header py-3">
+ <div class="row align-items-center">
+                     <div class="col-md-6">
+ <h4><b>MCO Scale Management</b></h4>
+ </div>
+                     <div class="col-md-6 text-end">
+ <a href="{{ route('mco.scales.create') }}"><button type="button" class="btn btn-primary">Add Scale</button></a>
+ </div>
+ </div>
+ <th>Scale Name</th>
Removed / Before Commit
- <div class="row mb-3">
- <label for="input35" class="col-sm-3 col-form-label">Icon</label>
- <div class="col-sm-4">
-                                 <select name="icon" class="form-control">
-                                 <option value="" {{ $menu->icon == '' ? 'selected' : '' }}>-- No Icon --</option>
-                                 <option value="bx bx-diamond" {{ $menu->icon == 'bx bx-diamond' ? 'selected' : '' }}>Diamond</option>
-                                 <option value="bx bx-home-alt" {{ $menu->icon == 'bx bx-home-alt' ? 'selected' : '' }}>Home</option>
-                             </select>
- </div>
- </div>
- 
- </div>
- </div>
- </div>
- @endsection
Added / After Commit
+ <div class="row mb-3">
+ <label for="input35" class="col-sm-3 col-form-label">Icon</label>
+ <div class="col-sm-4">
+                               <select id="icon-select" name="icon" class="form-control select2" style="width:100%">
+     @foreach ($icons as $icon)
+         @php
+             // Get all classes from the <i> tag
+             preg_match('/class="([^"]+)"/', $icon, $classMatch);
+             $classes = explode(' ', $classMatch[1] ?? '');
+             // Find the second class like 'fa-user', 'fa-gear' etc.
+             $name = $classes[1] ?? 'Unknown';
+         @endphp
+         <option value="{{ $icon }}" data-icon="{{ $icon }}" data-name="{{ $name }}" @if( $icon == $menu->icon) selected @endif>
+             {{ $name }}
+         </option>
+     @endforeach
+ </select>
+ 
Removed / Before Commit
- @section('content')
- 
- <div class="card">
-     <div class="card-header"><h4>M&R Manufacturing</h4></div>
- <div class="card-body">
- 
-         <form method="GET" class="row mb-4">
-             <div class="col-md-4">
-                 <label>Filter by Job Number</label>
-                 <select name="job_no" class="form-control" onchange="this.form.submit()">
-                     <option value="">-- Select --</option>
-                     @foreach($jobNumbers as $job)
-                         <option value="{{ $job }}" {{ request('job_no') == $job ? 'selected' : '' }}>{{ $job }}</option>
-                     @endforeach
-                 </select>
-             </div>
-         </form>
- 
Added / After Commit
+ @section('content')
+ 
+ <div class="card">
+     <div class="card-header py-3">
+         <div class="row align-items-center">
+             <div class="col-md-9">
+                 <h4><b>M&R Manufacturing</b></h4>
+             </div>
+             <div class="col-md-3">
+                 <form method="GET" class="row d-flex">
+                     
+                         <label>Filter by Job Number</label>
+                         <select name="job_no" class="form-control" onchange="this.form.submit()">
+                             <option value="">-- Select --</option>
+                             @foreach($jobNumbers as $job)
+                                 <option value="{{ $job }}" {{ request('job_no') == $job ? 'selected' : '' }}>{{ $job }}</option>
+                             @endforeach
+                         </select>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header py-3 d-flex justify-content-between align-items-center">
+     <h4 class="mb-0"><b>Requisition Data Detail</b></h4>
+     <a href="{{ route('demand.previous.details', encrypt($demand_no)) }}" class="btn btn-secondary btn-sm">
+         <i class="fa fa-arrow-left"></i> Back
+     </a>
+ </div>
+ 
+     <div class="card-body">
+         <div class="table-responsive">
+             <table class="table table-bordered table-striped">
+                 <thead class="table-primary">
+                     <tr>
+                         <th>Ser No</th>
+                         <th>Cos Sec</th>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ 
+ @if ($errors->any())
+     <div class="alert alert-danger">
+         <strong>Whoops!</strong> Please fix the following:
+         <ul>
+             @foreach ($errors->all() as $error)
+                 <li>{{ $error }}</li>
+             @endforeach
+         </ul>
+     </div>
+ @endif
+ 
+ <div class="card">
+     <div class="card-header py-3">
+         <div class="row align-items-center">
Removed / Before Commit
- </ul>
- </div>
- @endif
- 
- 
-             <div class="card">
-                             <div class="card-header py-3">
-                                 <div class="row align-items-center">
-                                     <div class="col-md-5">
-                                         <h4><b>Quality Control Number</b></h4>
-                                     </div>
-                                      <div class="col-md-7">
-                                        <form method="GET" action="{{ route('qc.index') }}" class="mb-1">
-                                          <div class="row align-items-end">
-                                             <div class="col-md-5">
-                                                 <label for="job_no" class="form-label">Job Number</label>
-                                                 <select name="job_no" class="form-select select2" data-placeholder="Select or search Job Number">
-                                                     <option value="">-- Select Job No --</option>
Added / After Commit
+ </ul>
+ </div>
+ @endif
+ <div class="card">
+     <div class="card-header py-3">
+         <div class="row align-items-center">
+             <div class="col-md-5">
+                 <h4><b>Quality Control Number</b></h4>
+             </div>
+                 <div class="col-md-7">
+                 <form method="GET" action="{{ route('qc.index') }}" class="mb-1">
+                     <div class="row align-items-end">
+                     <div class="col-md-5">
+                         <label for="job_no" class="form-label">Job Number</label>
+                         <select name="job_no" class="form-select select2" data-placeholder="Select or search Job Number">
+                             <option value="">-- Select Job No --</option>
+                             @foreach($jobNumbers as $jobNo)
+                                 <option value="{{ $jobNo }}" {{ request('job_no') == $jobNo ? 'selected' : '' }}>
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $repairClasses->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit
- 
- @section('content')
- 
- 
- 				<div class="row">
- <div class="col-lg-12">
Added / After Commit
+ 
+ @section('content')
+ 
+ @if ($errors->any())
+     <div class="alert alert-danger">
+         <ul class="mb-0">
+             @foreach ($errors->all() as $error)
+                 <li>{{ $error }}</li>
+             @endforeach
+         </ul>
+     </div>
+ @endif
+ 
+ 				<div class="row">
+ <div class="col-lg-12">
Removed / Before Commit
- 
- @section('content')
- 
- 
- <div class="row">
- <div class="col-lg-12">
Added / After Commit
+ 
+ @section('content')
+ 
+ @if ($errors->any())
+     <div class="alert alert-danger">
+         <ul class="mb-0">
+             @foreach ($errors->all() as $error)
+                 <li>{{ $error }}</li>
+             @endforeach
+         </ul>
+     </div>
+ @endif
+ 
+ <div class="row">
+ <div class="col-lg-12">
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="card">
+     <div class="card-header">
+         <h4>{{ isset($shift) ? 'Edit' : 'Create' }} Shift</h4>
+     </div>
+     <div class="card-body">
+         <form action="{{ isset($shift) ? route('shifts.update', $shift->id) : route('shifts.store') }}" method="POST">
+             @csrf
+             @if(isset($shift)) @method('PUT') @endif
+ 
+             <div class="row">
+                 <div class="col-md-4 mb-3">
+                     <label>Shift Name <span class="text-danger">*</span></label>
+                     <input type="text" name="name" class="form-control" value="{{ old('name', $shift->name ?? '') }}" required>
+                 </div>
+                 <div class="col-md-4 mb-3">
+                     <label>Start Time <span class="text-danger">*</span></label>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between align-items-center">
+         <h4>Shifts</h4>
+         <a href="{{ route('shifts.create') }}" class="btn btn-primary btn-sm">Add Shift</a>
+     </div>
+     <div class="card-body">
+         <div class="table-responsive">
+             <table class="table table-bordered table-striped">
+                 <thead class="table-light">
+                     <tr>
+                         <th>#</th>
+                         <th>Name</th>
+                         <th>Start Time</th>
+                         <th>End Time</th>
+                         <th>Early Grace (min)</th>
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
- });
- });
- </script>
- @endsection
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $subAssys->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
+ });
+ });
+ </script>
+ <script>
+     // Allow only digits and one optional decimal point (for float values)
+     document.querySelectorAll('input[type="number"]').forEach(input => {
+         input.addEventListener('input', function () {
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $units->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit
- 
- <div class="card-body">
- <div class="container-fluid">
-     
-     <!-- 📊 Table -->
-     <div class="table-responsive">
-         <table class="table table-bordered table-striped" id="example">
-             <thead class="table-primary">
-                 <tr>
-                     <th>Unit</th>
-                     <th>WKSP</th>
-                     <!-- <th>Command</th> -->
-                     <th>Unit WO No</th>
-                     <th>WO Date</th>
-                     <th>Repair Class</th>
-                     <!-- <th>Group Name</th> -->
-                     <th>Main Eqpt</th>
-                     <th>Sub Assy</th>
Added / After Commit
+ 
+ <div class="card-body">
+ <div class="container-fluid">
+             <!-- 📊 Table -->
+             <div class="table-responsive">
+                 <table class="table table-bordered table-striped" id="example">
+                     <thead class="table-primary">
+ <tr>
+                             <th>Unit</th>
+                             <th>WKSP</th>
+                             <!-- <th>Command</th> -->
+                             <th>Unit WO No</th>
+                             <th>WO Date</th>
+                             <th>Repair Class</th>
+                             <!-- <th>Group Name</th> -->
+                             <th>Main Eqpt</th>
+                             <th>Sub Assy</th>
+                             <!-- <th>Qty</th> -->
Removed / Before Commit
- @endforeach
- </tbody>
- </table>
- 
- </div>
- </div>
- </div>
Added / After Commit
+ @endforeach
+ </tbody>
+ </table>
+ <div class="mt-3 d-flex justify-content-end">
+     <nav>
+         {{ $wksps->links() }}
+     </nav>
+ </div>
+ </div>
+ </div>
+ </div>
Removed / Before Commit
- </div>
- <div class="modal-body">
- <div class="mb-3">
-           <label class="form-label"><strong>Control Number:</strong></label>
- <p id="controlNumberValue" class="mb-0">---</p>
- </div>
- <div class="mb-3">
-           <label class="form-label"><strong>Control Date:</strong></label>
- <p id="controlDateValue" class="mb-0">---</p>
- </div>
- </div>
- return $(this).data('name') === 'M&R';
- });
- 
-         if (['LM', 'MOS'].includes(selectedRepairClass)) {
-             if (mrOption.length > 0) {
-                 $('#groupSelect').val(mrOption.val()).trigger('change');
-             }
Added / After Commit
+ </div>
+ <div class="modal-body">
+ <div class="mb-3">
+           <label class="form-label"> <strong id="numberLabel">Control Number:</strong></label>
+ <p id="controlNumberValue" class="mb-0">---</p>
+ </div>
+ <div class="mb-3">
+           <label class="form-label"> <strong id="dateLabel">Control Date:</strong></label>
+ <p id="controlDateValue" class="mb-0">---</p>
+ </div>
+ </div>
+ return $(this).data('name') === 'M&R';
+ });
+ 
+        if (['LM', 'MOS'].includes(selectedRepairClass)) {
+     if (mrOption.length > 0) {
+         $('#groupSelect').val(mrOption.val()).trigger('change');
+     }
Removed / Before Commit
- use App\Http\Controllers\McoScaleController;
- use App\Http\Controllers\CrcEntryController;
- use App\Http\Controllers\CrcRepairController;
- 
- /*
- |--------------------------------------------------------------------------
- return view('welcome');
- });
- 
- 
- Route::get('register', [RegisterController::class, 'showRegisterForm'])->name('register');
- Route::post('register', [RegisterController::class, 'register']);
- 
- 
- Route::middleware(['auth'])->group(function () {
- Route::get('/dashboard', [UserController::class, 'dashboard'])->name('dashboard')->middleware('check.permission:Dashboard,view');;
- Route::get('/users', [UserController::class, 'index'])->name('user.index')->middleware('check.permission:User,view');;
- Route::get('/user-edit/{id}', [UserController::class, 'edit'])->name('user.edit')->middleware('check.permission:User,modify');;
Added / After Commit
+ use App\Http\Controllers\McoScaleController;
+ use App\Http\Controllers\CrcEntryController;
+ use App\Http\Controllers\CrcRepairController;
+ use App\Http\Controllers\EqptTargetController;
+ use App\Http\Controllers\DemandController;
+ use App\Http\Controllers\ProductionDemandController;
+ use App\Http\Controllers\McoDemandController;
+ use App\Http\Controllers\McoAdminDemandApprovalController;
+ use App\Http\Controllers\InventoryController;
+ use App\Http\Controllers\IssueController;
+ use App\Http\Controllers\LeaveTypeController;
+ use App\Http\Controllers\DepartmentController;
+ use App\Http\Controllers\DesignationController;
+ use App\Http\Controllers\ShiftController;
+ use App\Http\Controllers\HolidayController;
+ 
+ 
+ /*