Commit e37389a9 by PratiwiOkuli

Perbaikan CRUD Petugas dan CRUD Barang

parent b0271184
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Customer extends Model
{
protected $fillable = [
'name', 'email', 'username','password','saldo',
];
}
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\User;
use App\Transaksi;
use App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class AdminController extends Controller class AdminController extends Controller
{ {
public function laporanTransaksi() public function laporanTransaksi()
{ {
return view('adminlte::admin.laporanTransaksi.index'); $transaksis = Transaksi::all();
return view('adminlte::admin.laporanTransaksi.index', compact('transaksis'));
} }
public function listPetugas() public function listPetugas()
{ {
return view('adminlte::admin.listPetugas.index'); $users = User::where([['status','!=','customer'], ['status','!=', 'admin']])->get();
return view('adminlte::admin.listPetugas.index', compact('users'));
} }
public function createPetugas() public function createPetugas()
......
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Petugas extends Model
{
protected $table = 'petugass';
protected $fillable = [
'name', 'email', 'username','password',
];
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Transaksi extends Model
{
protected $fillable = [
'username', 'nama_barang', 'kategori','jumlah','total_harga','status_pengantaran',
];
}
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
<tbody> <tbody>
@foreach($users as $user) @foreach($users as $user)
<tr> <tr>
<td>{{$user->username}}</td> <td>{{$user->name}}</td>
<td>{{$user->email}}</td> <td>{{$user->email}}</td>
<td>{{$user->username}}</td> <td>{{$user->username}}</td>
<td>{{$user->status}} <td>{{$user->status}}</td>
<td> <td>
<a href="{{ url('/editPetugas', $user->id) }}" type="submit" button type="button" class="btn btn-warning">Edit</a> <a href="{{ url('/editPetugas', $user->id) }}" type="submit" button type="button" class="btn btn-warning">Edit</a>
<a href="{{ url('/deletePetugas', $user->id) }}" type="submit" button type="button" class="btn btn-warning">Delete</a></td> <a href="{{ url('/deletePetugas', $user->id) }}" type="submit" button type="button" class="btn btn-warning">Delete</a>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
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