Commit 6e6e8e63 by Juliper

push admin and owner file, controller

parent 8f5c7b5e
......@@ -3,9 +3,14 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;
class AdminController extends Controller
{
/**
* Display a listing of the resource.
*
......@@ -23,7 +28,7 @@ class AdminController extends Controller
*/
public function create()
{
return view('');
return view('adminlte::layouts.admin.addOwner');
}
/**
......@@ -34,7 +39,18 @@ class AdminController extends Controller
*/
public function store(Request $request)
{
//
$data = $request->all();
$user = new User();
$user->name = $data['name'];
$user->username = $data['username'];
$user->email = $data['email'];
$user->password = bcrypt($data['password']);
$user->role = 'Owner';
dd($user);
$user->save();
}
/**
......
......@@ -41,7 +41,7 @@ class RegisterController extends Controller
*
* @var string
*/
protected $redirectTo = '/home';
//protected $redirectTo = '/home';
/**
* Create a new controller instance.
......@@ -79,8 +79,10 @@ class RegisterController extends Controller
{
return User::create([
'name' => $data['name'],
'username' => $data['username'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'role' => $data['role'],
]);
}
}
......@@ -4,7 +4,6 @@
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<div class="container-fluid spark-screen">
<div class="row">
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<div class="container-fluid spark-screen">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div id="app">
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="register-box-body">
<p class="login-box-msg">{{ trans('adminlte_lang::message.registermember') }}</p>
<form action="{{ url('admin') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="{{ trans('adminlte_lang::message.fullname') }}" name="name" value="{{ old('name') }}"/>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="{{ trans('adminlte_lang::message.username') }}" name="username" value="{{ old('username') }}"/>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="email" class="form-control" placeholder="{{ trans('adminlte_lang::message.email') }}" name="email" value="{{ old('email') }}"/>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="{{ trans('adminlte_lang::message.password') }}" name="password"/>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="{{ trans('adminlte_lang::message.retrypepassword') }}" name="password_confirmation"/>
<span class="glyphicon glyphicon-log-in form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input value="Owner" type="text" class="form-control" placeholder="{{ trans('adminlte_lang::message.role') }}" name="role" disabled/>
<span class="glyphicon glyphicon-wrench form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-1">
<label>
<div class="checkbox_register icheck">
<label>
<input type="checkbox" name="terms">
</label>
</div>
</label>
</div><!-- /.col -->
<div class="col-xs-6">
<div class="form-group">
<button type="button" class="btn btn-block btn-flat" data-toggle="modal" data-target="#termsModal">{{ trans('adminlte_lang::message.terms') }}</button>
</div>
</div><!-- /.col -->
<div class="col-xs-4 col-xs-push-1">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ trans('adminlte_lang::message.register') }}</button>
</div><!-- /.col -->
</div>
</form>
</div><!-- /.form-box -->
</div>
</div>
</div>
</div>
</div>
@endsection
\ No newline at end of file
......@@ -51,7 +51,7 @@ Landing page based on Pratt: http://blacktie.co/demo/pratt/
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#home" class="smoothScroll">{{ trans('adminlte_lang::message.home') }}</a></li>
<li><a href="#desc" class="smoothScroll">{{ trans('adminlte_lang::message.description') }}</a></li>
<li><a href="#desc" class="smoothScroll">{{ trans('adminlte_lang::message.homestay') }}</a></li>
<li><a href="#showcase" class="smoothScroll">{{ trans('adminlte_lang::message.showcase') }}</a></li>
<li><a href="#contact" class="smoothScroll">{{ trans('adminlte_lang::message.contact') }}</a></li>
</ul>
......
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
@yield('contentheader_title', 'Page Header here')
@yield('contentheader_title')
<small>@yield('contentheader_description')</small>
</h1>
<ol class="breadcrumb">
......
<head>
<meta charset="UTF-8">
<title> AdminLTE 2 with Laravel - @yield('htmlheader_title', 'Your title here') </title>
<title> SI Booking Homestay - @yield('htmlheader_title', 'Your title here') </title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
......
......@@ -20,66 +20,9 @@
<ul class="nav navbar-nav">
<!-- Messages: style can be found in dropdown.less-->
<li class="dropdown messages-menu">
<!-- Menu toggle button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>
<span class="label label-success">4</span>
</a>
<ul class="dropdown-menu">
<li class="header">{{ trans('adminlte_lang::message.tabmessages') }}</li>
<li>
<!-- inner menu: contains the messages -->
<ul class="menu">
<li><!-- start message -->
<a href="#">
<div class="pull-left">
<!-- User Image -->
<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image"/>
</div>
<!-- Message title and timestamp -->
<h4>
{{ trans('adminlte_lang::message.supteam') }}
<small><i class="fa fa-clock-o"></i> 5 mins</small>
</h4>
<!-- The message -->
<p>{{ trans('adminlte_lang::message.awesometheme') }}</p>
</a>
</li><!-- end message -->
</ul><!-- /.menu -->
</li>
<li class="footer"><a href="#">c</a></li>
</ul>
</li><!-- /.messages-menu -->
<!-- Notifications Menu -->
<li class="dropdown notifications-menu">
<!-- Menu toggle button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bell-o"></i>
<span class="label label-warning">10</span>
</a>
<ul class="dropdown-menu">
<li class="header">{{ trans('adminlte_lang::message.notifications') }}</li>
<li>
<!-- Inner Menu: contains the notifications -->
<ul class="menu">
<li><!-- start notification -->
<a href="#">
<i class="fa fa-users text-aqua"></i> {{ trans('adminlte_lang::message.newmembers') }}
</a>
</li><!-- end notification -->
</ul>
</li>
<li class="footer"><a href="#">{{ trans('adminlte_lang::message.viewall') }}</a></li>
</ul>
</li>
<!-- Tasks Menu -->
<li class="dropdown tasks-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-flag-o"></i>
<span class="label label-danger">9</span>
</a>
<ul class="dropdown-menu">
<li class="header">{{ trans('adminlte_lang::message.tasks') }}</li>
<li>
......@@ -127,21 +70,11 @@
<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />
<p>
{{ Auth::user()->name }}
<small>{{ trans('adminlte_lang::message.login') }} Nov. 2012</small>
<small>{{ trans('adminlte_lang::message.login') }} </small>
</p>
</li>
<!-- Menu Body -->
<li class="user-body">
<div class="col-xs-4 text-center">
<a href="#">{{ trans('adminlte_lang::message.followers') }}</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">{{ trans('adminlte_lang::message.sales') }}</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">{{ trans('adminlte_lang::message.friends') }}</a>
</div>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
......
......@@ -31,17 +31,19 @@
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">{{ trans('adminlte_lang::message.header') }}</li>
<!-- Optionally, you can add icons to the links -->
<li class="active"><a href="{{ url('home') }}"><i class='fa fa-link'></i> <span>{{ trans('adminlte_lang::message.home') }}</span></a></li>
<li><a href="{{url('admin/create')}}"><i class='fa fa-link'></i> <span>{{ trans('adminlte_lang::message.addOwner') }}</span></a></li>
<li class="treeview">
<a href="#"><i class='fa fa-link'></i> <span>{{ trans('adminlte_lang::message.multilevel') }}</span> <i class="fa fa-angle-left pull-right"></i></a>
<ul class="treeview-menu">
<li><a href="#">{{ trans('adminlte_lang::message.linklevel2') }}</a></li>
<li><a href="#">{{ trans('adminlte_lang::message.linklevel2') }}</a></li>
</ul>
</li>
@if(Auth::user()->role =="Admin")
<li class="header">{{ trans('adminlte_lang::message.header') }}</li>
<!-- Optionally, you can add icons to the links -->
<li class="active"><a href="{{ url('home') }}"><i class='fa fa-home'></i> <span>{{ trans('adminlte_lang::message.home') }}</span></a></li>
<li><a href="{{url('admin/create')}}"><i class='fa fa-plus'></i> <span>{{ trans('adminlte_lang::message.addOwner') }}</span></a></li>
@elseif(Auth::user()->role=="Owner")
@endif
</ul><!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
......
......@@ -129,5 +129,10 @@ return [
'fullname' => 'Full Name',
'username' => 'Username',
'addOwner' => 'Add Owner Homestay',
'homestay' => 'Homestay',
'role' => 'Role',
'username' => 'Username',
'' => '',
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment