-- Adminer 4.2.4 MySQL dump

SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

CREATE TABLE `kategori` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) DEFAULT NULL,
  `slug` varchar(255) DEFAULT NULL,
  `parent_id` int(11) DEFAULT '0',
  `level` tinyint(3) DEFAULT '1',
  `urutan` int(11) DEFAULT '1',
  `status` tinyint(3) DEFAULT '1',
  `icon` varchar(255) DEFAULT NULL,
  `thumbnail` varchar(255) DEFAULT NULL,
  `gambar` varchar(255) DEFAULT NULL,
  `deskripsi` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `kota` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `provinsi_id` int(11) NOT NULL,
  `nama` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `provinsi_id` (`provinsi_id`),
  CONSTRAINT `kota_ibfk_1` FOREIGN KEY (`provinsi_id`) REFERENCES `provinsi` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `menu` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `nama` varchar(50) NOT NULL,
  `deskripsi` text,
  `controller` varchar(255) DEFAULT NULL,
  `actions` text,
  `default_action` varchar(255) DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `parent_id` int(11) DEFAULT '0',
  `level` int(11) DEFAULT '1',
  `status_tampil` int(11) DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=744;

INSERT INTO `menu` (`id`, `nama`, `deskripsi`, `controller`, `actions`, `default_action`, `icon`, `parent_id`, `level`, `status_tampil`, `created_at`, `updated_at`) VALUES
(1,	'Beranda',	'',	'site',	'[\"index\"]',	'index',	'fa fa-home',	NULL,	1,	1,	'2018-12-18 16:12:35',	'2018-12-26 09:33:30'),
(2,	'Role',	'',	'role',	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'index',	'fa fa-user-md',	4,	2,	1,	'2018-12-18 16:13:09',	'2018-12-26 09:36:52'),
(3,	'Menu',	'',	'menu',	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'index',	'fa fa-th-list',	4,	2,	1,	'2018-12-20 06:33:57',	'2018-12-26 09:37:18'),
(4,	'User & Role',	'',	'',	'\"\"',	'',	'fa fa-lock',	NULL,	1,	1,	'2018-12-20 07:07:19',	'2018-12-29 11:19:23'),
(5,	'Role Menu',	'',	'role-menu',	'[\"create\",\"index\",\"update\",\"delete\",\"up\",\"down\",\"view\"]',	'index',	'fa fa-check-square-o',	4,	2,	1,	'2018-12-20 07:18:45',	'2018-12-26 09:38:03'),
(6,	'User',	'',	'user',	'[\"create\",\"index\",\"update\",\"delete\",\"change-password\",\"view\"]',	'index',	'fa fa-users',	4,	2,	1,	'2018-12-20 09:09:21',	'2019-01-12 14:15:31'),
(19,	'Vendor',	NULL,	'vendor',	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'index',	'fa fa-bank',	NULL,	1,	1,	'2019-01-12 14:16:56',	'2019-02-01 03:46:50'),
(20,	'Peserta',	NULL,	'peserta',	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'index',	'fa fa-users',	23,	2,	0,	'2019-01-12 14:17:22',	'2019-02-01 03:29:46'),
(21,	'Trainer',	NULL,	'trainer',	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'index',	'fa fa-graduation-cap',	23,	2,	0,	'2019-01-12 14:20:48',	'2019-02-01 03:29:54'),
(22,	'Training',	NULL,	'training',	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'index',	'fa fa-cube',	NULL,	1,	1,	'2019-01-12 14:21:30',	'2019-01-12 14:21:30'),
(23,	'Detail Training',	NULL,	'',	'\"\"',	'',	'fa fa-cube',	NULL,	1,	0,	'2019-02-01 03:29:28',	'2019-02-01 03:29:28');

CREATE TABLE `migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base',	1545108178),
('m130524_201442_init',	1545108181),
('m181211_160017_create_table_setting',	1545108182);

CREATE TABLE `peserta_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `peserta_training` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nomor_peserta` varchar(255) NOT NULL,
  `waktu_daftar` datetime NOT NULL,
  `status_bayar` int(11) NOT NULL,
  `tanggal_bayar` date NOT NULL,
  `jumlah_bayar` int(11) NOT NULL,
  `bukti_transfer` varchar(255) NOT NULL,
  `file_sertifikat` varchar(255) NOT NULL,
  `peserta_status_id` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `peserta_status_id` (`peserta_status_id`),
  CONSTRAINT `peserta_training_ibfk_1` FOREIGN KEY (`peserta_status_id`) REFERENCES `peserta_status` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `provinsi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `riwayat_pembayaran_vendor` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `jenis` varchar(255) NOT NULL,
  `jumlah` int(11) NOT NULL,
  `keterangan` text NOT NULL,
  `training_id` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `training_id` (`training_id`),
  CONSTRAINT `riwayat_pembayaran_vendor_ibfk_1` FOREIGN KEY (`training_id`) REFERENCES `training` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `role` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `nama` varchar(50) NOT NULL,
  `deskripsi` text,
  `status` smallint(6) NOT NULL DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `role` (`id`, `nama`, `deskripsi`, `status`, `created_at`, `updated_at`) VALUES
(1,	'Super Admin',	'Super admin yang mempunyai semua hak di dalam aplikasi',	1,	'2018-12-18 16:11:28',	'2018-12-29 11:11:40'),
(2,	'Admin',	'Admin Umum\r\n',	1,	'2018-12-20 08:27:06',	'2018-12-29 11:11:16');

CREATE TABLE `role_menu` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` int(11) unsigned DEFAULT NULL,
  `menu_id` int(11) unsigned DEFAULT NULL,
  `parameter` varchar(255) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `posisi` int(11) unsigned DEFAULT NULL,
  `privileges` varchar(255) NOT NULL COMMENT 'misal: crud',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`),
  KEY `menu_id` (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=744;

INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `parameter`, `label`, `posisi`, `privileges`, `created_at`, `updated_at`) VALUES
(4,	1,	4,	'',	'',	3,	'\"\"',	'2018-12-20 07:22:17',	'2018-12-26 09:47:19'),
(6,	1,	2,	'',	'',	4,	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'2018-12-20 07:45:09',	'2018-12-29 11:11:28'),
(7,	1,	5,	'',	'',	6,	'[\"create\",\"index\",\"update\",\"delete\",\"up\",\"down\",\"view\"]',	'0000-00-00 00:00:00',	'2018-12-21 10:05:45'),
(9,	1,	6,	'',	'User',	2,	'[\"create\",\"index\",\"update\",\"delete\",\"change-password\",\"view\"]',	'2018-12-20 09:22:42',	'2018-12-26 09:49:00'),
(17,	1,	1,	'',	'',	1,	'[\"index\"]',	'2018-12-20 16:06:16',	'2018-12-26 09:34:05'),
(18,	2,	1,	'',	'',	1,	'[\"index\"]',	'2018-12-20 16:11:03',	'2018-12-26 09:33:58'),
(26,	1,	3,	'',	'',	5,	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'2018-12-20 21:21:30',	'2018-12-22 09:40:11'),
(39,	1,	22,	'',	'',	7,	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'2019-01-12 14:22:03',	'2019-01-12 14:22:03'),
(40,	1,	19,	'',	'',	8,	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'2019-01-12 14:22:23',	'2019-01-12 14:22:23'),
(41,	1,	20,	'',	'',	9,	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'2019-01-12 14:22:32',	'2019-01-12 14:22:32'),
(42,	1,	21,	'',	'',	10,	'[\"index\",\"create\",\"view\",\"update\",\"delete\"]',	'2019-01-12 14:22:49',	'2019-01-12 14:22:49');

CREATE TABLE `setting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) DEFAULT NULL,
  `deskripsi` varchar(255) DEFAULT NULL,
  `nilai` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `trainer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) NOT NULL,
  `alamat` text NOT NULL,
  `telepon` varchar(255) NOT NULL,
  `bidang` varchar(255) NOT NULL,
  `kompetensi` varchar(255) NOT NULL,
  `pendidikan` varchar(255) NOT NULL,
  `sertifikat` varchar(255) NOT NULL,
  `pengalaman` text NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `training` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) NOT NULL,
  `poster` varchar(255) NOT NULL,
  `thumbnail` varchar(255) NOT NULL,
  `deskripsi` text NOT NULL,
  `konten` text NOT NULL,
  `peserta_minimum` int(11) NOT NULL,
  `peserta_maksimum` int(11) NOT NULL,
  `provinsi_id` int(11) NOT NULL,
  `kota_id` int(11) NOT NULL,
  `alamat` text NOT NULL,
  `latitude` varchar(255) NOT NULL,
  `longitude` varchar(255) NOT NULL,
  `tanggal_mulai` date NOT NULL,
  `tanggal_selesai` date NOT NULL,
  `biaya` int(11) NOT NULL,
  `diskon` int(11) NOT NULL,
  `vendor_id` int(11) NOT NULL,
  `kategori_id` int(11) NOT NULL,
  `training_status_id` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `vendor_id` (`vendor_id`),
  KEY `training_status_id` (`training_status_id`),
  KEY `kategori_id` (`kategori_id`),
  KEY `provinsi_id` (`provinsi_id`),
  KEY `kota_id` (`kota_id`),
  CONSTRAINT `training_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`id`),
  CONSTRAINT `training_ibfk_2` FOREIGN KEY (`training_status_id`) REFERENCES `training_status` (`id`),
  CONSTRAINT `training_ibfk_3` FOREIGN KEY (`kategori_id`) REFERENCES `kategori` (`id`),
  CONSTRAINT `training_ibfk_4` FOREIGN KEY (`provinsi_id`) REFERENCES `provinsi` (`id`),
  CONSTRAINT `training_ibfk_5` FOREIGN KEY (`kota_id`) REFERENCES `kota` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `training_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) NOT NULL,
  `warna` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `training_status` (`id`, `nama`, `warna`, `created_at`, `updated_at`, `created_by`, `updated_by`) VALUES
(1,	'Pending',	'label-default',	'2019-02-01 11:00:38',	'2019-02-01 11:00:38',	1,	1),
(2,	'Terkonfirmasi',	'label-primary',	'2019-02-01 11:00:54',	'2019-02-01 11:00:54',	1,	1),
(3,	'Berlangsung',	'label-warning',	'2019-02-01 11:01:24',	'2019-02-01 11:01:24',	1,	1),
(4,	'Gagal',	'label-danger',	'2019-02-01 11:01:46',	'2019-02-01 11:01:46',	1,	1),
(5,	'Sukses',	'label-success',	'2019-02-01 11:01:59',	'2019-02-01 11:01:59',	1,	1);

-- 2019-02-09 23:48:17
