Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hms #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
13 changes: 13 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
php:
preset: laravel
disabled:
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
10 changes: 10 additions & 0 deletions Add_rooms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Add_rooms extends Model
{
protected $fillable = [ 'year' , 'from' , 'to' , 'category' , 'hostel'];
}
83 changes: 83 additions & 0 deletions AdminController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,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);
// }



}
13 changes: 13 additions & 0 deletions Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
46 changes: 46 additions & 0 deletions HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;

class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}

/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('/home');
}
public function update_book_room(user $user)
{

$user->book_room = '1';
$user->save();
return redirect('/home');
}
public function update_utr(user $user)
{ // { dd('hello');

$user->utr_number = request('utr_number');
$user->save();
return redirect('/home');


}

}
13 changes: 13 additions & 0 deletions Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Request extends Model
{
protected $fillable = [ 'user_1_id' , 'user_2_id' , 'user_3_id' ,


];
}
10 changes: 10 additions & 0 deletions RequestController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class RequestController extends Controller
{
//
}
23 changes: 23 additions & 0 deletions Room.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Room extends Model
{
protected $fillable = [ 'user_1_id' , 'user_2_id' ,'user_3_id' ,
];


];
public function users()
{
return $this->hasMany('App\User');
}
//
public function request()
{
return $this->hasOne('App\Request');
}
}
19 changes: 19 additions & 0 deletions Room_Type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Room_Type extends Model
{
protected $fillable = [ 'room_type',


];

public function room_type()
{
return $this->belongsTo('App\Room');

}
}
16 changes: 16 additions & 0 deletions SearchController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;

class SearchController extends Controller
{
public function search()
{
$users = DB::table('users')->select('name')->where('fee_status', '=', '1')->get();

return view("/searchroommates", compact('users'));
}

}
60 changes: 60 additions & 0 deletions User.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
use Notifiable;

/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
'roll_number' ,'admission_number',
'mobile_number','year','utr_number' ,'gender' ,'room_id', 'is_hosteler'
];

/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
const ADMIN_TYPE = 'admin';
const DEFAULT_TYPE = 'default';
protected $hidden = [
'password', 'remember_token',
];

/**
* The attributes that should be cast to native types.
*
* @var array

*/

public function isAdmin() {
return $this->type === self::ADMIN_TYPE;
}
public function request()
{
return $this->hasMany('App\Request');
}
public function addclick() {


$this->book_room = '1' ;
$this->save();

}

protected $casts = [
'email_verified_at' => 'datetime',
];
}
Loading