Skip to content

Commit 5b8c730

Browse files
committed
Merge branch 'master' of https://github.com/kmanjari/hrms
2 parents baec231 + 582842f commit 5b8c730

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

app/Http/Controllers/EmpController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ public function showEmployee()
9292
{
9393
$emps = User::with('employee', 'role.role')->paginate(40);
9494

95-
return view('hrms.employee.show_emp', compact('emps'));
95+
$column = '';
96+
$string = '';
97+
return view('hrms.employee.show_emp', compact('emps', 'column', 'string'));
9698
}
9799

98100
public function showEdit($id)
@@ -524,7 +526,7 @@ public function searchEmployee(Request $request)
524526
})->with('employee')->paginate(20);
525527
}
526528

527-
return view('hrms.employee.show_emp', compact('emps'));
529+
return view('hrms.employee.show_emp', compact('emps', 'column', 'string'));
528530
} else
529531
{
530532
if($column == '')
@@ -541,8 +543,6 @@ public function searchEmployee(Request $request)
541543
})->with('employee')->get();
542544
}
543545

544-
$results = [];
545-
546546
$fileName = 'Employee_Listing_'. rand(1,1000). '.xlsx';
547547
$filePath = storage_path('exports/'). $fileName;
548548
$file = new \SplFileObject($filePath, "a");

app/Http/Helper/helper.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,16 @@ function getFormattedDate($date)
6060
{
6161
$date = new DateTime($date);
6262
return date_format($date,'l jS \\of F Y');
63+
}
6364

64-
}
65+
function getEmployeeDropDown()
66+
{
67+
$data = [
68+
'name' => 'Name',
69+
'code' => 'Code',
70+
'department' => 'Department',
71+
'email' => 'Email',
72+
'number' => 'Number'
73+
];
74+
return $data;
75+
}

resources/views/hrms/employee/show_emp.blade.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,11 @@
4141
<div class="row">
4242
{!! Form::open() !!}
4343
<div class="col-md-3">
44-
<input type="text" class="field form-control" placeholder="query string" style="height:40px" name="string">
44+
<input type="text" class="field form-control" placeholder="query string" style="height:40px" value="{{$string}}" name="string">
4545
</div>
4646
<div class="col-md-3">
4747
<label class="field select">
48-
<select id="column" name="column">
49-
<option value="">Filter by</option>
50-
<option value="name">Name</option>
51-
<option value="code">Code</option>
52-
<option value="department">Department</option>
53-
<option value="email">Email</option>
54-
<option value="number">Number</option>
55-
</select>
48+
{!! Form::select('column', getEmployeeDropDown(),$column) !!}
5649
<i class="arrow double"></i>
5750
</label>
5851
</div>

0 commit comments

Comments
 (0)