Commit 7bb4923c by Palti Sinaga

commit

parents 8b730aad 683b24a6
......@@ -35,6 +35,7 @@ class RegisterController extends Controller
*/
public function showRegistrationForm()
{
dd('masyk diads');
return view('adminlte::auth.register');
}
......@@ -52,6 +53,7 @@ class RegisterController extends Controller
*/
public function __construct()
{
$this->middleware('guest');
}
......
......@@ -119,34 +119,6 @@ class CustomerController extends Controller
return view('adminlte::layouts.customers.profiles')->with('data',$data[0]);
}
//Menyimpan data Pelanggan disaat melakukan Pendaftaran
public function registerStore(Request $data){
$user = new User();
$user->name = $data['name'];
$user->username = $data['username'];
$user->email = $data['email'];
$user->password = bcrypt($data['password']);
$user->role = "Customer";
$user->foto = "gravatar.png";
$user->save();
$dataPel = DB::table('users')
->select('users.id')
->where('users.username','=',$data['username'])
->get();
$cus = new Customer();
$cus->id_akun = $dataPel[0]->id;
$cus->nama = $data['name'] ;
$cus->alamat = "---";
$cus->no_telepon = "---";
$cus->pekerjaan = "---";
$cus->save();
return redirect('login');
}
//Mengakses Halaman untuk mengedit/mengubah profile
public function editProfile($id){
$data = Customer::find($id);
......@@ -206,6 +178,19 @@ class CustomerController extends Controller
$lb = new ListBook();
$dataPelanggan = DB::table('users')
->join('pelanggan','users.id','=','pelanggan.id_akun')
->select('pelanggan.id','pelanggan.nama')
->where('users.id','=',Auth::user()->id)
->get();
$dataHasilValidPelanggan = $this->dataValidation($dataPelanggan[0]->id);
if($dataHasilValidPelanggan > 0 ){
//dd($dataHasilValidPelanggan,'nggak boleh');
return redirect('customerProfile')->with('message','Lengkkapi data diri anda!!');
}
$dataHomestay = DB::table('homestay')
->join('kamar','homestay.id','=','kamar.id_homestay')
->select('kamar.*','homestay.harga','homestay.jumlah_kamar')
......@@ -249,12 +234,6 @@ class CustomerController extends Controller
}
}
$dataPelanggan = DB::table('users')
->join('pelanggan','users.id','=','pelanggan.id_akun')
->select('pelanggan.id','pelanggan.nama')
->where('users.id','=',Auth::user()->id)
->get();
$time = explode('-', $request['tanggal']);
if ($time[1]==2){
......@@ -331,5 +310,30 @@ class CustomerController extends Controller
return redirect('customerHistory');
}
public function dataValidation($id){
$dataPelanggan = DB::table('pelanggan')
->select('pelanggan.*')
->where('pelanggan.id','=',$id)
->get();
$counter = 0;
if($dataPelanggan[0]->nama == "---"){
$counter +=1;
}
if($dataPelanggan[0]->alamat =="---"){
$counter +=1;
}
if($dataPelanggan[0]->no_telepon =="---"){
$counter +=1;
}
if($dataPelanggan[0]->pekerjaan == "---"){
$counter +=1;
}
return $counter;
}
}
......@@ -34,6 +34,33 @@ class GuestController extends Controller
return view('welcome');
}
//Menyimpan data Pelanggan disaat melakukan Pendaftaran
public function registerStore(Request $data){
$user = new User();
$user->name = $data['name'];
$user->username = $data['username'];
$user->email = $data['email'];
$user->password = bcrypt($data['password']);
$user->role = "Customer";
$user->foto = "gravatar.png";
$user->save();
$dataPel = DB::table('users')
->select('users.id')
->where('users.username','=',$data['username'])
->get();
$cus = new Customer();
$cus->id_akun = $dataPel[0]->id;
$cus->nama = $data['name'] ;
$cus->alamat = "---";
$cus->no_telepon = "---";
$cus->pekerjaan = "---";
$cus->save();
return redirect('login');
}
public function register(){
return view('adminlte::auth.register');
......
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 26 Mei 2017 pada 06.32
-- Versi Server: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `p2d4ti06_test`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `daftar_book`
--
CREATE TABLE `daftar_book` (
`id` int(10) UNSIGNED NOT NULL,
`homestay` int(10) UNSIGNED DEFAULT NULL,
`id_transaksi` int(10) UNSIGNED NOT NULL,
`nama_pemesan` varchar(255) DEFAULT NULL,
`jumlah_kamar` int(255) DEFAULT NULL,
`tanggal_mulai` date DEFAULT NULL,
`tanggal_berakhir` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `dinaspariwisata`
--
CREATE TABLE `dinaspariwisata` (
`id_pegawai` int(10) UNSIGNED NOT NULL,
`nama_pegawai` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`divisi_pegawai` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `dinaspariwisata`
--
INSERT INTO `dinaspariwisata` (`id_pegawai`, `nama_pegawai`, `divisi_pegawai`, `created_at`, `updated_at`) VALUES
(2, 'Juliper', 'Homestay', '2017-05-03 01:19:00', '2017-05-03 01:19:02');
-- --------------------------------------------------------
--
-- Struktur dari tabel `feedback`
--
CREATE TABLE `feedback` (
`id` int(10) UNSIGNED NOT NULL,
`id_pemilik_homestay` int(10) UNSIGNED DEFAULT NULL,
`id_pelanggan` int(10) UNSIGNED NOT NULL,
`feedback` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `feedback`
--
INSERT INTO `feedback` (`id`, `id_pemilik_homestay`, `id_pelanggan`, `feedback`, `created_at`, `updated_at`) VALUES
(1, 6, 2, 'Sesuatu banget ya homestay nya suka deh....', '2017-05-21 19:38:55', '2017-05-21 19:38:55'),
(2, 6, 2, 'Sesuatu banget ya homestay nya suka deh....', '2017-05-21 19:39:11', '2017-05-21 19:39:11'),
(3, 6, 2, 'Sesuatu banget ya homestay nya suka deh....', '2017-05-21 19:40:17', '2017-05-21 19:40:17'),
(4, 6, 2, 'Sesuatu banget ya homestay nya suka deh....', '2017-05-21 19:41:41', '2017-05-21 19:41:41');
-- --------------------------------------------------------
--
-- Struktur dari tabel `homestay`
--
CREATE TABLE `homestay` (
`id` int(10) UNSIGNED NOT NULL,
`id_pemilik` int(10) UNSIGNED DEFAULT NULL,
`nama_homestay` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`alamat` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`jumlah_kamar` int(11) NOT NULL,
`harga` double NOT NULL,
`fasilitas` text COLLATE utf8_unicode_ci,
`gambar` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `homestay`
--
INSERT INTO `homestay` (`id`, `id_pemilik`, `nama_homestay`, `owner`, `alamat`, `jumlah_kamar`, `harga`, `fasilitas`, `gambar`, `status`, `created_at`, `updated_at`) VALUES
(9, 6, 'Mawar Homestay', 'Palti Sinaga', 'Balige', 4, 150000, ' ', 'slide-01.jpg', '----', '2017-05-08 02:51:28', '2017-05-24 05:36:49'),
(11, 13, 'Blessing Homestay', 'Op.Balata', 'Lumban Bul Bul', 3, 150000, NULL, NULL, '----', '2017-05-25 21:25:28', '2017-05-25 21:29:33');
-- --------------------------------------------------------
--
-- Struktur dari tabel `kamar`
--
CREATE TABLE `kamar` (
`id` int(10) UNSIGNED NOT NULL,
`id_homestay` int(10) UNSIGNED DEFAULT NULL,
`id_transaksi` int(10) UNSIGNED DEFAULT NULL,
`nomor_kamar` int(10) UNSIGNED NOT NULL,
`jumlah_bed` int(10) DEFAULT NULL,
`fasilitas` varchar(255) DEFAULT NULL,
`gambar` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `kamar`
--
INSERT INTO `kamar` (`id`, `id_homestay`, `id_transaksi`, `nomor_kamar`, `jumlah_bed`, `fasilitas`, `gambar`) VALUES
(8, 9, 1, 1, 3, 'wkwkw enak deh guys', 'big251436.jpg'),
(9, 9, 1, 2, 2, 'adu adu adu', '20150901_172049.jpg'),
(10, 9, 1, 3, 1, 'Ada Speed Boat', 'bougenville4.JPG'),
(11, 9, NULL, 4, 2, 'Ada SpringBed', 'wisma-intan-kamar-tidur.jpg'),
(15, 11, NULL, 1, 2, NULL, NULL),
(16, 11, NULL, 2, 2, NULL, NULL),
(17, 11, NULL, 3, 2, NULL, NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `kategorifasilitas`
--
CREATE TABLE `kategorifasilitas` (
`id` int(10) UNSIGNED NOT NULL,
`nama_fasilitas` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `kategorifasilitas`
--
INSERT INTO `kategorifasilitas` (`id`, `nama_fasilitas`) VALUES
(1, 'Kamar Tidur'),
(2, 'Perlatan Kamar Mandi');
-- --------------------------------------------------------
--
-- Struktur dari tabel `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2017_04_19_090402_Pelanggan', 2),
(4, '2017_04_19_090837_Admin', 2),
(5, '2017_04_19_091320_DinasPariwisata', 2),
(6, '2017_04_19_091651_PemilikiHomestay', 2),
(7, '2017_04_19_092041_Homestay', 2),
(8, '2017_04_19_101431_Pemesanan', 2),
(9, '2017_04_20_092606_Pembayaran', 2),
(10, '2017_04_22_074954_Feedback', 3);
-- --------------------------------------------------------
--
-- Struktur dari tabel `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `pelanggan`
--
CREATE TABLE `pelanggan` (
`id` int(10) UNSIGNED NOT NULL,
`id_Akun` int(10) UNSIGNED DEFAULT NULL,
`nama` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`alamat` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`no_telepon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`pekerjaan` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`foto` varchar(2555) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `pelanggan`
--
INSERT INTO `pelanggan` (`id`, `id_Akun`, `nama`, `alamat`, `no_telepon`, `pekerjaan`, `foto`, `created_at`, `updated_at`) VALUES
(2, 14, 'Lesa Lesuu ', 'Medan Bung', '082134657865', 'Panortor Profesional', NULL, '2017-05-09 02:32:54', '2017-05-09 21:46:55'),
(4, 15, 'Parhuta', '---', '---', '---', NULL, '2017-05-09 03:12:56', '2017-05-09 03:12:56');
-- --------------------------------------------------------
--
-- Struktur dari tabel `pemilikhomestay`
--
CREATE TABLE `pemilikhomestay` (
`id` int(10) UNSIGNED NOT NULL,
`id_akun` int(10) UNSIGNED DEFAULT NULL,
`nama` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`alamat` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`pekerjaan` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`no_telepon` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`no_rekening` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`foto` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `pemilikhomestay`
--
INSERT INTO `pemilikhomestay` (`id`, `id_akun`, `nama`, `alamat`, `pekerjaan`, `no_telepon`, `no_rekening`, `foto`, `created_at`, `updated_at`) VALUES
(6, 5, 'Palti Sinaga', 'Balige', 'Petani', '6282272194654', '12345678981', '1493643347919.jpg', '2017-04-29 08:07:38', '2017-05-24 05:38:43'),
(13, 22, 'Op.Balata', '--', '--', '--', '--', 'gravatar.png', '2017-05-25 21:10:39', '2017-05-25 21:10:39'),
(14, 23, 'Dion Marpaung', '--', '--', '--', '--', 'gravatar.png', '2017-05-25 21:11:26', '2017-05-25 21:11:26');
-- --------------------------------------------------------
--
-- Struktur dari tabel `pengajuan_homestay`
--
CREATE TABLE `pengajuan_homestay` (
`id` int(10) NOT NULL,
`id_pemilik_homestay` int(10) UNSIGNED DEFAULT NULL,
`id_pgw_dinas_pariwisata` int(101) UNSIGNED DEFAULT NULL,
`nama_homestay` varchar(255) NOT NULL,
`jumlah_kamar` int(10) NOT NULL,
`status` int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `pengajuan_homestay`
--
INSERT INTO `pengajuan_homestay` (`id`, `id_pemilik_homestay`, `id_pgw_dinas_pariwisata`, `nama_homestay`, `jumlah_kamar`, `status`) VALUES
(3, 6, NULL, 'Test2', 4, 1),
(5, 13, NULL, 'Blessing Homestay', 3, 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `requestfasilitas`
--
CREATE TABLE `requestfasilitas` (
`id` int(11) NOT NULL,
`id_pemilik_homestay` int(10) UNSIGNED DEFAULT NULL,
`id_kategori_fasiltas` int(10) UNSIGNED DEFAULT NULL,
`nama_request_fasilitas` varchar(255) NOT NULL,
`deskripsi` varchar(255) NOT NULL,
`jumlah` int(11) NOT NULL,
`gambar` varchar(255) DEFAULT NULL,
`status` int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `requestfasilitas`
--
INSERT INTO `requestfasilitas` (`id`, `id_pemilik_homestay`, `id_kategori_fasiltas`, `nama_request_fasilitas`, `deskripsi`, `jumlah`, `gambar`, `status`) VALUES
(8, 6, 2, 'Keramik Pecah', 'Terjadi Perang saudara', 100, 'Agar-Keramik-Tidak-Meledak.jpg', 2),
(12, 6, 2, 'Keramik Pecah', ' Tsunami dan pelanggan mati gan', 100, 'Agar-Keramik-Tidak-Meledak.jpg', 2);
-- --------------------------------------------------------
--
-- Struktur dari tabel `transaksi`
--
CREATE TABLE `transaksi` (
`id` int(10) UNSIGNED NOT NULL,
`id_pelanggan` int(10) UNSIGNED NOT NULL,
`id_homestay` int(10) UNSIGNED DEFAULT NULL,
`tanggal_mulai` date NOT NULL,
`tanggal_berakhir` date NOT NULL,
`jumlah_kamar` int(10) NOT NULL,
`lama_menginap` int(10) NOT NULL,
`bukti_pembayaran` varchar(255) DEFAULT NULL,
`total_pembayaran` int(10) DEFAULT NULL,
`tanggal_konfirmasi` date DEFAULT NULL,
`status` int(1) UNSIGNED ZEROFILL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`foto` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`role` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `users`
--
INSERT INTO `users` (`id`, `name`, `username`, `email`, `password`, `foto`, `role`, `remember_token`, `created_at`, `updated_at`) VALUES
(2, 'Juliper', 'admin', 'admin@del.ac.id', '$2y$10$nnnUgQAnb9FnDb3DNTlwaehkE5GiJ6piv8Yg/LXyXypdgaxigpHVe', 'gravatar.png', 'DinasPariwisata', 'T6Xof13PvUcNvlcRx0YLzdS2LSfvHLnVbZKeTUnBmMFbHKtQX4kTOQN8Io12', '2017-04-22 02:30:14', '2017-05-25 21:25:52'),
(5, 'Palti Sinaga', 'palti', 'palti1@gmail.com', '$2y$10$YZNp2gw4amlEQWi4hvDA9OfGixdYx1AIsl0.El8TzQoo9IPed8E..', 'gravatar.png', 'Owner', 'BHxVk84KZZ5Df0Pv5DIACId40uJv74AwRPBqU6NNtzgD9KJu9nTHR7MfTlel', '2017-04-29 08:07:38', '2017-05-25 20:22:05'),
(14, 'Lesa Lesuu ', 'lesa', 'lesa@gmail.com', '$2y$10$zudTTxc6.lENGpFKwp093u9SuvEjidfYExLHk3vsOvZISDma1HChW', 'anonymous1.jpg', 'Customer', 'o0wZR6Sbzx0EKZB6EUkgTOesPyvZesdIZm4wRZm1ojlZulALATiyEQYLJJFQ', '2017-05-09 02:41:21', '2017-05-25 20:52:31'),
(15, 'Parhuta', 'hutahuta', 'huta@gmail.com', '$2y$10$S/thLiTQUbpZ6/utPKPwDe7JGoScFnebDK6Vt6sm0I.7CIoQ9HrWe', 'gravatar.png', 'Customer', NULL, '2017-05-09 03:12:55', '2017-05-09 03:12:55'),
(22, 'Op.Balata', 'balata', 'balata@gmail.com', '$2y$10$r6Vxa2PnV2eKFaaGZ51RHOeJiloAdgF6YaMLiFFqF4p4AydQTLzAW', NULL, 'Owner', '4yzzuMhFfK3UmhVj7qChMGEKyJQpjpbTv6FEHifA8TABcxn4kWTnuA2XaXcJ', '2017-05-25 21:10:39', '2017-05-25 21:31:43'),
(23, 'Dion Marpaung', 'dionm', 'dion@gmail.com', '$2y$10$OVg25M/AMKoziQhfym4OcOYTmR8TWAMWFz8tOs6ogB7xdTnIeCG1u', NULL, 'Owner', NULL, '2017-05-25 21:11:26', '2017-05-25 21:11:26');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `daftar_book`
--
ALTER TABLE `daftar_book`
ADD PRIMARY KEY (`id`),
ADD KEY `homestay` (`homestay`),
ADD KEY `id_transaksi` (`id_transaksi`);
--
-- Indexes for table `dinaspariwisata`
--
ALTER TABLE `dinaspariwisata`
ADD PRIMARY KEY (`id_pegawai`);
--
-- Indexes for table `feedback`
--
ALTER TABLE `feedback`
ADD PRIMARY KEY (`id`),
ADD KEY `idPelanggan` (`id_pelanggan`),
ADD KEY `id_pemilikHomestay` (`id_pemilik_homestay`);
--
-- Indexes for table `homestay`
--
ALTER TABLE `homestay`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `nama` (`nama_homestay`),
ADD UNIQUE KEY `id_owner` (`owner`),
ADD KEY `id_owner_2` (`owner`),
ADD KEY `idPemilik` (`id_pemilik`),
ADD KEY `nama_2` (`nama_homestay`);
--
-- Indexes for table `kamar`
--
ALTER TABLE `kamar`
ADD PRIMARY KEY (`id`),
ADD KEY `idPemesanan` (`id_transaksi`),
ADD KEY `idHomestay` (`id_homestay`);
--
-- Indexes for table `kategorifasilitas`
--
ALTER TABLE `kategorifasilitas`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`),
ADD KEY `password_resets_token_index` (`token`);
--
-- Indexes for table `pelanggan`
--
ALTER TABLE `pelanggan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pemilikhomestay`
--
ALTER TABLE `pemilikhomestay`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `nama` (`nama`),
ADD KEY `id_Akun` (`id_akun`);
--
-- Indexes for table `pengajuan_homestay`
--
ALTER TABLE `pengajuan_homestay`
ADD PRIMARY KEY (`id`),
ADD KEY `idPemilikHomestay` (`id_pemilik_homestay`),
ADD KEY `idPgwDinasPariwisata` (`id_pgw_dinas_pariwisata`);
--
-- Indexes for table `requestfasilitas`
--
ALTER TABLE `requestfasilitas`
ADD PRIMARY KEY (`id`),
ADD KEY `id_kategoriFasiltas` (`id_kategori_fasiltas`),
ADD KEY `id_pemilik_homestay` (`id_pemilik_homestay`);
--
-- Indexes for table `transaksi`
--
ALTER TABLE `transaksi`
ADD PRIMARY KEY (`id`),
ADD KEY `id_pelanggan` (`id_pelanggan`),
ADD KEY `id_homestay` (`id_homestay`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`),
ADD UNIQUE KEY `username` (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `daftar_book`
--
ALTER TABLE `daftar_book`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dinaspariwisata`
--
ALTER TABLE `dinaspariwisata`
MODIFY `id_pegawai` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `feedback`
--
ALTER TABLE `feedback`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `homestay`
--
ALTER TABLE `homestay`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `kamar`
--
ALTER TABLE `kamar`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `kategorifasilitas`
--
ALTER TABLE `kategorifasilitas`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `pelanggan`
--
ALTER TABLE `pelanggan`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `pemilikhomestay`
--
ALTER TABLE `pemilikhomestay`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `pengajuan_homestay`
--
ALTER TABLE `pengajuan_homestay`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `requestfasilitas`
--
ALTER TABLE `requestfasilitas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `transaksi`
--
ALTER TABLE `transaksi`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `daftar_book`
--
ALTER TABLE `daftar_book`
ADD CONSTRAINT `daftar_book_ibfk_1` FOREIGN KEY (`homestay`) REFERENCES `homestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `daftar_book_ibfk_2` FOREIGN KEY (`id_transaksi`) REFERENCES `transaksi` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `feedback`
--
ALTER TABLE `feedback`
ADD CONSTRAINT `feedback_ibfk_1` FOREIGN KEY (`id_pelanggan`) REFERENCES `pelanggan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `feedback_ibfk_2` FOREIGN KEY (`id_pemilik_homestay`) REFERENCES `pemilikhomestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `homestay`
--
ALTER TABLE `homestay`
ADD CONSTRAINT `homestay_ibfk_1` FOREIGN KEY (`id_pemilik`) REFERENCES `pemilikhomestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `kamar`
--
ALTER TABLE `kamar`
ADD CONSTRAINT `kamar_ibfk_2` FOREIGN KEY (`id_homestay`) REFERENCES `homestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `pemilikhomestay`
--
ALTER TABLE `pemilikhomestay`
ADD CONSTRAINT `pemilikhomestay_ibfk_1` FOREIGN KEY (`id_Akun`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `pengajuan_homestay`
--
ALTER TABLE `pengajuan_homestay`
ADD CONSTRAINT `pengajuan_homestay_ibfk_1` FOREIGN KEY (`id_pemilik_homestay`) REFERENCES `pemilikhomestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `pengajuan_homestay_ibfk_2` FOREIGN KEY (`id_pgw_dinas_pariwisata`) REFERENCES `dinaspariwisata` (`id_pegawai`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `requestfasilitas`
--
ALTER TABLE `requestfasilitas`
ADD CONSTRAINT `requestfasilitas_ibfk_1` FOREIGN KEY (`id_pemilik_homestay`) REFERENCES `pemilikhomestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `requestfasilitas_ibfk_2` FOREIGN KEY (`id_kategori_fasiltas`) REFERENCES `kategorifasilitas` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `transaksi`
--
ALTER TABLE `transaksi`
ADD CONSTRAINT `transaksi_ibfk_1` FOREIGN KEY (`id_pelanggan`) REFERENCES `pelanggan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `transaksi_ibfk_2` FOREIGN KEY (`id_homestay`) REFERENCES `homestay` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
......@@ -36,6 +36,12 @@
<a class="agileits w3layoutswow slideInLeft" href="{{url('editProfileCustomer/'.$data->id)}}" >Edit Profile <span class="glyphicon agileits w3layouts glyphicon-arrow-right" aria-hidden="true"></span></a>
<a class="agileits w3layoutswow slideInLeft" href="{{url('customerHistory')}}">History <span class="glyphicon agileits w3layouts glyphicon-arrow-right" aria-hidden="true"></span></a>
</div>
<br><br>
@if(Session::has('message'))
<div class="alert alert-danger">
{{ Session::get('message') }}
</div>
@endif
</div>
<div class="clearfix"></div>
</div>
......
......@@ -15,6 +15,11 @@
<div class="details agileits w3layouts" style="margin-top: 10px; padding:0px">
<br>
@if(Session::has('message'))
<div class="alert alert-danger">
{{ Session::get('message') }}
</div>
@endif
<div class="container">
@if (count($errors) > 0)
<div class="alert alert-danger">
......
......@@ -82,12 +82,12 @@ Route::group(['middleware' => 'owner'], function () {
Route::get('detailhomestay/{id}','GuestController@detailhomestay');
Route::get('daftar','GuestController@register');
Route::post('daftar','GuestController@registerStore');
Route::group(['middleware' => 'customer'], function () {
Route::delete('batalkanPemesanan/{id}','CustomerController@cancelPemesanan');
Route::put('upload/{id}','CustomerController@upload');
Route::get('customerHistory','CustomerController@history');
Route::post('daftar','CustomerController@registerStore');
Route::post('book','CustomerController@booking');
Route::get('buktipembayaran/{id}','CustomerController@bukti');
Route::get('editProfileCustomer/{id}','CustomerController@editProfile');
......
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