<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.js"></script>
<style>
.dropdown-menu{
	width:200px !important;
}
</style>
<div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title">Manage CMS Pages</div>
                            </div>
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i></li>
                                <li><a class="parent-item" href="index.php?page=home">Home</a></li>
                            </ol>
                        </div>
                    </div>
<div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="card">
                                <div class="card-head">
                                    <header></header>                                    
                                </div>
                                <div class="card-body" id="bar-parent1">
                                	
                                	<?php if(isset($error) && $error!='') { ?> 
                                	<div class="alert alert-danger"><?php echo $error; ?></div>
                                	<?php } else if(isset($success) && $success!=''){ ?>                                		
                                		<div class="alert alert-success"><?php echo $success; ?></div>
                                	<?php } else if(isset($_REQUEST['success'])){ ?>                                		
                                		<div class="alert alert-success"><?php echo $_REQUEST['success']; ?></div>
                                	<?php }  ?>
                                	                                	
                                    <form action="" id="form_staff_add" class="form-horizontal" method="post" enctype="multipart/form-data">
                                        <div class="form-body">
                                        	                                        	 
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Select Page<span class="required"> * </span></label>
                                                <div class="col-md-4">                                                    
                                                    <select class="form-control" id="page_name" name="page_name" onchange="submit()">	   
										                      <option value="<?php if(isset($_POST['page_name'])) { echo $_POST['page_name']; } ?>" > <?php if(isset($_POST['page_name'])) { echo $_POST['page_name']; } else { echo 'Select Page'; } ?> </option>
										                      <?php while($pageRec = mysqli_fetch_array($resPageRs)){ ?>
										                      	<option value="<?php echo $pageRec['page_name']; ?>" <?php if(isset($_POST['page_name']) && $_POST['page_name']==$pageRec['page_name']) { echo 'selected'; } ?> ><?php echo $pageRec['page_name']; ?></option>
										                      <?php } ?>					              
										            </select>
                                                </div>
                                            </div> 
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">HTML Title<span class="required"> * </span></label>
                                                <div class="col-md-4">                                                    
                                                    <input name="html_title" type="text" id="html_title" data-required="1" class="form-control" value="<?php if(isset($html_title) && $html_title!=''){ echo $html_title;} ?>"/>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Meta Keywords</label>
                                                <div class="col-md-6">   
                                                	<textarea name="meta_keywords" id="meta_keywords" cols="40" rows="4" class="form-control"><?php if(isset($meta_keywords) && $meta_keywords!=''){ echo $meta_keywords;} ?></textarea>                                                 
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Meta Description</label>
                                                <div class="col-md-6">   
                                                	<textarea name="meta_description" id="meta_description" cols="40" rows="4" class="form-control"><?php if(isset($meta_description) && $meta_description!=''){ echo $meta_description;} ?></textarea>                                                 
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">SEO URL</label>
                                                <div class="col-md-4">                                                    
                                                    <input name="seo_url" type="text" id="seo_url" data-required="1" class="form-control" value="<?php if(isset($seo_url) && $seo_url!=''){ echo $seo_url;} ?>"/>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Page Heading<span class="required"> * </span></label>
                                                <div class="col-md-4">                                                    
                                                    <input name="title" type="text" id="title" data-required="1" class="form-control" value="<?php if(isset($title) && $title!=''){ echo $title;} ?>"/>
                                                </div>
                                            </div>  
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Page Content</label>
                                                <div class="col-md-12"> 
													<textarea name="page_content" id="summernote"><?php if(isset($contentExist) && $contentExist!=''){ echo $contentExist; }?></textarea>
                                                </div> 
                                                <script>
												    $(document).ready(function() {
												        $('#page_content').summernote();
												    });
												</script>
                                            </div>
                                            
                                        </div>                                        
                                      	<div class="form-group">
                                            <div class="offset-md-3 col-md-9">                                            	
                                            	<button type="submit" name="update" class="btn btn-info">Update</button>                                            	
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
	</div>
</div>
