			</div><!-- End Dv Container-fluid -->
			<!-- END PAGE CONTAINER--> 

		</div>

		<!-- END PAGE -->    

	</div>

	<!-- END CONTAINER -->

	<!-- BEGIN FOOTER -->

	<div class="footer">

		<div class="footer-inner">

			<?php echo date('Y');?> &copy; <?php echo $this->lang->line('website_name');?>.

		</div>

		<div class="footer-tools">

			<span class="go-top">

			<i class="icon-angle-up"></i>

			</span>

		</div>

	</div>

	<!-- END FOOTER -->

	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

	<!-- BEGIN CORE PLUGINS -->

	<script src="<?php echo base_url();?>assets/js/jquery-1.10.1.min.js" type="text/javascript"></script>

	<script src="<?php echo base_url();?>assets/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

	<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

	<script src="<?php echo base_url();?>assets/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>      

	<script src="<?php echo base_url();?>assets/js/bootstrap.min.js" type="text/javascript"></script>

	<!--[if lt IE 9]>

	<script src="<?php echo base_url();?>assets/js/excanvas.min.js"></script>

	<script src="<?php echo base_url();?>assets/js/respond.min.js"></script>  

	<![endif]-->   

	<script src="<?php echo base_url();?>assets/js/jquery.slimscroll.min.js" type="text/javascript"></script>

	<script src="<?php echo base_url();?>assets/js/jquery.blockui.min.js" type="text/javascript"></script>  

	<script src="<?php echo base_url();?>assets/js/jquery.cookie.min.js" type="text/javascript"></script>

	<script src="<?php echo base_url();?>assets/js/jquery.uniform.min.js" type="text/javascript" ></script>

	<!-- END CORE PLUGINS -->

	<!-- BEGIN PAGE LEVEL PLUGINS -->

	<script type="text/javascript" src="<?php echo base_url();?>assets/js/select2.min.js"></script>
	
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/wysihtml5-0.3.0.js"></script> 
	
	<?php if($this->uri->segment(1) == 'announcement') {?>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.form.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/tinymce/tinymce.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>assets/js/tinymce/jquery.tinymce.min.js"></script>
	<?php } else {?>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap-wysihtml5.js"></script>
	<?php }?>
	
	<script>
		var js_text_records_per_page = "<?php echo $this->lang->line('js_text_records_per_page');?> ";
		var js_no_matching_records_found = "<?php echo $this->lang->line('js_no_matching_records_found');?> ";
		var js_filtered = "<?php echo $this->lang->line('js_filtered');?> ";
		var js_text_search = "<?php echo $this->lang->line('js_text_search');?> ";
		var js_text_prev = "<?php echo $this->lang->line('js_text_prev');?> ";
		var js_text_next = "<?php echo $this->lang->line('js_text_next');?> ";
		var js_text_show_info = "<?php echo $this->lang->line('js_text_show_info');?> ";
		var js_text_show_info_empty = "<?php echo $this->lang->line('js_text_show_info_empty');?> ";
		var js_text_loading = "<?php echo $this->lang->line('js_text_loading');?> ";
		var js_text_processing = "<?php echo $this->lang->line('js_text_processing');?> ";
	</script>
	
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.dataTables.js"></script>

	<script type="text/javascript" src="<?php echo base_url();?>assets/js/DT_bootstrap.js"></script>
	
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap-datepicker.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap-datetimepicker.js"></script>
	
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.tagsinput.min.js"></script>

	<!-- END PAGE LEVEL PLUGINS -->

	<!-- BEGIN PAGE LEVEL SCRIPTS -->

	<script src="<?php echo base_url();?>assets/js/app.js"></script>     

	<script src="<?php echo base_url();?>assets/js/table-editable.js"></script> 	
	
	<script src="<?php echo base_url();?>assets/js/form-components.js"></script>  
	
	<?php if($this->uri->segment(1) == 'member') {?>
	<script>
		var js_text_checking = "<?php echo $this->lang->line('js_text_checking');?>";
		var js_text_registration_check_existing_of_placement = "<?php echo $this->lang->line('registration_check_existing_of_placement');?>";
	</script>
	
	<script src="<?php echo base_url();?>assets/js/custom.js"></script>  
	<?php }?>

	<!-- END PAGE LEVEL SCRIPTS -->

	<script>

		jQuery(document).ready(function() {       

		   // initiate layout and plugins

		   App.init();
		   
		   TableEditable.init();
		   
		   FormComponents.init();

		});

	</script>
	
	<?php 
		if($this->uri->segment(1) == 'member' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>member/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
			
			$('#search_register_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});

		function resetRolling(mid){
			var confirm_txt = '<?php echo $this->lang->line('registration_confirm_message')?>';
			var success_txt = '<?php echo $this->lang->line('registration_reset_rolling_successful_message')?>';
			var fail_txt = '<?php echo $this->lang->line('registration_reset_rolling_fail_message')?>';
			var r = confirm(confirm_txt);
			if (r == true) {
				$.post('<?php echo base_url();?>member/reset_rolling_gaming/', {
						member_id: mid,
						csrf_ssg_ad_token: '<?php echo $this->security->get_csrf_hash();?>'
					},
					function(data){
						if(data == 1){
							$('#rolling_gaming_' + mid).html("0.00");
							alert(success_txt);
						}else {
							alert(fail_txt);
						}
					}
				);
			}
		}
		
		function update_setting(opt, mid) {
			var confirm_txt = '<?php echo $this->lang->line('registration_confirm_message')?>';
			var success_txt = '<?php echo $this->lang->line('registration_setting_update_successful_message')?>';
			var fail_txt = '<?php echo $this->lang->line('registration_setting_update_fail_message')?>';
			var active_txt = '<?php echo $this->lang->line('registration_active')?>';
			var deactivated_txt = '<?php echo $this->lang->line('registration_deactivated')?>';
			var suspended_txt = '<?php echo $this->lang->line('registration_suspended')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				$.post('<?php echo base_url();?>member/update_setting/', {
						type: opt,
						member_id: mid,
						csrf_ssg_ad_token: '<?php echo $this->security->get_csrf_hash();?>'
					},
					function(data){
						if (data == 1) {
							if(opt == 1) {
								var obj = $('#allowed_withdraw_' + mid);
								if(obj.hasClass('label-fail')) {
									obj.removeClass('label-fail').addClass('label-success').html(active_txt);
								}
								else {
									obj.removeClass('label-success').addClass('label-fail').html(deactivated_txt);
								}
							}
							else if(opt == 2) {
								var obj = $('#unlimited_withdraw_' + mid);
								if(obj.hasClass('label-fail')) {
									obj.removeClass('label-fail').addClass('label-success').html(active_txt);
								}
								else {
									obj.removeClass('label-success').addClass('label-fail').html(deactivated_txt);
								}
							}
							else if(opt == 3) {
								var obj = $('#allowed_transfer_' + mid);
								if(obj.hasClass('label-fail')) {
									obj.removeClass('label-fail').addClass('label-success').html(active_txt);
								}
								else {
									obj.removeClass('label-success').addClass('label-fail').html(deactivated_txt);
								}
							}
							else if(opt == 4) {
								var obj = $('#account_status_' + mid);
								if(obj.hasClass('label-fail')) {
									obj.removeClass('label-fail').addClass('label-success').html(active_txt);
									$('#allowed_withdraw_' + mid).removeClass('label-fail').addClass('label-success').html(active_txt);
									$('#allowed_transfer_' + mid).removeClass('label-fail').addClass('label-success').html(active_txt);
									$('#allowed_convert_' + mid).removeClass('label-fail').addClass('label-success').html(active_txt);
									$('#allowed_topup_' + mid).removeClass('label-fail').addClass('label-success').html(active_txt);
								}
								else {
									obj.removeClass('label-success').addClass('label-fail').html(suspended_txt);
									$('#allowed_withdraw_' + mid).removeClass('label-success').addClass('label-fail').html(deactivated_txt);
									$('#allowed_transfer_' + mid).removeClass('label-success').addClass('label-fail').html(deactivated_txt);
									$('#allowed_convert_' + mid).removeClass('label-success').addClass('label-fail').html(deactivated_txt);
									$('#allowed_topup_' + mid).removeClass('label-success').addClass('label-fail').html(deactivated_txt);
								}
							}
							else if(opt == 5) {
								var obj = $('#allowed_topup_' + mid);
								if(obj.hasClass('label-fail')) {
									obj.removeClass('label-fail').addClass('label-success').html(active_txt);
								}
								else {
									obj.removeClass('label-success').addClass('label-fail').html(deactivated_txt);
								}
							}
							else if(opt == 6) {
								var obj = $('#allowed_convert_' + mid);
								if(obj.hasClass('label-fail')) {
									obj.removeClass('label-fail').addClass('label-success').html(active_txt);
								}
								else {
									obj.removeClass('label-success').addClass('label-fail').html(deactivated_txt);
								}
							}
							
							alert(success_txt);
						}
						else {
							alert(fail_txt);
						}
					}
				);

				return false;
			}
		}
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && $this->uri->segment(2) == 'wallet_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>member/getwalletlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount = 0;
					var TotalAmount2 = 0;
					var TotalAmount3 = 0;
					var TotalAmount4 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount += aaData[i][2]*1;
						TotalAmount2 += aaData[i][3]*1;
						TotalAmount3 += aaData[i][4]*1;
						TotalAmount4 += aaData[i][5]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmount2 * 10000) / 10000;
					nCells[3].innerHTML = Math.round(TotalAmount3 * 10000) / 10000;
					nCells[4].innerHTML = Math.round(TotalAmount4 * 10000) / 10000;
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && $this->uri->segment(2) == 'downline') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"bFilter": false,
				"sAjaxSource": '<?php echo base_url();?>member/getdownlinelist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
			
			$('#search_register_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && $this->uri->segment(2) == 'reinvest_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>member/getreinvestlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
			
			$('#search_register_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && $this->uri->segment(2) == 'intro') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"bFilter": false,
				"sAjaxSource": '<?php echo base_url();?>member/getintrolist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
			
			$('#search_register_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && $this->uri->segment(2) == 'topup_package_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>member/get_topup_package_list/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][1]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
				}
			});
			
			$('#search_topup_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'report' && $this->uri->segment(2) == 'daily_bonus' && $this->session->userdata('report_start_date') && $this->session->userdata('report_end_date')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"bFilter": false,
				"sAjaxSource": '<?php echo base_url();?>report/daily_bonus_getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					var TotalAmount2 = 0;
					var TotalAmount3 = 0;
					var TotalAmount4 = 0;
					var TotalAmount5 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][1]*1;
						TotalAmount2 += aaData[i][2]*1;
						TotalAmount3 += aaData[i][3]*1;
						TotalAmount4 += aaData[i][4]*1;
						TotalAmount5 += aaData[i][5]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmount2 * 10000) / 10000;
					nCells[3].innerHTML = Math.round(TotalAmount3 * 10000) / 10000;
					nCells[4].innerHTML = Math.round(TotalAmount4 * 10000) / 10000;
					nCells[5].innerHTML = Math.round(TotalAmount5 * 10000) / 10000;
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'report' && $this->uri->segment(2) == 'income_summary' && $this->session->userdata('report_income_date')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"bFilter": false,
				"sAjaxSource": '<?php echo base_url();?>report/income_summary_getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					var TotalAmount2 = 0;
					var TotalAmount3 = 0;
					var TotalAmount4 = 0;
					var TotalAmount5 = 0;
					var GrandTotal = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][1]*1;
						TotalAmount2 += aaData[i][2]*1;
						TotalAmount3 += aaData[i][3]*1;
						TotalAmount4 += aaData[i][4]*1;
						TotalAmount5 += aaData[i][5]*1;
						GrandTotal += aaData[i][6]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmount2 * 10000) / 10000;
					nCells[3].innerHTML = Math.round(TotalAmount3 * 10000) / 10000;
					nCells[4].innerHTML = Math.round(TotalAmount4 * 10000) / 10000;
					nCells[5].innerHTML = Math.round(TotalAmount5 * 10000) / 10000;
					nCells[6].innerHTML = Math.round(GrandTotal * 10000) / 10000;
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'report' && $this->uri->segment(2) == 'income_detail' && $this->session->userdata('report_income_date')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>report/income_detail_getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][3]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'report' && $this->uri->segment(2) == 'balance' && $this->session->userdata('report_income_date')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>report/balance_getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc'], [1, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'report') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			$('#income_date').change(function() {
				var val = $(this).val();
				if(val == 7) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && ($this->uri->segment(2) == 'structure')) {
			if($json != '') {
	?>
	<script src="<?php echo base_url();?>assets/js/jquery.orgchart.js"></script>

    <script type="text/javascript">
    var chartData = [
       <?php echo $json;?>
    ];
    $(function(){
        org_chart = $('#orgChart').orgChart({
            data: chartData,
            showControls: false,
            allowEdit: false
        });
    });
    </script>
	<?php } }?>
	
	<?php 
		if($this->uri->segment(1) == 'member' && ($this->uri->segment(2) == 'sales')) {
	?>
    <script type="text/javascript">
    $(document).ready(function() {
		var oTable = $('#table-listing').dataTable({
			"bProcessing": true,
			"bServerSide": true,
			"bFilter": false,
			"bDisplay": false,
			"bPaginate": false,
			"bLengthChange": false,
			"sAjaxSource": '<?php echo base_url();?>member/getsaleslist/',
			"iDisplayLength": 25,
			"aaSorting": [[0, 'desc']],
			"aoColumns": [
				{ "bVisible": true, "bSearchable": false, "bSortable": false },
				{ "bVisible": true, "bSearchable": false, "bSortable": false },
				// { "bVisible": true, "bSearchable": true, "bSortable": true },
				// { "bVisible": true, "bSearchable": false, "bSortable": true },
				{ "bVisible": true, "bSearchable": false, "bSortable": false }
			],
			"fnInitComplete": function () {
				oTable.fnAdjustColumnSizing();
			},
			'fnServerData': function (sSource, aoData, fnCallback) {
				aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
				$.ajax
				({
					'dataType': 'json',
					'type': 'POST',
					'url': sSource,
					'data': aoData,
					'success': fnCallback
				});
			},
			"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
				var TotalAmount = 0;
				for ( var i=0 ; i<aaData.length ; i++ )
				{
					TotalAmount += aaData[i][2]*1;
				}

				var nCells = nRow.getElementsByTagName('th');
				nCells[1].innerHTML = Math.round(TotalAmount * 10000) / 10000;
			}
		});
			
		$('#search_register_date').change(function() {
			var val = $(this).val();
			if(val == 2) {
				$('#custom_date_panel').show();
			}
			else {
				$('#custom_date_panel').hide();
			}
		});
    });
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'transfer' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>transfer/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalIn = 0;
					var TotalOut = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalIn += aaData[i][2]*1;
						TotalOut += aaData[i][3]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[2].innerHTML = Math.round(TotalIn * 10000) / 10000;
					nCells[3].innerHTML = Math.round(TotalOut * 10000) / 10000;
				}
			});
			
			$('#search_transfer_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'convert' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>convert/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmt = 0;
					var TotalAmt2 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmt += aaData[i][2]*1;
						TotalAmt2 += aaData[i][3]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmt * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmt2 * 10000) / 10000;
				}
			});
			
			$('#search_convert_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'message' && ($this->uri->segment(2) == 'inbox' || $this->uri->segment(2) == 'sent')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>message/getlist/<?php echo $this->uri->segment(2);?>/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'topup' && ($this->uri->segment(2) == 'request' || $this->uri->segment(2) == 'submit')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			$('#remark').change(function() {
				var val = $(this).val();
				if(val == 'Others') {
					$('#remark_others_panel').show();
				}
				else {
					$('#remark_others_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'topup' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>topup/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					var TotalAmount2 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][3]*1;
						TotalAmount2 += aaData[i][4]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmount2 * 10000) / 10000;
				}
			});
			
			$('#search_topup_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'topup' && $this->uri->segment(2) == 'offline_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>topup/get_offline_list/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount += aaData[i][2]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount * 10000) / 10000;
				}
			});
			
			$('#search_topup_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'topup' && $this->uri->segment(2) == 'usdt_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>topup/get_usdt_list/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					var TotalAmount2 = 0;
					var TotalAmount3 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][1]*1;
						TotalAmount2 += aaData[i][2]*1;
						TotalAmount3 += aaData[i][4]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmount2 * 10000) / 10000;
					nCells[4].innerHTML = Math.round(TotalAmount3 * 10000) / 10000;
				}
			});
			
			$('#search_topup_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'topup' && $this->uri->segment(2) == 'sands_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>topup/get_sands_list/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][1]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
				}
			});
			
			$('#search_topup_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'topup' && $this->uri->segment(2) == 'ping_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>topup/get_ping_list/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					var TotalAmount2 = 0;
					var TotalAmount3 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][1]*1;
						TotalAmount2 += aaData[i][2]*1;
						TotalAmount3 += aaData[i][4]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalAmount2 * 10000) / 10000;
					nCells[4].innerHTML = Math.round(TotalAmount3 * 10000) / 10000;
				}
			});
			
			$('#search_topup_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'adjustment' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>adjustment/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount += aaData[i][2]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount * 10000) / 10000;
				}
			});
			
			$('#search_adjustment_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'withdrawal' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>withdrawal/getList/',
				"iDisplayLength": 25,
				"aaSorting": [[1, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalActual = 0;
					var TotalWithdraw = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalActual += aaData[i][3]*1;
						TotalWithdraw += aaData[i][4]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalActual * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalWithdraw * 10000) / 10000;
				}
			});
			
			$('#search_withdrawal_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
		
		$('#datetimepicker1').datetimepicker({
			format: 'yyyy-mm-dd hh:ii'
		});
		
		$('#datetimepicker2').datetimepicker({
			format: 'yyyy-mm-dd hh:ii'
		});
		
		function update_withdrawal_status(id, val) {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				location.href = '<?php echo base_url();?>withdrawal/update_withdrawal/' + id + '/' + val + '/';
			}
			else {
				$('#update_status').val(0);
			}
		}
		
		// check or uncheck all checkbox 
		function checkBox(t) {
			if(t.checked == true) {
				checkAll(document.getElementsByName(t.name));
			}
			else {
				uncheckAll(document.getElementsByName(t.name));
			}
			
		}

		// All chekcbox checking
		function checkOrUncheck(t) {
			var check = true;
			var field = document.getElementsByName(t.name);
			for(i = 1; i < field.length; i++) {
				if(field[i].checked == false)
					check = false;
			}
			field[0].checked = check;
			if(check == true) {
				$('#uniform-mainchkbox span').addClass('checked');
			}
			else {
				$('#uniform-mainchkbox span').removeClass('checked');
			}
		}

		function checkAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}

		function uncheckAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
		
		function update_withdrawal_listing_status() {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				$('#withdrawal-form').submit();
			}
			else {
				$('#listing_submit').val(0);
			}
		}
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'withdrawal' && $this->uri->segment(2) == 'usdt_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"bFilter": false,
				"sAjaxSource": '<?php echo base_url();?>withdrawal/getusdtlist/',
				"iDisplayLength": 25,
				"aaSorting": [[1, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalActual = 0;
					var TotalWithdraw = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalActual += aaData[i][2]*1;
						TotalWithdraw += aaData[i][3]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalActual * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalWithdraw * 10000) / 10000;
				}
			});
			
			$('#search_withdrawal_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
		
		$('#datetimepicker1').datetimepicker({
			format: 'yyyy-mm-dd hh:ii'
		});
		
		$('#datetimepicker2').datetimepicker({
			format: 'yyyy-mm-dd hh:ii'
		});
		
		function update_withdrawal_usdt_status(id, val) {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				location.href = '<?php echo base_url();?>withdrawal/update_withdrawal_usdt/' + id + '/' + val + '/';
			}
			else {
				$('#update_status').val(0);
			}
		}
		
		// check or uncheck all checkbox 
		function checkBox(t) {
			if(t.checked == true) {
				checkAll(document.getElementsByName(t.name));
			}
			else {
				uncheckAll(document.getElementsByName(t.name));
			}
			
		}

		// All chekcbox checking
		function checkOrUncheck(t) {
			var check = true;
			var field = document.getElementsByName(t.name);
			for(i = 1; i < field.length; i++) {
				if(field[i].checked == false)
					check = false;
			}
			field[0].checked = check;
			if(check == true) {
				$('#uniform-mainchkbox span').addClass('checked');
			}
			else {
				$('#uniform-mainchkbox span').removeClass('checked');
			}
		}

		function checkAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}

		function uncheckAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
		
		function update_withdrawal_usdt_listing_status() {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				$('#withdrawal-form').submit();
			}
			else {
				$('#listing_submit').val(0);
			}
		}
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'withdrawal' && $this->uri->segment(2) == 'ping_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>withdrawal/getpinglist/',
				"iDisplayLength": 25,
				"aaSorting": [[1, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalActual = 0;
					var TotalWithdraw = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalActual += aaData[i][2]*1;
						TotalWithdraw += aaData[i][3]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalActual * 10000) / 10000;
					nCells[2].innerHTML = Math.round(TotalWithdraw * 10000) / 10000;
				}
			});
			
			$('#search_withdrawal_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
		
		$('#datetimepicker1').datetimepicker({
			format: 'yyyy-mm-dd hh:ii'
		});
		
		$('#datetimepicker2').datetimepicker({
			format: 'yyyy-mm-dd hh:ii'
		});
		
		function update_withdrawal_ping_status(id, val) {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				location.href = '<?php echo base_url();?>withdrawal/update_withdrawal_ping/' + id + '/' + val + '/';
			}
			else {
				$('#update_status').val(0);
			}
		}
		
		// check or uncheck all checkbox 
		function checkBox(t) {
			if(t.checked == true) {
				checkAll(document.getElementsByName(t.name));
			}
			else {
				uncheckAll(document.getElementsByName(t.name));
			}
			
		}

		// All chekcbox checking
		function checkOrUncheck(t) {
			var check = true;
			var field = document.getElementsByName(t.name);
			for(i = 1; i < field.length; i++) {
				if(field[i].checked == false)
					check = false;
			}
			field[0].checked = check;
			if(check == true) {
				$('#uniform-mainchkbox span').addClass('checked');
			}
			else {
				$('#uniform-mainchkbox span').removeClass('checked');
			}
		}

		function checkAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}

		function uncheckAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
		
		function update_withdrawal_ping_listing_status() {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				$('#withdrawal-form').submit();
			}
			else {
				$('#listing_submit').val(0);
			}
		}
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'payout' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>payout/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount1 = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount1 += aaData[i][7]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount1 * 10000) / 10000;
				}
			});
			
			$('#search_payout_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'insurance' && $this->uri->segment(2) == 'buy_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>insurance/getbuylist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmt = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmt += aaData[i][1]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmt * 10000) / 10000;
				}
			});
			
			$('#search_insurance_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'insurance' && $this->uri->segment(2) == 'claim_listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>insurance/getclaimlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalAmount = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalAmount += aaData[i][2]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalAmount * 10000) / 10000;
				}
			});
			
			$('#search_insurance_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
		
		function update_claim_status(id, val) {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				location.href = '<?php echo base_url();?>insurance/update_claim/' + id + '/' + val + '/';
			}
			else {
				$('#update_status').val(0);
			}
		}
		
		// check or uncheck all checkbox 
		function checkBox(t) {
			if(t.checked == true) {
				checkAll(document.getElementsByName(t.name));
			}
			else {
				uncheckAll(document.getElementsByName(t.name));
			}
			
		}

		// All chekcbox checking
		function checkOrUncheck(t) {
			var check = true;
			var field = document.getElementsByName(t.name);
			for(i = 1; i < field.length; i++) {
				if(field[i].checked == false)
					check = false;
			}
			field[0].checked = check;
			if(check == true) {
				$('#uniform-mainchkbox span').addClass('checked');
			}
			else {
				$('#uniform-mainchkbox span').removeClass('checked');
			}
		}

		function checkAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}

		function uncheckAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
		
		function update_claim_listing_status() {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				$('#insurance-form').submit();
			}
			else {
				$('#listing_submit').val(0);
			}
		}
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'game' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>game/getList/',
				"iDisplayLength": 25,
				"aaSorting": [[1, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				},
				"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
					var TotalActual = 0;
					for ( var i=0 ; i<aaData.length ; i++ )
					{
						TotalActual += aaData[i][2]*1;
					}

					var nCells = nRow.getElementsByTagName('th');
					nCells[1].innerHTML = Math.round(TotalActual * 10000) / 10000;
				}
			});
			
			$('#search_deposit_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
		
		function update_deposit_status(id, val) {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				location.href = '<?php echo base_url();?>game/update_deposit/' + id + '/' + val + '/';
			}
			else {
				$('#update_status').val(0);
			}
		}
		
		// check or uncheck all checkbox 
		function checkBox(t) {
			if(t.checked == true) {
				checkAll(document.getElementsByName(t.name));
			}
			else {
				uncheckAll(document.getElementsByName(t.name));
			}
			
		}

		// All chekcbox checking
		function checkOrUncheck(t) {
			var check = true;
			var field = document.getElementsByName(t.name);
			for(i = 1; i < field.length; i++) {
				if(field[i].checked == false)
					check = false;
			}
			field[0].checked = check;
			if(check == true) {
				$('#uniform-mainchkbox span').addClass('checked');
			}
			else {
				$('#uniform-mainchkbox span').removeClass('checked');
			}
		}

		function checkAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}

		function uncheckAll(field) {
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
		
		function update_listing_status() {
			var confirm_txt = '<?php echo $this->lang->line('withdrawal_confirm_approve_withdrawal')?>';
			
			var r = confirm(confirm_txt);
			if (r == true) {
				$('#deposit-form').submit();
			}
			else {
				$('#listing_submit').val(0);
			}
		}
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'product' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>product/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'product' && $this->uri->segment(2) == 'order') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>product/getorderlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
			
			$('#search_order_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'announcement' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>announcement/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'admin' && $this->uri->segment(2) == 'listing') {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			var oTable = $('#table-listing').dataTable({
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": '<?php echo base_url();?>admin/getlist/',
				"iDisplayLength": 25,
				"aaSorting": [[0, 'desc']],
				"aoColumns": [
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": true, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": true },
					{ "bVisible": true, "bSearchable": false, "bSortable": false }
				],
				"fnInitComplete": function () {
					oTable.fnAdjustColumnSizing();
				},
				'fnServerData': function (sSource, aoData, fnCallback) {
					aoData.push({name: '<?php echo $this->security->get_csrf_token_name();?>', value : '<?php echo $this->security->get_csrf_hash();?>'});
					$.ajax
					({
						'dataType': 'json',
						'type': 'POST',
						'url': sSource,
						'data': aoData,
						'success': fnCallback
					});
				}
			});
		});
    </script>
	<?php }?>
	
	<?php 
		if($this->uri->segment(1) == 'message' && ($this->uri->segment(2) == 'compose' || $this->uri->segment(2) == 'compose_submit')) {
	?>
	<script type="text/javascript">
        $(document).ready(function() {
			$('#search_register_date').change(function() {
				var val = $(this).val();
				if(val == 2) {
					$('#custom_date_panel').show();
				}
				else {
					$('#custom_date_panel').hide();
				}
			});
		});
    </script>
	<?php }?>
	
	<?php
        if($this->uri->segment(1) == 'announcement') {
    ?>
    <script type="text/javascript">
        +function() {
            $(document).ready(function() {
                tinymce.init({
                    selector:'textarea#message_en',
                    height: 450,
					document_base_url: "<?php echo base_url();?>",
					convert_urls : false,
					plugins: [
						"advlist autolink lists link image charmap print preview anchor",
						"searchreplace visualblocks code fullscreen",
						"insertdatetime media table contextmenu paste"
					],
					toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
                    file_browser_callback: function(field_name, url, type, win) {
                        if(type=='image') $('#file_form_en input').click();
                    }
                });
				tinymce.init({
					selector:'textarea#message_zh_cn',
					height: 450,
					document_base_url: "<?php echo base_url();?>",
					convert_urls : false,
					plugins: [
						"advlist autolink lists link image charmap print preview anchor",
						"searchreplace visualblocks code fullscreen",
						"insertdatetime media table contextmenu paste"
					],
					toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
					file_browser_callback: function(field_name, url, type, win) {
						if(type=='image') $('#file_form_zh_cn input').click();
					}
				});
				tinymce.init({
					selector:'textarea#message_zh_hk',
					height: 450,
					document_base_url: "<?php echo base_url();?>",
					convert_urls : false,
					plugins: [
						"advlist autolink lists link image charmap print preview anchor",
						"searchreplace visualblocks code fullscreen",
						"insertdatetime media table contextmenu paste"
					],
					toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
					file_browser_callback: function(field_name, url, type, win) {
						if(type=='image') $('#file_form_zh_hk input').click();
					}
				});
                $('#file_form_selector_en').on('change', function() {
                    $('#file_form_en').ajaxSubmit({
                        dataType: 'json',
                        method: 'post',
                        success: function(resp) {
                            if (resp.status && resp.status == 'success') {
                                $('.mce-btn.mce-open').parent().find('.mce-textbox').val(resp.img).closest('.mce-window').find('.mce-primary').click();
                            } else {
                                alert(resp.msg);
                            }

                            $(this).val('');
                            $('.mce-btn.mce-open').parent().find('.mce-textbox').val('');
                        }
                    });
                });
				$('#file_form_selector_zh_cn').on('change', function() {
					$('#file_form_zh_cn').ajaxSubmit({
						dataType: 'json',
						method: 'post',
						success: function(resp) {
							if (resp.status && resp.status == 'success') {
								$('.mce-btn.mce-open').parent().find('.mce-textbox').val(resp.img).closest('.mce-window').find('.mce-primary').click();
							} else {
								alert(resp.msg);
							}

							$(this).val('');
							$('.mce-btn.mce-open').parent().find('.mce-textbox').val('');
						}
					});
				});
				$('#file_form_selector_zh_hk').on('change', function() {
					$('#file_form_zh_hk').ajaxSubmit({
						dataType: 'json',
						method: 'post',
						success: function(resp) {
							if (resp.status && resp.status == 'success') {
								$('.mce-btn.mce-open').parent().find('.mce-textbox').val(resp.img).closest('.mce-window').find('.mce-primary').click();
							} else {
								alert(resp.msg);
							}

							$(this).val('');
							$('.mce-btn.mce-open').parent().find('.mce-textbox').val('');
						}
					});
				});
            });
        }(jQuery);
    </script>
    <?php
        }
    ?>
	
	<script type="text/javascript">
		function validateForm(formId) {
			$('form .btn').attr("disabled", true);
			if (confirm('<?php echo $this->lang->line('js_text_confirm_to_proceed');?>')) {
				$('#' + formId).submit(function(e) {
					e.preventDefault();
					this.submit();
				});
				
				return true;
			}
			else {
				$('form .btn').attr("disabled", false);
			}
			
			return false;
		}
	</script>
	
	<?php if($this->uri->segment(1) == 'admin') {?>
	<script>
		$(document).ready(function() {
			$('#modules-selector').select2({
				allowClear: true
			});
		});
	</script>
	<?php } ?>

	<!-- END JAVASCRIPTS -->

</body>

<!-- END BODY -->

</html>