-- http://www.phpmyadmin.net
--




--
-- Database: `codeego_pos`
--

-- --------------------------------------------------------

--
-- Table structure for table `activity_delete`
--

CREATE TABLE IF NOT EXISTS `activity_delete` (
`id` int(11) NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  `oleh` int(11) NOT NULL,
  `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;

--
-- Dumping data for table `activity_delete`
--

INSERT INTO `activity_delete` (`id`, `url`, `oleh`, `datetime`) VALUES
(1, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=6', 2, '2021-02-26 12:52:53'),
(2, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=5', 2, '2021-02-26 13:12:03'),
(3, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=1', 2, '2021-02-26 13:12:48'),
(4, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=14', 2, '2021-02-26 13:37:39'),
(5, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=16', 2, '2021-02-27 04:07:47'),
(6, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=17', 2, '2021-02-27 04:08:16'),
(7, 'http://localhost/pos/dashboard/kasir.php?page=scan/delete&id=1', 7, '2021-02-27 07:27:43'),
(8, 'http://localhost/pos/dashboard/welcome.php?page=tabulasi/delete&faktur=10419&sandi=10419', 2, '2021-02-27 13:46:11'),
(9, 'http://localhost/pos/dashboard/kasir.php?page=scan/delete&id=3', 7, '2021-02-27 13:50:46'),
(10, 'http://localhost/pos/dashboard/kasir.php?page=tabulasi/delete&faktur=11136&sandi=11136', 7, '2021-02-27 13:50:56'),
(11, 'http://pos.codeego.com/dashboard/welcome.php?page=scan/delete&id=12', 2, '2021-05-29 07:08:19'),
(12, 'http://pos.codeego.com/dashboard/welcome.php?page=scan/delete&id=14', 2, '2021-05-29 07:29:44'),
(13, 'http://pos.codeego.com/dashboard/welcome.php?page=scan/delete&id=15', 2, '2021-05-29 11:02:18'),
(14, 'http://pos.codeego.com/dashboard/welcome.php?page=barcode/delete&id_barcode=2', 2, '2021-05-30 10:39:17'),
(15, 'http://pos.codeego.com/dashboard/welcome.php?page=barcode/delete&id_barcode=1', 2, '2021-05-30 10:39:20'),
(16, 'http://localhost/pos/dashboard/welcome.php?page=delete/hapus&id_photo=4&img=2602cd8df6f1e4.png', 2, '2021-08-04 07:16:33'),
(17, 'http://localhost/pos/dashboard/kasir.php?page=scan/delete&id=1', 6, '2021-08-04 13:26:49'),
(18, 'http://localhost/pos/dashboard/welcome.php?page=kassa/delete&id_kassa=5', 2, '2021-08-04 13:34:46'),
(19, 'http://localhost/pos/dashboard/welcome.php?page=kassa/delete&id_kassa=8', 2, '2021-08-04 13:34:51'),
(20, 'http://localhost/pos/dashboard/welcome.php?page=scan/delete&id=2', 2, '2021-08-04 13:45:11'),
(21, 'http://localhost/pos/dashboard/welcome.php?page=barcode/delete&id_barcode=1', 2, '2021-08-04 14:25:41'),
(22, 'http://localhost/pos/dashboard/welcome.php?page=tabulasi/delete&faktur=84699&sandi=84699', 2, '2021-08-06 10:44:34'),
(23, 'http://localhost/pos/dashboard/welcome.php?page=tabulasi/delete&faktur=83599&sandi=83599', 2, '2021-08-06 10:44:37'),
(24, 'http://localhost/pos/dashboard/welcome.php?page=kassa/delete&id_kassa=7', 2, '2021-08-06 12:58:36'),
(25, 'http://localhost/pos/dashboard/kasir.php?page=tabulasi/delete&faktur=55817&sandi=55817', 6, '2021-08-06 13:17:01'),
(26, 'http://localhost/pos/dashboard/welcome.php?page=delete/hapus&id_photo=5&img=26031b740bdbe9.jpg', 2, '2021-08-07 12:19:34'),
(27, 'http://localhost/pos/dashboard/welcome.php?page=produk/delete&id_produk=4', 2, '2021-08-07 13:55:24'),
(28, 'http://localhost/pos/dashboard/welcome.php?page=produk/delete&id_produk=3', 2, '2021-08-07 13:55:29'),
(29, 'http://localhost/pos/dashboard/welcome.php?page=produk/delete&id_produk=1', 2, '2021-08-07 13:55:48'),
(30, 'http://localhost/pos/dashboard/welcome.php?page=kategori/delete&id_kategori=1', 2, '2021-08-07 13:57:14');

-- --------------------------------------------------------

--
-- Table structure for table `activity_update`
--

CREATE TABLE IF NOT EXISTS `activity_update` (
`id` int(11) NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  `oleh` int(11) NOT NULL,
  `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;

--
-- Dumping data for table `activity_update`
--

INSERT INTO `activity_update` (`id`, `url`, `oleh`, `datetime`) VALUES
(1, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=421', 2, '2021-02-26 08:52:37'),
(2, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=459', 2, '2021-02-26 08:53:06'),
(3, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=457', 2, '2021-02-26 08:53:12'),
(4, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=456', 2, '2021-02-26 08:53:19'),
(5, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=455', 2, '2021-02-26 08:53:31'),
(6, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=453', 2, '2021-02-26 08:53:57'),
(7, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=452', 2, '2021-02-26 08:54:04'),
(8, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=451', 2, '2021-02-26 08:54:11'),
(9, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=459', 2, '2021-02-27 02:14:52'),
(10, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=459', 2, '2021-02-27 02:15:42'),
(11, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=460', 2, '2021-02-27 02:50:38'),
(12, 'http://localhost/pos/dashboard/welcome.php?page=produk/update&id_produk=2', 2, '2021-02-27 06:26:15'),
(13, 'http://localhost/pos/dashboard/welcome.php?page=kassa/update&id_kassa=7', 2, '2021-02-27 07:17:12'),
(14, 'http://localhost/pos/dashboard/welcome.php?page=kassa/update&id_kassa=6', 2, '2021-05-05 04:12:48'),
(15, 'http://localhost/pos/dashboard/kasir.php?page=produk/update&id_produk=461', 6, '2021-05-05 04:23:58'),
(16, 'http://localhost/pos/dashboard/welcome.php?page=manage/min', 2, '2021-05-05 04:26:26'),
(17, 'https://pos.codeego.com/dashboard/welcome.php?page=produk/update&id_produk=464', 2, '2021-05-29 01:18:41'),
(18, 'https://pos.codeego.com/dashboard/welcome.php?page=produk/update&id_produk=462', 2, '2021-05-29 01:24:27'),
(19, 'https://pos.codeego.com/dashboard/welcome.php?page=produk/update&id_produk=463', 2, '2021-05-29 01:37:01'),
(20, 'https://pos.codeego.com/dashboard/welcome.php?page=produk/update&id_produk=464', 2, '2021-05-29 04:57:39'),
(21, 'http://localhost/pos/dashboard/welcome.php?page=admin/update&id_admin=2', 2, '2021-08-04 10:47:28'),
(22, 'http://localhost/pos/dashboard/welcome.php?page=kassa/update&id_kassa=6', 2, '2021-08-06 12:51:52'),
(23, 'http://localhost/pos/dashboard/welcome.php?page=update/profile', 2, '2021-08-07 13:02:00');

-- --------------------------------------------------------

--
-- Table structure for table `barcode`
--

CREATE TABLE IF NOT EXISTS `barcode` (
`id_barcode` int(11) NOT NULL,
  `barcode` varchar(15) NOT NULL,
  `qtybarcode` int(11) NOT NULL,
  `added` int(11) NOT NULL,
  `addby` int(11) NOT NULL,
  `tercatat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `faktur`
--

CREATE TABLE IF NOT EXISTS `faktur` (
`idfaktur` int(11) NOT NULL,
  `tglfaktur` date NOT NULL,
  `kodefaktur` varchar(11) NOT NULL,
  `addedfaktur` int(11) NOT NULL,
  `addbyfaktur` int(11) NOT NULL,
  `periode` varchar(5) NOT NULL,
  `datetimefaktur` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `kembalian` double DEFAULT NULL,
  `potongan` double DEFAULT NULL,
  `totalbayar` double DEFAULT NULL,
  `statusfaktur` enum('Y','N') NOT NULL DEFAULT 'N',
  `qtyprint` int(11) NOT NULL,
  `printby` int(11) NOT NULL,
  `adminfaktur` varchar(30) DEFAULT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

-- --------------------------------------------------------

--
-- Table structure for table `harga`
--

CREATE TABLE IF NOT EXISTS `harga` (
`idharga` int(11) NOT NULL,
  `kodeproduk` varchar(15) NOT NULL,
  `hargajual` double NOT NULL,
  `hargabaru` double NOT NULL,
  `hargadasar` double NOT NULL,
  `namaprodukOld` varchar(100) NOT NULL,
  `namaprodukBaru` varchar(100) NOT NULL,
  `added` int(11) NOT NULL,
  `addby` int(11) NOT NULL,
  `tercatat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `kategori`
--

CREATE TABLE IF NOT EXISTS `kategori` (
`idkategori` int(11) NOT NULL,
  `namakategori` varchar(30) NOT NULL,
  `ketkategori` varchar(100) DEFAULT NULL,
  `addedkategori` int(11) NOT NULL DEFAULT '123',
  `updatedkategori` int(11) NOT NULL,
  `addbykategori` int(11) NOT NULL DEFAULT '1'
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `periode`
--

CREATE TABLE IF NOT EXISTS `periode` (
`idperiode` int(11) NOT NULL,
  `kodeperiode` varchar(5) NOT NULL,
  `ketperiode` varchar(30) NOT NULL,
  `sttperiode` enum('Y','N') NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `periode`
--

INSERT INTO `periode` (`idperiode`, `kodeperiode`, `ketperiode`, `sttperiode`) VALUES
(1, '2021', 'Periode 2021', 'Y');

-- --------------------------------------------------------

--
-- Table structure for table `produk`
--

CREATE TABLE IF NOT EXISTS `produk` (
`idproduk` int(11) NOT NULL,
  `namaproduk` varchar(100) NOT NULL,
  `kategori` int(11) NOT NULL,
  `deskproduk` varchar(200) DEFAULT NULL,
  `hargadasar` double NOT NULL,
  `hargajual` double NOT NULL,
  `kodeproduk` varchar(15) NOT NULL,
  `satuan` varchar(15) NOT NULL COMMENT 'di distinct',
  `stok` int(11) NOT NULL,
  `minProduk` int(11) DEFAULT NULL COMMENT 'Alert Minimal',
  `statusproduk` enum('Y','N') NOT NULL DEFAULT 'Y',
  `addedproduk` int(11) NOT NULL DEFAULT '123',
  `updatedproduk` int(11) NOT NULL,
  `addbyproduk` int(11) NOT NULL,
  `alertproduk` varchar(255) DEFAULT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

-- --------------------------------------------------------

--
-- Table structure for table `returnproduk`
--

CREATE TABLE IF NOT EXISTS `returnproduk` (
`id_return` int(11) NOT NULL,
  `asalfaktur` varchar(11) NOT NULL,
  `produkreturn` varchar(15) NOT NULL,
  `qtyreturn` int(11) NOT NULL,
  `ketreturn` varchar(255) NOT NULL,
  `addedreturn` int(11) NOT NULL,
  `addbyreturn` int(11) NOT NULL,
  `tercatatreturn` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `namareturn` varchar(50) DEFAULT NULL,
  `hargadasar` double DEFAULT NULL,
  `hargajual` double DEFAULT NULL,
  `periode` varchar(5) NOT NULL,
  `tglreturn` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `stok`
--

CREATE TABLE IF NOT EXISTS `stok` (
`id_stok` int(11) NOT NULL,
  `status` enum('T','K') NOT NULL,
  `qty` int(11) NOT NULL,
  `produkID` int(11) NOT NULL,
  `oldStok` int(11) NOT NULL,
  `barcode` varchar(15) NOT NULL,
  `namaproduk` varchar(100) DEFAULT NULL,
  `ket` varchar(255) DEFAULT NULL,
  `tastok` varchar(5) NOT NULL DEFAULT '2021',
  `added` int(11) NOT NULL,
  `addby` int(11) NOT NULL,
  `tercatat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COMMENT='Mencatat Perubahan Stok Barang' AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `tb_config`
--

CREATE TABLE IF NOT EXISTS `tb_config` (
`id_config` int(11) NOT NULL,
  `title` varchar(50) DEFAULT NULL,
  `deskripsi` varchar(255) DEFAULT NULL,
  `header` varchar(50) DEFAULT NULL,
  `footer` varchar(100) DEFAULT NULL,
  `text1` varchar(255) DEFAULT NULL,
  `text2` text,
  `text3` enum('Y','N') NOT NULL DEFAULT 'Y'
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `tb_config`
--

INSERT INTO `tb_config` (`id_config`, `title`, `deskripsi`, `header`, `footer`, `text1`, `text2`, `text3`) VALUES
(1, 'TOKO NINDY', 'Jl. Rajawali, Sidorejo, Kec. Arut Sel., Kabupaten Kotawaringin Barat, Kalimantan Tengah 74112', 'TOKO NINDY', 'Jl. Rajawali, Sidorejo, Kec. Arut Sel., Kabupaten Kotawaringin Barat, Kalimantan Tengah 74112', NULL, NULL, 'Y');

-- --------------------------------------------------------

--
-- Table structure for table `tb_menu`
--

CREATE TABLE IF NOT EXISTS `tb_menu` (
`id_menu` int(11) NOT NULL,
  `nourut_menu` int(11) DEFAULT NULL,
  `link_menu` varchar(50) DEFAULT NULL,
  `icon_menu` varchar(30) DEFAULT NULL,
  `text_menu` varchar(30) DEFAULT NULL,
  `color_menu` varchar(15) DEFAULT NULL,
  `label_menu` varchar(30) DEFAULT NULL,
  `level_menu` int(11) NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;



-- --------------------------------------------------------

--
-- Table structure for table `tb_photo`
--

CREATE TABLE IF NOT EXISTS `tb_photo` (
`id_photo` int(11) NOT NULL,
  `pemilik_photo` int(11) NOT NULL,
  `images_photo` varchar(60) NOT NULL,
  `waktuawal_photo` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `tanggal_photo` date NOT NULL,
  `ct_photo` datetime NOT NULL,
  `ut_photo` datetime NOT NULL,
  `rt_photo` datetime NOT NULL,
  `cb_photo` int(11) NOT NULL,
  `ub_photo` int(11) NOT NULL,
  `rb_photo` int(11) NOT NULL,
  `active_photo` enum('Y','N') NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `tb_photo`
--

INSERT INTO `tb_photo` (`id_photo`, `pemilik_photo`, `images_photo`, `waktuawal_photo`, `tanggal_photo`, `ct_photo`, `ut_photo`, `rt_photo`, `cb_photo`, `ub_photo`, `rb_photo`, `active_photo`) VALUES
(1, 14, '145f7193cd38f7f.png', '2020-09-27 17:42:05', '2020-09-28', '2020-09-28 14:42:05', '2020-09-28 14:42:05', '2020-09-28 14:42:05', 14, 0, 0, 'Y'),
(6, 2, '2610e7a4d6f7bb.png', '2021-08-07 12:19:25', '2021-08-07', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 2, 0, 0, 'Y');

-- --------------------------------------------------------

--
-- Table structure for table `tb_ta`
--

CREATE TABLE IF NOT EXISTS `tb_ta` (
`id_ta` int(11) NOT NULL,
  `kode_ta` varchar(5) NOT NULL,
  `nama_ta` varchar(25) NOT NULL,
  `ket_ta` varchar(255) NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `tb_ta`
--

INSERT INTO `tb_ta` (`id_ta`, `kode_ta`, `nama_ta`, `ket_ta`) VALUES
(1, '2021', '2021', 'TAHUN PERIODE 2021');

-- --------------------------------------------------------

--
-- Table structure for table `transaksidetail`
--

CREATE TABLE IF NOT EXISTS `transaksidetail` (
`id` int(11) NOT NULL,
  `faktur` varchar(30) NOT NULL,
  `tanggal` date NOT NULL,
  `kode` varchar(15) NOT NULL,
  `nama` varchar(100) DEFAULT NULL COMMENT 'Mencatat Nama Produk sebelumnya',
  `harga` double NOT NULL,
  `hargadasar` double NOT NULL,
  `diskon` double unsigned NOT NULL,
  `qty` int(11) NOT NULL,
  `added` int(11) NOT NULL,
  `addby` int(11) NOT NULL,
  `stt` enum('Y','N') NOT NULL,
  `periode` varchar(5) NOT NULL,
  `admintd` varchar(30) DEFAULT NULL COMMENT 'Mencatat Nama Admin'
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;

-- --------------------------------------------------------

--
-- Table structure for table `transaksitemp`
--

CREATE TABLE IF NOT EXISTS `transaksitemp` (
`id` int(11) NOT NULL,
  `faktur` varchar(30) NOT NULL,
  `tanggal` date NOT NULL,
  `kode` varchar(15) NOT NULL,
  `nama` varchar(100) DEFAULT NULL COMMENT 'Mencatat Nama Produk sebelumnya',
  `harga` double NOT NULL,
  `hargadasar` double NOT NULL,
  `diskon` double unsigned NOT NULL,
  `qty` int(11) NOT NULL,
  `added` int(11) NOT NULL,
  `addby` int(11) NOT NULL,
  `admintt` varchar(30) DEFAULT NULL,
  `stt` enum('Y','N') NOT NULL,
  `periode` varchar(5) NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- Stand-in structure for view `vw_login`
--
CREATE TABLE IF NOT EXISTS `vw_login` (
`ID` int(11)
,`Login` varchar(10)
,`Password` varchar(50)
,`Level` int(11)
,`Nama` varchar(60)
,`Key` varchar(50)
);
-- --------------------------------------------------------

--
-- Structure for view `vw_login`
--

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_delete`
--
ALTER TABLE `activity_delete`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `activity_update`
--
ALTER TABLE `activity_update`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `barcode`
--
ALTER TABLE `barcode`
 ADD PRIMARY KEY (`id_barcode`), ADD UNIQUE KEY `barcode` (`barcode`);

--
-- Indexes for table `faktur`
--
ALTER TABLE `faktur`
 ADD PRIMARY KEY (`idfaktur`), ADD UNIQUE KEY `kodefaktur` (`kodefaktur`);

--
-- Indexes for table `harga`
--
ALTER TABLE `harga`
 ADD PRIMARY KEY (`idharga`), ADD KEY `kodeproduk` (`kodeproduk`);

--
-- Indexes for table `kategori`
--
ALTER TABLE `kategori`
 ADD PRIMARY KEY (`idkategori`), ADD UNIQUE KEY `namakategori` (`namakategori`);

--
-- Indexes for table `periode`
--
ALTER TABLE `periode`
 ADD PRIMARY KEY (`idperiode`), ADD UNIQUE KEY `kodeperiode` (`kodeperiode`);

--
-- Indexes for table `produk`
--
ALTER TABLE `produk`
 ADD PRIMARY KEY (`idproduk`), ADD UNIQUE KEY `kodeproduk` (`kodeproduk`), ADD KEY `kategori` (`kategori`);

--
-- Indexes for table `returnproduk`
--
ALTER TABLE `returnproduk`
 ADD PRIMARY KEY (`id_return`), ADD KEY `asalfaktur` (`asalfaktur`), ADD KEY `produkreturn` (`produkreturn`);

--
-- Indexes for table `stok`
--
ALTER TABLE `stok`
 ADD PRIMARY KEY (`id_stok`), ADD KEY `produkID` (`produkID`), ADD KEY `barcode` (`barcode`);

--
-- Indexes for table `tb_config`
--
ALTER TABLE `tb_config`
 ADD PRIMARY KEY (`id_config`);

--
-- Indexes for table `tb_menu`
--
ALTER TABLE `tb_menu`
 ADD PRIMARY KEY (`id_menu`);

--
-- Indexes for table `tb_photo`
--
ALTER TABLE `tb_photo`
 ADD PRIMARY KEY (`id_photo`);

--
-- Indexes for table `tb_ta`
--
ALTER TABLE `tb_ta`
 ADD PRIMARY KEY (`id_ta`);

--
-- Indexes for table `transaksidetail`
--
ALTER TABLE `transaksidetail`
 ADD PRIMARY KEY (`id`), ADD KEY `kode` (`kode`), ADD KEY `faktur` (`faktur`), ADD KEY `addby` (`addby`);

--
-- Indexes for table `transaksitemp`
--
ALTER TABLE `transaksitemp`
 ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `activity_delete`
--
ALTER TABLE `activity_delete`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `activity_update`
--
ALTER TABLE `activity_update`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `barcode`
--
ALTER TABLE `barcode`
MODIFY `id_barcode` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `faktur`
--
ALTER TABLE `faktur`
MODIFY `idfaktur` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `harga`
--
ALTER TABLE `harga`
MODIFY `idharga` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `kategori`
--
ALTER TABLE `kategori`
MODIFY `idkategori` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `periode`
--
ALTER TABLE `periode`
MODIFY `idperiode` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `produk`
--
ALTER TABLE `produk`
MODIFY `idproduk` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `returnproduk`
--
ALTER TABLE `returnproduk`
MODIFY `id_return` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stok`
--
ALTER TABLE `stok`
MODIFY `id_stok` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `tb_config`
--
ALTER TABLE `tb_config`
MODIFY `id_config` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `tb_menu`
--
ALTER TABLE `tb_menu`
MODIFY `id_menu` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tb_photo`
--
ALTER TABLE `tb_photo`
MODIFY `id_photo` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tb_ta`
--
ALTER TABLE `tb_ta`
MODIFY `id_ta` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `transaksidetail`
--
ALTER TABLE `transaksidetail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `transaksitemp`
--
ALTER TABLE `transaksitemp`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `harga`
--
ALTER TABLE `harga`
ADD CONSTRAINT `harga_ibfk_1` FOREIGN KEY (`kodeproduk`) REFERENCES `produk` (`kodeproduk`) ON UPDATE CASCADE;

--
-- Constraints for table `produk`
--
ALTER TABLE `produk`
ADD CONSTRAINT `produk_ibfk_1` FOREIGN KEY (`kategori`) REFERENCES `kategori` (`idkategori`) ON UPDATE CASCADE;

--
-- Constraints for table `returnproduk`
--
ALTER TABLE `returnproduk`
ADD CONSTRAINT `returnproduk_ibfk_3` FOREIGN KEY (`asalfaktur`) REFERENCES `faktur` (`kodefaktur`) ON UPDATE CASCADE,
ADD CONSTRAINT `returnproduk_ibfk_4` FOREIGN KEY (`produkreturn`) REFERENCES `produk` (`kodeproduk`) ON UPDATE CASCADE;

--
-- Constraints for table `stok`
--
ALTER TABLE `stok`
ADD CONSTRAINT `stok_ibfk_1` FOREIGN KEY (`barcode`) REFERENCES `produk` (`kodeproduk`) ON UPDATE CASCADE;

--
-- Constraints for table `transaksidetail`
--
ALTER TABLE `transaksidetail`
ADD CONSTRAINT `transaksidetail_ibfk_2` FOREIGN KEY (`faktur`) REFERENCES `faktur` (`kodefaktur`) ON UPDATE CASCADE;

