Skip to content

Commit bb77886

Browse files
committed
frontend
1 parent 5b5b165 commit bb77886

34 files changed

+422
-74
lines changed

app/Http/Controllers/Auth/ActivateController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class ActivateController extends Controller
1818
{
1919
use ActivationTrait;
2020

21-
private static $userHomeRoute = 'public.home';
22-
private static $adminHomeRoute = 'public.home';
21+
private static $userHomeRoute = 'home';
22+
private static $adminHomeRoute = 'home';
2323
private static $activationView = 'auth.activation';
2424
private static $activationRoute = 'activation-required';
2525

app/Http/Controllers/FrontendController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function partnership()
5353
public function eventStarter()
5454
{
5555
if(Auth::guest()){
56-
return Redirect::guest("login")->withSuccess('You have to login first');
56+
return Redirect::guest("login")->with('error', 'You have to login first!');
5757
}
5858
return view('frontend.event-starter');
5959
}
@@ -97,7 +97,7 @@ public function checkout($id)
9797
$product = Product::find($id);
9898

9999
if(Auth::guest()){
100-
return Redirect::guest("login")->withSuccess('You have to login first');
100+
return Redirect::guest("login")->with('error', 'You have to login first!');
101101
}
102102
return view('frontend.checkout', compact('product'));
103103
}
@@ -107,7 +107,7 @@ public function reserve($id)
107107
$product = Product::find($id);
108108

109109
if(Auth::guest()){
110-
return Redirect::guest("login")->withSuccess('You have to login first');
110+
return Redirect::guest("login")->with('error', 'You have to login first!');
111111
}
112112
return view('frontend.reservation', compact('product'));
113113
}
@@ -117,7 +117,7 @@ public function confirmPayment($id)
117117
$invoice = Invoice::find($id);
118118

119119
if(Auth::guest()){
120-
return Redirect::guest("login")->withSuccess('You have to login first');
120+
return Redirect::guest("login")->with('error', 'You have to login first!');
121121
}
122122
return view('frontend.confirm-payment', compact('invoice'));
123123
}

app/Http/Controllers/InvoiceController.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use Validator,Redirect,Response;
1111
use Illuminate\Support\Facades\Auth;
1212
use Illuminate\Support\Facades\Hash;
13+
use Illuminate\Support\Facades\Mail;
14+
use App\Mail\InvoiceGenerated;
1315
use Session;
1416

1517
class InvoiceController extends Controller

app/Http/Controllers/PartnershipController.php

+17-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class PartnershipController extends Controller
1414
*/
1515
public function index()
1616
{
17-
//
17+
$partnerships = Partnership::latest()->paginate(5);
18+
return view('pages.partnerships.list', compact('partnerships'));
1819
}
1920

2021
/**
@@ -39,19 +40,19 @@ public function store(Request $request)
3940
'user_id' => 'required',
4041
'company' => 'required',
4142
'partner_type' => 'required',
42-
'proposal' => 'required|file|image|mimes:pdf,zip,xlx,csv|max:2048',
43+
'proposal' => 'required|file|mimes:pdf,zip,xlx,csv|max:2048',
4344

4445
]);
4546

4647

4748
// menyimpan data file yang diupload ke variabel $file
48-
$file = $request->file('image');
49-
50-
$file_name = time()."_".$file->getClientOriginalName();
51-
52-
// isi dengan nama folder tempat kemana file diupload
53-
$upload_folder = 'uploads';
54-
$file->move($upload_folder,$file_name);
49+
$file = $request->file('proposal');
50+
51+
$file_name = time()."_".$file->getClientOriginalName();
52+
53+
// isi dengan nama folder tempat kemana file diupload
54+
$upload_folder = 'uploads';
55+
$file->move($upload_folder,$file_name);
5556

5657
$partnership = new Partnership([
5758
'user_id' => $request->get('user_id'),
@@ -84,7 +85,7 @@ public function show(Partnership $partnership)
8485
*/
8586
public function edit(Partnership $partnership)
8687
{
87-
//
88+
return view('pages.partnerships.edit',compact('partnership'));
8889
}
8990

9091
/**
@@ -96,7 +97,12 @@ public function edit(Partnership $partnership)
9697
*/
9798
public function update(Request $request, Partnership $partnership)
9899
{
99-
//
100+
$partnership->status = $request->get('status');
101+
$partnership->update();
102+
103+
$partnership->update();
104+
105+
return redirect('/manage/partnerships')->with('success', 'Partnership updated successfully');
100106
}
101107

102108
/**

app/Http/Controllers/ProfilesController.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Models\Profile;
99
use App\Models\Theme;
1010
use App\Models\User;
11+
use Illuminate\Support\Facades\Auth;
1112
use App\Notifications\SendGoodbyeEmail;
1213
use App\Traits\CaptureIpTrait;
1314
use File;
@@ -67,9 +68,15 @@ public function show($username)
6768
$data = [
6869
'user' => $user,
6970
'currentTheme' => $currentTheme,
71+
'membership' => $user->membership->load('invoice')->first()->invoice->product->name,
72+
'end_date' => $user->membership->load('invoice')->first()->end_date,
7073
];
7174

72-
return view('profiles.show')->with($data);
75+
$user = Auth::user();
76+
if ($user->isAdmin()) {
77+
return view('profiles.show')->with($data);
78+
}
79+
return view('profiles.index')->with($data);
7380
}
7481

7582
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class ChangeProfilesTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
///change some column
17+
Schema::table('profiles', function (Blueprint $table) {
18+
$table->string('profession')->nullable()->change();
19+
$table->string('institute')->nullable()->change();
20+
$table->string('phone')->nullable()->change();
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
//
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class ChangePartnershipsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
//add some column
17+
Schema::table('partnerships', function (Blueprint $table) {
18+
$table->string('status')->nullable();
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*
25+
* @return void
26+
*/
27+
public function down()
28+
{
29+
//
30+
}
31+
}
3.12 KB
Loading
Loading
Loading
Loading
8.89 KB
Loading
4.74 KB
Loading
4.74 KB
Loading
Loading
4.29 KB
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.

resources/views/frontend/checkout.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
</div>
7777
<div class="row">
7878
<div class="col-md-6 mb-3">
79-
<input type="text" class="form-control" id="Instansi" placeholder="Instansi" aria-label="Instansi" value="" readonly>
79+
<input type="text" class="form-control" id="Instansi" placeholder="Instansi" aria-label="Instansi" value="{{ (Auth()->user()->institute) }}" readonly>
8080
</div>
8181
<div class="col-md-6 mb-3">
82-
<input type="text" class="form-control" id="Phone" placeholder="Phone" aria-label="Phone" value="" readonly>
82+
<input type="text" class="form-control" id="Phone" placeholder="Phone" aria-label="Phone" value="{{ (Auth()->user()->phone) }}" readonly>
8383
</div>
8484
</div>
8585

resources/views/frontend/home.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="col-md-6 intro-info order-md-first order-last">
1212
<h2>Ezo Co-working<br><span>Space</span></h2>
1313
<span style="line-height: 2.5em;">
14-
<span class="subtitle">Rangsang</span><span class="subsub"><strong> Kreatatifitas</strong></span>
14+
<span class="subtitle">Rangsang</span><span class="subsub"><strong> Kreativitas</strong></span></br>
1515
<span class="subtitle">Perluas</span><span class="subsub"><strong> Networking</strong></span>
1616
</span>
1717
<div class="quote">Co-Working Space terlengkap hanya untuk kamu</br>Didesain sesuai kebutuhanmu

resources/views/frontend/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<div class="card-body ml-0 ">
141141
<div class="row">
142142
<ol>
143-
<li style="list-style-type: none;">{!!$product->description!!}</li>
143+
<li style="list-style-type: none;">{!! nl2br($product->description) !!}</li>
144144
</ol>
145145
</div>
146146
</div>

resources/views/frontend/partnership.blade.php

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<div class="form-group row">
8787
<label for="company" class="col-4 col-form-label">Your Company Name</label>
8888
<div class="col-8">
89+
<input type="hidden" name="user_id" value="{{(Auth()->user()->id)}}">
8990
<input class="form-control" type="text" value="" id="company" name="company">
9091
</div>
9192
</div>

resources/views/frontend/private-office.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
<p class="lead">Join our membership plans and get the best services at minimum prices.</p>
157157
</header>
158158
<div class="row">
159-
<div class="d-flex justify-content-center">
159+
<div class="col d-flex justify-content-center">
160160
@foreach ($products as $product)
161161
<div class="col-md-4 col-sm-4 col-xs-12">
162162
<div class="card h-100 mb-4 text-center border-success align-items-center">
@@ -166,7 +166,7 @@
166166
<div class="card-body ml-0 ">
167167
<div class="row">
168168
<ol>
169-
<li style="list-style-type: none;">{!!$product->description!!}</li>
169+
<li style="list-style-type: none;">{!! nl2br($product->description) !!}</li>
170170
</ol>
171171
</div>
172172
</div>

resources/views/frontend/room.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<div class="card-body ml-0 ">
154154
<div class="row">
155155
<ol>
156-
<li style="list-style-type: none;">{!!$product->description!!}</li>
156+
<li style="list-style-type: none;">{!! nl2br($product->description) !!}</li>
157157
</ol>
158158
</div>
159159
</div>

resources/views/layouts/frontend.blade.php

+10-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{-- CSRF Token --}}
1010
<meta name="csrf-token" content="{{ csrf_token() }}">
1111

12-
<title>@hasSection('template_title')@yield('template_title') | @endif {{ config('app.name', Lang::get('titles.app')) }}</title>
12+
<title class="mt-5">@hasSection('template_title')@yield('template_title') | @endif {{ config('app.name', Lang::get('titles.app')) }}</title>
1313

1414
{{-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --}}
1515
<!--[if lt IE 9]>
@@ -117,10 +117,17 @@
117117
<a class="btn btn-outline-primary" href="#">Sign up</a>
118118
</div>-->
119119

120+
<div class="fixed-top container">
121+
<div class="row">
122+
<div class="col-12" style="z-index: -1">
123+
@include('partials.form-status')
124+
</div>
125+
</div>
126+
</div>
120127
<header class="header">
121128
<nav class="navbar navbar-expand-lg fixed-top py-3">
122129
<div class="container">
123-
<a href="#" class="navbar-brand"><img height="30" width="70" class="d-inline-block align-top" alt="" src="/img/logoezo.png"></a>
130+
<a href="{{ route('home') }}" class="navbar-brand"><img height="30" width="70" class="d-inline-block align-top" alt="" src="/img/logoezo.png"></a>
124131
<button type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler navbar-toggler-right"><i class="fa fa-bars"></i></button>
125132

126133
<div id="navbarSupportedContent" class="collapse navbar-collapse">
@@ -158,13 +165,7 @@
158165
</nav>
159166
</header>
160167

161-
<div class="container">
162-
<div class="row">
163-
<div class="col-12">
164-
@include('partials.form-status')
165-
</div>
166-
</div>
167-
</div>
168+
168169

169170
@yield('content')
170171

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@extends('layouts.app')
2+
@section('template_title')
3+
{!! trans('Edit Partnership') !!}
4+
@endsection
5+
@section('content')
6+
<div class="container">
7+
<div class="col-lg-10 offset-lg-1">
8+
<div class="card">
9+
<div class="card-header d-flex">
10+
<div class="col-lg-9">
11+
Edit Partnership
12+
</div>
13+
<div class="col-lg-3 text-right">
14+
<a class="btn btn-light btn-sm" href="{{ route('partnerships') }}"><i class="fa fa-fw fa-reply-all" aria-hidden="true"></i><span class="hidden-xs"> Back</span></a>
15+
</div>
16+
</div>
17+
<div class="card-body">
18+
<form action="{{ route('partnerships.update', $partnership->id) }}" method="POST">
19+
@csrf
20+
@method('PUT')
21+
<div class="form-group row">
22+
<label for="user_id" class="col-sm-2 col-form-label">User</label>
23+
<div class="col-sm-10">
24+
<input type="text" name="user_id" id="user_id" class="form-control" disabled value="{{$partnership->user_id}}"/>
25+
</div>
26+
</div>
27+
<div class="form-group row">
28+
<label for="company" class="col-sm-2 col-form-label">Company Name</label>
29+
<div class="col-sm-10">
30+
<input type="text" name="company" id="company" class="form-control" disabled value="{{$partnership->company}}"/>
31+
</div>
32+
</div>
33+
<div class="form-group row">
34+
<label for="partner_type" class="col-sm-2 col-form-label">Partnership Type</label>
35+
<div class="col-sm-10">
36+
<input type="text" name="partner_type" id="partner_type" class="form-control" disabled value="{{$partnership->partner_type}}"/>
37+
</div>
38+
</div>
39+
<div class="form-group row">
40+
<label for="status" class="col-sm-2 col-form-label">Status</label>
41+
<div class="col-sm-10">
42+
<select id="status" name="status" class="form-control">
43+
<option value="Confirmed" {{($partnership->status === 'Confirmed') ? 'selected' : ''}}>Confirmed</option>
44+
<option value="On Process" {{($partnership->status === 'On Process') ? 'selected' : ''}}>On Process</option>
45+
</select>
46+
</div>
47+
</div>
48+
<div class="form-group row">
49+
<div class="col-sm-10">
50+
<button type="submit" class="btn btn-primary">Submit</button>
51+
</div>
52+
</div>
53+
</form>
54+
</div>
55+
</div>
56+
</div>
57+
</div>
58+
@endsection

0 commit comments

Comments
 (0)