-- --------------------------------------------------------
-- Server OS:                    Linux
-- HeidiSQL Version:             11.0.0.5919
-- --------------------------------------------------------


USE cssd;

-- Dumping structure for trigger cssd.petugas_kegiatan_after_update
SET @OLDTMP_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_ENGINE_SUBSTITUTION';
DELIMITER //
CREATE TRIGGER `petugas_kegiatan_after_update` AFTER UPDATE ON `petugas_kegiatan` FOR EACH ROW BEGIN

	IF NEW.STATUS = 2 THEN
		UPDATE cssd.pengembalian_alat pa 
		   SET pa.STATUS = 2
		 WHERE pa.PENERIMAAN_ALAT_KOTOR = OLD.PENERIMAAN_ALAT_KOTOR;
	END IF;

END//
DELIMITER ;

