<title>Edit Metadata</title>
<div id="pagetitle">EDIT METADATA</div>
<div id="batascontent" class="clearfix">
	<form action="?m=phpmail_update" method="post" enctype="multipart/form-data">
		<?php
			$id = mysqli_real_escape_string($koneksi, $_GET['id']);
			$db = mysqli_query($koneksi, "SELECT * FROM cmas_phpmail WHERE phpmail_id='$id'");
			$dt = mysqli_fetch_array($db);
		?>
		<input name="phpmail_id" type="hidden" value="<?php echo $dt['phpmail_id']; ?>">
		
		<div id="wrapgsetting" class="clearfix">
			<div id="gsettinglefts">
				<div id="gsettingtitles">HOST</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Host</div>
					<div id="gsettingedit">
						<input name="phpmail_host" type="text" value="<?php echo $dt['phpmail_host']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Username</div>
					<div id="gsettingedit">
						<input name="phpmail_username" type="text" value="<?php echo $dt['phpmail_username']; ?>">
					</div>
				</div>		
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Password</div>
					<div id="gsettingedit">
						<input name="phpmail_password" type="password" value="<?php echo $dt['phpmail_password']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Charset Mail</div>
					<div id="gsettingedit">
						<select name="phpmail_charset">
							<option value="<?php echo $dt['phpmail_charset']; ?>"><?php echo $dt['phpmail_charset']; ?></option>
							<option value="Numb">Numb</option>
							<option value="ASCII">ASCII</option>
							<option value="ANSI">ANSI</option>
							<option value="8859">8859</option>
							<option value="UTF-8">UTF-8</option>
						</select>
					</div>
				</div>
				<?php if ($dt['phpmail_logoid'] == 0) { ?>
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Logo Name</div>
						<div id="gsettingedit">
							<input name="phpmail_logoname" type="text" value="<?php echo $dt['phpmail_logoname']; ?>">
						</div>
					</div>
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Upload Logo</div>
						<div id="gsettingimage">
							<input name="phpmail_logo" type="file"/>
						</div>
					</div>
				<?php } else { ?>
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Logo Name</div>
						<div id="gsettingedit">
							<input name="phpmail_logoname" type="text" value="<?php echo $dt['phpmail_logoname']; ?>">
						</div>
					</div>
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Upload Logo</div>
						<div id="gsettingimage">
							<input name="phpmail_logo" type="file"/>
						</div>
					</div>
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Mail Logo</div>
						<div id="gsettingimgsml">
							<img src="assets/images/<?php echo $dt['phpmail_logo']; ?>">
						</div>
					</div>
				<?php } ?>
			</div>
			
			<div id="gsettingrites">
				<div id="gsettingtitles">EMAIL</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Email From</div>
					<div id="gsettingedit">
						<input name="phpmail_mailfrom" type="text" value="<?php echo $dt['phpmail_mailfrom']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Name From</div>
					<div id="gsettingedit">
						<input name="phpmail_mailname" type="text" value="<?php echo $dt['phpmail_mailname']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">CC Mail</div>
					<div id="gsettingedit">
						<input name="phpmail_ccmail" type="text" value="<?php echo $dt['phpmail_ccmail']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">CC Name</div>
					<div id="gsettingedit">
						<input name="phpmail_ccname" type="text" value="<?php echo $dt['phpmail_ccname']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">BCC Mail</div>
					<div id="gsettingedit">
						<input name="phpmail_bccmail" type="text" value="<?php echo $dt['phpmail_bccmail']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">BCC Name</div>
					<div id="gsettingedit">
						<input name="phpmail_bccname" type="text" value="<?php echo $dt['phpmail_bccname']; ?>">
					</div>
				</div>
			</div>
		</div>
		
		<div id="wrapgsetting" class="clearfix">
			<div id="gsettingtitles">RE-CAPTCHA</div>
			<div id="gsetting" class="clearfix">
				<div id="gsettinglabel">Captcha Sitekey</div>
				<div id="gsettingedit">
					<input name="captcha_sitekey" type="text" value="<?php echo $dt['captcha_sitekey']; ?>">
				</div>
			</div>
			<div id="gsetting" class="clearfix">
				<div id="gsettinglabel">Captcha Secretkey</div>
				<div id="gsettingedit">
					<input name="captcha_secretkey" type="text" value="<?php echo $dt['captcha_secretkey']; ?>">
				</div>
			</div>
		</div>
		<div id="tombolsubmit">
			<a href="?m=phpmail_index"><input name="button" type="button" value="KEMBALI" class="myButton"/></a>
			<input name="submit" type="submit" value="SIMPAN" class="submitbutton"/> 
		</div>
	</form>
	<div id="infobottom" class="clearfix">
		<div class="infobottomfull">
			<?php $abdb = mysqli_query($koneksi, "SELECT * FROM cmas_admin WHERE admin_id='$dt[updated_id]'"); $abdt = mysqli_fetch_array($abdb); ?>
			Updated by <b><?php echo $abdt['admin_nama']; ?></b> on <b><?php echo date_format(date_create($dt['updated']), 'd/m/Y H:i:s'); ?></b>
		</div>
	</div>
</div>