Advertisement
orie

sql

Sep 3rd, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.33 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.6.5.2
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: 127.0.0.1
  6. -- Generation Time: Sep 03, 2018 at 08:18 PM
  7. -- Server version: 10.1.21-MariaDB
  8. -- PHP Version: 5.6.30
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET time_zone = "+00:00";
  12.  
  13.  
  14. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  15. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  16. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  17. /*!40101 SET NAMES utf8mb4 */;
  18.  
  19. --
  20. -- Database: `imania`
  21. --
  22.  
  23. -- --------------------------------------------------------
  24.  
  25. --
  26. -- Table structure for table `barang`
  27. --
  28.  
  29. CREATE TABLE `barang` (
  30. `id_barang` int(11) NOT NULL,
  31. `kode_barang` varchar(50) NOT NULL,
  32. `nama_barang` varchar(100) NOT NULL,
  33. `model` varchar(100) NOT NULL,
  34. `foto` varchar(255) DEFAULT NULL,
  35. `active` varchar(1) NOT NULL DEFAULT '1'
  36. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  37.  
  38. --
  39. -- Dumping data for table `barang`
  40. --
  41.  
  42. INSERT INTO `barang` (`id_barang`, `kode_barang`, `nama_barang`, `model`, `foto`, `active`) VALUES
  43. (1, 'PNT30', 'Pintu', 'Minimalis', NULL, '1'),
  44. (3, 'MJA6590', 'Meja Makan', 'Lipat', NULL, '1'),
  45. (4, 'RJG33JI', 'Ranjang', 'Modernistik', NULL, '1'),
  46. (5, 'KRS889U', 'Kursi Ayun', 'ala Eropa', NULL, '1'),
  47. (8, 'KRS9PJG', 'Kursi Panjang', 'merk IKEA', 'vue_logo.png', '1'),
  48. (9, 'MJ25PJG', 'Meja Panjang', '2m', 'production.png', '1'),
  49. (10, 'KBATAS', 'Kabinet Atas', 'Oke', NULL, '1'),
  50. (11, 'BR99TST', 'Barang Tes', 'Ket tes', 'pdf2.png', '1'),
  51. (12, 'MJA123', 'Meja Belajar', '', NULL, '1');
  52.  
  53. -- --------------------------------------------------------
  54.  
  55. --
  56. -- Table structure for table `customer`
  57. --
  58.  
  59. CREATE TABLE `customer` (
  60. `id_customer` int(11) NOT NULL,
  61. `nama_lengkap` varchar(100) NOT NULL,
  62. `no_hp` varchar(20) DEFAULT NULL,
  63. `no_telp` varchar(20) DEFAULT NULL,
  64. `email` varchar(100) DEFAULT NULL,
  65. `alamat` tinytext NOT NULL,
  66. `tgl_lahir` date DEFAULT NULL,
  67. `keterangan` text NOT NULL,
  68. `active` varchar(1) NOT NULL DEFAULT '1'
  69. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  70.  
  71. --
  72. -- Dumping data for table `customer`
  73. --
  74.  
  75. INSERT INTO `customer` (`id_customer`, `nama_lengkap`, `no_hp`, `no_telp`, `email`, `alamat`, `tgl_lahir`, `keterangan`, `active`) VALUES
  76. (1, 'Jihad Dzikri Waspada', '085785324570', '(021) 598-4033', 'dewey992@gmail.com', 'Blok H4 Binong Permai no. 35, Tangerang', '1992-12-27', 'Punya istri 3', '1'),
  77. (2, 'Amita Diananda', '081387432666', '(021) 598-4033', 'amitadiananda@gmail.com', 'Harapan Kita, Tangerang', '1968-04-25', '', '1'),
  78. (3, 'Nida Millatina', '08571234567', '(021) 190-0001', 'nida@duniawebsite.com', 'Jl. Empu Kanwa', '1993-03-12', 'COO Dunia Website', '1'),
  79. (4, 'Ibu Lita', '08571234900', '(021) 7868378', 'lita@lita.com', 'Tangerang', '1972-11-27', 'Punya anak 3', '1'),
  80. (5, 'Ibu Fitri', '0859897635373', '021543725', 'fitri@yahoo.com', 'Apartement Cinere Blok A4 No.5', '1988-11-26', 'nama anaknya fahri', '1'),
  81. (8, 'Hia\'', '09182827', '', '', 'Tangerang', NULL, '', '0'),
  82. (9, 'Customer Test', '0857324567', '12345667', 'customer_test@test.com', 'Bekasi', '1978-01-12', 'Anak 4', '1');
  83.  
  84. -- --------------------------------------------------------
  85.  
  86. --
  87. -- Table structure for table `quotation`
  88. --
  89.  
  90. CREATE TABLE `quotation` (
  91. `id_quotation` int(11) NOT NULL,
  92. `judul` text NOT NULL,
  93. `alamat_proyek` text NOT NULL,
  94. `id_customer` int(11) NOT NULL,
  95. `keterangan` varchar(10) NOT NULL DEFAULT 'belum'
  96. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  97.  
  98. --
  99. -- Dumping data for table `quotation`
  100. --
  101.  
  102. INSERT INTO `quotation` (`id_quotation`, `judul`, `alamat_proyek`, `id_customer`, `keterangan`) VALUES
  103. (1, 'Tes Proyek', 'Tangerang', 5, 'ok'),
  104. (2, 'GSB', 'Bintaro', 2, 'ok'),
  105. (3, 'oke', 'cikoneng', 9, 'ok');
  106.  
  107. -- --------------------------------------------------------
  108.  
  109. --
  110. -- Table structure for table `quotation_hm_bahan`
  111. --
  112.  
  113. CREATE TABLE `quotation_hm_bahan` (
  114. `id_produksi` int(11) NOT NULL,
  115. `id_ruangan` int(11) NOT NULL,
  116. `jumlah_barang` tinyint(4) NOT NULL,
  117. `id_barang` int(11) NOT NULL,
  118. `jumlah_bahan` tinyint(4) NOT NULL,
  119. `id_bahan` int(11) NOT NULL,
  120. `harga_bahan` int(11) NOT NULL,
  121. `transportasi` int(11) NOT NULL,
  122. `tukang` int(11) NOT NULL,
  123. `lain_lain` int(11) NOT NULL,
  124. `margin` tinyint(4) NOT NULL
  125. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  126.  
  127. --
  128. -- Dumping data for table `quotation_hm_bahan`
  129. --
  130.  
  131. INSERT INTO `quotation_hm_bahan` (`id_produksi`, `id_ruangan`, `jumlah_barang`, `id_barang`, `jumlah_bahan`, `id_bahan`, `harga_bahan`, `transportasi`, `tukang`, `lain_lain`, `margin`) VALUES
  132. (1, 1, 1, 4, 1, 3, 15000, 0, 0, 0, 0),
  133. (1, 1, 1, 4, 1, 4, 55000, 0, 0, 0, 0),
  134. (1, 1, 1, 4, 1, 2, 25500, 0, 0, 0, 0),
  135. (1, 1, 1, 4, 5, 5, 17500, 0, 0, 0, 0),
  136. (1, 1, 1, 10, 4, 3, 15000, 0, 0, 0, 0),
  137. (1, 1, 1, 10, 2, 15, 80000, 0, 0, 0, 0),
  138. (1, 1, 1, 10, 6, 10, 144000, 0, 0, 0, 0),
  139. (1, 1, 1, 10, 8, 17, 95000, 0, 0, 0, 0),
  140. (1, 1, 1, 10, 3, 11, 68300, 0, 0, 0, 0),
  141. (2, 3, 3, 10, 4, 3, 15000, 0, 0, 0, 0),
  142. (2, 3, 3, 10, 2, 15, 80000, 0, 0, 0, 0),
  143. (2, 3, 3, 10, 6, 10, 144000, 0, 0, 0, 0),
  144. (2, 3, 3, 10, 8, 17, 95000, 0, 0, 0, 0),
  145. (2, 3, 3, 10, 3, 11, 68300, 0, 0, 0, 0),
  146. (2, 3, 2, 9, 4, 13, 51000, 0, 0, 0, 0),
  147. (2, 3, 2, 9, 2, 5, 17500, 0, 0, 0, 0),
  148. (2, 3, 2, 9, 3, 10, 144000, 0, 0, 0, 0),
  149. (2, 3, 2, 9, 2, 9, 152500, 0, 0, 0, 0),
  150. (2, 3, 2, 9, 10, 12, 34000, 0, 0, 0, 0),
  151. (2, 3, 2, 9, 4, 14, 42000, 0, 0, 0, 0),
  152. (2, 4, 2, 4, 1, 3, 15000, 140000, 2000000, 260000, 15),
  153. (2, 4, 2, 4, 1, 4, 55000, 140000, 2000000, 260000, 15),
  154. (2, 4, 2, 4, 1, 2, 25500, 140000, 2000000, 260000, 15),
  155. (2, 4, 2, 4, 5, 5, 17500, 140000, 2000000, 260000, 15),
  156. (2, 4, 1, 1, 1, 2, 25500, 200000, 5000000, 450000, 10),
  157. (2, 4, 1, 1, 2, 3, 15000, 200000, 5000000, 450000, 10),
  158. (2, 4, 1, 1, 2, 9, 152500, 200000, 5000000, 450000, 10),
  159. (2, 4, 1, 1, 3, 5, 17500, 200000, 5000000, 450000, 10),
  160. (2, 4, 1, 1, 5, 10, 144000, 200000, 5000000, 450000, 10);
  161.  
  162. -- --------------------------------------------------------
  163.  
  164. --
  165. -- Table structure for table `ruangan`
  166. --
  167.  
  168. CREATE TABLE `ruangan` (
  169. `id_ruangan` int(11) NOT NULL,
  170. `nama_ruangan` varchar(100) NOT NULL,
  171. `id_quotation` int(11) NOT NULL,
  172. `lantai` int(11) NOT NULL
  173. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  174.  
  175. --
  176. -- Dumping data for table `ruangan`
  177. --
  178.  
  179. INSERT INTO `ruangan` (`id_ruangan`, `nama_ruangan`, `id_quotation`, `lantai`) VALUES
  180. (1, 'tamu', 1, 0),
  181. (3, 'dapur', 2, 0),
  182. (4, 'kamar utama', 2, 0),
  183. (5, 'free', 3, 1),
  184. (6, 'depan', 3, 1),
  185. (7, 'qqqq', 3, 2);
  186.  
  187. -- --------------------------------------------------------
  188.  
  189. --
  190. -- Table structure for table `ruangan_hm_barang`
  191. --
  192.  
  193. CREATE TABLE `ruangan_hm_barang` (
  194. `id_ruangan` int(11) NOT NULL,
  195. `id_barang` int(11) NOT NULL,
  196. `jumlah_barang` tinyint(4) NOT NULL,
  197. `satuan_barang` varchar(20) NOT NULL,
  198. `spesifikasi` text,
  199. `transportasi` int(11) NOT NULL DEFAULT '0',
  200. `tukang` int(11) NOT NULL DEFAULT '0',
  201. `lain_lain` int(11) NOT NULL DEFAULT '0',
  202. `margin` float NOT NULL DEFAULT '0'
  203. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  204.  
  205. --
  206. -- Dumping data for table `ruangan_hm_barang`
  207. --
  208.  
  209. INSERT INTO `ruangan_hm_barang` (`id_ruangan`, `id_barang`, `jumlah_barang`, `satuan_barang`, `spesifikasi`, `transportasi`, `tukang`, `lain_lain`, `margin`) VALUES
  210. (1, 4, 1, 'unit', '[\"Multiplex\",\"Bagian Luar Finishing HPL - Taco/ArtForm Standart\"]', 0, 0, 0, 0),
  211. (1, 10, 1, 'kabinet', '[\"Multiplex\",\"Bagian Luar Finishing HPL - Taco/ArtForm Standart\",\"Engsel Softclose - FGV\",\"Handle Alumunium\",\"Edging Alumunium\",\"Edging PVC\"]', 0, 0, 0, 0),
  212. (4, 4, 2, 'buah', '[\"Multiplex\",\"Bagian Luar Finishing HPL - Taco/ArtForm Standart\"]', 140000, 2000000, 260000, 15),
  213. (4, 1, 1, 'daun', '[\"Multiplex\",\"Handle Alumunium\",\"Rel Tandem Slowmotion\",\"Bagian dalam Finishing Decosheet\",\"Backsplash\"]', 200000, 5000000, 450000, 10),
  214. (3, 10, 3, 'buah', '[\"Multiplex\",\"Bagian Luar Finishing HPL - Taco/ArtForm Standart\",\"Engsel Softclose - FGV\",\"Handle Alumunium\",\"Edging Alumunium\",\"Edging PVC\"]', 0, 0, 0, 0),
  215. (3, 9, 2, 'unit', '[\"Multiplex\",\"Bagian Luar Finishing HPL - Taco/ArtForm Standart\",\"Backsplash\",\"Tacosheet\",\"Cat Hitam Pekat\"]', 0, 0, 0, 0),
  216. (5, 1, 3, 'Unit', NULL, 0, 0, 0, 0),
  217. (6, 1, 2, 'umit', NULL, 0, 0, 0, 0),
  218. (7, 5, 1, 'b', NULL, 0, 0, 0, 0),
  219. (6, 9, 2, 'Unit', NULL, 0, 0, 0, 0);
  220.  
  221. --
  222. -- Indexes for dumped tables
  223. --
  224.  
  225. --
  226. -- Indexes for table `barang`
  227. --
  228. ALTER TABLE `barang`
  229. ADD PRIMARY KEY (`id_barang`),
  230. ADD UNIQUE KEY `kode_barang` (`kode_barang`);
  231.  
  232. --
  233. -- Indexes for table `customer`
  234. --
  235. ALTER TABLE `customer`
  236. ADD PRIMARY KEY (`id_customer`);
  237.  
  238. --
  239. -- Indexes for table `quotation`
  240. --
  241. ALTER TABLE `quotation`
  242. ADD PRIMARY KEY (`id_quotation`),
  243. ADD KEY `id_customer` (`id_customer`),
  244. ADD KEY `id_status` (`keterangan`);
  245.  
  246. --
  247. -- Indexes for table `quotation_hm_bahan`
  248. --
  249. ALTER TABLE `quotation_hm_bahan`
  250. ADD KEY `id_produksi` (`id_produksi`),
  251. ADD KEY `id_ruangan` (`id_ruangan`),
  252. ADD KEY `id_barang` (`id_barang`),
  253. ADD KEY `id_bahan` (`id_bahan`);
  254.  
  255. --
  256. -- Indexes for table `ruangan`
  257. --
  258. ALTER TABLE `ruangan`
  259. ADD PRIMARY KEY (`id_ruangan`),
  260. ADD KEY `id_quotation` (`id_quotation`);
  261.  
  262. --
  263. -- Indexes for table `ruangan_hm_barang`
  264. --
  265. ALTER TABLE `ruangan_hm_barang`
  266. ADD KEY `id_barang` (`id_barang`),
  267. ADD KEY `id_ruangan` (`id_ruangan`);
  268.  
  269. --
  270. -- AUTO_INCREMENT for dumped tables
  271. --
  272.  
  273. --
  274. -- AUTO_INCREMENT for table `barang`
  275. --
  276. ALTER TABLE `barang`
  277. MODIFY `id_barang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  278. --
  279. -- AUTO_INCREMENT for table `customer`
  280. --
  281. ALTER TABLE `customer`
  282. MODIFY `id_customer` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
  283. --
  284. -- AUTO_INCREMENT for table `quotation`
  285. --
  286. ALTER TABLE `quotation`
  287. MODIFY `id_quotation` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  288. --
  289. -- AUTO_INCREMENT for table `ruangan`
  290. --
  291. ALTER TABLE `ruangan`
  292. MODIFY `id_ruangan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  293. --
  294. -- Constraints for dumped tables
  295. --
  296.  
  297. --
  298. -- Constraints for table `quotation`
  299. --
  300. ALTER TABLE `quotation`
  301. ADD CONSTRAINT `quotation_bt_customer` FOREIGN KEY (`id_customer`) REFERENCES `customer` (`id_customer`) ON DELETE CASCADE ON UPDATE CASCADE;
  302.  
  303. --
  304. -- Constraints for table `quotation_hm_bahan`
  305. --
  306. ALTER TABLE `quotation_hm_bahan`
  307. ADD CONSTRAINT `quotation_hm_bahan_ibfk_1` FOREIGN KEY (`id_ruangan`) REFERENCES `ruangan` (`id_ruangan`) ON UPDATE CASCADE,
  308. ADD CONSTRAINT `quotation_hm_bahan_ibfk_2` FOREIGN KEY (`id_barang`) REFERENCES `barang` (`id_barang`) ON UPDATE CASCADE,
  309. ADD CONSTRAINT `quotation_hm_bahan_ibfk_3` FOREIGN KEY (`id_bahan`) REFERENCES `bahan` (`id_bahan`) ON UPDATE CASCADE;
  310.  
  311. --
  312. -- Constraints for table `ruangan`
  313. --
  314. ALTER TABLE `ruangan`
  315. ADD CONSTRAINT `ruangan_bt_quotation` FOREIGN KEY (`id_quotation`) REFERENCES `quotation` (`id_quotation`) ON DELETE CASCADE ON UPDATE CASCADE;
  316.  
  317. --
  318. -- Constraints for table `ruangan_hm_barang`
  319. --
  320. ALTER TABLE `ruangan_hm_barang`
  321. ADD CONSTRAINT `ruangan_hm_barang_ibfk_1` FOREIGN KEY (`id_ruangan`) REFERENCES `ruangan` (`id_ruangan`) ON DELETE CASCADE ON UPDATE CASCADE,
  322. ADD CONSTRAINT `ruangan_hm_barang_ibfk_2` FOREIGN KEY (`id_barang`) REFERENCES `barang` (`id_barang`) ON DELETE CASCADE ON UPDATE CASCADE;
  323.  
  324. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  325. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  326. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement