-
Notifications
You must be signed in to change notification settings - Fork 2
/
AdminController.php
83 lines (61 loc) · 1.62 KB
/
AdminController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use App\Add_rooms;
class AdminController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function verify_results()
{
$users = DB::table('users')->select('name','id' , 'roll_number' ,'admission_number', 'result_status')->where([
['book_room', '=', '1'],
])->get();
return view("/verifyresults", compact('users'));
}
public function verify_fees()
{
$users = DB::table('users')->select('name' ,'id', 'utr_number' ,'admission_number', 'fee_status')->where([
['result_status', '=', '1'],
])->get();
return view("/verifyfees", compact('users'));
}
public function update_result_status(User $user)
{
if($user->result_status == '1')
{
$user->result_status='0';
}
else
$user->result_status='1';
$user->save();
return redirect('/verifyresults');
}
public function update_fee_status(User $user)
{
if($user->fee_status == '1')
{
$user->fee_status='0';
}
else
$user->fee_status='1';
$user->save();
return redirect('/verifyfees');
}
// public function addrooms(Add_rooms $add_rooms)
// {
// return Add_rooms::create([
// 'hostel' => $add_rooms['hostel'],
// 'category' => $add_rooms['category'],
// 'to' => $add_rooms['to'],
// 'from' => $add_rooms['from'],
// 'year' => $add_rooms['year'],
// ]);
// return redirect('/addrooms);
// }
}