MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/cafsindia/hrms_allyindian_com/application/views/dynamic_db/manage.php
<?php 
	$this->load->view("partial/header"); 

	$access_data    = $this->session->userdata('access_data');
	$access_add     = (int)$access_data[$controller_name]['access_add'];
	$access_update  = (int)$access_data[$controller_name]['access_update'];
	$access_delete  = (int)$access_data[$controller_name]['access_delete'];
	$access_search  = (int)$access_data[$controller_name]['access_search']; 
	$access_export  = (int)$access_data[$controller_name]['access_export'];
	$access_import  = (int)$access_data[$controller_name]['access_import'];
	
	$page_name      = ucwords(str_replace("_"," ",$controller_name));
	$uniqueId       = "prime_".$controller_name."_id";
?>
<script type="text/javascript">
    $(document).ready(function (){

		$("#db_config").submit(function(event){ event.preventDefault(); }).validate({
			rules:{
				hostname:'required',
				username:'required',
				database:'required',
				confirm_password:{
 					equalTo: "#password"
				},
				port:{
					digits: true
				}
			},
			submitHandler: function (form){
				//Encrypted 
				var send_url   = '<?php echo site_url("$controller_name/db_config");?>'
				let formData   = new FormData(form);
				// Convert FormData to JSON object
				let jsonData   = Object.fromEntries(formData.entries());
				var key        = '<?php echo $key; ?>';
				var encData    = encrypt(key,jsonData);
				$("#submit").html("<i class='fa fa-spinner fa-spin'></i> Processing...");
				$('#submit').attr('disabled','disabled');
				$.ajax({
					url         : $(form).attr('action'), 
					type        : 'POST',
					contentType : 'text/plain', 
					data        : encData,
					success: function (response){
						$('#submit').attr('disabled',false);
						$("#submit").html("Submit");
						if(response.success){
							toastr.success(response.msg);
							location.reload();
						}else{
							toastr.error(response.msg);
							$('#db_config')[0].reset();
						}
					},
					dataType: 'json'
				});
			}
		});
	
    });
</script>
<div class='row title_content'>
	<div class='col-md-4 col-xs-4'>
		<h1 class='page_txt'>Dynamic DB Configuration</h1>
	</div>
</div>
<div id="holder" class="form-inline" style="margin-top:20px;">
	<div class='col-md-12'style='margin:15px 0px;border-radius:2px;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2);padding:15px 0px;'>
		<?php  echo  form_open("$controller_name/db_config",array("id"=>"db_config","class"=>"form-inline")); ?>
		<div class="form-group">
			<?php 
				echo form_label('Hostname', 'hostname', array('class' => "control-label required"))."<br/>";
				echo form_input(array('name'=>'hostname', 'id'=>'hostname', 'class'=>'form-control','placeholder'=> "Host Name")); 
			?>
		</div>
		<div class="form-group">
			<?php
				echo form_label('Port', 'port', array('class' => "control-label"))."<br/>";
				echo form_input(array('name'=>'port','id'=>'port','class'=>'form-control','placeholder'=> "Enter port number"));
			?>
		</div>
		<div class="form-group">
			<?php 
				echo form_label('Username', 'username', array('class' => "control-label required"))."<br/>";
				echo form_input(array('name'=>'username', 'id' => 'username', 'class'=>'form-control','placeholder'=> "User Name"));
			?>
		</div>
		<div class="form-group">
			<?php
				echo form_label('Password', 'Password', array('class' => "control-label"))."<br/>";
				echo form_password(array('name'=>'password', 'id' => 'password', 'class'=>'form-control','placeholder'=> "Password")); 
			?>
		</div>
		<div class="form-group">
			<?php
				echo form_label('Confirm Password', 'Confirm Password', array('class' => "control-label"))."<br/>";
				echo form_password(array('name'=>'confirm_password', 'id' => 'confirm_password', 'class'=>'form-control','placeholder'=> "Confirm Password"));
				?>
		</div>
		<div class="form-group">
			<?php
				echo form_label('Database', 'database', array('class' => "control-label required"))."<br/>";
				echo form_input(array('name'=>'database', 'id' => 'database', 'class'=>'form-control','placeholder'=> "Database Name"));
			?>
		</div>
		<div class="form-group">
			<button class='btn btn-primary btn-sm' id="submit" style='margin-top:20px;'>Submit</button>
		</div>
		<?php echo form_close(); ?>
	</div>
</div>
<style>
	.pull-right.search {
		display: none !important;
	}
	.columns.columns-right.btn-group.pull-right {
		display: none !important;
	}
	<?php 
		if($access_search === 1){
			echo ".pull-right.search { display: block !important; }";
		}
		if($access_export === 1){
			echo ".columns.columns-right.btn-group.pull-right{display: block !important;}";
		}
	?>
</style>
<?php $this->load->view("partial/footer"); ?>