<commit_before>define(["jquery", "knockout", "notify"], function($, ko){
	
	function ViewModel() {
		var self = this;
		self.tlhpList = ko.observableArray();
		self.tlhpListEnable = ko.observable(false);
		
		self.choosenYear = ko.observable();
		self.choosenLhpId = ko.observable();
		
		self.getLhp = function() {
			var reqYear = self.choosenYear();
			$.ajax({
				type: "GET",
				url: site_url+"tlhp/addlhp/get_all/"+ reqYear,
				beforeSend: function(){
					self.tlhpList.removeAll();
				},
				success: function(data) {
					for (var i=0; i< data.length; i++) {
						self.tlhpList.push(data[i]);
					}
				},
				error: function(xhr, msg) {
					alert("Sory, there is something wrong in our system");
				}
			});
			
		}
		self.choosenTlhpTitle = ko.observable();
		self.choosenTlhpTitle.subscribe(function(val){
			console.debug(val);
			$("#lhp_id").attr("value", val.lhp_id);
		});
		
		self.choosenYear.subscribe(function(val){
			self.tlhpListEnable(true);
		});
		
		self.doEdit = function() {
			var selectedLhp = self.choosenTlhpTitle();
			if (selectedLhp == undefined) {
				alert("Lhp tidak boleh kosong");
			} else {
				window.location = site_url+"tlhp/lhp/edit?lhp_id="+selectedLhp.lhp_id;
			}
		}
		<commit_msg>rename redirect controller<commit_after>define(["jquery", "knockout", "notify"], function($, ko){
	
	function ViewModel() {
		var self = this;
		self.tlhpList = ko.observableArray();
		self.tlhpListEnable = ko.observable(false);
		
		self.choosenYear = ko.observable();
		self.choosenLhpId = ko.observable();
		
		self.getLhp = function() {
			var reqYear = self.choosenYear();
			$.ajax({
				type: "GET",
				url: site_url+"tlhp/addlhp/get_all/"+ reqYear,
				beforeSend: function(){
					self.tlhpList.removeAll();
				},
				success: function(data) {
					for (var i=0; i< data.length; i++) {
						self.tlhpList.push(data[i]);
					}
				},
				error: function(xhr, msg) {
					alert("Sory, there is something wrong in our system");
				}
			});
			
		}
		self.choosenTlhpTitle = ko.observable();
		self.choosenTlhpTitle.subscribe(function(val){
			console.debug(val);
			$("#lhp_id").attr("value", val.lhp_id);
		});
		
		self.choosenYear.subscribe(function(val){
			self.tlhpListEnable(true);
		});
		
		self.doEdit = function() {
			var selectedLhp = self.choosenTlhpTitle();
			if (selectedLhp == undefined) {
				alert("Lhp tidak boleh kosong");
			} else {
				window.location = site_url+"tlhp/kkt/edit?lhp_id="+selectedLhp.lhp_id;
			}
		}
		
{'fraction_non_alphanumeric': 0.16753507014028057, 'fraction_numerical': 0.0008016032064128256, 'mean_word_length': 3.340869565217391, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1647454', 'n_tokens_mistral': 1107, 'n_tokens_neox': 900, 'n_words': 152}