CREATE TABLE `tujuan_kunjungan` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Code` varchar(100) NOT NULL,
  `TujuanKunjungan` varchar(255) NOT NULL,
  `Member` tinyint(1) DEFAULT NULL,
  `NonMember` tinyint(1) DEFAULT NULL,
  `Rombongan` tinyint(1) DEFAULT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `Code` (`Code`),
  KEY `tujuan_kunjungan_createby` (`CreateBy`),
  KEY `tujuan_kunjungan_updateby` (`UpdateBy`),
  CONSTRAINT `tujuan_kunjungan_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tujuan_kunjungan_updateby` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

/*Data for the table `tujuan_kunjungan` */

insert  into `tujuan_kunjungan`(`ID`,`Code`,`TujuanKunjungan`,`Member`,`NonMember`,`Rombongan`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`) values (1,'MEMBACA','Kunjungan Biasa/Membaca',1,1,1,NULL,'2015-08-27 10:55:44','::1',NULL,'2015-08-27 10:55:44','::1'),(2,'PENELITIAN','Penelitian',1,1,1,NULL,'2015-08-27 10:56:12','::1',NULL,'2015-08-27 10:56:12','::1'),(3,'STUDYTOUR','Study Tour',1,1,1,NULL,'2015-08-27 10:56:42','::1',NULL,'2015-08-27 10:56:42','::1'),(4,'REFRESHING','Refreshing',1,1,1,NULL,'2015-08-27 10:57:03','::1',NULL,'2015-08-27 10:57:03','::1'),(5,'TUGASKULIAH','Tugas Kuliah',1,1,1,NULL,'2015-08-27 10:57:35','::1',NULL,'2015-08-27 10:57:35','::1'),(6,'LITERATUR','Pencarian Literatur',1,1,1,NULL,'2015-08-27 10:58:00','::1',NULL,'2015-08-27 10:58:00','::1');

/*Table structure for table `user` */

CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `status` smallint(6) NOT NULL DEFAULT '10',
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `password_reset_token` (`password_reset_token`),
  KEY `user_createby` (`CreateBy`),
  KEY `user` (`UpdateBy`),
  CONSTRAINT `user` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `user_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `user` */

/*Table structure for table `userloclibforcol` */

CREATE TABLE `userloclibforcol` (
  `User_id` int(11) NOT NULL,
  `LocLib_id` int(11) NOT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  KEY `User_id` (`User_id`),
  KEY `LocLib_id` (`LocLib_id`),
  KEY `userloclibforcol_createby` (`CreateBy`),
  KEY `userloclibforcol_updateby` (`UpdateBy`),
  CONSTRAINT `FK_userloclibforcol_loclib` FOREIGN KEY (`LocLib_id`) REFERENCES `location_library` (`ID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `FK_userloclibforcol_user` FOREIGN KEY (`User_id`) REFERENCES `users` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `userloclibforcol_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `userloclibforcol_updateby` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `userloclibforcol` */

insert  into `userloclibforcol`(`User_id`,`LocLib_id`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`) values (33,1,NULL,NULL,NULL,NULL,NULL,NULL),(33,5,NULL,NULL,NULL,NULL,NULL,NULL);

/*Table structure for table `userloclibforloan` */

CREATE TABLE `userloclibforloan` (
  `User_id` int(11) NOT NULL,
  `LocLib_id` int(11) NOT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  KEY `User_id` (`User_id`),
  KEY `LocLib_id` (`LocLib_id`),
  KEY `userloclibforloan_createby` (`CreateBy`),
  KEY `userloclibforloan` (`UpdateBy`),
  CONSTRAINT `FK_userloclibforloan_loclib` FOREIGN KEY (`LocLib_id`) REFERENCES `location_library` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_userloclibforloan_user` FOREIGN KEY (`User_id`) REFERENCES `users` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `userloclibforloan` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `userloclibforloan_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `userloclibforloan` */

insert  into `userloclibforloan`(`User_id`,`LocLib_id`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`) values (33,1,NULL,NULL,NULL,NULL,NULL,NULL),(33,5,NULL,NULL,NULL,NULL,NULL,NULL);

/*Table structure for table `userlogs` */

CREATE TABLE `userlogs` (
  `User_id` int(11) NOT NULL,
  `Name` varchar(255) NOT NULL,
  `Description` varchar(255) DEFAULT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  KEY `User_id` (`User_id`),
  KEY `userlogs_createby` (`CreateBy`),
  KEY `userlogs` (`UpdateBy`),
  CONSTRAINT `FKF49AED76753825B6` FOREIGN KEY (`User_id`) REFERENCES `users` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `userlogs` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `userlogs_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `userlogs` */

/*Table structure for table `users` */

CREATE TABLE `users` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `auth_key` varchar(32) DEFAULT NULL,
  `password_hash` varchar(255) DEFAULT NULL,
  `password_reset_token` varchar(255) DEFAULT NULL,
  `status` smallint(10) DEFAULT NULL,
  `PhotoUrl` varchar(255) DEFAULT NULL,
  `Fullname` varchar(255) NOT NULL,
  `EmailAddress` varchar(255) DEFAULT NULL,
  `IsActive` bit(1) DEFAULT b'1',
  `SesID` varchar(255) DEFAULT NULL,
  `MaxDateSesID` datetime DEFAULT NULL,
  `ActivationCode` varchar(255) DEFAULT NULL,
  `LoginAttemp` int(11) DEFAULT NULL,
  `LastSubmtLogin` datetime DEFAULT NULL,
  `LastSuccess` datetime DEFAULT NULL,
  `Department_id` int(11) DEFAULT NULL,
  `Branch_id` int(11) DEFAULT NULL,
  `Role_id` int(11) NOT NULL,
  `IsCanResetUserPassword` bit(1) DEFAULT b'0',
  `IsCanResetMemberPassword` bit(1) DEFAULT b'0',
  `IsAdvanceEntryCatalog` bit(1) DEFAULT b'0',
  `IsAdvanceEntryCollection` bit(1) DEFAULT b'0',
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  `KIILastUploadDate` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `Department_id` (`Department_id`),
  KEY `Branch_id` (`Branch_id`),
  KEY `Role_id` (`Role_id`),
  KEY `Users_Password` (`password`),
  KEY `users_createby` (`CreateBy`),
  KEY `users_updateby` (`UpdateBy`),
  KEY `users_kii` (`KIILastUploadDate`),
  KEY `Users_UserName` (`username`),
  KEY `users_createdate` (`CreateDate`),
  KEY `users_updatedate` (`UpdateDate`),
  KEY `users_IsActive` (`IsActive`),
  CONSTRAINT `FK617D3C3A6ADC8006` FOREIGN KEY (`Branch_id`) REFERENCES `branchs` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK617D3C3AA5775E88` FOREIGN KEY (`Department_id`) REFERENCES `departments` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK617D3C3AD86F6C52` FOREIGN KEY (`Role_id`) REFERENCES `roles` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `users_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=latin1;

/*Data for the table `users` */

insert  into `users`(`ID`,`username`,`password`,`auth_key`,`password_hash`,`password_reset_token`,`status`,`PhotoUrl`,`Fullname`,`EmailAddress`,`IsActive`,`SesID`,`MaxDateSesID`,`ActivationCode`,`LoginAttemp`,`LastSubmtLogin`,`LastSuccess`,`Department_id`,`Branch_id`,`Role_id`,`IsCanResetUserPassword`,`IsCanResetMemberPassword`,`IsAdvanceEntryCatalog`,`IsAdvanceEntryCollection`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`,`created_at`,`updated_at`,`KIILastUploadDate`) values (1,'keanggotaan-online','E8D1373B4E7163F3D72BCB51B963ECF61FC2BAAF',NULL,NULL,NULL,NULL,NULL,'Raminah SE','raminah_se@yahoo.com','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,6,'','','\0','\0',NULL,'2015-01-26 00:00:00','36.78.223.122',NULL,'2015-01-26 00:00:00','36.78.223.122',NULL,NULL,NULL),(33,'inlislite','ed8fb134e25fa542df61e676dac8948259b3db0b',NULL,'$2y$13$GzqTSNp7xxV9Xda/R10ntuT7quVZOHtPJ8ib1wCbFpyCrDUVgHhL6',NULL,NULL,NULL,'Inlislite','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'','','\0','\0',33,'2013-04-03 16:24:11','::1',33,'2015-08-30 13:06:17','::1',NULL,1520854169,'2015-10-27 14:11:31'),(43,'denisyahreza','3895A02E201479D6471A673387E962C529CC4777',NULL,NULL,NULL,NULL,NULL,'Deni Syahreza',NULL,'\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'\0','\0','','\0',33,'2013-04-24 02:03:08','::1',33,'2013-04-24 02:03:08','::1',NULL,NULL,'2015-10-27 14:11:31'),(46,'superadmin','afad293631ede68b1dc3eeab3b37d6f7285e4ae1','SHzEhxK1nLeQEZqLpD5YMxbuTvTnKt95','$2y$13$PtvDLG65VU6VRt6uhNoRUuYb2/dDFbDak7//BXOUD20Q3atI/oXnW',NULL,10,NULL,'Henry','henry@inlislite.perpusnas.go.id','\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'','','','\0',33,'2015-10-26 23:40:00',NULL,33,NULL,NULL,1439872940,1456806695,'2015-10-27 14:11:31');

/*Table structure for table `worksheetfielditems` */

CREATE TABLE `worksheetfielditems` (
  `WorksheetField_id` int(11) NOT NULL,
  `Name` varchar(255) NOT NULL,
  `RefferenceMode` varchar(20) NOT NULL,
  `StartPosition` int(11) DEFAULT NULL,
  `Length` int(11) DEFAULT NULL,
  `DefaultValue` varchar(255) DEFAULT NULL,
  `IdemTag` varchar(255) DEFAULT NULL,
  `IdemStartPosition` int(11) DEFAULT NULL,
  `Refference_id` int(11) DEFAULT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  KEY `Refference_id` (`Refference_id`),
  KEY `WorksheetField_id` (`WorksheetField_id`),
  KEY `WFItems_StartPosition` (`StartPosition`),
  KEY `worksheetfielditems_createby` (`CreateBy`),
  KEY `worksheetfielditems_updateby` (`UpdateBy`),
  CONSTRAINT `FKB9A428D2352BBDA2` FOREIGN KEY (`WorksheetField_id`) REFERENCES `worksheetfields` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FKB9A428D2EACE6BC0` FOREIGN KEY (`Refference_id`) REFERENCES `refferences` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `worksheetfielditems_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `worksheetfielditems_updateby` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `worksheetfielditems` */

insert  into `worksheetfielditems`(`WorksheetField_id`,`Name`,`RefferenceMode`,`StartPosition`,`Length`,`DefaultValue`,`IdemTag`,`IdemStartPosition`,`Refference_id`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`) values (4,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,12,NULL,NULL,NULL,NULL,NULL,NULL),(4,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,13,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,78,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,79,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Belum ditetapkan','None',2,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Warna','Dropdown',3,1,'#','',0,80,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Format rekaman video','Dropdown',4,1,'#','',0,81,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Suara pada medium','Dropdown',5,1,'#','',0,82,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Medium suara','Dropdown',6,1,'#','',0,83,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Dimensi','Dropdown',7,1,'#','',0,84,NULL,NULL,NULL,NULL,NULL,NULL),(134,'Konfigurasi saluran alat putar','Dropdown',8,1,'#','',0,85,NULL,NULL,NULL,NULL,NULL,NULL),(169,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,99,NULL,NULL,NULL,NULL,NULL,NULL),(169,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,100,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,102,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,103,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Belum ditetapkan','None',2,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Kecepatan','Dropdown',3,1,'#','',0,104,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Konfigurasi saluran alat putar','Dropdown',4,1,'#','',0,105,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Lebar alur / pola titinada alur','Dropdown',5,1,'#','',0,106,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Dimensi','Dropdown',6,1,'#','',0,107,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Lebar pita','Dropdown',7,1,'#','',0,108,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Konfigurasi pita','Dropdown',8,1,'#','',0,109,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Jenis cakram, silinder, atau pita','Dropdown',9,1,'#','',0,110,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Jenis bahan','Dropdown',10,1,'#','',0,111,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Jenis potongan','Dropdown',11,1,'#','',0,112,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Karakteristik khusus alat putar','Dropdown',12,1,'#','',0,113,NULL,NULL,NULL,NULL,NULL,NULL),(184,'Teknik pengambilan dan penyimpanan','Dropdown',13,1,'#','',0,114,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,122,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,123,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Belum ditetapkan','None',2,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Aspek positif / negatif','Dropdown',3,1,'#','',0,124,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Dimensi','Dropdown',4,1,'#','',0,125,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Kisaran perbandingan reduksi','Dropdown',5,1,'#','',0,126,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Perbandingan reduksi','Dropdown',6,3,'###','',0,127,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Warna','Dropdown',9,1,'#','',0,128,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Emulsi film','Dropdown',10,1,'#','',0,129,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Generasi','Dropdown',11,1,'#','',0,130,NULL,NULL,NULL,NULL,NULL,NULL),(200,'Dasar film','Dropdown',12,1,'#','',0,131,NULL,NULL,NULL,NULL,NULL,NULL),(117,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,72,NULL,NULL,NULL,NULL,NULL,NULL),(117,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,73,NULL,NULL,NULL,NULL,NULL,NULL),(117,'Belum ditetapkan','None',2,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(117,'Warna','Dropdown',3,1,'#','',0,74,NULL,NULL,NULL,NULL,NULL,NULL),(117,'Bahan dasar utama','Dropdown',4,1,'#','',0,75,NULL,NULL,NULL,NULL,NULL,NULL),(117,'Bahan dasar pendukung','Dropdown',5,1,'#','',0,76,NULL,NULL,NULL,NULL,NULL,NULL),(256,'Jenis bahan pustaka','Dropdown',0,1,'','',0,90,NULL,NULL,NULL,NULL,NULL,NULL),(256,'Keterangan bahan khusus','Dropdown',1,1,'','',0,91,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Tanggal pemasukan ke berkas','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Ilustrasi','Dropdown',18,4,'####','',0,14,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Kelompok sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Bentuk bahan','Dropdown',23,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Isi','Dropdown',24,4,'####','',0,15,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Terbitan pemerintah','Dropdown',28,1,'#','',0,6,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Terbitan konferensi','Dropdown',29,1,'#','',0,16,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Feskrif','Dropdown',30,1,'#','',0,10,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Indeks','Dropdown',31,1,'#','',0,8,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Belum ditetapkan','None',32,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Bentuk karya tulis','Dropdown',33,1,'#','',0,17,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Biografi','Dropdown',34,1,'#','',0,18,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(5,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Bentuk bahan pustaka','Dropdown',0,1,'k','',0,133,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Lama waktu tayang','Dropdown',1,3,'###','008',19,42,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Belum ditetapkan','None',4,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Kelompok sasaran','Dropdown',5,1,'#','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Belum ditetapkan','None',6,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Terbitan pemerintah','Dropdown',11,1,'#','008',28,6,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Bentuk bahan','Dropdown',12,1,'#','008',29,9,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Belum ditetapkan','None',13,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Jenis bahan pustaka visual','Dropdown',16,1,'#','008',33,140,NULL,NULL,NULL,NULL,NULL,NULL),(116,'Teknik','Dropdown',17,1,'#','008',34,141,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Tanggal pemasukan data','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Lama waktu tayang','Dropdown',18,3,'###','',0,139,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Belum ditetapkan','Dropdown',21,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Kelompok sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Belum ditetapkan','None',23,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Terbitan pemerintah','Dropdown',28,1,'#','',0,6,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Bentuk bahan','Dropdown',29,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Belum ditetapkan','None',30,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Jenis bahan pustaka visual','Dropdown',33,1,'#','',0,140,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Teknik','None',34,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(118,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Bentuk bahan pustaka','Dropdown',0,1,'g','',0,77,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Lama waktu tayang','Dropdown',1,3,'###','008',19,86,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Belum ditetapkan','None',4,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Kelompok sasaran','Dropdown',5,1,'#','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Belum ditetapkan','None',6,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Terbitan pemerintah','Dropdown',11,1,'#','008',28,6,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Bentuk bahan','Dropdown',12,1,'#','008',29,9,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Belum ditetapkan','None',13,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Jenis bahan pustaka visual','Dropdown',16,1,'#','008',33,87,NULL,NULL,NULL,NULL,NULL,NULL),(133,'Teknik','Dropdown',17,1,'#','008',34,88,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Tanggal pemasukan data','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Lama waktu tayang','Dropdown',18,3,'###','',0,86,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Belum ditetapkan','None',21,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Kelompok Sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Belum ditetapkan','None',23,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Terbitan pemerintah','Dropdown',28,1,'#','',0,6,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Bentuk bahan','Dropdown',29,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Belum ditetapkan','None',30,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Jenis bahan pustaka visual','Dropdown',33,1,'#','',0,87,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Teknik','Dropdown',34,1,'#','',0,88,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(135,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Bentuk bahan pustaka','Dropdown',0,1,'c','',0,89,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Bentuk komposisi','Dropdown',1,2,'##','008',18,115,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Format musik','Dropdown',3,2,'##','008',20,116,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Kelompok sasaran','Dropdown',5,2,'##','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Bahan sertaan','Dropdown',7,6,'######','008',24,118,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Karya tertulis untuk rekaman suara','Dropdown',13,2,'##','008',30,119,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Belum ditetapkan','None',15,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Transposisi dan aransemen','Dropdown',16,1,'#','008',33,120,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Belum ditetapkan','None',17,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Tanggal pemasukan data','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Bentuk komposisi','Dropdown',18,2,'##','',0,115,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Format musik','Dropdown',20,1,'#','',0,116,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Bagian musik','Dropdown',21,1,'#','',0,117,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Kelompok sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Bentuk bahan','Dropdown',23,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Bahan sertaan','Dropdown',24,6,'######','',0,118,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Karya tertulis untuk rekaman suara','Dropdown',30,2,'##','',0,119,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Belum ditetapkan','None',32,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Transposisi dan aransemen','Dropdown',33,1,'#','',0,120,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Belum ditetapkan','None',34,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(168,'Bentuk bahan pustaka','Dropdown',0,1,'p','',0,98,NULL,NULL,NULL,NULL,NULL,NULL),(168,'Belum ditetapkan','None',1,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(168,'Bentuk bahan','Dropdown',6,1,'#','008',23,9,NULL,NULL,NULL,NULL,NULL,NULL),(168,'Belum ditetapkan','None',7,11,'###########','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Tanggal pemasukan data','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Belum ditetapkan','None',18,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Bentuk bahan','Dropdown',23,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Belum ditetapkan','Dropdown',24,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Terbitan pemerintah','Dropdown',25,1,'#','',0,6,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Belum ditetapkan','None',26,9,'#########','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(170,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Bentuk bahan pustaka','Dropdown',0,1,'i','',0,134,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Lama waktu tayang','Dropdown',1,3,'###','008',19,142,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Belum ditetapkan','None',4,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Kelompok sasaran','Dropdown',5,1,'#','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Belum ditetapkan','None',6,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Terbitan pemerintah','Dropdown',11,1,'#','008',28,6,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Bentuk bahan','Dropdown',12,1,'#','008',29,9,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Belum ditetapkan','None',13,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Jenis bahan pustaka visual','Dropdown',16,1,'#','008',33,143,NULL,NULL,NULL,NULL,NULL,NULL),(183,'Teknik','Dropdown',17,1,'#','008',34,144,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Tanggal pemasukan data','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Bentuk komposisi','Dropdown',18,2,'##','',0,115,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Format musik','Dropdown',20,1,'#','',0,116,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Bagian musik','Dropdown',21,1,'#','',0,117,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Kelompok sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Bentuk bahan','Dropdown',23,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Bahan sertaan','Dropdown',24,6,'######','',0,118,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Karya tertulis untuk rekaman suara','Dropdown',30,2,'##','',0,119,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Belum ditetapkan','None',32,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Transposisi dan aransemen','Dropdown',33,1,'#','',0,120,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Belum ditetapkan','None',34,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Modifikasi Cantuman','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(185,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Bentuk bahan pustaka','Dropdown',0,1,'#','',0,135,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Lama waktu tayang','Dropdown',1,3,'###','008',19,145,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Belum ditetapkan','None',4,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Kelompok sasaran','Dropdown',5,1,'#','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Belum ditetapkan','None',6,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Terbitan pemerintah','Dropdown',11,1,'#','008',28,6,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Bentuk bahan','Dropdown',12,1,'#','008',29,9,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Belum ditetapkan','None',13,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Jenis bahan pustaka visual','Dropdown',16,1,'#','008',33,43,NULL,NULL,NULL,NULL,NULL,NULL),(199,'Teknik','Dropdown',17,1,'#','008',34,147,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Tanggal pemasukan data','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Lama waktu tayang','Dropdown',18,3,'###','',0,145,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Belum ditetapkan','None',21,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Kelompok sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Belum ditetapkan','None',23,5,'#####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Terbitan pemerintah','Dropdown',28,1,'#','',0,6,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Bentuk bahan','Dropdown',29,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Belum ditetapkan','None',30,3,'###','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Jenis bahan pustaka visual','Dropdown',33,1,'#','',0,146,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Teknik','Dropdown',34,1,'#','',0,147,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Bentuk bahan pustaka','Dropdown',0,1,'t','',0,11,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Ilustrasi','Dropdown',1,4,'####','008',18,14,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Kelompok pembaca','Dropdown',5,1,'#','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Bentuk bahan','Dropdown',6,4,'####','008',23,9,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Isi','Dropdown',10,1,'#','008',24,15,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Terbitan pemerintah','Dropdown',11,1,'#','008',28,6,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Terbitan konferensi','Dropdown',12,1,'#','008',29,16,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Feskrif','Dropdown',13,1,'#','008',30,10,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Indeks','Dropdown',14,1,'#','008',31,8,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Belum ditetapkan','None',15,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Bentuk sastra','Dropdown',16,1,'#','008',33,17,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Biografi','Dropdown',17,1,'#','008',34,18,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Tanggal pemasukan ke berkas','None',0,6,'######','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Jenis tahun terbit','Dropdown',6,1,'#','',0,1,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Tahun 1','None',7,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Tahun 2','None',11,4,'####','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Tempat terbit, produksi atau pelaksanaan','Dropdown',15,3,'###','',0,7,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Ilustrasi','Dropdown',18,4,'####','',0,14,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Kelompok sasaran','Dropdown',22,1,'#','',0,2,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Bentuk bahan','Dropdown',23,1,'#','',0,9,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Isi','Dropdown',24,4,'####','',0,15,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Terbitan pemerintah','Dropdown',28,1,'#','',0,6,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Terbitan konferensi','Dropdown',29,1,'#','',0,16,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Feskrif','Dropdown',30,1,'#','',0,10,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Indeks','Dropdown',31,1,'#','',0,8,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Belum ditetapkan','None',32,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Bentuk karya tulis','Dropdown',33,1,'#','',0,17,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Biografi','Dropdown',34,1,'#','',0,18,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Bahasa','Dropdown',35,3,'###','',0,5,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Cantuman sudah dimodifikasi','Dropdown',38,1,'#','',0,3,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Sumber pengkatalogan','Dropdown',39,1,'#','',0,4,NULL,NULL,NULL,NULL,NULL,NULL),(272,'Jenis bahan pustaka','Dropdown',0,1,'#','',0,12,NULL,NULL,NULL,NULL,NULL,NULL),(272,'Keterangan bahan khusus','Dropdown',1,1,'#','',0,13,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Bentuk bahan pustaka/materi','Dropdown',0,1,'a','',0,11,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Ilustrasi','None',1,4,'####','008',18,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Kelompok pembaca/sasaran','Dropdown',5,1,'#','008',22,2,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Bentuk bahan/materi','Dropdown',6,1,'#','008',23,9,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Isi','Dropdown',7,4,'####','008',24,15,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Terbitan pemerintah','Dropdown',11,1,'#','008',28,6,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Terbitan konferensi','Dropdown',12,1,'#','008',29,16,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Feskrif','Dropdown',13,1,'#','008',30,10,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Indeks','Dropdown',14,1,'#','008',31,8,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Belum ditetapkan','None',15,1,'#','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Bentuk sastra/literer','Dropdown',16,1,'#','008',33,17,NULL,NULL,NULL,NULL,NULL,NULL),(3,'Biografi','Dropdown',17,1,'#','008',34,18,NULL,NULL,NULL,NULL,NULL,NULL);

/*Table structure for table `worksheetfields` */

CREATE TABLE `worksheetfields` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Field_id` int(11) DEFAULT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  `Worksheet_id` int(11) DEFAULT NULL,
  `IsAkuisisi` bit(1) DEFAULT b'0',
  `ISDEPOSIT` bit(1) DEFAULT b'0',
  `ISDETAILKOLEKSI_PENGOLAHAN` bit(1) DEFAULT b'0',
  `ISDETAILKOLEKSI_AKUISISI` bit(1) DEFAULT b'0',
  PRIMARY KEY (`ID`),
  KEY `Field_id` (`Field_id`),
  KEY `Worksheet_id` (`Worksheet_id`),
  KEY `worksheetfields_createby` (`CreateBy`),
  KEY `worksheetfields_updateby` (`UpdateBy`),
  CONSTRAINT `FK1471BB4B66DFF9B4` FOREIGN KEY (`Field_id`) REFERENCES `fields` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK1471BB4BFEC5D3CC` FOREIGN KEY (`Worksheet_id`) REFERENCES `worksheets` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `worksheetfields_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `worksheetfields_updateby` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1212 DEFAULT CHARSET=latin1;

/*Data for the table `worksheetfields` */

insert  into `worksheetfields`(`ID`,`Field_id`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`,`Worksheet_id`,`IsAkuisisi`,`ISDEPOSIT`,`ISDETAILKOLEKSI_PENGOLAHAN`,`ISDETAILKOLEKSI_AKUISISI`) values (1,1,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(2,3,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(3,4,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(4,28,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(5,29,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(6,31,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'','\0','\0','\0'),(7,32,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(8,33,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(9,36,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(10,37,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(11,38,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(12,39,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(13,45,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'','\0','\0','\0'),(14,46,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'','\0','\0','\0'),(15,51,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'','\0','\0','\0'),(16,54,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(17,58,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(18,60,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(19,70,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(20,72,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(21,79,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(22,80,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',1,'\0','\0','\0','\0'),(48,NULL,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',NULL,'\0','\0','\0','\0'),(68,NULL,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2012-09-12 13:54:51','DeniPC',NULL,'\0','\0','\0','\0'),(114,1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(115,3,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(116,4,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(117,28,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(118,29,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(119,32,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(120,33,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(121,38,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(122,45,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'','\0','\0','\0'),(123,51,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'','\0','\0','\0'),(124,54,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(125,60,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(127,70,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(129,79,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(130,80,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',6,'\0','\0','\0','\0'),(131,1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(132,3,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(133,4,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(134,28,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(135,29,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(136,32,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(137,33,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(138,36,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(139,45,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'','\0','\0','\0'),(140,51,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'','\0','\0','\0'),(141,54,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'','\0','\0','\0'),(142,60,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(143,102,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(144,104,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(145,70,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(146,72,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(147,79,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(148,80,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',7,'\0','\0','\0','\0'),(166,1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(167,3,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(168,4,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(169,28,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(170,29,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(171,32,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(172,33,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(173,38,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(174,39,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(175,45,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'','\0','\0','\0'),(176,54,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'','\0','\0','\0'),(177,60,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(178,16,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(179,66,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(180,80,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',9,'\0','\0','\0','\0'),(181,1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(182,3,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(183,4,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(184,28,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(185,29,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(186,32,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(187,33,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(188,36,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(189,38,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(190,45,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'','\0','\0','\0'),(191,51,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'','\0','\0','\0'),(192,54,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(193,60,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(194,70,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(195,79,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(196,80,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2012-09-12 13:54:52','DeniPC',10,'\0','\0','\0','\0'),(197,1,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(198,3,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(199,4,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(200,28,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(201,29,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(202,33,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(203,38,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(204,45,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'','\0','\0','\0'),(205,51,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'','\0','\0','\0'),(206,54,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'','\0','\0','\0'),(207,60,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(208,70,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(209,71,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(210,73,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(211,79,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(212,80,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2012-09-12 13:54:53','DeniPC',11,'\0','\0','\0','\0'),(252,1,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(253,2,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(254,3,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(255,4,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(256,28,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(257,29,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(258,32,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(259,33,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(260,36,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(261,38,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(262,45,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'','\0','\0','\0'),(263,51,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'','\0','\0','\0'),(264,54,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'','\0','\0','\0'),(265,60,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(266,70,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(267,79,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(268,80,NULL,NULL,NULL,NULL,'2012-10-28 03:55:08','::1',8,'\0','\0','\0','\0'),(269,1,NULL,NULL,NULL,NULL,'2012-10-28 16:55:04','::1',12,'\0','\0','\0','\0'),(270,3,NULL,NULL,NULL,NULL,'2012-10-28 16:55:04','::1',12,'\0','\0','\0','\0'),(271,4,NULL,NULL,NULL,NULL,'2012-10-28 16:55:04','::1',12,'\0','\0','\0','\0'),(272,28,NULL,NULL,NULL,NULL,'2012-10-28 16:55:04','::1',12,'\0','\0','\0','\0'),(273,29,NULL,NULL,NULL,NULL,'2012-10-28 16:55:04','::1',12,'\0','\0','\0','\0'),(274,31,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'','\0','\0','\0'),(275,32,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(276,33,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(277,36,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(278,37,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(279,38,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(280,39,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'','\0','\0','\0'),(281,45,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'','\0','\0','\0'),(282,46,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'','\0','\0','\0'),(283,51,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'','\0','\0','\0'),(284,54,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'','\0','\0','\0'),(285,58,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(286,60,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(287,70,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(288,72,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(289,79,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(290,80,NULL,NULL,NULL,NULL,'2012-10-28 16:55:05','::1',12,'\0','\0','\0','\0'),(362,34,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(363,35,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(364,40,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(365,41,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(366,5,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(367,42,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(368,59,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(369,61,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(370,62,NULL,NULL,NULL,NULL,'2015-08-15 04:18:22','::1',1,'\0','\0','\0','\0'),(371,63,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(372,64,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(373,65,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(374,66,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(375,67,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(376,68,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(377,69,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(378,71,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(379,73,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(380,23,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(381,74,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(382,75,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(383,76,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(384,77,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(385,78,NULL,NULL,NULL,NULL,'2015-08-15 04:18:23','::1',1,'\0','\0','\0','\0'),(456,36,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(457,37,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(458,39,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(459,40,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'','\0','\0','\0'),(460,41,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(461,46,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'','\0','\0','\0'),(462,113,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(463,66,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(464,67,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(465,128,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(466,78,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(467,19,NULL,NULL,NULL,NULL,'2015-08-15 04:50:54','::1',6,'\0','\0','\0','\0'),(468,31,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'','\0','\0','\0'),(469,88,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(470,34,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(471,35,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(472,37,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(473,26,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(474,63,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(475,109,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(476,64,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(477,65,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(478,66,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(479,67,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(480,68,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(481,71,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(482,73,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(483,74,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(484,24,NULL,NULL,NULL,NULL,'2015-08-15 04:54:18','::1',7,'\0','\0','\0','\0'),(485,84,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'','\0','\0','\0'),(486,34,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(487,35,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(488,96,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(489,37,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(490,39,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(491,40,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(492,41,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(493,20,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(494,72,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(495,73,NULL,NULL,NULL,NULL,'2015-08-15 05:20:38','::1',8,'\0','\0','\0','\0'),(496,23,NULL,NULL,NULL,NULL,'2015-08-15 05:20:39','::1',8,'\0','\0','\0','\0'),(497,74,NULL,NULL,NULL,NULL,'2015-08-15 05:20:39','::1',8,'\0','\0','\0','\0'),(498,19,NULL,NULL,NULL,NULL,'2015-08-15 05:20:39','::1',8,'\0','\0','\0','\0'),(499,24,NULL,NULL,NULL,NULL,'2015-08-15 05:20:39','::1',8,'\0','\0','\0','\0'),(500,34,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(501,35,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(502,36,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(503,37,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(504,40,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'','\0','\0','\0'),(505,41,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(506,46,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'','\0','\0','\0'),(507,51,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'','\0','\0','\0'),(508,64,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(509,111,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(510,20,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(511,117,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(512,118,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(513,67,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(514,70,NULL,NULL,NULL,NULL,'2015-08-15 05:23:52','::1',9,'\0','\0','\0','\0'),(515,71,NULL,NULL,NULL,NULL,'2015-08-15 05:23:53','::1',9,'\0','\0','\0','\0'),(516,79,NULL,NULL,NULL,NULL,'2015-08-15 05:23:53','::1',9,'\0','\0','\0','\0'),(517,24,NULL,NULL,NULL,NULL,'2015-08-15 05:23:53','::1',9,'\0','\0','\0','\0'),(518,87,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(519,34,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(520,93,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(521,95,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(522,96,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(523,37,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(524,39,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(525,40,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'','\0','\0','\0'),(526,41,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(527,42,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(528,46,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'','\0','\0','\0'),(529,50,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'','\0','\0','\0'),(530,58,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(531,63,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(532,16,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(533,104,NULL,NULL,NULL,NULL,'2015-08-15 05:27:28','::1',10,'\0','\0','\0','\0'),(534,109,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(535,64,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(536,72,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(537,73,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(538,23,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(539,19,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(540,24,NULL,NULL,NULL,NULL,'2015-08-15 05:27:29','::1',10,'\0','\0','\0','\0'),(541,32,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(542,35,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(543,36,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(544,37,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(545,39,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(546,26,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(547,50,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'','\0','\0','\0'),(548,15,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(549,64,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(550,20,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(551,113,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(552,116,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(553,66,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(554,67,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(555,72,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(556,75,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(557,125,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(558,18,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(559,78,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(560,19,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(561,24,NULL,NULL,NULL,NULL,'2015-08-15 05:31:13','::1',11,'\0','\0','\0','\0'),(562,40,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'','\0','\0','\0'),(563,53,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'','\0','\0','\0'),(564,11,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(565,16,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(566,103,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(567,64,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'','\0','\0','\0'),(568,65,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(569,110,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(570,20,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(571,113,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(572,116,NULL,NULL,NULL,NULL,'2015-08-15 05:34:02','::1',12,'\0','\0','\0','\0'),(573,138,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(574,117,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(575,118,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(576,120,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(577,121,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(578,122,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(579,123,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(580,74,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(581,18,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(582,22,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(583,130,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(584,19,NULL,NULL,NULL,NULL,'2015-08-15 05:40:08','::1',12,'\0','\0','\0','\0'),(585,1,NULL,NULL,NULL,NULL,'2015-08-15 06:09:41','::1',15,'\0','\0','\0','\0'),(586,3,NULL,NULL,NULL,NULL,'2015-08-15 06:09:41','::1',15,'\0','\0','\0','\0'),(587,4,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(588,28,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(589,29,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(590,31,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(591,32,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(592,33,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(593,34,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(594,35,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(595,36,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(596,37,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(597,38,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(598,39,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(599,40,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(600,41,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(601,5,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(602,42,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(603,45,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(604,46,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(605,51,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(606,54,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'','\0','\0','\0'),(607,58,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(608,59,NULL,NULL,NULL,NULL,'2015-08-15 06:09:42','::1',15,'\0','\0','\0','\0'),(609,60,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(610,61,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(611,62,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(612,63,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(613,64,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'','\0','\0','\0'),(614,65,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(615,66,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(616,67,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(617,68,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(618,69,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(619,70,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(620,71,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(621,72,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(622,73,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(623,23,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(624,74,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(625,75,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(626,76,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(627,77,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(628,78,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(629,79,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(630,80,NULL,NULL,NULL,NULL,'2015-08-15 06:09:43','::1',15,'\0','\0','\0','\0'),(631,139,NULL,NULL,NULL,NULL,'2016-04-04 23:39:53','::1',1,'\0','\0','\0','\0'),(636,139,NULL,NULL,NULL,NULL,'2016-04-04 23:46:12','::1',6,'\0','\0','\0','\0'),(637,139,NULL,NULL,NULL,NULL,'2016-04-04 23:46:21','::1',7,'\0','\0','\0','\0'),(638,139,NULL,NULL,NULL,NULL,'2016-04-04 23:46:53','::1',8,'\0','\0','\0','\0'),(639,139,NULL,NULL,NULL,NULL,'2016-04-04 23:47:01','::1',9,'\0','\0','\0','\0'),(640,139,NULL,NULL,NULL,NULL,'2016-04-04 23:47:08','::1',10,'\0','\0','\0','\0'),(641,139,NULL,NULL,NULL,NULL,'2016-04-04 23:47:25','::1',11,'\0','\0','\0','\0'),(642,139,NULL,NULL,NULL,NULL,'2016-04-04 23:47:32','::1',12,'\0','\0','\0','\0'),(644,139,NULL,NULL,NULL,NULL,'2016-04-04 23:47:50','::1',15,'\0','\0','\0','\0'),(645,140,NULL,NULL,NULL,NULL,'2016-04-05 03:32:42','::1',1,'\0','\0','\0','\0'),(646,141,NULL,NULL,NULL,NULL,'2016-04-05 03:32:42','::1',1,'\0','\0','\0','\0'),(647,142,NULL,NULL,NULL,NULL,'2016-04-05 03:32:42','::1',1,'\0','\0','\0','\0'),(949,1,NULL,'2016-05-20 13:51:21','192.168.0.1',NULL,'2016-05-20 13:51:21','192.168.0.1',4,'\0','\0','\0','\0'),(950,3,NULL,'2016-05-20 13:51:21','192.168.0.1',NULL,'2016-05-20 13:51:21','192.168.0.1',4,'\0','\0','\0','\0'),(951,4,NULL,'2016-05-20 13:51:21','192.168.0.1',NULL,'2016-05-20 13:51:21','192.168.0.1',4,'\0','\0','\0','\0'),(952,28,NULL,'2016-05-20 13:51:21','192.168.0.1',NULL,'2016-05-20 13:51:21','192.168.0.1',4,'\0','\0','\0','\0'),(953,29,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(954,6,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(955,32,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(956,33,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(957,36,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(958,38,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(959,7,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(960,45,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(961,51,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(962,54,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(963,9,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(964,15,NULL,'2016-05-20 13:51:22','192.168.0.1',NULL,'2016-05-20 13:51:22','192.168.0.1',4,'\0','\0','\0','\0'),(965,60,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(966,70,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(967,80,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(968,34,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(969,37,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(970,5,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(971,8,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(972,26,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(973,27,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(974,46,NULL,'2016-05-20 13:51:23','192.168.0.1',NULL,'2016-05-20 13:51:23','192.168.0.1',4,'\0','\0','\0','\0'),(975,10,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(976,59,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(977,63,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(978,112,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(979,120,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(980,136,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(981,71,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(982,130,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(983,19,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(984,137,NULL,'2016-05-20 13:51:24','192.168.0.1',NULL,'2016-05-20 13:51:24','192.168.0.1',4,'\0','\0','\0','\0'),(985,139,NULL,'2016-05-20 13:51:25','192.168.0.1',NULL,'2016-05-20 13:51:25','192.168.0.1',4,'\0','\0','\0','\0'),(986,1,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(987,3,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(988,4,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(989,28,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(990,29,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(991,31,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(992,32,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(993,33,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(994,36,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(995,37,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(996,38,NULL,'2016-05-20 13:51:40','192.168.0.1',NULL,'2016-05-20 13:51:40','192.168.0.1',68,'\0','\0','\0','\0'),(997,39,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(998,45,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(999,46,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1000,51,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1001,54,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1002,58,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1003,60,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1004,70,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1005,72,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1006,79,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1007,80,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1008,34,NULL,'2016-05-20 13:51:41','192.168.0.1',NULL,'2016-05-20 13:51:41','192.168.0.1',68,'\0','\0','\0','\0'),(1009,35,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1010,40,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1011,41,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1012,5,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1013,42,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1014,59,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1015,61,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1016,62,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1017,63,NULL,'2016-05-20 13:51:42','192.168.0.1',NULL,'2016-05-20 13:51:42','192.168.0.1',68,'\0','\0','\0','\0'),(1018,64,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1019,65,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1020,66,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1021,67,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1022,68,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1023,69,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1024,71,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1025,73,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1026,23,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1027,74,NULL,'2016-05-20 13:51:43','192.168.0.1',NULL,'2016-05-20 13:51:43','192.168.0.1',68,'\0','\0','\0','\0'),(1028,75,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1029,76,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1030,77,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1031,78,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1032,139,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1033,140,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1034,141,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1035,142,NULL,'2016-05-20 13:51:44','192.168.0.1',NULL,'2016-05-20 13:51:44','192.168.0.1',68,'\0','\0','\0','\0'),(1036,1,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1037,3,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1038,4,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1039,28,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1040,29,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1041,31,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1042,32,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1043,33,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1044,36,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1045,37,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',69,'\0','\0','\0','\0'),(1046,38,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1047,39,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1048,45,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1049,46,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1050,51,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1051,54,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1052,58,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1053,60,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1054,70,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1055,72,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1056,79,NULL,'2016-05-24 15:15:49','192.168.0.1',NULL,'2016-05-24 15:15:49','192.168.0.1',69,'\0','\0','\0','\0'),(1057,80,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1058,34,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1059,35,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1060,40,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1061,41,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1062,5,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1063,42,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1064,59,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1065,61,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1066,62,NULL,'2016-05-24 15:15:50','192.168.0.1',NULL,'2016-05-24 15:15:50','192.168.0.1',69,'\0','\0','\0','\0'),(1067,63,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1068,64,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1069,65,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1070,66,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1071,67,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1072,68,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1073,69,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1074,71,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1075,73,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1076,23,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1077,74,NULL,'2016-05-24 15:15:51','192.168.0.1',NULL,'2016-05-24 15:15:51','192.168.0.1',69,'\0','\0','\0','\0'),(1078,75,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1079,76,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1080,77,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1081,78,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1082,139,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1083,140,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1084,141,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1085,142,NULL,'2016-05-24 15:15:52','192.168.0.1',NULL,'2016-05-24 15:15:52','192.168.0.1',69,'\0','\0','\0','\0'),(1086,1,NULL,'2016-05-25 09:13:49','192.168.0.1',NULL,'2016-05-25 09:13:49','192.168.0.1',2,'\0','\0','\0','\0'),(1087,3,NULL,'2016-05-25 09:13:49','192.168.0.1',NULL,'2016-05-25 09:13:49','192.168.0.1',2,'\0','\0','\0','\0'),(1088,4,NULL,'2016-05-25 09:13:49','192.168.0.1',NULL,'2016-05-25 09:13:49','192.168.0.1',2,'\0','\0','\0','\0'),(1089,28,NULL,'2016-05-25 09:13:49','192.168.0.1',NULL,'2016-05-25 09:13:49','192.168.0.1',2,'\0','\0','\0','\0'),(1090,29,NULL,'2016-05-25 09:13:49','192.168.0.1',NULL,'2016-05-25 09:13:49','192.168.0.1',2,'\0','\0','\0','\0'),(1091,32,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1092,33,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1093,36,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1094,38,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1095,45,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1096,51,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1097,54,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1098,9,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1099,15,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1100,60,NULL,'2016-05-25 09:13:50','192.168.0.1',NULL,'2016-05-25 09:13:50','192.168.0.1',2,'\0','\0','\0','\0'),(1101,21,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1102,70,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1103,73,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1104,79,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1105,80,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1106,31,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1107,6,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1108,34,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1109,35,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1110,37,NULL,'2016-05-25 09:13:51','192.168.0.1',NULL,'2016-05-25 09:13:51','192.168.0.1',2,'\0','\0','\0','\0'),(1111,39,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1112,40,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1113,41,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1114,5,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1115,7,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1116,8,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1117,26,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1118,46,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1119,16,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1120,64,NULL,'2016-05-25 09:13:52','192.168.0.1',NULL,'2016-05-25 09:13:52','192.168.0.1',2,'\0','\0','\0','\0'),(1121,20,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1122,66,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1123,67,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1124,68,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1125,69,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1126,71,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1127,72,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1128,23,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1129,17,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1130,18,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1131,22,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1132,19,NULL,'2016-05-25 09:13:53','192.168.0.1',NULL,'2016-05-25 09:13:53','192.168.0.1',2,'\0','\0','\0','\0'),(1133,24,NULL,'2016-05-25 09:13:54','192.168.0.1',NULL,'2016-05-25 09:13:54','192.168.0.1',2,'\0','\0','\0','\0'),(1134,139,NULL,'2016-05-25 09:13:54','192.168.0.1',NULL,'2016-05-25 09:13:54','192.168.0.1',2,'\0','\0','\0','\0'),(1135,140,NULL,'2016-05-25 09:13:54','192.168.0.1',NULL,'2016-05-25 09:13:54','192.168.0.1',2,'\0','\0','\0','\0'),(1136,1,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1137,3,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1138,4,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1139,28,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1140,29,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1141,32,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1142,33,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1143,36,NULL,'2016-05-25 09:14:21','192.168.0.1',NULL,'2016-05-25 09:14:21','192.168.0.1',3,'\0','\0','\0','\0'),(1144,37,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1145,45,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1146,50,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1147,51,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1148,54,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1149,60,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1150,102,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1151,103,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1152,104,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1153,64,NULL,'2016-05-25 09:14:22','192.168.0.1',NULL,'2016-05-25 09:14:22','192.168.0.1',3,'\0','\0','\0','\0'),(1154,116,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1155,66,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1156,70,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1157,72,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1158,73,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1159,128,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1160,18,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1161,79,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1162,19,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1163,24,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1164,80,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1165,139,NULL,'2016-05-25 09:14:23','192.168.0.1',NULL,'2016-05-25 09:14:23','192.168.0.1',3,'\0','\0','\0','\0'),(1166,1,NULL,'2016-05-27 14:01:58','192.168.0.1',NULL,'2016-05-27 14:01:58','192.168.0.1',5,'\0','\0','\0','\0'),(1167,3,NULL,'2016-05-27 14:01:58','192.168.0.1',NULL,'2016-05-27 14:01:58','192.168.0.1',5,'\0','\0','\0','\0'),(1168,4,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1169,28,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1170,29,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1171,32,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1172,35,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1173,36,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1174,38,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1175,45,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1176,48,NULL,'2016-05-27 14:01:59','192.168.0.1',NULL,'2016-05-27 14:01:59','192.168.0.1',5,'\0','\0','\0','\0'),(1177,51,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1178,54,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1179,58,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1180,60,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1181,71,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1182,73,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1183,79,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1184,80,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1185,31,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1186,6,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1187,33,NULL,'2016-05-27 14:02:00','192.168.0.1',NULL,'2016-05-27 14:02:00','192.168.0.1',5,'\0','\0','\0','\0'),(1188,34,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1189,97,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1190,37,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1191,39,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1192,40,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1193,7,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1194,8,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1195,42,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1196,26,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1197,46,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1198,57,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1199,59,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1200,63,NULL,'2016-05-27 14:02:01','192.168.0.1',NULL,'2016-05-27 14:02:01','192.168.0.1',5,'\0','\0','\0','\0'),(1201,20,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1202,113,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1203,66,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1204,67,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1205,70,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1206,74,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1207,128,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1208,78,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1209,19,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1210,24,NULL,'2016-05-27 14:02:02','192.168.0.1',NULL,'2016-05-27 14:02:02','192.168.0.1',5,'\0','\0','\0','\0'),(1211,139,NULL,'2016-05-27 14:02:03','192.168.0.1',NULL,'2016-05-27 14:02:03','192.168.0.1',5,'\0','\0','\0','\0');

/*Table structure for table `worksheets` */

CREATE TABLE `worksheets` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(100) NOT NULL,
  `Format_id` int(11) NOT NULL,
  `CreateBy` int(11) DEFAULT NULL,
  `CreateDate` datetime DEFAULT NULL,
  `CreateTerminal` varchar(100) DEFAULT NULL,
  `UpdateBy` int(11) DEFAULT NULL,
  `UpdateDate` datetime DEFAULT NULL,
  `UpdateTerminal` varchar(100) DEFAULT NULL,
  `NoUrut` int(11) DEFAULT '99',
  `DEPOSITFORMAT_CODE` varchar(5) DEFAULT NULL,
  `ISSERIAL` tinyint(1) DEFAULT '0',
  `ISMUSIK` bit(1) DEFAULT b'0',
  `ISKARTOGRAFI` bit(1) DEFAULT b'0',
  `CODE` varchar(10) NOT NULL,
  `Keterangan` varchar(255) DEFAULT NULL,
  `MaxPinjamKoleksi` int(11) DEFAULT '0',
  `MaxLoanDays` int(11) DEFAULT '0',
  `DendaType` varchar(45) DEFAULT 'Konstan',
  `DendaTenorJumlah` decimal(10,0) DEFAULT '0',
  `DendaTenorSatuan` varchar(45) DEFAULT 'Hari',
  `DendaPerTenor` decimal(10,0) DEFAULT '0',
  `DendaTenorMultiply` int(11) DEFAULT '1',
  `SuspendMember` bit(1) DEFAULT b'0',
  `WarningLoanDueDay` int(11) DEFAULT '0',
  `SuspendType` varchar(45) DEFAULT 'Konstan',
  `SuspendTenorJumlah` double DEFAULT '0',
  `SuspendTenorSatuan` varchar(45) DEFAULT 'Hari',
  `DaySuspend` int(11) DEFAULT '0',
  `SuspendTenorMultiply` int(11) DEFAULT '1',
  `DayPerpanjang` int(11) DEFAULT '0',
  `CountPerpanjang` int(11) DEFAULT '0',
  `IsBerisiArtikel` bit(1) DEFAULT b'0',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `Name` (`Name`),
  KEY `Format_id` (`Format_id`),
  KEY `worksheets_createby` (`CreateBy`),
  KEY `worksheets_updateby` (`UpdateBy`),
  CONSTRAINT `FK3800D37D5B024CA8` FOREIGN KEY (`Format_id`) REFERENCES `formats` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `worksheets_createby` FOREIGN KEY (`CreateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `worksheets_updateby` FOREIGN KEY (`UpdateBy`) REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=latin1;

/*Data for the table `worksheets` */

insert  into `worksheets`(`ID`,`Name`,`Format_id`,`CreateBy`,`CreateDate`,`CreateTerminal`,`UpdateBy`,`UpdateDate`,`UpdateTerminal`,`NoUrut`,`DEPOSITFORMAT_CODE`,`ISSERIAL`,`ISMUSIK`,`ISKARTOGRAFI`,`CODE`,`Keterangan`,`MaxPinjamKoleksi`,`MaxLoanDays`,`DendaType`,`DendaTenorJumlah`,`DendaTenorSatuan`,`DendaPerTenor`,`DendaTenorMultiply`,`SuspendMember`,`WarningLoanDueDay`,`SuspendType`,`SuspendTenorJumlah`,`SuspendTenorSatuan`,`DaySuspend`,`SuspendTenorMultiply`,`DayPerpanjang`,`CountPerpanjang`,`IsBerisiArtikel`) values (1,'Monograf',1,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2015-12-02 12:13:13','::1',1,'CB',0,'\0','\0','001','Buku, Jurnal, Laporan, dll',0,0,'Konstan',0,'Hari',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(2,'Sumber Elektronik',1,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2016-05-25 09:13:49','192.168.0.1',10,NULL,0,'\0','\0','002','CD-ROM, Floppy Disk, VCD, dll',0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(3,'Film',1,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2016-05-25 09:14:20','192.168.0.1',11,NULL,0,'\0','\0','003','Film, dll',0,0,'Konstan',0,'Hari',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(4,'Terbitan Berkala',1,NULL,'2012-09-12 13:54:51','DeniPC',NULL,'2016-05-20 13:51:21','192.168.0.1',2,NULL,1,'\0','\0','004','Surat Kabar, Majalah, dll',0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(5,'Bahan Kartografis',1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2016-05-27 14:01:58','192.168.0.1',9,NULL,0,'\0','\0','005','Peta, dll',0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(6,'Bahan Grafis',1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2015-09-18 15:19:24','::1',6,NULL,0,'\0','\0','006','Foto, Lukisan, dll',0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(7,'Rekaman Video',1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2015-08-15 04:54:17','::1',7,NULL,0,'\0','\0','007',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(8,'Musik',1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2015-08-15 05:20:38','::1',8,NULL,0,'','\0','008',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(9,'Bahan Campuran',1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2015-08-15 05:23:52','::1',9,NULL,0,'\0','\0','009',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(10,'Rekaman Suara',1,NULL,'2012-09-12 13:54:52','DeniPC',NULL,'2015-08-15 05:27:28','::1',10,NULL,0,'\0','\0','010',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(11,'Bentuk Mikro',1,NULL,'2012-09-12 13:54:53','DeniPC',NULL,'2015-08-15 05:31:13','::1',11,NULL,0,'\0','\0','011',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(12,'Manuskrip',1,NULL,'2012-10-24 20:30:35','114.79.54.148',NULL,'2015-08-15 05:40:07','::1',12,NULL,0,'\0','\0','012',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(15,'Bahan Ephemeral',1,NULL,'2015-08-15 06:07:47','::1',NULL,'2015-08-15 06:09:41','::1',15,NULL,0,'\0','\0','015',NULL,0,0,'Konstan',0,'0',0,0,NULL,0,'Konstan',0,'Hari',0,1,0,0,'\0'),(68,'Skripsi',1,NULL,'2016-04-22 11:45:59','192.168.0.1',NULL,'2016-05-20 13:51:39','192.168.0.1',3,NULL,0,'\0','\0','skripsi','Karya Akademik Mahasiswa S1',0,0,'Konstan',0,'Hari',0,1,'\0',0,'Konstan',0,'Hari',0,1,0,0,'\0'),(69,'Tesis',1,NULL,'2016-05-24 15:15:48','192.168.0.1',NULL,'2016-05-24 15:15:48','192.168.0.1',5,NULL,0,'\0','\0','Tesis','Karya Akademik Mahasiswa S2',0,0,'Konstan',0,'Hari',0,1,'\0',0,'Konstan',0,'Hari',0,1,0,0,'\0');

/* Trigger structure for table `inbox` */

DELIMITER $$

/*!50003 CREATE */ /*!50017 DEFINER = 'root'@'%' */ /*!50003 TRIGGER `inbox_timestamp` BEFORE INSERT ON `inbox` FOR EACH ROW BEGIN
    IF NEW.ReceivingDateTime = '0000-00-00 00:00:00' THEN
        SET NEW.ReceivingDateTime = CURRENT_TIMESTAMP();
    END IF;
END */$$


DELIMITER ;

/* Trigger structure for table `outbox` */

DELIMITER $$

/*!50003 CREATE */ /*!50017 DEFINER = 'root'@'%' */ /*!50003 TRIGGER `outbox_timestamp` BEFORE INSERT ON `outbox` FOR EACH ROW BEGIN
    IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
        SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
    END IF;
    IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN
        SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
    END IF;
    IF NEW.SendingTimeOut = '0000-00-00 00:00:00' THEN
        SET NEW.SendingTimeOut = CURRENT_TIMESTAMP();
    END IF;
END */$$


DELIMITER ;

/* Trigger structure for table `phones` */

DELIMITER $$

/*!50003 CREATE */ /*!50017 DEFINER = 'root'@'%' */ /*!50003 TRIGGER `phones_timestamp` BEFORE INSERT ON `phones` FOR EACH ROW BEGIN
    IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
        SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
    END IF;
    IF NEW.TimeOut = '0000-00-00 00:00:00' THEN
        SET NEW.TimeOut = CURRENT_TIMESTAMP();
    END IF;
END */$$


DELIMITER ;

/* Trigger structure for table `sentitems` */

DELIMITER $$

/*!50003 CREATE */ /*!50017 DEFINER = 'root'@'%' */ /*!50003 TRIGGER `sentitems_timestamp` BEFORE INSERT ON `sentitems` FOR EACH ROW BEGIN
    IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
        SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
    END IF;
    IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN
        SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
    END IF;
END */$$


DELIMITER ;

/* Function  structure for function  `GetWarningLoanDueDay` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `GetWarningLoanDueDay`( JenisAnggotaID double, WorksheetID int(11)) RETURNS int(11)
BEGIN
declare WarningLoanDueDay int(11);
set WarningLoanDueDay = 0;
set WarningLoanDueDay = (SELECT WarningLoanDueDay FROM jenis_anggota WHERE jenis_anggota.id = JenisAnggotaID);
if WarningLoanDueDay = 0 then set WarningLoanDueDay = (SELECT WarningLoanDueDay FROM worksheets WHERE worksheets.id = WorksheetID); end if;
return WarningLoanDueDay;
END */$$
DELIMITER ;

/* Function  structure for function  `KATEGORY_UMUR` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `KATEGORY_UMUR`( tglLahir_prm DATETIME ) RETURNS varchar(200) CHARSET latin1 COLLATE latin1_general_ci
BEGIN
    DECLARE umuranggota INTEGER;
    DECLARE katagory_umur_param varchar(200);
    
    SET umuranggota =YEAR(NOW())-YEAR(tglLahir_prm);
    
    IF DATE_FORMAT(tglLahir_prm,'%m%d')>DATE_FORMAT(NOW(),'%m%d') THEN SET umuranggota =umuranggota -1; END IF;
    select master_range_umur.`Keterangan` into katagory_umur_param from master_range_umur where umuranggota between master_range_umur.`umur1` and master_range_umur.`umur2`;
    RETURN katagory_umur_param;
    END */$$
DELIMITER ;

/* Function  structure for function  `levenshtein_ratio` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `levenshtein_ratio`( s1 text, s2 text ) RETURNS int(11)
    DETERMINISTIC
BEGIN 
    DECLARE s1_len, s2_len, max_len INT; 
    SET s1_len = LENGTH(s1), s2_len = LENGTH(s2); 
    IF s1_len > s2_len THEN  
      SET max_len = s1_len;  
    ELSE  
      SET max_len = s2_len;  
    END IF; 
    RETURN ROUND((1 - LEVENSHTEIN(s1, s2) / max_len) * 100); 
  END */$$
DELIMITER ;

/* Function  structure for function  `SPLIT_STR` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `SPLIT_STR`(
x VARCHAR(255),
delim VARCHAR(12),
pos INT
) RETURNS varchar(255) CHARSET latin1
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos),
LENGTH(SUBSTRING_INDEX(x, delim, pos -1)) + 1),
delim, '') */$$
DELIMITER ;

/* Function  structure for function  `get_next_no_pemijaman_id` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `get_next_no_pemijaman_id`() RETURNS varchar(20) CHARSET latin1
BEGIN
 DECLARE next_no_pemijaman VARCHAR(20);
 DECLARE last_no_pemijaman BIGINT(20) DEFAULT 1;
 DECLARE pemijaman_count BIGINT(20);
 
 SELECT COUNT(No_pinjaman) INTO pemijaman_count FROM lockers WHERE LEFT(No_pinjaman, 6) = DATE_FORMAT(NOW(),'%Y%m') ;
 IF pemijaman_count > 0 THEN
 
   SELECT RIGHT(No_pinjaman, 7) INTO last_no_pemijaman FROM lockers  WHERE LEFT(No_pinjaman, 6) = DATE_FORMAT(NOW(),'%Y%m')  ORDER BY no_pinjaman DESC LIMIT 0, 1;
   SET last_no_pemijaman = last_no_pemijaman+ 1;
 ELSE SET last_no_pemijaman =1;
 END IF;
 SET next_no_pemijaman = CONCAT(DATE_FORMAT(NOW(),'%Y%m'), REPEAT(0, 7 - LENGTH(last_no_pemijaman)), last_no_pemijaman);
 RETURN CONCAT(DATE_FORMAT(NOW(),'%Y%m'),REPEAT(0, 7 - LENGTH(last_no_pemijaman)),last_no_pemijaman);
END */$$
DELIMITER ;

/* Function  structure for function  `hasil35dec` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `hasil35dec`(param1 VARCHAR(3)) RETURNS varchar(11) CHARSET utf8
BEGIN
    DECLARE maxpengunjung VARCHAR(11) ;
    DECLARE pengunjung VARCHAR(11) ;
    SET maxpengunjung ='';
    SET pengunjung ='';
    IF param1 = 'GST' THEN
      SELECT MAX(nopengunjung) INTO maxpengunjung FROM memberguesses WHERE SUBSTR(nopengunjung,1,7)= CONCAT(param1,YEAR(NOW()));
    ELSE
      SELECT MAX(nopengunjung) INTO maxpengunjung FROM groupguesses WHERE SUBSTR(nopengunjung,1,7)= CONCAT(param1,YEAR(NOW()));
    END IF;
IF maxpengunjung IS NULL THEN 
	SET maxpengunjung=CONCAT(param1,YEAR(NOW()),'0001');
ELSE
	SET pengunjung =SUBSTR(maxpengunjung,8,4);
	SET pengunjung=CONV(pengunjung,36,10);
	SET pengunjung=pengunjung+1;
	SET pengunjung=CONV(pengunjung,10,36);
	SET maxpengunjung=CONCAT(param1,YEAR(NOW()),REPEAT(0, 4 - LENGTH(pengunjung)),pengunjung);
END IF;
RETURN maxpengunjung;
    END */$$
DELIMITER ;

/* Function  structure for function  `umur` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `umur`( tglLahir_prm DATEtime ) RETURNS int(11)
BEGIN
declare umuranggota integer;
set umuranggota =YEAR(NOW())-year(tglLahir_prm);
if DATE_FORMAT(tglLahir_prm,'%m%d')>DATE_FORMAT(now(),'%m%d') then SET umuranggota =umuranggota -1; end if;
return umuranggota;
END */$$
DELIMITER ;

/* Function  structure for function  `jaro_winkler_similarity` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `jaro_winkler_similarity`(
in1 text,
in2 text
) RETURNS float
    DETERMINISTIC
BEGIN
declare finestra, curString, curSub, maxSub, trasposizioni, prefixlen, maxPrefix int;
declare char1, char2 char(1);
declare common1, common2, old1, old2 text;
declare trovato boolean;
declare returnValue, jaro float;
set maxPrefix=6; set common1="";
set common2="";
set finestra=(length(in1)+length(in2)-abs(length(in1)-length(in2))) DIV 4
+ ((length(in1)+length(in2)-abs(length(in1)-length(in2)))/2) mod 2;
set old1=in1;
set old2=in2;
set curString=1;
while curString<=length(in1) and (curString<=(length(in2)+finestra)) do
set curSub=curstring-finestra;
if (curSub)<1 then
set curSub=1;
end if;
set maxSub=curstring+finestra;
if (maxSub)>length(in2) then
set maxSub=length(in2);
end if;
set trovato = false;
while curSub<=maxSub and trovato=false do
if substr(in1,curString,1)=substr(in2,curSub,1) then
set common1 = concat(common1,substr(in1,curString,1));
set in2 = concat(substr(in2,1,curSub-1),concat("0",substr(in2,curSub+1,length(in2)-curSub+1)));
set trovato=true;
end if;
set curSub=curSub+1;
end while;
set curString=curString+1;
end while;
set in2=old2;
set curString=1;
while curString<=length(in2) and (curString<=(length(in1)+finestra)) do
set curSub=curstring-finestra;
if (curSub)<1 then
set curSub=1;
end if;
set maxSub=curstring+finestra;
if (maxSub)>length(in1) then
set maxSub=length(in1);
end if;
set trovato = false;
while curSub<=maxSub and trovato=false do
if substr(in2,curString,1)=substr(in1,curSub,1) then
set common2 = concat(common2,substr(in2,curString,1));
set in1 = concat(substr(in1,1,curSub-1),concat("0",substr(in1,curSub+1,length(in1)-curSub+1)));
set trovato=true;
end if;
set curSub=curSub+1;
end while;
set curString=curString+1;
end while;
set in1=old1;
if length(common1)<>length(common2)
then set jaro=0;
elseif length(common1)=0 or length(common2)=0
then set jaro=0;
else
set trasposizioni=0;
set curString=1;
while curString<=length(common1) do
if(substr(common1,curString,1)<>substr(common2,curString,1)) then
set trasposizioni=trasposizioni+1;
end if;
set curString=curString+1;
end while;
set jaro=
(
length(common1)/length(in1)+
length(common2)/length(in2)+
(length(common1)-trasposizioni/2)/length(common1)
)/3;
end if; set prefixlen=0;
while (substring(in1,prefixlen+1,1)=substring(in2,prefixlen+1,1)) and (prefixlen<6) do
set prefixlen= prefixlen+1;
end while;
return jaro+(prefixlen*0.1*(1-jaro));
END */$$
DELIMITER ;

/* Function  structure for function  `levenshtein` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `levenshtein`( s1 text, s2 text) RETURNS int(11)
    DETERMINISTIC
BEGIN 
    DECLARE s1_len, s2_len, i, j, c, c_temp, cost INT; 
    DECLARE s1_char CHAR; 
    DECLARE cv0, cv1 text; 
    SET s1_len = CHAR_LENGTH(s1), s2_len = CHAR_LENGTH(s2), cv1 = 0x00, j = 1, i = 1, c = 0; 
    IF s1 = s2 THEN 
      RETURN 0; 
    ELSEIF s1_len = 0 THEN 
      RETURN s2_len; 
    ELSEIF s2_len = 0 THEN 
      RETURN s1_len; 
    ELSE 
      WHILE j <= s2_len DO 
        SET cv1 = CONCAT(cv1, UNHEX(HEX(j))), j = j + 1; 
      END WHILE; 
      WHILE i <= s1_len DO 
        SET s1_char = SUBSTRING(s1, i, 1), c = i, cv0 = UNHEX(HEX(i)), j = 1; 
        WHILE j <= s2_len DO 
          SET c = c + 1; 
          IF s1_char = SUBSTRING(s2, j, 1) THEN  
            SET cost = 0; ELSE SET cost = 1; 
          END IF; 
          SET c_temp = CONV(HEX(SUBSTRING(cv1, j, 1)), 16, 10) + cost; 
          IF c > c_temp THEN SET c = c_temp; END IF; 
            SET c_temp = CONV(HEX(SUBSTRING(cv1, j+1, 1)), 16, 10) + 1; 
            IF c > c_temp THEN  
              SET c = c_temp;  
            END IF; 
            SET cv0 = CONCAT(cv0, UNHEX(HEX(c))), j = j + 1; 
        END WHILE; 
        SET cv1 = cv0, i = i + 1; 
      END WHILE; 
    END IF; 
    RETURN c; 
  END */$$
DELIMITER ;

/* Function  structure for function  `regexp_replace` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `regexp_replace`(pattern VARCHAR(1000),replacement VARCHAR(1000),original VARCHAR(1000)) RETURNS varchar(1000) CHARSET latin1
    DETERMINISTIC
BEGIN
DECLARE temp VARCHAR(1000);
DECLARE ch VARCHAR(1);
DECLARE i INT;
DECLARE j INT;
DECLARE qbTemp VARCHAR(1000);
SET i = 1;
SET j = 1;
SET temp = '';
SET qbTemp = '';
IF original REGEXP pattern THEN
loop_label: LOOP
IF i>CHAR_LENGTH(original) THEN
LEAVE loop_label;
END IF;
SET ch = SUBSTRING(original,i,1);
IF NOT ch REGEXP pattern THEN
SET temp = CONCAT(temp,ch);
ELSE
SET temp = CONCAT(temp,replacement);
END IF;
SET i=i+1;
END LOOP;
ELSE
SET temp = original;
END IF;
SET temp = TRIM(BOTH replacement FROM temp);
SET temp = REPLACE(REPLACE(REPLACE(temp , CONCAT(replacement,replacement),CONCAT(replacement,'#')),CONCAT('#',replacement),''),'#','');
RETURN temp;
END */$$
DELIMITER ;

/* Function  structure for function  `regex_replace_master` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `regex_replace_master`(pattern VARCHAR(1000),replacement VARCHAR(1000),original VARCHAR(1000)) RETURNS varchar(1000) CHARSET latin1
    DETERMINISTIC
BEGIN
DECLARE temp VARCHAR(1000);
DECLARE ch VARCHAR(1);
DECLARE i INT;
DECLARE j INT;
DECLARE qbTemp VARCHAR(1000);
SET i = 1;
SET j = 1;
SET temp = '';
SET qbTemp = '';
IF original REGEXP pattern THEN
loop_label: LOOP
IF i>CHAR_LENGTH(original) THEN
LEAVE loop_label;
END IF;
SET ch = SUBSTRING(original,i,1);
IF NOT ch REGEXP pattern THEN
SET temp = CONCAT(temp,ch);
ELSE
SET temp = CONCAT(temp,replacement);
END IF;
SET i=i+1;
END LOOP;
ELSE
SET temp = original;
END IF;
SET temp = TRIM(BOTH replacement FROM temp);
SET temp = REPLACE(REPLACE(REPLACE(temp , CONCAT(replacement,replacement),CONCAT(replacement,'#')),CONCAT('#',replacement),''),'#','');
RETURN SUBSTRING(temp,1,1);
END */$$
DELIMITER ;

/* Function  structure for function  `terbilang` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `terbilang`(angka bigint) RETURNS varchar(5000) CHARSET utf8
BEGIN
 DECLARE sString varchar(30);
 DECLARE Bil1 varchar(255);
 DECLARE Bil2 varchar(255);
 DECLARE STot varchar(255);
 DECLARE X int;
 DECLARE Y int;
 DECLARE Z int;
 DECLARE Urai varchar(5000);
 SET sString = CAST(angka as char);
 SET Urai = '';
 SET X = 0;
 SET Y = 0;
 WHILE X <> LENGTH(sString) DO
SET X = X + 1;
SET sTot = MID(sString, X, 1);
SET Y = Y + CAST(sTot as UNSIGNED);
SET Z = LENGTH(sString) - X + 1;
CASE CAST(sTot as UNSIGNED)
WHEN 1 THEN
 BEGIN
  IF (Z = 1 OR Z = 7 OR Z = 10 OR Z = 13) THEN
   SET Bil1 = 'SATU ';
  ELSEIF (z = 4) THEN
   IF (x = 1) THEN
    SET Bil1 = 'SE';
   ELSE
    SET Bil1 = 'SATU';
   END IF;
  ELSEIF (Z = 2 OR Z = 5 OR Z = 8 OR Z = 11 OR Z = 14) THEN
   SET X = X + 1;
   SET sTot = MID(sString, X, 1);
   SET Z = LENGTH(sString) - X + 1;
   SET Bil2 = '';
   CASE CAST(sTot AS UNSIGNED)
    WHEN 0 THEN SET Bil1 = 'SEPULUH ';
    WHEN 1 THEN SET Bil1 = 'SEBELAS ';
    WHEN 2 THEN SET Bil1 = 'DUA BELAS ';
    WHEN 3 THEN SET Bil1 = 'TIGA BELAS ';
    WHEN 4 THEN SET Bil1 = 'EMPAT BELAS ';
    WHEN 5 THEN SET Bil1 = 'LIMA BELAS ';
    WHEN 6 THEN SET Bil1 = 'ENAM BELAS ';
    WHEN 7 THEN SET Bil1 = 'TUJUH BELAS ';
    WHEN 8 THEN SET Bil1 = 'DELAPAN BELAS ';
    WHEN 9 THEN SET Bil1 = 'SEMBILAN BELAS ';
   ELSE BEGIN END;
   END CASE;
  ELSE
   SET Bil1 = 'SE';
  END IF;
 END;
WHEN 2 THEN SET Bil1 = 'DUA ';
WHEN 3 THEN SET Bil1 = 'TIGA ';
WHEN 4 THEN SET Bil1 = 'EMPAT ';
WHEN 5 THEN SET Bil1 = 'LIMA ';
WHEN 6 THEN SET Bil1 = 'ENAM ';
WHEN 7 THEN SET Bil1 = 'TUJUH ';
WHEN 8 THEN SET Bil1 = 'DELAPAN ';
WHEN 9 THEN SET Bil1 = 'SEMBILAN ';
ELSE SET Bil1 = '';
END CASE;
IF CAST(sTot as UNSIGNED) > 0 THEN
IF (Z = 2 OR Z = 5 OR Z = 8 OR Z = 11 OR Z = 14) THEN
 SET Bil2 = 'PULUH ';
ELSEIF (Z = 3 OR Z = 6 OR Z = 9 OR Z = 12 OR Z = 15) THEN
 SET Bil2 = 'RATUS ';
ELSE
 SET Bil2 = '';
END IF;
ELSE
SET Bil2 = '';
END IF;
IF Y > 0 THEN
CASE Z
 WHEN 4 THEN BEGIN SET Bil2 = CONCAT(Bil2, 'RIBU '); SET Y = 0; END;
 WHEN 7 THEN BEGIN SET Bil2 = CONCAT(Bil2, 'JUTA '); SET Y = 0; END;
 WHEN 10 THEN BEGIN SET Bil2 = CONCAT(Bil2, 'MILYAR '); SET Y = 0; END;
 WHEN 13 THEN BEGIN SET Bil2 = CONCAT(Bil2, 'TRILYUN '); SET Y = 0; END;
 ELSE BEGIN END;
END CASE;
END IF;
SET Urai = CONCAT(Urai, Bil1, Bil2);
END WHILE;
RETURN Urai;
END */$$
DELIMITER ;

/* Function  structure for function  `TO_MARC` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `TO_MARC`( CATID INT) RETURNS text CHARSET latin1
    DETERMINISTIC
BEGIN
DECLARE v_ID INT(10);
DECLARE v_CatalogId DOUBLE;
DECLARE v_Tag VARCHAR(3);
DECLARE v_Indicator1 CHAR(1);
DECLARE v_Indicator2 CHAR(1);
DECLARE v_Value VARCHAR(4000);
DECLARE done INT DEFAULT FALSE;
DECLARE curCR CURSOR FOR SELECT ID,CatalogId,Tag,Indicator1,Indicator2,Value FROM catalog_ruas WHERE CatalogId=CATID;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
SET @FD = '^';
SET @WORKSHEET_ID = (SELECT Worksheet_id FROM catalogs WHERE ID=CATID);
SET @LEADER = '[LEN]c';
SET @TypeOfRecord = 'a';
IF @WORKSHEET_ID = 1  THEN SET @TypeOfRecord = 'a'; END IF;
IF @WORKSHEET_ID = 3  THEN SET @TypeOfRecord = 'g'; END IF;
IF @WORKSHEET_ID = 5  THEN SET @TypeOfRecord = 'e'; END IF;
IF @WORKSHEET_ID = 7  THEN SET @TypeOfRecord = 'g'; END IF;
IF @WORKSHEET_ID = 8  THEN SET @TypeOfRecord = 'j'; END IF;
IF @WORKSHEET_ID = 9  THEN SET @TypeOfRecord = 'p'; END IF;
IF @WORKSHEET_ID = 10  THEN SET @TypeOfRecord = 'j'; END IF;
IF @WORKSHEET_ID = 11  THEN SET @TypeOfRecord = 'g'; END IF;
IF @WORKSHEET_ID = 12  THEN SET @TypeOfRecord = 'f'; END IF;
IF @WORKSHEET_ID = 13  THEN SET @TypeOfRecord = 'a'; END IF;
IF @WORKSHEET_ID = 41  THEN SET @TypeOfRecord = 'a'; END IF;
IF @WORKSHEET_ID = 21  THEN SET @TypeOfRecord = 'k'; END IF;
IF @WORKSHEET_ID = 20  THEN SET @TypeOfRecord = 'm'; END IF;
IF @WORKSHEET_ID = 102  THEN SET @TypeOfRecord = 'a'; END IF;
SET @LEADER = CONCAT(@LEADER, @TypeOfRecord);
SET @BibLevel = 'm';
IF @WORKSHEET_ID = 13  THEN SET @TypeOfRecord = 's'; END IF;
IF @WORKSHEET_ID = 102  THEN SET @TypeOfRecord = 'a'; END IF;
SET @LEADER = CONCAT(@LEADER, @BibLevel, '  22[BAD]   4500');
SET @RESULT = '';
SET @DIRVAL = '';
SET @DIRNUM = 0;
SET @RECVAL = '';
OPEN curCR;
REPEAT
FETCH curCR INTO v_ID, v_CatalogId, v_Tag, v_Indicator1, v_Indicator2, v_Value;
IF NOT done AND LENGTH(v_Value) > 0 THEN
IF v_Tag = '035' THEN
IF LENGTH(v_Indicator1) = 0 THEN
SET v_Indicator1 = '#';
END IF;
IF LENGTH(v_Indicator2) = 0 THEN
SET v_Indicator2 = '#';
END IF;
IF SUBSTR(v_Value, 1, 2) <> '$a' THEN
SET v_Value = CONCAT('$a ', v_Value);
END IF;
END IF;
SET @LEN = 0;
SET @VAL3 = LPAD(@DIRNUM, 5, '0');
SET @DATAVAL = '';
SET @v_Indicator1 = v_Indicator1;
SET @v_Indicator2 = v_Indicator2;
SET @v_Value = v_Value;
IF v_Tag <= '010' THEN
SET @LEN = LENGTH(@v_Value) + 1;
SET @DIRNUM = @DIRNUM + @LEN;
SET @DATAVAL = @v_Value;
ELSE
SET @LEN = LENGTH(@v_Indicator1) + LENGTH(@v_Indicator2) + LENGTH(@v_Value) + 1;
SET @DIRNUM = @DIRNUM + @LEN;
SET @DATAVAL = CONCAT(@v_Indicator1, @v_Indicator2, @v_Value);
END IF;
SET @VAL1 = v_Tag;
SET @VAL2 = LPAD(@LEN, 4, '0');
SET @DIRVAL = CONCAT(@DIRVAL, @VAL1, @VAL2, @VAL3);
SET @RECVAL = CONCAT(@RECVAL, @FD, @DATAVAL);
END IF;
UNTIL done END REPEAT;
CLOSE curCR;
SET @RESULT = CONCAT(@LEADER, @DIRVAL);
SET @IndexBAD = LENGTH(@RESULT);
SET @RESULT = REPLACE(@RESULT, '[BAD]', LPAD(@IndexBAD, 5, '0'));
SET @RESULT = CONCAT(@RESULT, @RECVAL);
SET @RESULT = REPLACE(@RESULT, '[LEN]', LPAD(LENGTH(@RESULT), 5, '0'));
RETURN @RESULT;
END */$$
DELIMITER ;

/* Procedure structure for procedure `20newCollectionOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `20newCollectionOpac`()
BEGIN
SELECT c.id AS id, c.title AS title, c.author AS author, c.PublishLocation AS PublishLocation, 
				c.publishyear AS YEAR, CONCAT(c.PublishLocation, '  ' , c.Publisher, '  ' ,c.publishyear) AS penerbitan, 
				c.publisher AS publisher,  c.publishyear AS YEAR, CONCAT(c.publisher, ' : ', c.publishyear) AS penerbitan,
				s.CreateDate, w.name AS wn, TRIM(c.coverurl) AS coverurl, c.callnumber AS callnumber
				FROM collections s 
               INNER JOIN catalogs c ON c.id = s.catalog_id 
                              LEFT JOIN worksheets w ON w.ID = c.Worksheet_id 
               WHERE c.isopac =1 
               GROUP BY c.id 
               ORDER BY s.createdate DESC LIMIT 0,20;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `BrowseOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `BrowseOpac`(

                    IN keyword TEXT,

                    IN keyword2 TEXT,

                    IN keyword3 TEXT,

                    IN isLKD TEXT,

                    IN Location TEXT

                    )
BEGIN

                    IF isLKD = 1

                     THEN

                            IF keyword = 'Alphabetical' AND keyword2 = '' THEN

                            SET @query_as_string=CONCAT("SELECT 'A' AS `A` UNION ALL SELECT 'B' AS `B` UNION ALL SELECT 'C' AS `C` UNION ALL SELECT 'D' AS `D` UNION ALL SELECT 'E' AS `E` UNION ALL SELECT 'F' AS `F` UNION ALL SELECT 'G' AS `G` UNION ALL SELECT 'H' AS `H` UNION ALL SELECT 'I' AS `I` UNION ALL SELECT 'J' AS `J` UNION ALL SELECT 'K' AS `K` UNION ALL SELECT 'L' AS `L` UNION ALL SELECT 'M' AS `M` UNION ALL SELECT 'N' AS `N` UNION ALL SELECT 'O' AS `O` UNION ALL SELECT 'P' AS `P` UNION ALL SELECT 'Q' AS `Q` UNION ALL SELECT 'R' AS `R` UNION ALL SELECT 'S' AS `S` UNION ALL SELECT 'T' AS `T` UNION ALL SELECT 'U' AS `U` UNION ALL SELECT 'V' AS `V` UNION ALL SELECT 'W' AS `W` UNION ALL SELECT 'X' AS `X` UNION ALL SELECT 'Y' AS `Y` UNION ALL SELECT 'Z' AS `Z`");             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword = 'Alphabetical' AND keyword2 <> '' THEN

                            SET @query_as_string=CONCAT('

                             SELECT distinct CAT.',keyword2,' as name,COUNT(CAT.',keyword2,') as jml FROM catalogs CAT

                                                        INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id

                                                        WHERE CAT.isopac=1

                                                        AND CAT.',keyword2,' like "',keyword3,'%"  

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword2 = '' AND keyword <> 'Alphabetical' THEN

                            SET @query_as_string=CONCAT('

                                SELECT distinct CAT.',keyword,'  as name,COUNT(CAT.',keyword,' ) as jml FROM catalogs CAT

                                                        INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id

                                                        WHERE CAT.isopac=1

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20 ');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword2 <> '' AND keyword <> 'Alphabetical' THEN

                            SET @query_as_string=CONCAT('

                                SELECT distinct CAT.',keyword2,' as name,COUNT(CAT.',keyword2,') as jml FROM catalogs CAT

                                                        INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id

                                                        WHERE CAT.isopac=1 AND

                                                        CAT.',keyword,' = "',keyword3,'"

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20;');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;    

                            END IF;

                    ELSE

                    IF Location <> 0

                     THEN

                            IF keyword = 'Alphabetical' AND keyword2 = '' THEN

                            SET @query_as_string=CONCAT("SELECT 'A' AS `A` UNION ALL SELECT 'B' AS `B` UNION ALL SELECT 'C' AS `C` UNION ALL SELECT 'D' AS `D` UNION ALL SELECT 'E' AS `E` UNION ALL SELECT 'F' AS `F` UNION ALL SELECT 'G' AS `G` UNION ALL SELECT 'H' AS `H` UNION ALL SELECT 'I' AS `I` UNION ALL SELECT 'J' AS `J` UNION ALL SELECT 'K' AS `K` UNION ALL SELECT 'L' AS `L` UNION ALL SELECT 'M' AS `M` UNION ALL SELECT 'N' AS `N` UNION ALL SELECT 'O' AS `O` UNION ALL SELECT 'P' AS `P` UNION ALL SELECT 'Q' AS `Q` UNION ALL SELECT 'R' AS `R` UNION ALL SELECT 'S' AS `S` UNION ALL SELECT 'T' AS `T` UNION ALL SELECT 'U' AS `U` UNION ALL SELECT 'V' AS `V` UNION ALL SELECT 'W' AS `W` UNION ALL SELECT 'X' AS `X` UNION ALL SELECT 'Y' AS `Y` UNION ALL SELECT 'Z' AS `Z`");             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword = 'Alphabetical' AND keyword2 <> '' THEN

                            SET @query_as_string=CONCAT('

                             SELECT distinct CAT.',keyword2,' as name,COUNT(CAT.',keyword2,') as jml FROM catalogs CAT

                                                        LEFT JOIN collections col ON col.Catalog_id = CAT.ID

                                                        WHERE CAT.isopac=1 

                                                        AND col.Location_id = ',Location,'

                                                        AND CAT.',keyword2,' like "',keyword3,'%"  

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword2 = '' AND keyword <> 'Alphabetical' THEN

                            SET @query_as_string=CONCAT('

                                SELECT distinct CAT.',keyword,'  as name,COUNT(CAT.',keyword,' ) as jml FROM catalogs CAT

                                                        LEFT JOIN collections col ON col.Catalog_id = CAT.ID

                                                        WHERE CAT.isopac=1

                                                        AND col.Location_id = ',Location,'

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20 ');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword2 <> '' AND keyword <> 'Alphabetical' THEN

                            SET @query_as_string=CONCAT('

                                SELECT distinct CAT.',keyword2,' as name,COUNT(CAT.',keyword2,') as jml FROM catalogs CAT

                                                        LEFT JOIN collections col ON col.Catalog_id = CAT.ID

                                                        WHERE CAT.isopac=1

                                                        AND col.Location_id = ',Location,'          

                                                        AND

                                                        CAT.',keyword,' = "',keyword3,'"

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20;');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;    

                            END IF;

                    ELSE

                            IF keyword = 'Alphabetical' AND keyword2 = '' THEN

                            SET @query_as_string=CONCAT("SELECT 'A' AS `A` UNION ALL SELECT 'B' AS `B` UNION ALL SELECT 'C' AS `C` UNION ALL SELECT 'D' AS `D` UNION ALL SELECT 'E' AS `E` UNION ALL SELECT 'F' AS `F` UNION ALL SELECT 'G' AS `G` UNION ALL SELECT 'H' AS `H` UNION ALL SELECT 'I' AS `I` UNION ALL SELECT 'J' AS `J` UNION ALL SELECT 'K' AS `K` UNION ALL SELECT 'L' AS `L` UNION ALL SELECT 'M' AS `M` UNION ALL SELECT 'N' AS `N` UNION ALL SELECT 'O' AS `O` UNION ALL SELECT 'P' AS `P` UNION ALL SELECT 'Q' AS `Q` UNION ALL SELECT 'R' AS `R` UNION ALL SELECT 'S' AS `S` UNION ALL SELECT 'T' AS `T` UNION ALL SELECT 'U' AS `U` UNION ALL SELECT 'V' AS `V` UNION ALL SELECT 'W' AS `W` UNION ALL SELECT 'X' AS `X` UNION ALL SELECT 'Y' AS `Y` UNION ALL SELECT 'Z' AS `Z`");             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword = 'Alphabetical' AND keyword2 <> '' THEN

                            SET @query_as_string=CONCAT('

                             SELECT distinct CAT.',keyword2,' as name,COUNT(CAT.',keyword2,') as jml FROM catalogs CAT

                                                        

                                                        WHERE CAT.isopac=1

                                                        AND CAT.',keyword2,' like "',keyword3,'%"  

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword2 = '' AND keyword <> 'Alphabetical' THEN

                            SET @query_as_string=CONCAT('

                                SELECT distinct CAT.',keyword,'  as name,COUNT(CAT.',keyword,' ) as jml FROM catalogs CAT

                                                        WHERE CAT.isopac=1

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20 ');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;

                            END IF;

                            IF keyword2 <> '' AND keyword <> 'Alphabetical' THEN

                            SET @query_as_string=CONCAT('

                                SELECT distinct CAT.',keyword2,' as name,COUNT(CAT.',keyword2,') as jml FROM catalogs CAT

                                                        WHERE CAT.isopac=1 AND

                                                        CAT.',keyword,' = "',keyword3,'"

                                                        GROUP BY name

                                                        ORDER BY jml desc

                                                        limit 0,20;');             

                              PREPARE statement_1 FROM @query_as_string;

                              EXECUTE statement_1;

                              DEALLOCATE PREPARE statement_1;    

                            END IF;

                    END IF;

                    END IF;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `countPencarianLanjutOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `countPencarianLanjutOpac1`(

                        IN fAuthor TEXT,

                        IN fPublisher TEXT,

                        IN fPublishLoc TEXT,

                        IN fPublishYear TEXT,

                        IN fSubject TEXT,

                        IN fBahasa TEXT

                        )
BEGIN

                        SELECT COUNT(1)

                              FROM tempCariOpac

                              

                              WHERE

                              IF(fAuthor='',1=1,author = fAuthor) AND

                                   IF(fPublisher='',1=1,publisher = fPublisher) AND

                              IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                              IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                              IF(fSubject='',1=1,Subject = fSubject) AND

                              IF(fSubject='',1=1,SUBJECT LIKE fSubject);

                              

                                 

                        END */$$
DELIMITER ;

/* Procedure structure for procedure `countPencarianSederhanaOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `countPencarianSederhanaOpac1`(

                IN fAuthor TEXT,

                IN fPublisher TEXT,

                IN fPublishLoc TEXT,

                IN fPublishYear TEXT,

                IN fSubject TEXT,

                IN fBahasa TEXT

                )
BEGIN

                SELECT COUNT(1)

                      FROM tempCariOpac 

                      

                      WHERE 

                        IF(fAuthor='',1=1,author LIKE concat('%',concat(fAuthor,'%'))) AND

                      IF(fPublisher='',1=1,publisher LIKE fPublisher) AND

                      IF(fPublishLoc='',1=1,PublishLocation LIKE fPublishLoc) AND

                      IF(fPublishYear='',1=1,PublishYear LIKE fPublishYear) AND

                      IF(fBahasa='',1=1,bahasa LIKE fBahasa) AND

                      IF(fSubject='',1=1,Subject LIKE fSubject) ;

                      

                         

                END */$$
DELIMITER ;

/* Procedure structure for procedure `countTelusurOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `countTelusurOpac1`(
IN fAuthor TEXT,
IN fPublisher TEXT,
IN fPublishLoc TEXT,
IN fPublishYear TEXT
)
BEGIN
SELECT COUNT(1)
      FROM tempCariOpac
      
      WHERE 
      IF(fAuthor='',1=1,author LIKE fAuthor) AND
      IF(fPublisher='',1=1,publisher LIKE fPublisher) AND
      IF(fPublishLoc='',1=1,PublishLocation LIKE fPublishLoc) AND
      IF(fPublishYear='',1=1,PublishYear LIKE fPublishYear);
      
         
END */$$
DELIMITER ;

/* Procedure structure for procedure `explode_table` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `explode_table`(
bound VARCHAR(255),
IN fAuthor TEXT,
IN fPublisher TEXT,
IN fPublishLoc TEXT,
IN fPublishYear TEXT,
IN fSubject TEXT
)
BEGIN
DECLARE id INT DEFAULT 0;
DECLARE value TEXT;
DECLARE occurance INT DEFAULT 0;
DECLARE i INT DEFAULT 0;
DECLARE splitted_value varchar(25);
DECLARE done INT DEFAULT 0;
DECLARE cur1 CURSOR FOR SELECT author    FROM tempCariOpac
 WHERE 
      IF(fAuthor='',1=1,author LIKE concat('%',concat(fAuthor,'%'))) AND
      IF(fPublisher='',1=1,publisher LIKE fPublisher) AND
      IF(fPublishLoc='',1=1,PublishLocation LIKE fPublishLoc) AND
      IF(fPublishYear='',1=1,PublishYear LIKE fPublishYear) AND
	  IF(fSubject='',1=1,Subject LIKE fSubject);
                                     
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
DROP TEMPORARY TABLE IF EXISTS table2;
CREATE TEMPORARY TABLE table2(
`value` VARCHAR(56) NOT NULL
) engine=memory;
OPEN cur1;
  read_loop: LOOP
    FETCH cur1 INTO  value;
    IF done THEN
      LEAVE read_loop;
    END IF;
    SET occurance = (SELECT LENGTH(value)
                             - LENGTH(REPLACE(value, bound, ''))
                             +1);
    SET i=1;
    WHILE i <= occurance DO
      SET splitted_value =
      trim((SELECT REPLACE(SUBSTRING(SUBSTRING_INDEX(value, bound, i),
      LENGTH(SUBSTRING_INDEX(value, bound, i - 1)) + 1), ';', '')));
      INSERT INTO table2 VALUES ( splitted_value);
      SET i = i + 1;
    END WHILE;
  END LOOP;
 CLOSE cur1;
insert into table2  SELECT author FROM tempCariOpac  WHERE 
      IF(fAuthor='',1=1,author LIKE concat('%',concat(fAuthor,'%'))) AND
      IF(fPublisher='',1=1,publisher LIKE fPublisher) AND
      IF(fPublishLoc='',1=1,PublishLocation LIKE fPublishLoc) AND
      IF(fPublishYear='',1=1,PublishYear LIKE fPublishYear) AND
	  IF(fSubject='',1=1,Subject LIKE fSubject) AND author not like '%;%';
 
 END */$$
DELIMITER ;

/* Procedure structure for procedure `getStatKlasSubjekKoleksiDibaca` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `getStatKlasSubjekKoleksiDibaca`(
	IN `Bfrom` TEXT, 
	IN `Bto` TEXT
	
    )
BEGIN
    
    
    SELECT 
	COUNT(*) AS CountEksemplar, 
	namakelas AS NAME, 
	COUNT(DISTINCT catalogs.ID) AS CountJudul 
	FROM bacaditempat  
	INNER JOIN collections ON collections.ID = bacaditempat.collection_id  
	INNER JOIN catalogs ON collections.Catalog_id = catalogs.ID  
	INNER JOIN master_kelas_besar ON SUBSTR(catalogs.DeweyNo,1,1) = SUBSTR(master_kelas_besar.kdKelas,1,1) 
	WHERE DATE(collections.TanggalPengadaan) BETWEEN Bfrom AND Bto
	GROUP BY 
	kdKelas 
	ORDER BY 
	kdKelas ;
    
    
    END */$$
DELIMITER ;

/* Procedure structure for procedure `getStatKlasSubjekKoleksiDipinjam` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `getStatKlasSubjekKoleksiDipinjam`(
	IN `Bfrom` TEXT, 
	IN `Bto` TEXT
    )
BEGIN
    
	SELECT 
	COUNT(*) AS CountEksemplar, 
	namakelas AS NAME, 
	COUNT(DISTINCT catalogs.ID) AS CountJudul 
	FROM collectionloanitems  
	INNER JOIN collections ON collections.ID = collectionloanitems.Collection_id  
	INNER JOIN catalogs ON collections.Catalog_id = catalogs.ID  
	INNER JOIN master_kelas_besar ON SUBSTR(catalogs.DeweyNo,1,1) = SUBSTR(master_kelas_besar.kdKelas,1,1) 
	WHERE DATE(collections.TanggalPengadaan) BETWEEN Bfrom AND Bto
	GROUP BY 
	kdKelas 
	ORDER BY 
	kdKelas ;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `detailCatalogOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `detailCatalogOpac`(IN `catID` int
)
BEGIN
SELECT	C.Worksheet_id,
(SELECT C.CoverURL FROM catalogs C WHERE C.ID = catID) AS CoverURL , 
(SELECT W.name FROM worksheets W WHERE W.ID = C.worksheet_id) AS JENIS_BAHAN,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (245,246,440,740) GROUP BY CR.CatalogId) AS JUDUL,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (240) GROUP BY CR.CatalogId) AS JUDUL_SERAGAM,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR '|') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (100,110,111,700,710,711,800,810,811) GROUP BY CR.CatalogId) AS PENGARANG,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (250) GROUP BY CR.CatalogId) AS EDISI,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (490) GROUP BY CR.CatalogId) AS PERNYATAAN_SERI,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (260,264) GROUP BY CR.CatalogId) AS PENERBITAN,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (300) GROUP BY CR.CatalogId) AS DESKRIPSI_FISIK,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (336) GROUP BY CR.CatalogId) AS KONTEN,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (337) GROUP BY CR.CatalogId) AS MEDIA,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (338) GROUP BY CR.CatalogId) AS PENYIMPANAN_MEDIA,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (538) GROUP BY CR.CatalogId) AS INFORMASI_TEKNIS,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (020) GROUP BY CR.CatalogId) AS ISBN,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (022) GROUP BY CR.CatalogId) AS ISSN,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (024) AND CR.indicator1 = 2 GROUP BY CR.CatalogId) AS ISMN,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR '|') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (600,610,611,650,651) GROUP BY CR.CatalogId) AS SUBJEK,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (520) GROUP BY CR.CatalogId) AS ABSTRAK,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (500,501,502,504,505,533,550) GROUP BY CR.CatalogId) AS CATATAN,
(SELECT RI.Name FROM catalog_ruas CR LEFT JOIN refferenceitems RI ON TRIM(RI.Code) = SUBSTRING(CR.VALUE,36,3) WHERE CR.CatalogId = C.ID AND CR.Tag = 008 AND RI.Refference_id = 5) AS BAHASA,
(SELECT RI.Name FROM catalog_ruas CR LEFT JOIN refferenceitems RI ON TRIM(RI.Code) = SUBSTRING(CR.VALUE,34,1) WHERE CR.CatalogId = C.ID AND CR.Tag = 008 AND RI.Refference_id = 17) AS BENTUK_KARYA,
(SELECT RI.Name FROM catalog_ruas CR LEFT JOIN refferenceitems RI ON TRIM(RI.Code) = SUBSTRING(CR.VALUE,23,1) WHERE CR.CatalogId = C.ID AND CR.Tag = 008 AND RI.Refference_id = 2) AS TARGET_PEMBACA,
(SELECT GROUP_CONCAT(CS.Value ORDER BY CR.Tag,CS.Sequence ASC SEPARATOR ' ') FROM catalog_subruas CS LEFT JOIN catalog_ruas CR ON CS.RuasID = CR.ID WHERE CR.CatalogId = C.ID AND CR.Tag IN (856) GROUP BY CR.CatalogId) AS LOKASI_AKSES_ONLINE
FROM catalogs C WHERE C.ID = catID AND isopac = 1;
      
         
END */$$
DELIMITER ;

/* Procedure structure for procedure `duplikat_katalog` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `duplikat_katalog`()
BEGIN
SELECT update_collection (separtorVar) FROM
(
SELECT  * FROM
(
SELECT GROUP_CONCAT(id SEPARATOR ',') separtorVar,COUNT(1) AS JUM  FROM `catalogs` GROUP BY `Title`,`Author`,`Edition`,`Publisher`,`PublishLocation`,`PublishYear`
) katalogdouble
WHERE  JUM>1
) update_collection;
DELETE FROM catalogs WHERE id NOT IN (SELECT catalog_id FROM collections);
END */$$
DELIMITER ;

/* Procedure structure for procedure `get_stat_jenis_pendidikan` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `get_stat_jenis_pendidikan`(
IN `Bfrom` text, 
IN `Bto` text
)
BEGIN
    SELECT 
        `mp`.`Nama` AS `Keterangan`,
        COUNT(`mem`.`ID`) AS `Jumlah`,
        DATE_FORMAT(`mem`.`CreateDate`, '%Y') AS `Tahun`
     
    FROM
        (`master_pendidikan` `mp`
        LEFT JOIN `members` `mem` ON ((`mem`.`EducationLevel_id` = `mp`.`id`)))
    WHERE
        (`mem`.`EducationLevel_id` IS NOT NULL)
        
        and   
        (CAST(`mem`.`CreateDate`
            AS DATE) BETWEEN Bfrom AND Bto )
        
        GROUP BY `mp`.`Nama` , DATE_FORMAT(`mem`.`CreateDate`, '%Y')
    ORDER BY `mp`.`id` , `mem`.`CreateDate`;
    
    
END */$$
DELIMITER ;

/* Procedure structure for procedure `get_stat_kelas_subject_koleksi` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `get_stat_kelas_subject_koleksi`(
IN `Bfrom` text, 
IN `Bto` text
)
BEGIN
SELECT 
COUNT(*) AS CountEksemplar, 
namakelas as Name, 
COUNT(DISTINCT catalogs.ID) AS CountJudul 
FROM collections  
INNER JOIN catalogs ON collections.Catalog_id = catalogs.ID  
INNER JOIN master_kelas_besar ON SUBSTR(catalogs.DeweyNo,1,1) = SUBSTR(master_kelas_besar.kdKelas,1,1) 
WHERE DATE(collections.TanggalPengadaan) BETWEEN Bfrom AND Bto 
GROUP BY 
kdKelas 
ORDER BY 
kdKelas;
END */$$
DELIMITER ;

/* Procedure structure for procedure `get_stat_range_umur` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `get_stat_range_umur`(IN `Bfrom` text, IN `Bto` text
)
BEGIN
 SELECT 
        KATEGORY_UMUR(`members`.`DateOfBirth`) AS `Keterangan`,
        COUNT(`memberguesses`.`ID`) AS `Jumlah`
    FROM
        (`memberguesses`
        JOIN `members` ON ((`memberguesses`.`NoAnggota` = `members`.`MemberNo`)))
    WHERE
        (CAST(`memberguesses`.`CreateDate`
            AS DATE) BETWEEN Bfrom AND Bto )
    GROUP BY KATEGORY_UMUR(`members`.`DateOfBirth`)
    ORDER BY DATE_FORMAT(`memberguesses`.`CreateDate`,
            '%Y') DESC , COUNT(`memberguesses`.`ID`) DESC;
END */$$
DELIMITER ;

/* Procedure structure for procedure `facedArticle` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedArticle`(

                    IN facedType TEXT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN maxFaced INT

                    )
BEGIN

                IF facedType = 'Author'

                THEN

                    SELECT COALESCE(Creator_article,'-') Creator_article,COUNT(1) jml

                          FROM tempCariArticle 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Creator_article LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fSubject='',1=1,subject_article = fSubject) AND

                          IF(fBahasa='',1=1,Languages = fBahasa)

                        GROUP BY Creator_article

                        ORDER BY jml DESC

                        LIMIT 0,maxFaced;              

                ELSE             

                IF facedType = 'Bahasa'

                THEN                  

                    SELECT Languages,COUNT(1) jml

                          FROM tempCariArticle 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Creator_article LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fSubject='',1=1,subject_article = fSubject) AND

                          IF(fBahasa='',1=1,Languages = fBahasa)

                        GROUP BY Languages ORDER BY jml DESC

                        LIMIT 0,maxFaced;

                ELSE             

                IF facedType = 'Subject' 

                THEN

                    SELECT COALESCE(subject_article,'-') subject_article,COUNT(1) jml

                          FROM tempCariArticle 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Creator_article LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fSubject='',1=1,subject_article = fSubject) AND

                          IF(fBahasa='',1=1,Languages = fBahasa)

                        GROUP BY subject_article ORDER BY jml DESC

                        LIMIT 0,maxFaced;

                ELSE             

                IF facedType = 'Publisher' 

                THEN

                    SELECT COALESCE(Publisher,'-') Publisher,COUNT(1) jml

                          FROM tempCariArticle 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Creator_article LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fSubject='',1=1,subject_article = fSubject) AND

                          IF(fBahasa='',1=1,Languages = fBahasa)

                          

                        GROUP BY Publisher

                        ORDER BY jml DESC

                        LIMIT 0,maxFaced;

                END IF;

                END IF; 

                END IF; 

                END IF;         

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `facedAuthorOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedAuthorOpac1`(

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN maxFaced INT

                    )
BEGIN

                    -- call explode_table(';',fAuthor,fPublisher,fPublishLoc,fPublishYear,fSubject);

                                  

                    -- SELECT  COALESCE(Value,'-') Author ,COUNT(1) jml FROM table2 group by COALESCE(Value,'-') order by jml desc LIMIT 0,maxFaced;    

                              

                    SELECT Author,COUNT(1) jml

                          FROM tempCariOpac 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                          IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                          IF(fSubject='',1=1,SUBJECT = fSubject) AND

                          IF(fBahasa='',1=1,bahasa = fBahasa)

                        GROUP BY Author

                        ORDER BY jml DESC

                        LIMIT 0,maxFaced;    

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `facedBahasaOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedBahasaOpac1`(

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN maxFaced INT

                    )
BEGIN

                                  

                    SELECT bahasa,COUNT(1) jml

                          FROM tempCariOpac 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                          IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                          IF(fSubject='',1=1,SUBJECT = fSubject) AND

                          IF(fBahasa='',1=1,bahasa = fBahasa)

                        GROUP BY bahasa ORDER BY jml DESC

                        LIMIT 0,maxFaced;                 

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempSederhanaOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempSederhanaOpac`(

                    IN keyword TEXT,

                    IN tag TEXT,

                    IN worksheet VARCHAR(255),

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN fromTgl TEXT,

                    IN toTgl TEXT,

                    IN isLKD TEXT,

                    IN Location TEXT

                    )
BEGIN

                    DROP TABLE IF EXISTS tempCariOpac;

                    CREATE  TEMPORARY TABLE tempCariOpac

                    (

                    CatalogId            INT(11),

                    title       TEXT,

                    author    TEXT,

                    publisher   TEXT,

                    PublishLocation  TEXT,

                    PublishYear TEXT,

                    SUBJECT TEXT,

                    bahasa TEXT,

                    CoverURL TEXT,

                    CallNumber TEXT,

                    worksheet_id INT,

                    worksheet TEXT,

                    ISSERIAL TEXT,

                    JML_BUKU INT,

                    ALL_BUKU INT,

                    KONTEN_DIGITAL VARCHAR(100)

                    );

                    IF isLKD = 1

                    THEN

                     INSERT INTO tempCariOpac

                     SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.CallNumber ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE('.',REVERSE(FileURL)))+2) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                             INNER JOIN catalogfiles CF ON  CAT.ID = CF.Catalog_id 

                          

                          WHERE 

                          

                          

                          EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  

                                     WHERE 

                         

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    AND  R.Value LIKE keyword 

                            AND R.CATALOGID=CAT.ID

                        

                                    

                                    ) 

                                

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            

                            CAT.isopac=1 

                            

                            

                        HAVING CASE worksheet

                            WHEN 'pdf' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'doc' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'xls' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'rar' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'Semua Format File' THEN 1 = 1  

                        END

                            ;  

                    ELSE             

                    IF worksheet='4' THEN   

                    INSERT INTO tempCariOpac

                    SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.CallNumber ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                                WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID

                                     WHERE 

                                                            

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    

                            AND  R.Value LIKE keyword 

                             AND IF(fromTgl!='' AND toTgl!='' ,col.TANGGAL_TERBIT_EDISI_SERIAL BETWEEN fromTgl AND toTgl,1=1)

                                                    AND R.CATALOGID=CAT.ID) 

                            AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1 

                            ;    

                    ELSE

                    IF location<>0 THEN   

                    INSERT INTO tempCariOpac

                    SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.CallNumber ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                                WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID

                                     WHERE 

                                                            

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    

                            AND  R.Value LIKE keyword 

                            AND col.Location_id = Location AND R.CATALOGID=CAT.ID) 

                            AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1 

                            ;    

                    ELSE

                    INSERT INTO tempCariOpac

                    SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.CallNumber ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                                WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  

                                                     WHERE 

                                                            

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    

                            AND  R.Value LIKE keyword 

                                                   AND R.CATALOGID=CAT.ID) 

                            AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1 

                            ;  

                    END IF;

                    END IF;

                    END IF;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempSederhanaOpac0` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempSederhanaOpac0`(

                    IN keyword TEXT,

                    IN tag TEXT,

                    IN worksheet VARCHAR(255),

                    IN limit1 INT,

                    IN limit2 INT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN fromTgl TEXT,

                    IN toTgl TEXT,

                    IN isLKD TEXT,

                    IN Location TEXT

                    )
BEGIN

                    DROP TABLE IF EXISTS tempCariOpac;

                    CREATE  TEMPORARY TABLE tempCariOpac

                    (

                    CatalogId            INT(11),

                    title       TEXT,

                    author    TEXT,

                    publisher   TEXT,

                    PublishLocation  TEXT,

                    PublishYear TEXT,

                    SUBJECT TEXT,

                    bahasa TEXT,

                    CoverURL TEXT,

                    worksheet_id INT,

                    worksheet TEXT,

                    ISSERIAL TEXT,

                    JML_BUKU INT,

                    ALL_BUKU INT,

                    KONTEN_DIGITAL VARCHAR(100)

                    );

                    IF isLKD = 1

                    THEN

                     INSERT INTO tempCariOpac

                     SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE('.',REVERSE(FileURL)))+2) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                             INNER JOIN catalogfiles CF ON  CAT.ID = CF.Catalog_id 

                          

                          WHERE 

                          

                          

                          EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  

                                     WHERE 

                         

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                AND  R.Value LIKE keyword 

                                AND R.CATALOGID=CAT.ID

                        

                                    

                                    ) 

                                

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1

                            

                            

                         HAVING CASE worksheet

                            WHEN 'pdf' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'doc' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'xls' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'rar' THEN KONTEN_DIGITAL = worksheet

                            WHEN 'Semua Format File' THEN 1 = 1

                            

                                END

                            LIMIT limit1,limit2;  

                    ELSE             

                    IF worksheet='4' THEN   

                    INSERT INTO tempCariOpac

                    SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                                WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID

                                     WHERE 

                                                            

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    

                            AND  R.Value LIKE keyword 

                             AND IF(fromTgl!='' AND toTgl!='' ,col.TANGGAL_TERBIT_EDISI_SERIAL BETWEEN fromTgl AND toTgl,1=1)

                                                    AND R.CATALOGID=CAT.ID) 

                            AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1 

                            LIMIT limit1,limit2;    

                    ELSE

                    IF location<>0 THEN  

                    INSERT INTO tempCariOpac

                    SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                                WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID

                                     WHERE 

                                                            

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    

                            AND  R.Value LIKE keyword 

                             AND  R.Value LIKE keyword 

                            AND col.Location_id = Location

                                                    AND R.CATALOGID=CAT.ID) 

                            AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1 

                            LIMIT limit1,limit2;    

                    ELSE

                    INSERT INTO tempCariOpac

                    SELECT DISTINCT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                   (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < NOW() || BookingExpiredDate IS NULL)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                                WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  

                                                     WHERE 

                                                            

                            CASE tag

                            WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')

                            WHEN 'Pengarang' THEN R.TAG IN ('100','110','111','700','710','711','800','810','811')

                            WHEN 'Penerbit' THEN R.TAG IN ('260','264')

                            WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')

                            WHEN 'Nomor Panggil' THEN R.TAG IN ('090','084')

                            WHEN 'ISBN' THEN R.TAG IN ('020')

                            WHEN 'ISSN' THEN R.TAG IN ('022')

                            WHEN 'ISMN' THEN R.TAG IN ('024')        

                            WHEN 'Semua Ruas' THEN 1 = 1

                            END

                                    

                            AND  R.Value LIKE keyword 

                                                   AND R.CATALOGID=CAT.ID) 

                            AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)

                            AND

                            IF(fAuthor='',1=1,CAT.Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                            IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND

                            IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND

                            IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND

                            IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND

                            IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            

                            CAT.isopac=1 

                            LIMIT limit1,limit2;  

                    END IF;

                    END IF;

                    END IF;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `facedPublisherOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedPublisherOpac1`(

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN maxFaced INT

                    )
BEGIN

                                  

                    SELECT Publisher,COUNT(1) jml

                          FROM tempCariOpac 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                          IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                          IF(fSubject='',1=1,SUBJECT = fPublishYear) AND

                          IF(fBahasa='',1=1,bahasa = fBahasa)

                          

                        GROUP BY Publisher

                        ORDER BY jml DESC

                        LIMIT 0,maxFaced;                        

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `facedPublishLocationOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedPublishLocationOpac1`(

                IN fAuthor TEXT,

                IN fPublisher TEXT,

                IN fPublishLoc TEXT,

                IN fPublishYear TEXT,

                IN fSubject TEXT,

                IN fBahasa TEXT,

                IN maxFaced INT

                )
BEGIN

                              

                SELECT PublishLocation,COUNT(1) jml

                      FROM tempCariOpac 

                      

                      WHERE 

                      IF(fAuthor='',1=1,Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                      IF(fPublisher='',1=1,publisher = fPublisher) AND

                      IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                      IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                      IF(fSubject='',1=1,SUBJECT = fSubject) AND

                      IF(fBahasa='',1=1,bahasa = fBahasa)

                      

                    GROUP BY PublishLocation

                    ORDER BY jml DESC

                    LIMIT 0,maxFaced;    

                END */$$
DELIMITER ;

/* Procedure structure for procedure `facedPublishYearOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedPublishYearOpac1`(

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN maxFaced INT

                    )
BEGIN

                                  

                    SELECT PublishYear,COUNT(1) jml

                          FROM tempCariOpac

                          

                          WHERE 

                          IF(fAuthor='',1=1,Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                          IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                          IF(fSubject='',1=1,SUBJECT = fSubject) AND

                          IF(fBahasa='',1=1,bahasa = fBahasa)

                        GROUP BY PublishYear

                        ORDER BY jml DESC

                        LIMIT 0,maxFaced;      

                              

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `facedSubjectOpac1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `facedSubjectOpac1`(

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN maxFaced INT

                    )
BEGIN

                                  

                    SELECT COALESCE(SUBJECT,'-') SUBJECT,COUNT(1) jml

                          FROM tempCariOpac 

                          

                          WHERE 

                          IF(fAuthor='',1=1,Author LIKE CONCAT('%',CONCAT(fAuthor,'%'))) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                          IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                          IF(fSubject='',1=1,SUBJECT = fSubject) AND

                          IF(fBahasa='',1=1,bahasa = fBahasa)

                        GROUP BY SUBJECT ORDER BY jml DESC

                        LIMIT 0,maxFaced;    

                              

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `get_koleksi_terimakasih` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `get_koleksi_terimakasih`(
IN Partner_id text,
IN Source_id text,
IN TanggalPengadaan text
)
BEGIN
SET @Eks = 0;
SELECT 
cat.Worksheet_id as WORKSHEETID, 
w.Name as WorksheetName,(@Eks := COUNT(*)) as Eksemplar,
terbilang(@Eks) as Terbilang,
 Title as Judul,
 '' as AnakJudul,
 Author as Pengarang,
 '' as PengarangTambahan,
 '' as BadanKoperasi, 
 Publisher as Penerbit, 
 PublishLocation as TempatTerbit,
 PublishYear as TahunTerbit,
 CONCAT(PublishLocation,' ',Publisher,' ',PublishYear) as Penerbitan,
 Edition as Edisi,
 DeweyNo as NoKlas, 
 PhysicalDescription as DeskripsiFisik,
 ISBN as ISBN, Note as Catatan,
 '' as Skala, cs.Name as Sumber,
 Keterangan_Sumber as KeteranganSumber,
 Currency as Currency,
 Price as Harga, 
 u.UserName as ReportedBy,
 DATE_FORMAT(col.CreateDate,'%d %b %Y') as ReportedDate, 
 '' as Status, 
 u.FullName as NamaPenerima
 
 FROM collections col 
 INNER JOIN catalogs cat on col.Catalog_id = cat.id 
 INNER JOIN worksheets w on cat.Worksheet_id = w.id 
 INNER JOIN users u on col.createby = u.id 
 INNER JOIN collectionsources cs on col.Source_id = cs.id 
 
 WHERE Partner_id = Partner_id
 AND Source_id = Source_id
 AND DATE(col.TanggalPengadaan) = TanggalPengadaan 
 
 GROUP BY cat.ID;
         
END */$$
DELIMITER ;

/* Procedure structure for procedure `marcCatalogOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `marcCatalogOpac`(
IN catID int
)
BEGIN
select * from catalog_ruas where catalogId = catID order by Tag asc;
      
         
END */$$
DELIMITER ;

/* Procedure structure for procedure `showCollectionOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `showCollectionOpac`(IN keyword TEXT)
BEGIN
              
SELECT c.id,c.`Catalog_id`, m.`Name` media,c.`NomorBarcode`, c.`NoInduk`, c.`CallNumber`, r.`Name` akses, l.`Name` lokasi, s.`Name` ketersediaan, loc.`Name` namaperpus, c.BookingMemberID, c.BookingExpiredDate
			FROM collections c 
			LEFT JOIN collectionmedias m ON c.`Media_id`=m.`ID` 
			LEFT JOIN collectionrules r ON c.`Rule_id`=r.`ID` 
			LEFT JOIN collectionstatus s ON c.`Status_id`=s.`ID`   
			LEFT JOIN locations l ON c.`Location_id`=l.`ID`
            LEFT join location_library loc on c.`Location_Library_id` = loc.`id`
			WHERE c.`Catalog_id`=keyword;   
          
END */$$
DELIMITER ;

/* Procedure structure for procedure `showKontenDigital` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `showKontenDigital`(IN keyword TEXT)
BEGIN
              
Select C.ID,C.Catalog_id,C.FileURL,C.FileFlash,C.IsPublish,	(
								SELECT  SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE('.',REVERSE(FileURL)))+2))  as FormatFile
                				 FROM catalogfiles C where IsPublish <> 0 and Catalog_id =keyword;   
          
END */$$
DELIMITER ;

/* Procedure structure for procedure `get_stat_jenis_pendidikan_bulan` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `get_stat_jenis_pendidikan_bulan`(

                    IN `Bfrom` TEXT, 

                    IN `Bto` TEXT

                    )
BEGIN

                    SELECT 

                        `mp`.`Nama` AS `Keterangan`,

                        COUNT(`mem`.`ID`) AS `Jumlah`,

                        DATE(`mem`.`CreateDate`) AS `Tanggal`

                     

                    FROM

                        (`master_pendidikan` `mp`

                        LEFT JOIN `members` `mem` ON ((`mem`.`EducationLevel_id` = `mp`.`id`)))

                    WHERE

                        (`mem`.`EducationLevel_id` IS NOT NULL)

                        

                        AND   

                        (CAST(`mem`.`CreateDate`

                            AS DATE) BETWEEN Bfrom AND Bto )

                        

                        GROUP BY `mp`.`Nama` , DATE_FORMAT(`mem`.`CreateDate`, '%M')

                    ORDER BY `mp`.`id` , `mem`.`CreateDate`;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `get_stat_jenis_pendidikan_tahun` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `get_stat_jenis_pendidikan_tahun`(

                    IN `Bfrom` TEXT, 

                    IN `Bto` TEXT

                    )
BEGIN

                    SELECT 

                        `mp`.`Nama` AS `Keterangan`,

                        COUNT(`mem`.`ID`) AS `Jumlah`,

                        DATE(`mem`.`CreateDate`) AS `Tanggal`

                     

                    FROM

                        (`master_pendidikan` `mp`

                        LEFT JOIN `members` `mem` ON ((`mem`.`EducationLevel_id` = `mp`.`id`)))

                    WHERE

                        (`mem`.`EducationLevel_id` IS NOT NULL)

                        

                        AND   

                        (CAST(`mem`.`CreateDate`

                            AS DATE) BETWEEN Bfrom AND Bto )

                        

                        GROUP BY `mp`.`Nama` , DATE_FORMAT(`mem`.`CreateDate`, '%Y')

                    ORDER BY `mp`.`id` , `mem`.`CreateDate`;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempOpacSederhana` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempOpacSederhana`(
IN keyword TEXT,
IN tag TEXT,
IN worksheet VARCHAR(255),
IN fAuthor TEXT,
IN fPublisher TEXT,
IN fPublishLoc TEXT,
IN fPublishYear TEXT,
IN fSubject TEXT,
IN fromTgl DATE,
IN toTgl DATE
)
BEGIN
CREATE  TEMPORARY TABLE tempCariOpac
(
CatalogId            INT(11),
title       TEXT,
author    TEXT,
publisher   TEXT,
PublishLocation  TEXT,
PublishYear TEXT,
Subject Text,
CoverURL TEXT,
worksheet_id INT,
worksheet TEXT,
JML_BUKU INT,
ALL_BUKU INT,
KONTEN_DIGITAL VARCHAR(100)
);              
   
INSERT INTO tempCariOpac
SELECT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 
               (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,
                (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND BookingExpiredDate < now()) JML_BUKU,
                 (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,
                 (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 
                 FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL
      FROM catalogs CAT JOIN collections col ON col.Catalog_id = CAT.ID
      WHERE EXISTS           
               (SELECT  1
                FROM catalog_ruas R  
                 WHERE 
                 IF(fAuthor='',1=1,CAT.Author LIKE fAuthor) AND
		 IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND
		 IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND
		 IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND
         IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND
		
		CASE tag
		WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')
		WHEN 'Pengarang' THEN R.TAG IN ('100','110','700','710')
		WHEN 'Penerbit' THEN R.TAG IN ('260')
		WHEN 'Tahun Terbit' THEN R.TAG IN ('260')
		WHEN 'Subyek' THEN R.TAG LIKE '6%'
		WHEN 'Nomor Panggil' THEN R.TAG IN ('090','082','084','080')
		WHEN 'BIB-ID' THEN R.TAG IN ('035')
		WHEN 'ISBN/ISSN/ISMN' THEN R.TAG IN ('020','022')
		WHEN 'Semua Ruas' THEN R.TAG IN ('240','245','740','100','110','700','710','260','600','610','611','630','650','651','080','082','084','096','022','020')
		END
                
                AND  R.Value LIKE keyword 
                AND IF(worksheet='4',col.TANGGAL_TERBIT_EDISI_SERIAL BETWEEN fromTgl AND toTgl,1=1)
                AND R.CATALOGID=CAT.ID) 
		AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)
	
		
		 AND CAT.isopac=1 
        ;  
  
          
END */$$
DELIMITER ;

/* Procedure structure for procedure `TO_MARC` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `TO_MARC`(
IN CatID INT
)
BEGIN
select TO_MARC(CatID);
END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempLanjutArticle` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempLanjutArticle`(

                    IN worksheet TEXT,

                    IN bahasa TEXT,

                    IN targetPembaca TEXT,

                    IN bentukKarya TEXT,

                    IN keyword TEXT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN isLKD TEXT

                    )
BEGIN

                    DECLARE querys,querys2,querys3,bhs,karya,pembaca TEXT;

                    SET querys='';

                    SET querys2='';

                    SET querys3='';

                    SET bhs='';

                    SET karya='';

                    SET pembaca='';

                    DROP TABLE IF EXISTS tempCariArticle;

                    CREATE  TEMPORARY TABLE tempCariArticle

                    (

                Article_type VARCHAR(100),

                Creator_article VARCHAR(200),

                title_article TEXT,

                content_article TEXT,

                subject_article VARCHAR(200),

                EDISISERIAL VARCHAR(200),

                TANGGAL_TERBIT_EDISI_SERIAL VARCHAR(200),

                CatalogId            INT(11),

                title       TEXT,

                bahasa VARCHAR(100),

                author    VARCHAR(200),

                publisher   VARCHAR(100),

                PublishLocation  VARCHAR(100),

                PublishYear VARCHAR(100),

                SUBJECT VARCHAR(200),

                CoverURL VARCHAR(100),

                worksheet_id INT,

                worksheet VARCHAR(100),

                KONTEN_DIGITAL VARCHAR(100)

                    );

                     IF bahasa <> '' THEN SET bhs = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,36,3) = ''',bahasa,''''); 

                      END IF;

                     IF bentukKarya <> '' THEN SET karya = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,34,1) = ''',bentukKarya,''''); 

                      END IF;

                     IF targetPembaca <> '' THEN SET pembaca = CONCAT(pembaca,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,23,1) = ''',targetPembaca,''''); 

                      END IF;

                     

                     IF fAuthor <> '' THEN SET querys = CONCAT(querys,' AND CAT.Author = ''',fAuthor,''''); 

                      END IF;

                      IF fPublisher <> ''   THEN SET querys = CONCAT(querys,' AND CAT.Publisher = ''',fPublisher,'''');

                      END IF;

                      IF fPublishLoc <> '' THEN SET querys = CONCAT(querys,' AND CAT.PublishLocation = ''',fPublishLoc,''''); 

                      END IF;

                      IF fPublishYear <> ''  THEN SET querys = CONCAT(querys,' AND CAT.PublishYear = ''',fPublishYear,''''); 

                       END IF;

                      IF fSubject <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Subject = ''',fSubject,''''); 

                       END IF;

                        IF fBahasa <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Languages = ''',fBahasa,''''); 

                       END IF;

                            

                       

                    SET @query_as_string=CONCAT('

                INSERT INTO tempCariArticle

                        SELECT art.Article_type,art.Creator AS Creator_article, art.title AS title_article, art.content AS content_article, art.subject AS subject_article, art.EDISISERIAL, art.TANGGAL_TERBIT_EDISI_SERIAL, CAT.id CatalogId,CAT.title,CAT.Languages, CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 

                            w.name worksheet,

                                    (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE(''.'',REVERSE(FileURL)))+2) SEPARATOR '','') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM serial_articles art 

                          JOIN catalogs CAT ON art.Catalog_id = CAT.ID  

                          lEFT JOIN worksheets w ON w.id = CAT.Worksheet_id

                          

                          ',querys3,' 

                       WHERE 

                      

                       ',keyword,' AND CAT.isopac=1 AND art.ISOPAC=1

                            AND w.ISSERIAL = 1',querys,querys2,' ');

                     PREPARE statement_1 

                      FROM @query_as_string ;

                       EXECUTE statement_1;

                      DEALLOCATE PREPARE statement_1;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempLanjutArticle0` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempLanjutArticle0`(

                    IN worksheet TEXT,

                    IN bahasa TEXT,

                    IN targetPembaca TEXT,

                    IN bentukKarya TEXT,

                    IN keyword TEXT,

                    IN limit1 TEXT,

                    IN limit2 TEXT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN isLKD TEXT

                    )
BEGIN

                    DECLARE querys,querys2,querys3,bhs,karya,pembaca TEXT;

                    SET querys='';

                    SET querys2='';

                    SET querys3='';

                    SET bhs='';

                    SET karya='';

                    SET pembaca='';

                    DROP TABLE IF EXISTS tempCariArticle;

                    CREATE  TEMPORARY TABLE tempCariArticle

                    (

                Article_type VARCHAR(100),

                Creator_article VARCHAR(200),

                title_article TEXT,

                content_article TEXT,

                subject_article VARCHAR(200),

                EDISISERIAL VARCHAR(200),

                TANGGAL_TERBIT_EDISI_SERIAL VARCHAR(200),

                CatalogId            INT(11),

                title       TEXT,

                bahasa VARCHAR(100),

                author    VARCHAR(200),

                publisher   VARCHAR(100),

                PublishLocation  VARCHAR(100),

                PublishYear VARCHAR(100),

                SUBJECT VARCHAR(200),

                CoverURL VARCHAR(100),

                worksheet_id INT,

                worksheet VARCHAR(100),

                KONTEN_DIGITAL VARCHAR(100)

                    );

                     IF bahasa <> '' THEN SET bhs = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,36,3) = ''',bahasa,''''); 

                      END IF;

                     IF bentukKarya <> '' THEN SET karya = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,34,1) = ''',bentukKarya,''''); 

                      END IF;

                     IF targetPembaca <> '' THEN SET pembaca = CONCAT(pembaca,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,23,1) = ''',targetPembaca,''''); 

                      END IF;

                     

                     IF fAuthor <> '' THEN SET querys = CONCAT(querys,' AND CAT.Author = ''',fAuthor,''''); 

                      END IF;

                      IF fPublisher <> ''   THEN SET querys = CONCAT(querys,' AND CAT.Publisher = ''',fPublisher,'''');

                      END IF;

                      IF fPublishLoc <> '' THEN SET querys = CONCAT(querys,' AND CAT.PublishLocation = ''',fPublishLoc,''''); 

                      END IF;

                      IF fPublishYear <> ''  THEN SET querys = CONCAT(querys,' AND CAT.PublishYear = ''',fPublishYear,''''); 

                       END IF;

                      IF fSubject <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Subject = ''',fSubject,''''); 

                       END IF;

                        IF fBahasa <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Languages = ''',fBahasa,''''); 

                       END IF;

                SET @query_as_string=CONCAT('

                INSERT INTO tempCariArticle

                        SELECT art.Article_type,art.Creator AS Creator_article, art.title AS title_article, art.content AS content_article, art.subject AS subject_article, art.EDISISERIAL, art.TANGGAL_TERBIT_EDISI_SERIAL, CAT.id CatalogId,CAT.title,CAT.Languages, CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 

                            w.name worksheet,

                                    (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE(''.'',REVERSE(FileURL)))+2) SEPARATOR '','') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM serial_articles art 

                          JOIN catalogs CAT ON art.Catalog_id = CAT.ID  

                          lEFT JOIN worksheets w ON w.id = CAT.Worksheet_id

                          

                          ',querys3,' 

                       WHERE 

                      

                       ',keyword,' AND CAT.isopac=1 AND art.ISOPAC=1

                            AND w.ISSERIAL = 1',querys,querys2,' LIMIT ',limit1,',',limit2,' ');            

                      

                     PREPARE statement_1 

                      FROM @query_as_string ;

                       EXECUTE statement_1;

                      DEALLOCATE PREPARE statement_1;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempLanjutOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempLanjutOpac`(

                    IN worksheet TEXT,

                    IN bahasa TEXT,

                    IN targetPembaca TEXT,

                    in bentukKarya TEXT,

                    IN keyword TEXT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT,

                    IN isLKD TEXT,

                    IN lokasi TEXT

                    )
BEGIN

                    DECLARE querys,querys2,querys3,bhs,karya,pembaca,queryloc,querylocjoin TEXT;

                    set querys='';

                    set querys2='';

                    set querys3='';

                    SET queryloc='';

                    SET querylocjoin='';

                    set bhs='';

                    set karya='';

                    set pembaca='';

                    DROP TABLE IF EXISTS tempCariOpac;

                    CREATE  TEMPORARY TABLE tempCariOpac

                    (

                    CatalogId            INT(11),

                    title       TEXT,

                    author    TEXT,

                    publisher   TEXT,

                    PublishLocation  TEXT,

                    PublishYear TEXT,

                    Subject Text,

                    bahasa TEXT,

                    CoverURL TEXT,

                    worksheet_id INT,

                    worksheet TEXT,

                    ISSERIAL TEXT,

                    JML_BUKU INT,

                    ALL_BUKU INT,

                    KONTEN_DIGITAL VARCHAR(100)

                    );

                     IF bahasa <> '' THEN SET bhs = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,36,3) = ''',bahasa,''''); 

                      END IF;

                     IF bentukKarya <> '' THEN SET karya = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,34,1) = ''',bentukKarya,''''); 

                      END IF;

                     IF targetPembaca <> '' THEN SET pembaca = CONCAT(pembaca,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,23,1) = ''',targetPembaca,''''); 

                      END IF;

                     IF fAuthor <> '' THEN SET querys = CONCAT(querys,' AND CAT.Author = ''',fAuthor,''''); 

                      END IF;

                      IF fPublisher <> ''   THEN SET querys = CONCAT(querys,' AND CAT.Publisher = ''',fPublisher,'''');

                      END IF;

                      IF fPublishLoc <> '' THEN SET querys = CONCAT(querys,' AND CAT.PublishLocation = ''',fPublishLoc,''''); 

                      END IF;

                      IF fPublishYear <> ''  THEN SET querys = CONCAT(querys,' AND CAT.PublishYear = ''',fPublishYear,''''); 

                       END IF;

                      IF fSubject <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Subject = ''',fSubject,''''); 

                       END IF;

                        IF fBahasa <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Languages = ''',fBahasa,''''); 

                       END IF;

                       

                       IF lokasi <> 0 THEN SET queryloc = CONCAT(queryloc,' AND col.Location_id = ''',lokasi,''''); 

                       END IF;

                       

                       IF lokasi <> 0 THEN SET querylocjoin = CONCAT(querys,' LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID '); 

                       END IF;

                       

                        IF worksheet <> 'Semua Format FIle' and isLKD = 1  THEN SET querys2 = CONCAT(querys2,' HAVING KONTEN_DIGITAL =  ''',worksheet,''''); 

                       END IF;

                        IF isLKD  = 1  THEN SET querys3 = CONCAT(querys3,' INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id '); 

                       END IF;

                       

                       

                    SET @query_as_string=CONCAT('

                        INSERT INTO tempCariOpac

                         SELECT distinct CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id, 

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                    (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < now() || BookingExpiredDate is null)) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE(''.'',REVERSE(FileURL)))+2) SEPARATOR '','') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                          -- LEFT JOIN collections col ON col.Catalog_id = CAT.ID

                          

                          ',querys3,' 

                          WHERE EXISTS           

                                   (SELECT  1

                                    FROM catalog_ruas R  ',querylocjoin,' 

                                     WHERE 

                                     

                                    

                                     

                    ',keyword,queryloc,bhs,karya,pembaca,'  AND R.CATALOGID=CAT.ID) AND CAT.isopac=1',querys,querys2);

                     PREPARE statement_1 

                      FROM @query_as_string ;

                       EXECUTE statement_1;

                      DEALLOCATE PREPARE statement_1;

                            

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempLanjutOpac0` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempLanjutOpac0`(

                IN worksheet TEXT,

                IN bahasa TEXT,

                IN targetPembaca TEXT,

                IN bentukKarya TEXT,

                IN keyword TEXT,

                IN limit1 TEXT,

                IN limit2 TEXT,

                IN fAuthor TEXT,

                IN fPublisher TEXT,

                IN fPublishLoc TEXT,

                IN fPublishYear TEXT,

                IN fSubject TEXT,

                IN fBahasa TEXT,

                IN isLKD TEXT,

                IN lokasi TEXT

                )
BEGIN

                DECLARE querys,querys2,querys3,bhs,karya,pembaca,queryloc,querylocjoin TEXT;

                SET querys='';

                SET querys2='';

                SET querys3='';

                SET queryloc='';

                SET querylocjoin='';

                SET bhs='';

                SET karya='';

                SET pembaca='';

                DROP TABLE IF EXISTS tempCariOpac;

                CREATE  TEMPORARY TABLE tempCariOpac

                (

                CatalogId            INT(11),

                title       TEXT,

                author    TEXT,

                publisher   TEXT,

                PublishLocation  TEXT,

                PublishYear TEXT,

                SUBJECT TEXT,

                bahasa TEXT,

                CoverURL TEXT,

                worksheet_id INT,

                worksheet TEXT,

                ISSERIAL TEXT,

                JML_BUKU INT,

                ALL_BUKU INT,

                KONTEN_DIGITAL VARCHAR(100)

                );

                 IF bahasa <> '' THEN SET bhs = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,36,3) = ''',bahasa,''''); 

                  END IF;

                 IF bentukKarya <> '' THEN SET karya = CONCAT(bhs,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,34,1) = ''',bentukKarya,''''); 

                  END IF;

                 IF targetPembaca <> '' THEN SET pembaca = CONCAT(pembaca,' AND R.TAG IN (''008'') AND SUBSTRING(R.VALUE,23,1) = ''',targetPembaca,''''); 

                  END IF;

                 

                 IF fAuthor <> '' THEN SET querys = CONCAT(querys,' AND CAT.Author = ''',fAuthor,''''); 

                  END IF;

                  IF fPublisher <> ''   THEN SET querys = CONCAT(querys,' AND CAT.Publisher = ''',fPublisher,'''');

                  END IF;

                  IF fPublishLoc <> '' THEN SET querys = CONCAT(querys,' AND CAT.PublishLocation = ''',fPublishLoc,''''); 

                  END IF;

                  IF fPublishYear <> ''  THEN SET querys = CONCAT(querys,' AND CAT.PublishYear = ''',fPublishYear,''''); 

                   END IF;

                  IF fSubject <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Subject = ''',fSubject,''''); 

                   END IF;

                    IF fBahasa <> ''  THEN SET querys = CONCAT(querys,' AND CAT.Languages = ''',fBahasa,''''); 

                   END IF;

                   

                   IF lokasi <> 0 THEN SET queryloc = CONCAT(queryloc,' AND col.Location_id = ''',lokasi,''''); 

                   END IF;

                   

                   IF lokasi <> 0 THEN SET querylocjoin = CONCAT(querys,' LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID '); 

                   END IF;

                   

                   

                   

                      IF worksheet <> 'Semua Format FIle' AND isLKD = 1  THEN SET querys2 = CONCAT(querys2,' HAVING KONTEN_DIGITAL =  ''',worksheet,''''); 

                   END IF;

                   

                    IF isLKD  = 1  THEN SET querys3 = CONCAT(querys3,' INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id '); 

                   END IF;

                   

                   

                SET @query_as_string=CONCAT('

                    INSERT INTO tempCariOpac

                     SELECT distinct CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id, 

                               (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                               (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < now() || BookingExpiredDate is null)) JML_BUKU,

                                 (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                 (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE(''.'',REVERSE(FileURL)))+2) SEPARATOR '','') 

                                 FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                      FROM catalogs CAT 

                      -- LEFT JOIN collections col ON col.Catalog_id = CAT.ID

                      

                      ',querys3,' 

                   WHERE EXISTS           

                               (SELECT  1

                                FROM catalog_ruas R  ',querylocjoin,' 

                                 WHERE    

                                

                                 

                ',keyword,queryloc,bhs,karya,pembaca,' AND R.CATALOGID=CAT.ID) AND CAT.isopac=1',querys,querys2,' LIMIT ',limit1,',',limit2,' ');

                 PREPARE statement_1 

                  FROM @query_as_string ;

                   EXECUTE statement_1;

                  DEALLOCATE PREPARE statement_1;

                END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempSederhanaArticle` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempSederhanaArticle`(

                    IN keyword TEXT,

                    IN tag TEXT,

                    IN isLimit INT,

                    IN limit1 INT,

                    IN limit2 INT

                    )
BEGIN

                    DROP TABLE IF EXISTS tempCariArticle;

                    CREATE  TEMPORARY TABLE tempCariArticle

                    (

                    serial_articles_id INT(11),

                    Article_type VARCHAR(100),

                    Creator_article VARCHAR(200),

                    title_article TEXT,

                    content_article TEXT,

                    subject_article VARCHAR(200),

                    EDISISERIAL VARCHAR(200),

                    TANGGAL_TERBIT_EDISI_SERIAL VARCHAR(200),

                    CatalogId            INT(11),

                    title       TEXT,

                    bahasa VARCHAR(100),

                    author    VARCHAR(200),

                    publisher   VARCHAR(100),

                    PublishLocation  VARCHAR(100),

                    PublishYear VARCHAR(100),

                    SUBJECT VARCHAR(200),

                    CoverURL VARCHAR(100),

                    worksheet_id INT,

                    worksheet VARCHAR(100),

                    KONTEN_DIGITAL VARCHAR(100)

                    );              

                    IF isLimit = 1

                    THEN

                            INSERT INTO tempCariArticle

                            SELECT art.id AS id, art.Article_type,art.Creator AS Creator_article, art.title AS title_article, art.content AS content_article, art.subject AS subject_article, art.EDISISERIAL, art.TANGGAL_TERBIT_EDISI_SERIAL, CAT.id CatalogId,CAT.title,CAT.Languages, CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 

                                w.name worksheet,

                                (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') FROM serial_articlefiles WHERE Articles_id = art.id AND art.Catalog_id = CAT.ID) KONTEN_DIGITAL

                              FROM serial_articles art 

                              -- update nambah join ini

                                JOIN serial_articles_repeatable sar ON sar.serial_article_ID = art.id

                              -- batas akhir update 

                              JOIN catalogs CAT ON art.Catalog_id = CAT.ID  

                              lEFT JOIN worksheets w ON w.id = CAT.Worksheet_id

                              WHERE  

                              

                                CASE tag

                                    WHEN 'Judul' THEN art.Title LIKE keyword

                                    -- update filter

                                    WHEN 'Pengarang' THEN (sar.article_field IN ('Kreator','Kontributor') AND sar.value LIKE keyword)

                                    WHEN 'Subyek' THEN (sar.article_field IN ('Subjek') AND sar.value LIKE keyword)

                                    -- batas update filter

                                    /*WHEN 'Pengarang' THEN art.Creator LIKE keyword

                                    WHEN 'Subyek' THEN art.Subject LIKE keyword*/     

                                    WHEN 'Sembarang' THEN 1 = 1

                                END

                              

                                AND CAT.isopac=1 

                                AND art.ISOPAC=1

                                AND w.ISSERIAL = 1

                                GROUP BY art.id

                                LIMIT limit1,limit2;

                                

                    ELSE

                            INSERT INTO tempCariArticle

                            SELECT art.id AS id, art.Article_type,art.Creator AS Creator_article, art.title AS title_article, art.content AS content_article, art.subject AS subject_article, art.EDISISERIAL, art.TANGGAL_TERBIT_EDISI_SERIAL, CAT.id CatalogId,CAT.title,CAT.Languages, CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 

                                w.name worksheet,

                                (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') FROM serial_articlefiles WHERE Articles_id = art.id AND art.Catalog_id = CAT.ID) KONTEN_DIGITAL

                              FROM serial_articles art 

                              -- update nambah join ini

                                JOIN serial_articles_repeatable sar ON sar.serial_article_ID = art.id

                              -- batas akhir update 

                              JOIN catalogs CAT ON art.Catalog_id = CAT.ID  

                              lEFT JOIN worksheets w ON w.id = CAT.Worksheet_id

                              WHERE  

                              

                                CASE tag

                                    WHEN 'Judul' THEN art.Title LIKE keyword

                                    -- update filter

                                    WHEN 'Pengarang' THEN (sar.article_field IN ('Kreator','Kontributor') AND sar.value LIKE keyword)

                                    WHEN 'Subyek' THEN (sar.article_field IN ('Subjek') AND sar.value LIKE keyword)

                                    -- batas update filter

                                    /*WHEN 'Pengarang' THEN art.Creator LIKE keyword

                                    WHEN 'Subyek' THEN art.Subject LIKE keyword*/     

                                    WHEN 'Sembarang' THEN 1 = 1

                                END

                              

                                AND CAT.isopac=1 

                                AND art.ISOPAC=1

                                AND w.ISSERIAL = 1

                                GROUP BY art.id;  

                            

                        END IF;

                              

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempSederhanaOpac123` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempSederhanaOpac123`(
IN keyword TEXT,
IN tag TEXT,
IN worksheet VARCHAR(255),
IN fAuthor TEXT,
IN fPublisher TEXT,
IN fPublishLoc TEXT,
IN fPublishYear TEXT,
IN fSubject TEXT,
IN fromTgl TEXT,
IN toTgl TEXT,
IN isLKD TEXT
)
BEGIN
CREATE  TEMPORARY TABLE tempCariOpac
(
CatalogId            INT(11),
title       TEXT,
author    TEXT,
publisher   TEXT,
PublishLocation  TEXT,
PublishYear TEXT,
Subject TEXT,
CoverURL TEXT,
worksheet_id INT,
worksheet TEXT,
JML_BUKU INT,
ALL_BUKU INT,
KONTEN_DIGITAL VARCHAR(100)
);
IF isLKD = 1
then
 INSERT INTO tempCariOpac
 SELECT distinct CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 
               (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,
                (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < now() || BookingExpiredDate is null)) JML_BUKU,
                 (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,
                 (SELECT GROUP_CONCAT(DISTINCT SUBSTRING(FileURL,(LENGTH(FileURL)-LOCATE('.',REVERSE(FileURL)))+2) SEPARATOR ', ') 
                 FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL
      FROM catalogs CAT 
      	 INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id 
      
      WHERE 
      
      
      EXISTS           
               (SELECT  1
                FROM catalog_ruas R  
                 WHERE 
     
		CASE tag
		WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')
		WHEN 'Pengarang' THEN R.TAG IN ('100','110','700','710')
		WHEN 'Penerbit' THEN R.TAG IN ('260')
		WHEN 'Tahun Terbit' THEN R.TAG IN ('260')
		WHEN 'Subyek' THEN R.TAG IN ('600','610','611','650','651')
		WHEN 'Nomor Panggil' THEN R.TAG IN ('090','082','084','080')
		WHEN 'BIB-ID' THEN R.TAG IN ('035')
		WHEN 'ISBN/ISSN/ISMN' THEN R.TAG IN ('020','022')
		        WHEN 'Semua Ruas' THEN 1 = 1
		END
                AND  R.Value LIKE keyword 
			                 AND R.CATALOGID=CAT.ID
	
                
                ) 
			
        AND
		IF(fAuthor='',1=1,CAT.Author LIKE concat('%',concat(fAuthor,'%'))) AND
		IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND
		IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND
		IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND
        IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND
		
        CAT.isopac=1
        
		
	 HAVING CASE worksheet
		 WHEN 'pdf' THEN KONTEN_DIGITAL = worksheet
		 WHEN 'doc' THEN KONTEN_DIGITAL = worksheet
		 WHEN 'xls' THEN KONTEN_DIGITAL = worksheet
		 WHEN 'rar' THEN KONTEN_DIGITAL = worksheet
         WHEN 'Semua Format File' THEN 1 = 1
        
			END
        ;  
else             
IF worksheet='4' THEN   
INSERT INTO tempCariOpac
SELECT distinct CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 
               (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,
                (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < now() || BookingExpiredDate is null)) JML_BUKU,
                 (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,
                 (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 
                 FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL
      FROM catalogs CAT 
            WHERE EXISTS           
               (SELECT  1
                FROM catalog_ruas R  LEFT JOIN collections col ON col.Catalog_id = R.CATALOGID
                 WHERE 
      							 		
		CASE tag
		WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')
		WHEN 'Pengarang' THEN R.TAG IN ('100','110','700','710')
		WHEN 'Penerbit' THEN R.TAG IN ('260')
		WHEN 'Tahun Terbit' THEN R.TAG IN ('260')
		WHEN 'Subyek' THEN R.TAG LIKE '6%'
		WHEN 'Nomor Panggil' THEN R.TAG IN ('090','082','084','080')
		WHEN 'BIB-ID' THEN R.TAG IN ('035')
		WHEN 'ISBN/ISSN/ISMN' THEN R.TAG IN ('020','022')
		WHEN 'Semua Ruas' THEN R.TAG IN ('240','245','740','100','110','700','710','260','600','610','611','630','650','651','080','082','084','096','022','020')
		END
                
		AND  R.Value LIKE keyword 
         AND IF(fromTgl!='' AND toTgl!='' ,col.TANGGAL_TERBIT_EDISI_SERIAL BETWEEN fromTgl AND toTgl,1=1)
                                AND R.CATALOGID=CAT.ID) 
		AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)
		AND
        IF(fAuthor='',1=1,CAT.Author LIKE concat('%',concat(fAuthor,'%'))) AND
		IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND
		IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND
		IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND
        IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND
		
        CAT.isopac=1 
		;    
else
INSERT INTO tempCariOpac
SELECT distinct CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.subject,CAT.CoverURL ,CAT.Worksheet_id, 
               (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,
                (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND (BookingExpiredDate < now() || BookingExpiredDate is null)) JML_BUKU,
                 (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,
                 (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 
                 FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL
      FROM catalogs CAT 
            WHERE EXISTS           
               (SELECT  1
                FROM catalog_ruas R  
                                 WHERE 
      							 		
		CASE tag
		WHEN 'Judul' THEN R.TAG IN ('240','245','246','440','740')
		WHEN 'Pengarang' THEN R.TAG IN ('100','110','700','710')
		WHEN 'Penerbit' THEN R.TAG IN ('260')
		WHEN 'Tahun Terbit' THEN R.TAG IN ('260')
		WHEN 'Subyek' THEN R.TAG LIKE '6%'
		WHEN 'Nomor Panggil' THEN R.TAG IN ('090','082','084','080')
		WHEN 'BIB-ID' THEN R.TAG IN ('035')
		WHEN 'ISBN/ISSN/ISMN' THEN R.TAG IN ('020','022')
		WHEN 'Semua Ruas' THEN R.TAG IN ('240','245','740','100','110','700','710','260','600','610','611','630','650','651','080','082','084','096','022','020')
		END
                
		AND  R.Value LIKE keyword 
                               AND R.CATALOGID=CAT.ID) 
		AND IF(worksheet='Semua Jenis bahan',1=1,CAT.Worksheet_id = worksheet)
		AND
        IF(fAuthor='',1=1,CAT.Author LIKE concat('%',concat(fAuthor,'%'))) AND
		IF(fPublisher='',1=1,CAT.Publisher LIKE fPublisher) AND
		IF(fPublishLoc='',1=1,CAT.PublishLocation LIKE fPublishLoc) AND
		IF(fPublishYear='',1=1,CAT.PublishYear LIKE fPublishYear) AND
        IF(fSubject='',1=1,CAT.Subject LIKE fSubject) AND
		
        CAT.isopac=1 
		;  
end if;
end if;
END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempTelusurArticle` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempTelusurArticle`(

                        IN tag TEXT,

                        IN findby TEXT,

                        IN fquery TEXT,

                        IN fquery2 TEXT,

                        IN fAuthor TEXT,

                        IN fPublisher TEXT,

                        IN fPublishLoc TEXT,

                        IN fPublishYear TEXT,

                        IN FSubject TEXT,

                        IN fBahasa TEXT,

                        IN isLKD TEXT

                        )
BEGIN

                        DROP TABLE IF EXISTS tempCariArticle;

                        CREATE  TEMPORARY TABLE tempCariArticle

                        (

                        CatalogId            INT(11),

                        title       TEXT,

                        author    TEXT,

                        publisher   TEXT,

                        PublishLocation  TEXT,

                        PublishYear TEXT,

                        SUBJECT TEXT,

                        bahasa TEXT,

                        CoverURL TEXT,

                        worksheet_id INT,

                        worksheet TEXT,

                        ISSERIAL TEXT,

                        JML_BUKU INT,

                        ALL_BUKU INT,

                        KONTEN_DIGITAL VARCHAR(100)

                        );              

                        IF isLKD = 1 THEN

                                INSERT INTO tempCariArticle

                        SELECT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.Subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id,

                                       (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                        (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                        (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND BookingExpiredDate < NOW()) JML_BUKU,

                                         (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                         (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                         FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                              FROM catalogs CAT 

                              INNER JOIN catalogfiles CF ON  CAT.ID = CF.Catalog_id

                              WHERE CAT.isopac=1 AND

                                         IF(fAuthor='',1=1,CAT.Author = fAuthor) AND

                                 IF(fPublisher='',1=1,CAT.Publisher = fPublisher) AND

                                 IF(fPublishLoc='',1=1,CAT.PublishLocation = fPublishLoc) AND

                                 IF(fPublishYear='',1=1,CAT.PublishYear = fPublishYear) AND

                                 IF(fSubject='',1=1,CAT.SUBJECT = fSubject) AND

                                 IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                                CASE tag

                                WHEN 'Author' THEN CAT.Author = fquery2

                                WHEN 'Subject' THEN CAT.subject = fquery2

                                WHEN 'Publisher' THEN CAT.Publisher = fquery2

                                WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery2

                                WHEN 'PublishYear' THEN CAT.PublishYear = fquery2

                                END

                                 AND

                                CASE findBy

                                WHEN 'Alphabetical'  THEN  1=1

                                WHEN 'Author' THEN CAT.Author = fquery

                                WHEN 'Subject' THEN CAT.subject = fquery

                                WHEN 'Publisher' THEN CAT.Publisher = fquery

                                WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery

                                WHEN 'PublishYear' THEN CAT.PublishYear = fquery

                                END;

                                  

                        ELSE

                            INSERT INTO tempCariArticle

                        SELECT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.Subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id,

                                       (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                        (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                        (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND BookingExpiredDate < NOW()) JML_BUKU,

                                         (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                         (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                         FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                              FROM catalogs CAT 

                              WHERE CAT.isopac=1 AND

                                 IF(fAuthor='',1=1,CAT.Author = fAuthor) AND

                                 IF(fPublisher='',1=1,CAT.Publisher = fPublisher) AND

                                 IF(fPublishLoc='',1=1,CAT.PublishLocation = fPublishLoc) AND

                                 IF(fPublishYear='',1=1,CAT.PublishYear = fPublishYear) AND

                                 IF(fSubject='',1=1,CAT.SUBJECT = fSubject) AND

                                 IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                                CASE tag

                                WHEN 'Author' THEN CAT.Author = fquery2

                                WHEN 'Subject' THEN CAT.subject = fquery2

                                WHEN 'Publisher' THEN CAT.Publisher = fquery2

                                WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery2

                                WHEN 'PublishYear' THEN CAT.PublishYear = fquery2

                                END

                                 AND

                                CASE findBy

                                WHEN 'Alphabetical'  THEN  1=1

                                WHEN 'Author' THEN CAT.Author = fquery

                                WHEN 'Subject' THEN CAT.subject = fquery

                                WHEN 'Publisher' THEN CAT.Publisher = fquery

                                WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery

                                WHEN 'PublishYear' THEN CAT.PublishYear = fquery

                                END;

                                  

                        END IF;

                        END */$$
DELIMITER ;

/* Procedure structure for procedure `insertTempTelusurOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTempTelusurOpac`(

                    IN tag TEXT,

                    IN findby TEXT,

                    IN fquery TEXT,

                    IN fquery2 TEXT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN FSubject TEXT,

                    IN fBahasa TEXT,

                    IN isLKD TEXT

                    )
BEGIN

                    DROP TABLE IF EXISTS tempCariOpac;

                    CREATE  TEMPORARY TABLE tempCariOpac

                    (

                    CatalogId            INT(11),

                    title       TEXT,

                    author    TEXT,

                    publisher   TEXT,

                    PublishLocation  TEXT,

                    PublishYear TEXT,

                    Subject TEXT,

                    bahasa TEXT,

                    CoverURL TEXT,

                    worksheet_id INT,

                    worksheet TEXT,

                    ISSERIAL TEXT,

                    JML_BUKU INT,

                    ALL_BUKU INT,

                    KONTEN_DIGITAL VARCHAR(100)

                    );              

                    if isLKD = 1 then

                            INSERT INTO tempCariOpac

                    SELECT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.Subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id,

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                    (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND BookingExpiredDate < now()) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                          INNER JOIN catalogfiles CF on  CAT.ID = CF.Catalog_id

                          WHERE CAT.isopac=1 AND

                                     IF(fAuthor='',1=1,CAT.Author = fAuthor) AND

                             IF(fPublisher='',1=1,CAT.Publisher = fPublisher) AND

                             IF(fPublishLoc='',1=1,CAT.PublishLocation = fPublishLoc) AND

                             IF(fPublishYear='',1=1,CAT.PublishYear = fPublishYear) AND

                             IF(fSubject='',1=1,CAT.SUBJECT = fSubject) AND

                             IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            CASE tag

                            WHEN 'Author' THEN CAT.Author = fquery2

                            WHEN 'Subject' THEN CAT.subject = fquery2

                            WHEN 'Publisher' THEN CAT.Publisher = fquery2

                            WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery2

                            WHEN 'PublishYear' THEN CAT.PublishYear = fquery2

                            END

                             AND

                            CASE findBy

                            When 'Alphabetical'  THEN  1=1

                            WHEN 'Author' THEN CAT.Author = fquery

                            WHEN 'Subject' THEN CAT.subject = fquery

                            WHEN 'Publisher' THEN CAT.Publisher = fquery

                            WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery

                            WHEN 'PublishYear' THEN CAT.PublishYear = fquery

                            END;

                              

                    else

                        INSERT INTO tempCariOpac

                    SELECT CAT.id CatalogId,CAT.title,CAT.author,CAT.publisher,CAT.PublishLocation,CAT.PublishYear,CAT.Subject,CAT.Languages,CAT.CoverURL ,CAT.Worksheet_id,

                                   (SELECT NAME FROM worksheets WHERE id=CAT.Worksheet_id) worksheet,

                                    (SELECT ISSERIAL FROM worksheets WHERE id=CAT.Worksheet_id) ISSERIAL,

                                    (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID AND STATUS_ID=1 AND BookingExpiredDate < now()) JML_BUKU,

                                     (SELECT COUNT(1) FROM collections WHERE CATALOG_ID=CAT.ID) ALL_BUKU,

                                     (SELECT GROUP_CONCAT(DISTINCT SUBSTR(fileURL,INSTR(fileURL, '.')+1) SEPARATOR ', ') 

                                     FROM catalogfiles WHERE Catalog_id = CAT.ID) KONTEN_DIGITAL

                          FROM catalogs CAT 

                          WHERE CAT.isopac=1 AND

                             IF(fAuthor='',1=1,CAT.Author = fAuthor) AND

                             IF(fPublisher='',1=1,CAT.Publisher = fPublisher) AND

                             IF(fPublishLoc='',1=1,CAT.PublishLocation = fPublishLoc) AND

                             IF(fPublishYear='',1=1,CAT.PublishYear = fPublishYear) AND

                             IF(fSubject='',1=1,CAT.SUBJECT = fSubject) AND

                             IF(fBahasa='',1=1,CAT.Languages LIKE fBahasa) AND

                            CASE tag

                            WHEN 'Author' THEN CAT.Author = fquery2

                            WHEN 'Subject' THEN CAT.subject = fquery2

                            WHEN 'Publisher' THEN CAT.Publisher = fquery2

                            WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery2

                            WHEN 'PublishYear' THEN CAT.PublishYear = fquery2

                            END

                             AND

                            CASE findBy

                            When 'Alphabetical'  THEN  1=1

                            WHEN 'Author' THEN CAT.Author = fquery

                            WHEN 'Subject' THEN CAT.subject = fquery

                            WHEN 'Publisher' THEN CAT.Publisher = fquery

                            WHEN 'PublishLocation' THEN CAT.PublishLocation = fquery

                            WHEN 'PublishYear' THEN CAT.PublishYear = fquery

                            END;

                              

                    end if;

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `newCollectionOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `newCollectionOpac`()
BEGIN
SELECT c.id AS id, c.title AS title, c.author AS author, c.PublishLocation AS PublishLocation, 
				c.publishyear AS YEAR, CONCAT(c.PublishLocation, '  ' , c.Publisher, '  ' ,c.publishyear) AS penerbitan, 
				c.publisher AS publisher,  c.publishyear AS YEAR, CONCAT(c.publisher, ' : ', c.publishyear) AS penerbitan,
				s.CreateDate, w.name AS wn, TRIM(c.coverurl) AS coverurl, c.callnumber AS callnumber
				FROM collections s 
               INNER JOIN catalogs c ON c.id = s.catalog_id 
                              LEFT JOIN worksheets w ON w.ID = c.Worksheet_id 
               WHERE c.isopac =1 
               GROUP BY c.id 
               ORDER BY s.createdate DESC;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `pencarianLanjutLimitOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `pencarianLanjutLimitOpac`(

                    IN limit1 INT, 

                    IN limit2 INT,

                    IN fAuthor TEXT,

                    IN fPublisher TEXT,

                    IN fPublishLoc TEXT,

                    IN fPublishYear TEXT,

                    IN fSubject TEXT,

                    IN fBahasa TEXT

                    )
BEGIN

                    SELECT CatalogId,title kalimat2,author,publisher,PublishLocation,PublishYear,Subject,bahasa,CoverURL,

                                   worksheet_id,worksheet,

                                    JML_BUKU,

                                    ALL_BUKU,

                                    KONTEN_DIGITAL

                          FROM tempCariOpac

                          

                          WHERE 

                                IF(fAuthor='',1=1,author = fAuthor) AND

                          IF(fPublisher='',1=1,publisher = fPublisher) AND

                          IF(fPublishLoc='',1=1,PublishLocation = fPublishLoc) AND

                          IF(fPublishYear='',1=1,PublishYear = fPublishYear) AND

                          IF(fBahasa='',1=1,bahasa LIKE fBahasa) AND

                          IF(fSubject='',1=1,Subject = fSubject) 

                          

                          

                          LIMIT limit1,limit2;    

                    END */$$
DELIMITER ;

/* Procedure structure for procedure `pencarianSederhanaOpacLimit1` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `pencarianSederhanaOpacLimit1`(

                IN limit1 INT, 

                IN limit2 INT,

                IN fAuthor TEXT,

                IN fPublisher TEXT,

                IN fPublishLoc TEXT,

                IN fPublishYear TEXT,

                IN fSubject TEXT,

                IN fBahasa TEXT

                )
BEGIN

                SELECT *

                      FROM tempCariOpac 

                      

                      WHERE 

                     IF(fAuthor='',1=1,author LIKE concat('%',concat(fAuthor,'%'))) AND

                           IF(fPublisher='',1=1,publisher LIKE fPublisher) AND

                      IF(fPublishLoc='',1=1,PublishLocation LIKE fPublishLoc) AND

                      IF(fPublishYear='',1=1,PublishYear LIKE fPublishYear) AND

                      IF(fBahasa='',1=1,bahasa LIKE fBahasa) AND

                       IF(fSubject='',1=1,Subject LIKE fSubject)

                      

                      

                      LIMIT limit1,limit2;    

                END */$$
DELIMITER ;

/* Procedure structure for procedure `topCollectionOpac` */

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `topCollectionOpac`()
BEGIN
SELECT COUNT(collection_id) entry, c.title AS title, c.id AS id, c.author AS author,
				c.PublishLocation AS PublishLocation, c.publishyear AS YEAR, 
				CONCAT(c.PublishLocation, '  ',  c.Publisher, '  ' ,c.publishyear) AS penerbitan, w.name AS wn,
				c.publisher AS publisher, c.publishyear AS YEAR, CONCAT(c.publisher, ' : ', c.publishyear) AS penerbitan, 
				TRIM(c.coverurl) AS coverurl,  c.callnumber AS callnumber
				
FROM collectionloanitems h 
               INNER JOIN collections s ON s.id = h.collection_id 
               INNER JOIN catalogs c ON c.id = s.catalog_id and c.ISOPAC =1 
                LEFT JOIN worksheets w ON w.ID = c.Worksheet_id 
               GROUP BY c.id ORDER BY entry DESC;
    END */$$
DELIMITER ;

/*Table structure for table `item_koleksi` */


/*!50001 CREATE TABLE  `item_koleksi`(
 `periode` varchar(6) ,
 `bulan` int(2) ,
 `tahun` int(4) ,
 `jumlah_eksemplar` bigint(21) 
)*/;

/*Table structure for table `v_abjadopac` */


/*!50001 CREATE TABLE  `v_abjadopac`(
 `A` varchar(1) 
)*/;

/*Table structure for table `v_lap_kriteria_anggota` */


/*!50001 CREATE TABLE  `v_lap_kriteria_anggota`(
 `kriteria` varchar(14) ,
 `id_dtl_anggota` varchar(255) ,
 `dtl_anggota` varchar(255) 
)*/;

/*Table structure for table `v_lap_kriteria_koleksi` */


/*!50001 CREATE TABLE  `v_lap_kriteria_koleksi`(
 `kriteria` varchar(19) ,
 `id_dtl_kriteria` text ,
 `dtl_kriteria` text 
)*/;

/*Table structure for table `v_pertumb_jml_kunjungan` */


/*!50001 CREATE TABLE  `v_pertumb_jml_kunjungan`(
 `kriteria` varchar(10) ,
 `tahun` bigint(20) ,
 `jumlah` bigint(21) 
)*/;

/*Table structure for table `v_pertumb_jml_kunjungan_bulanan` */


/*!50001 CREATE TABLE  `v_pertumb_jml_kunjungan_bulanan`(
 `kriteria` varchar(10) ,
 `tahun` bigint(20) ,
 `bulan` bigint(20) ,
 `jumlah` decimal(32,0) 
)*/;

/*Table structure for table `v_stat_anggota` */


/*!50001 CREATE TABLE  `v_stat_anggota`(
 `tahun` int(4) ,
 `bulan` int(2) ,
 `jumlah` bigint(21) ,
 `jenisanggota` varchar(50) ,
 `IDjenisanggota` int(11) 
)*/;

/*Table structure for table `v_stat_colectionloan` */


/*!50001 CREATE TABLE  `v_stat_colectionloan`(
 `tahun` int(4) ,
 `bulan` int(1) ,
 `jumlah_judul` int(2) ,
 `jumlah_eksemplar` int(3) ,
 `jumlah_dijital` int(2) 
)*/;

/*Table structure for table `v_stat_jenis_pendidikan` */


/*!50001 CREATE TABLE  `v_stat_jenis_pendidikan`(
 `Keterangan` varchar(50) ,
 `Jumlah` bigint(21) ,
 `Tahun` varchar(4) ,
 `bulan` int(2) 
)*/;

/*Table structure for table `v_stat_jumlah_koleksi` */


/*!50001 CREATE TABLE  `v_stat_jumlah_koleksi`(
 `bulan` int(2) ,
 `tahun` int(4) ,
 `jumlah_judul` bigint(21) ,
 `jumlah_eksemplar` bigint(21) ,
 `jumlah_dijital` bigint(21) 
)*/;

/*Table structure for table `v_stat_kelas_subjek` */


/*!50001 CREATE TABLE  `v_stat_kelas_subjek`(
 `Keterangan` varchar(255) ,
 `Jumlah` int(11) ,
 `Tahun` int(4) 
)*/;

/*Table structure for table `v_stat_koleksi_dipinjam_eksemplar` */


/*!50001 CREATE TABLE  `v_stat_koleksi_dipinjam_eksemplar`(
 `tahun` int(4) ,
 `bulan` int(2) ,
 `jumlah_eksemplar` bigint(21) 
)*/;

/*Table structure for table `v_stat_koleksi_dipinjam_judul` */


/*!50001 CREATE TABLE  `v_stat_koleksi_dipinjam_judul`(
 `tahun` int(4) ,
 `bulan` int(2) ,
 `jumlah_judul` bigint(21) 
)*/;

/*Table structure for table `v_stat_pendidikan` */


/*!50001 CREATE TABLE  `v_stat_pendidikan`(
 `Nama` varchar(50) ,
 `Jumlah` int(11) ,
 `Tahun` int(4) 
)*/;

/*Table structure for table `v_stat_rangeumur_kunj` */


/*!50001 CREATE TABLE  `v_stat_rangeumur_kunj`(
 `Keterangan` varchar(200) ,
 `Tahun` varchar(4) ,
 `Jumlah` bigint(21) 
)*/;

/*Table structure for table `v_stat_rangeumur_kunj_bulanan` */


/*!50001 CREATE TABLE  `v_stat_rangeumur_kunj_bulanan`(
 `Keterangan` varchar(200) ,
 `Tahun` varchar(4) ,
 `bulan` int(2) ,
 `Jumlah` bigint(21) 
)*/;

/*View structure for view item_koleksi */

/*!50001 DROP TABLE IF EXISTS `item_koleksi` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `item_koleksi` AS select concat(year(`collections`.`CreateDate`),lpad(month(`collections`.`CreateDate`),2,0)) AS `periode`,month(`collections`.`CreateDate`) AS `bulan`,year(`collections`.`CreateDate`) AS `tahun`,count('*') AS `jumlah_eksemplar` from `collections` group by month(`collections`.`CreateDate`),year(`collections`.`CreateDate`) */;

/*View structure for view v_abjadopac */

/*!50001 DROP TABLE IF EXISTS `v_abjadopac` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_abjadopac` AS select 'A' AS `A` union all select 'B' AS `B` union all select 'C' AS `C` union all select 'D' AS `D` union all select 'E' AS `E` union all select 'F' AS `F` union all select 'G' AS `G` union all select 'H' AS `H` union all select 'I' AS `I` union all select 'J' AS `J` union all select 'K' AS `K` union all select 'L' AS `L` union all select 'M' AS `M` union all select 'N' AS `N` union all select 'O' AS `O` union all select 'P' AS `P` union all select 'Q' AS `Q` union all select 'R' AS `R` union all select 'S' AS `S` union all select 'T' AS `T` union all select 'U' AS `U` union all select 'V' AS `V` union all select 'W' AS `W` union all select 'X' AS `X` union all select 'Y' AS `Y` union all select 'Z' AS `Z` */;

/*View structure for view v_lap_kriteria_anggota */

/*!50001 DROP TABLE IF EXISTS `v_lap_kriteria_anggota` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_lap_kriteria_anggota` AS select distinct 'Pekerjaan' AS `kriteria`,`master_pekerjaan`.`Pekerjaan` AS `id_dtl_anggota`,`master_pekerjaan`.`Pekerjaan` AS `dtl_anggota` from `master_pekerjaan` union all select distinct 'Pendidikan' AS `kriteria`,`master_pendidikan`.`Nama` AS `id_dtl_anggota`,`master_pendidikan`.`Nama` AS `dtl_anggota` from `master_pendidikan` union all select distinct 'Status_Anggota' AS `kriteria`,`status_anggota`.`Nama` AS `id_dtl_anggota`,`status_anggota`.`Nama` AS `dtl_anggota` from `status_anggota` union all select distinct 'Jenis_Anggota' AS `kriteria`,`jenis_anggota`.`jenisanggota` AS `id_dtl_anggota`,`jenis_anggota`.`jenisanggota` AS `dtl_anggota` from `jenis_anggota` union all select distinct 'Kelas' AS `kriteria`,`kelas_siswa`.`namakelassiswa` AS `id_dtl_anggota`,`kelas_siswa`.`namakelassiswa` AS `dtl_anggota` from `kelas_siswa` union all select distinct 'Fakultas' AS `kriteria`,`master_fakultas`.`Nama` AS `id_dtl_anggota`,`master_fakultas`.`Nama` AS `dtl_anggota` from `master_fakultas` union all select distinct 'Jurusan' AS `kriteria`,`master_jurusan`.`Nama` AS `id_dtl_anggota`,`master_jurusan`.`Nama` AS `dtl_anggota` from `master_jurusan` */;

/*View structure for view v_lap_kriteria_koleksi */

/*!50001 DROP TABLE IF EXISTS `v_lap_kriteria_koleksi` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_lap_kriteria_koleksi` AS select distinct 'PublishLocation' AS `kriteria`,`catalogs`.`PublishLocation` AS `id_dtl_kriteria`,`catalogs`.`PublishLocation` AS `dtl_kriteria` from `catalogs` union all select distinct 'Publisher' AS `kriteria`,`catalogs`.`Publisher` AS `id_dtl_kriteria`,`catalogs`.`Publisher` AS `dtl_kriteria` from `catalogs` union all select distinct 'PublishYear' AS `kriteria`,`catalogs`.`PublishYear` AS `id_dtl_kriteria`,`catalogs`.`PublishYear` AS `dtl_kriteria` from `catalogs` union all select distinct 'Subject' AS `kriteria`,`catalogs`.`Subject` AS `id_dtl_kriteria`,`catalogs`.`Subject` AS `dtl_kriteria` from `catalogs` union all select 'location_library' AS `kriteria`,`location_library`.`ID` AS `id_dtl_kriteria`,`location_library`.`Name` AS `dtl_kriteria` from `location_library` union all select 'locations' AS `kriteria`,`locations`.`ID` AS `id_dtl_kriteria`,`locations`.`Name` AS `dtl_kriteria` from `locations` union all select 'collectionsources' AS `kriteria`,`collectionsources`.`ID` AS `id_dtl_kriteria`,`collectionsources`.`Name` AS `dtl_kriteria` from `collectionsources` union all select 'partners' AS `kriteria`,`partners`.`ID` AS `id_dtl_kriteria`,`partners`.`Name` AS `dtl_kriteria` from `partners` union all select 'currency' AS `kriteria`,`currency`.`Currency` AS `id_dtl_kriteria`,concat(`currency`.`Currency`,' - ',`currency`.`Description`) AS `dtl_kriteria` from `currency` union all select 'collectioncategorys' AS `kriteria`,`collectioncategorys`.`ID` AS `id_dtl_kriteria`,`collectioncategorys`.`Name` AS `dtl_kriteria` from `collectioncategorys` union all select 'collectionrules' AS `kriteria`,`collectionrules`.`ID` AS `id_dtl_kriteria`,`collectionrules`.`Name` AS `dtl_kriteria` from `collectionrules` union all select 'worksheets' AS `kriteria`,`worksheets`.`ID` AS `id_dtl_kriteria`,`worksheets`.`Name` AS `dtl_kriteria` from `worksheets` union all select 'collectionmedias' AS `kriteria`,`collectionmedias`.`ID` AS `id_dtl_kriteria`,`collectionmedias`.`Name` AS `dtl_kriteria` from `collectionmedias` union all select 'no_klas' AS `kriteria`,`master_kelas_besar`.`kdKelas` AS `id_dtl_kriteria`,`master_kelas_besar`.`namakelas` AS `dtl_kriteria` from `master_kelas_besar` union all select 'createby' AS `kriteria`,`users`.`ID` AS `id_dtl_kriteria`,`users`.`username` AS `dtl_kriteria` from `users` union all select 'Members' AS `kriteria`,`members`.`ID` AS `id_dtl_kriteria`,concat(`members`.`MemberNo`,' - ',`members`.`Fullname`) AS `dtl_kriteria` from `members` */;

/*View structure for view v_pertumb_jml_kunjungan */

/*!50001 DROP TABLE IF EXISTS `v_pertumb_jml_kunjungan` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_pertumb_jml_kunjungan` AS select 'ANGGOTA' AS `kriteria`,year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,count(0) AS `jumlah` from `memberguesses` where (`memberguesses`.`NoAnggota` is not null) group by year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) union all select 'NONANGGOTA' AS `kriteria`,year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,count(0) AS `jumlah` from `memberguesses` where isnull(`memberguesses`.`NoAnggota`) group by year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) union all select 'ROMBONGAN' AS `kriteria`,year(str_to_date(`groupguesses`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,count(0) AS `jumlah` from `groupguesses` group by year(str_to_date(`groupguesses`.`CreateDate`,'%Y-%m-%d')) */;

/*View structure for view v_pertumb_jml_kunjungan_bulanan */

/*!50001 DROP TABLE IF EXISTS `v_pertumb_jml_kunjungan_bulanan` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_pertumb_jml_kunjungan_bulanan` AS select 'ANGGOTA' AS `kriteria`,year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,month(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,count(0) AS `jumlah` from `memberguesses` where (`memberguesses`.`NoAnggota` is not null) group by year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')),month(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) union all select 'NONANGGOTA' AS `kriteria`,year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,month(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,count(0) AS `jumlah` from `memberguesses` where isnull(`memberguesses`.`NoAnggota`) group by year(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')),month(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) union all select 'ROMBONGAN' AS `kriteria`,year(str_to_date(`groupguesses`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,month(str_to_date(`groupguesses`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,sum(`groupguesses`.`CountPersonel`) AS `jumlah` from `groupguesses` group by year(str_to_date(`groupguesses`.`CreateDate`,'%Y-%m-%d')),month(str_to_date(`groupguesses`.`CreateDate`,'%Y-%m-%d')) order by `tahun` */;

/*View structure for view v_stat_anggota */

/*!50001 DROP TABLE IF EXISTS `v_stat_anggota` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_anggota` AS select year(str_to_date(`members`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,month(str_to_date(`members`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,count(0) AS `jumlah`,`jenis_anggota`.`jenisanggota` AS `jenisanggota`,`jenis_anggota`.`id` AS `IDjenisanggota` from (`members` left join `jenis_anggota` on((`jenis_anggota`.`id` = `members`.`JenisAnggota_id`))) group by year(str_to_date(`members`.`CreateDate`,'%Y-%m-%d')),month(str_to_date(`members`.`CreateDate`,'%Y-%m-%d')),`jenis_anggota`.`id` */;

/*View structure for view v_stat_colectionloan */

/*!50001 DROP TABLE IF EXISTS `v_stat_colectionloan` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_colectionloan` AS select 2015 AS `tahun`,2 AS `bulan`,10 AS `jumlah_judul`,100 AS `jumlah_eksemplar`,20 AS `jumlah_dijital` */;

/*View structure for view v_stat_jenis_pendidikan */

/*!50001 DROP TABLE IF EXISTS `v_stat_jenis_pendidikan` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_jenis_pendidikan` AS select `mp`.`Nama` AS `Keterangan`,count(`mem`.`ID`) AS `Jumlah`,date_format(`mem`.`CreateDate`,'%Y') AS `Tahun`,month(str_to_date(`mem`.`CreateDate`,'%Y-%m-%d')) AS `bulan` from (`master_pendidikan` `mp` left join `members` `mem` on((`mem`.`EducationLevel_id` = `mp`.`id`))) where (`mem`.`EducationLevel_id` is not null) group by `mp`.`Nama`,date_format(`mem`.`CreateDate`,'%Y'),month(str_to_date(`mem`.`CreateDate`,'%Y-%m-%d')) order by `mp`.`id`,`mem`.`CreateDate` */;

/*View structure for view v_stat_jumlah_koleksi */

/*!50001 DROP TABLE IF EXISTS `v_stat_jumlah_koleksi` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_jumlah_koleksi` AS select `item_koleksi`.`bulan` AS `bulan`,`item_koleksi`.`tahun` AS `tahun`,(select count(0) from `catalogs` where (concat(year(`catalogs`.`CreateDate`),lpad(month(`catalogs`.`CreateDate`),2,0)) = `item_koleksi`.`periode`)) AS `jumlah_judul`,`item_koleksi`.`jumlah_eksemplar` AS `jumlah_eksemplar`,(select count(0) from `catalogfiles` where (concat(year(`catalogfiles`.`CreateDate`),lpad(month(`catalogfiles`.`CreateDate`),2,0)) = `item_koleksi`.`periode`)) AS `jumlah_dijital` from `item_koleksi` */;

/*View structure for view v_stat_kelas_subjek */

/*!50001 DROP TABLE IF EXISTS `v_stat_kelas_subjek` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_kelas_subjek` AS select `master_kelas_besar`.`namakelas` AS `Keterangan`,`master_kelas_besar`.`ID` AS `Jumlah`,2015 AS `Tahun` from `master_kelas_besar` */;

/*View structure for view v_stat_koleksi_dipinjam_eksemplar */

/*!50001 DROP TABLE IF EXISTS `v_stat_koleksi_dipinjam_eksemplar` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_koleksi_dipinjam_eksemplar` AS select year(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,month(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,count(0) AS `jumlah_eksemplar` from `collectionloanitems` `colit` where (`colit`.`CreateDate` between (now() + interval -(12) month) and (now() + interval -(1) month)) group by year(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')),month(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')) */;

/*View structure for view v_stat_koleksi_dipinjam_judul */

/*!50001 DROP TABLE IF EXISTS `v_stat_koleksi_dipinjam_judul` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_koleksi_dipinjam_judul` AS select year(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')) AS `tahun`,month(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,count(distinct `colit`.`Collection_id`) AS `jumlah_judul` from `collectionloanitems` `colit` where (`colit`.`CreateDate` between (now() + interval -(12) month) and (now() + interval -(1) month)) group by year(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')),month(str_to_date(`colit`.`CreateDate`,'%Y-%m-%d')) */;

/*View structure for view v_stat_pendidikan */

/*!50001 DROP TABLE IF EXISTS `v_stat_pendidikan` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_pendidikan` AS select `master_pendidikan`.`Nama` AS `Nama`,`master_pendidikan`.`id` AS `Jumlah`,2015 AS `Tahun` from `master_pendidikan` */;

/*View structure for view v_stat_rangeumur_kunj */

/*!50001 DROP TABLE IF EXISTS `v_stat_rangeumur_kunj` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_rangeumur_kunj` AS select `KATEGORY_UMUR`(`members`.`DateOfBirth`) AS `Keterangan`,date_format(`memberguesses`.`CreateDate`,'%Y') AS `Tahun`,count(`memberguesses`.`ID`) AS `Jumlah` from (`memberguesses` join `members` on((`memberguesses`.`NoAnggota` = `members`.`MemberNo`))) where (cast(`memberguesses`.`CreateDate` as date) between '2010-01-01' and '2016-12-31') group by `KATEGORY_UMUR`(`members`.`DateOfBirth`),date_format(`memberguesses`.`CreateDate`,'%Y') order by date_format(`memberguesses`.`CreateDate`,'%Y') desc,count(`memberguesses`.`ID`) desc */;

/*View structure for view v_stat_rangeumur_kunj_bulanan */

/*!50001 DROP TABLE IF EXISTS `v_stat_rangeumur_kunj_bulanan` */;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_stat_rangeumur_kunj_bulanan` AS select `KATEGORY_UMUR`(`members`.`DateOfBirth`) AS `Keterangan`,date_format(`memberguesses`.`CreateDate`,'%Y') AS `Tahun`,month(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) AS `bulan`,count(`memberguesses`.`ID`) AS `Jumlah` from (`memberguesses` join `members` on((`memberguesses`.`NoAnggota` = `members`.`MemberNo`))) group by `KATEGORY_UMUR`(`members`.`DateOfBirth`),date_format(`memberguesses`.`CreateDate`,'%Y'),month(str_to_date(`memberguesses`.`CreateDate`,'%Y-%m-%d')) order by date_format(`memberguesses`.`CreateDate`,'%Y') desc,count(`memberguesses`.`ID`) desc */;

