<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head><title><?php echo APP_NAME ; ?> System Configuration</title>
<meta http-equiv='Pragma' content='no-cache'>
<meta http-equiv='Expires' content='Sat, 01 Jan 2000 06:00:00 GMT'>
<meta http-equiv='Cache-Control' content='no-store, no-cache, must-revalidate, max-age=0'>
<link type="text/css" href="<?php echo Util::asset('css/redmond/jquery-ui.css'); ?>" rel="stylesheet" />
<link type="text/css" href="<?php echo Util::asset('css/sbg-hrms.css'); ?>" rel="stylesheet" />
<!-- <script type="text/javascript" src="<?php echo Util::asset('js/jquery-2.2.4.min.js'); ?>"></script> -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script type="text/javascript" src="<?php echo Util::asset('js/jquery-ui-1.10.4.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo Util::asset('js/sbg-util.js'); ?>"></script>
</head>
<body>
<form id="sbg-config" name="sbg-config" enctype="multipart/form-data" method="post" action="">
<div>
<div id="sbg-config-entry" style="width:710px;margin:0 auto">
	<div style="font-size: 20px;margin-top:10px;margin-bottom:10px"><?php echo APP_NAME ; ?> System Configuration</div>
	<div id="config-tabs">
		<ul style="font-size: 0.8em;">
			<li><a href="#config-db">Database</a></li>
			<li><a href="#config-notif-db">Notification Centre Database</a></li>
			<li><a href="#config-backup-restore">Backup/Restore</a></li>
			
			<span class="sbg-tab-title"></span>
		</ul>
		<div id="config-db" style="height:220px;">
			<table>
				<tr>
					<td style="text-align:right;width:150px"><span>Server : </span></td>
					<td style="width:450px"><input type="text" maxlength="50" size="50" id="txtConfigServer" value="<?php echo $this->getServer() ;?>" />
					<span id="config_err_server" style="color:Red;display:none">*</span></td>
					
				</tr>
				<tr>
					<td style="text-align:right;"><span>Database Type : </span></td>
					<td><select id="cobConfigDbType"><?php echo $this->getTypeList() ; ?></select></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>Database Name : </span></td>
					<td><input type="text" size="20" id="txtConfigDbName" value="<?php echo $this->getDbName() ;?>" />
					<span id="config_err_name" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>Port No : </span></td>
					<td><input type="text" maxlength="5" size="10" id="txtConfigDbPort" value="<?php echo $this->getDbPort() ;?>" />
					<span>(blank for default port no)</span>
					<span id="config_err_port" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>User Name : </span></td>
					<td><input type="text" maxlength="20" size="15" id="txtConfigDbUser" value="<?php echo $this->getDbUser() ;?>" />
					<span id="config_err_user" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>Password : </span></td>
					<td><input type="password" maxlength="15" size="15" id="txtConfigDbPwd" value="<?php echo $this->getDbPwd() ;?>" />
					<span id="config_err_pwd" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:right">
						<input id="btnConfigTest" type="button" value="Test Connection"></input>
						<input id="btnConfigUpdateDatabase" type="button" value="Update Database"></input>
						<input id="btnConfigCreate" type="button" value="Create"></input>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<!-- <input id="btnConfigClearTransaction" type="button" value="Clear Transaction"></input> -->
					</td>
				</tr>
			</table>
		</div>
		<div id="config-notif-db" style="height:210px;">
			<table>
				<tr>
					<td style="text-align:right;width:150px"><span>Server : </span></td>
					<td style="width:450px"><input type="text" maxlength="50" size="50" id="txtConfigServerNotif" value="<?php echo $this->getServerNotif() ;?>" />
					<span id="config_err_server" style="color:Red;display:none">*</span></td>
					
				</tr>
				<tr>
					<td style="text-align:right;"><span>Database Type : </span></td>
					<td><select id="cobConfigDbTypeNotif"><?php echo $this->getTypeList() ; ?></select></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>Database Name : </span></td>
					<td><input type="text" maxlength="20" size="20" id="txtConfigDbNameNotif" value="<?php echo $this->getDbNameNotif() ;?>" />
					<span id="config_err_name" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>Port No : </span></td>
					<td><input type="text" maxlength="5" size="10" id="txtConfigDbPortNotif" value="<?php echo $this->getDbPortNotif() ;?>" />
					<span>(blank for default port no)</span>
					<span id="config_err_port" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>User Name : </span></td>
					<td><input type="text" maxlength="20" size="15" id="txtConfigDbUserNotif" value="<?php echo $this->getDbUserNotif() ;?>" />
					<span id="config_err_user" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td style="text-align:right;"><span>Password : </span></td>
					<td><input type="password" maxlength="15" size="15" id="txtConfigDbPwdNotif" value="<?php echo $this->getDbPwdNotif() ;?>" />
					<span id="config_err_pwd" style="color:Red;display:none">*</span></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:right">
						<input id="btnConfigTestNotif" type="button" value="Test Connection"></input>
						<input id="btnConfigCreateNotif" type="button" value="Create"></input>
					</td>
				</tr>
			</table>
		</div>
		
		<div id="config-backup-restore" style="height:220px;">
			<table>
				<tr>
					
					<td style="width:300px">
						<table>
							<tr>
								<td></td>
							</tr>
							<tr>
								<td style="width:100px">
								
									<select id="buName" style="display:none;">
										<option value="">-All BU-</option>
										<?php //echo $this->getBuBackup() ; ?><
									</select>
								</td>
							</tr>
							
							<tr>
								<td><span>Backup filename : </span></td>
							</tr>
							<tr>
								<td ><input style="width:300px" type="text" id="txtConfigBackupFilename" value="<?php echo $this->getBackupFilename() ;?>" /></td>
							</tr>
							<tr>
								<td style="text-align:left">
								<input id="btnConfigProcessBackup" type="button" value="Start Backup"></input>
								<input id="btnConfigClearTransaction" type="button" value="Clear Transaction"></input>
								</td>
								
							</tr>
						</table>
					</td>
					<td style="width:300px;vertical-align: bottom !important">
						<table>
							<tr>
								<td><span>Available file(s) : </span></td>
							</tr>
							<tr>
								<td><select style="width:300px;height:22px;" id="cobConfigRestoreFile"><?php echo $this->getRestoreFiles() ; ?></select></td>
							</tr>
							<tr>
								
								<td style="text-align:left">
								<input id="btnConfigProcessRestore" type="button" value="Start Restore"></input>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
		
	</div>
	<div class="ui-widget-content ui-corner-all" style="height:40px;margin-top:2px;">
		<div class="sbg-entry-error" style="width:300px;">
			<span id="config_err_mesg" class="sbg-error"></span>
		</div>
		<div class="sbg-entry-command">
			<input id="btnConfigSave" type="button" value="Save"></input>
		</div>
	</div>
</div>
</div>
<div id="sbg-progress" style="display:none">
	<div class="sbg-progress"></div>
	<div class="sbg-progress-box ui-corner-all">
		<div style="font-size:1.5em">
			<img src="image/progress.gif"></img>&nbsp;&nbsp;Please wait .....
		</div>
		<div id="sbg-progress-mesg" class="sbg-progress-mesg"></div>
	</div>
</div>
</form>
<script type="text/javascript">
<?php include (PATH_CODE . "js/admin/config.js") ; ?>
</script>
</body>
</html>