<title>Edit Metadata</title>
<div id="pagetitle">EDIT METADATA</div>
<div id="batascontent" class="clearfix">
	<form action="?m=metadata_update" method="post" enctype="multipart/form-data">
		<?php
			$id = mysqli_real_escape_string($koneksi, $_GET['id']);
			$db = mysqli_query($koneksi, "SELECT * FROM cmas_metadata WHERE metadata_id='$id'");
			$dt = mysqli_fetch_array($db);
		?>
		<input name="metadata_id" type="hidden" value="<?php echo $dt['metadata_id']; ?>">
		
		<div id="wrapgsetting" class="clearfix">
			<div id="gsettinglefts">
				<div id="gsettingtitles">SEO</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Title</div>
					<div id="gsettingedit">
						<input name="metadata_title" type="text" value="<?php echo $dt['metadata_title']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Description</div>
					<div id="gsettingedit">
						<textarea name="metadata_description" cols="100"><?php echo $dt['metadata_description']; ?></textarea>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Keywords</div>
					<div id="gsettingedit">
						<textarea name="metadata_keyword" cols="100"><?php echo $dt['metadata_keyword']; ?></textarea>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Copyright</div>
					<div id="gsettingedit">
						<input name="metadata_copyright" type="text" value="<?php echo $dt['metadata_copyright']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Url</div>
					<div id="gsettingedit">
						<input name="metadata_url" type="text" value="<?php echo $dt['metadata_url']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Author</div>
					<div id="gsettingedit">
						<input name="metadata_author" type="text" value="<?php echo $dt['metadata_author']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Favicon</div>
					<div id="gsettingimage">
						<input name="metadata_gambar" type="file"/>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel"></div>
					<div id="gsettingimgsml">
						<img src="assets/images/<?php echo $dt['metadata_gambar']; ?>">
					</div>
				</div>
				<div id="gsettingtitles">LICENSE</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Generator</div>
					<div id="gsettinginput">
						<input name="metadata_generator" type="hidden" value="<?php echo $dt['metadata_generator']; ?>"><?php echo $dt['metadata_generator']; ?>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Developer</div>
					<div id="gsettinginput">
						<input name="metadata_developer" type="hidden" value="<?php echo $dt['metadata_developer']; ?>"><?php echo $dt['metadata_developer']; ?>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Powered by</div>
					<div id="gsettinginput">
						<input name="metadata_powered" type="hidden" value="<?php echo $dt['metadata_powered']; ?>"><?php echo $dt['metadata_powered']; ?>
					</div>
				</div>
				<div id="gsettingtitles">PATH</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Path</div>
					<div id="gsettingedit">
						<input name="metadata_path" type="text" value="<?php echo $dt['metadata_path']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Path Domain</div>
					<div id="gsettingedit">
						<input name="metadata_pathdomain" type="text" value="<?php echo $dt['metadata_pathdomain']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Subdomain</div>
					<div id="gsettingedit">
						<input name="metadata_subdomain" type="text" value="<?php echo $dt['metadata_subdomain']; ?>">
					</div>
				</div>
			</div>
			
			<div id="gsettingrites">
				<div id="gsettingtitles">META</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Charset</div>
					<div id="gsettingedit">
						<select name="metadata_charset">
							<option value="<?php echo $dt['metadata_charset']; ?>"><?php echo $dt['metadata_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>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Robots</div>
					<div id="gsettingedit">
						<select name="metadata_robots">
							<option value="<?php echo $dt['metadata_robots']; ?>"><?php echo $dt['metadata_robots']; ?></option>
							<option value="index, follow">index, follow</option>
							<option value="noindex, nofollow">noindex, nofollow</option>
						</select>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">App ID</div>
					<div id="gsettingedit">
						<input name="metadata_appid" type="text" value="<?php echo $dt['metadata_appid']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Page Type</div>
					<div id="gsettingedit">
						<input name="metadata_type" type="text" value="<?php echo $dt['metadata_type']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Google Site</div>
					<div id="gsettingedit">
						<input name="metadata_googlesite" type="text" value="<?php echo $dt['metadata_googlesite']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Google Tag Manager</div>
					<div id="gsettingedit">
						<input name="metadata_tagmanagerid" type="text" value="<?php echo $dt['metadata_tagmanagerid']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">View Port</div>
					<div id="gsettinginput">
						<input name="metadata_viewport" type="hidden" value="<?php echo $dt['metadata_viewport']; ?>"><?php echo $dt['metadata_viewport']; ?>
					</div>
				</div>
				<div id="gsettingtitles">ATTRIBUTES</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Share ID</div>
					<div id="gsettingedit">
						<input name="metadata_addthisid" type="text" value="<?php echo $dt['metadata_addthisid']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Share Class</div>
					<div id="gsettingedit">
						<input name="metadata_addthisclass" type="text" value="<?php echo $dt['metadata_addthisclass']; ?>">
					</div>
				</div>
				
				<div id="gsettingtitles">ARTICLE TAG</div>
				<div id="gsetting" class="clearfix" >
					<div id="tagstop">
						<a href="?m=metatag_input&id=<?php echo $dt['metadata_id']; ?>" class="tagsbtn">+ Tags</a>
					</div>
					
					<div id="gsettinginputfull">
						<div id="tagsbot" class="clearfix">
							<?php
								$tgdb = mysqli_query($koneksi, "SELECT * FROM cmas_metatag WHERE metadata_id='$dt[metadata_id]' ORDER BY metatag_id DESC");
								$find = mysqli_num_rows($tgdb);
								
								if ($find == 0) {
									echo "No Tag";
								} else {
									while($tgdt = mysqli_fetch_array($tgdb)) {
							?>
									<div id="tagsrows" class="clearfix">
										<div id="tagsleft">
											<?php echo $tgdt['metatag_title']; ?>
										</div>
										<div id="tagsrite">
											<a href="?m=metatag_hapus&id=<?php echo $tgdt['metatag_id']; ?>" class="erasetags">x</a>
										</div>
									</div>
								<?php } ?>
							<?php } ?>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="tombolsubmit">
			<a href="?m=metadata_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">
			Updated by <b><?php echo $dt['updated_nama']; ?></b> on <b><?php echo date_format(date_create($dt['updated']), 'd/m/Y H:i:s'); ?></b>
		</div>
	</div>
</div>