<?php
include 'header.php';
$page_nm = "About Us";
$pageUrl = "about-us.php";


    
    if (isset($_POST['btn_submit'])) {

$description = $_POST['description'];

            $editqry = "UPDATE ".DB_PREFIX."about_us SET 
                   description='".$description."' WHERE id='1'";
				   
            $ai_db->aiQuery($editqry);
			
			$ai_core->aiGoPage($pageUrl);
        
    }
  
$qry = "SELECT * FROM ".DB_PREFIX."about_us WHERE id='1'";
$row = $ai_db->aiGetQueryObj($qry);
?>
<script src="<?php ADMIN_URL; ?>ckeditor/ckeditor.js"></script> 
<div class="main-panel">
    <div class="main-content">
        <div class="content-wrapper"><!-- Basic form layout section start -->
            <section id="horizontal-form-layouts">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="content-header">Manage <?php echo $page_nm; ?></div>
                    </div>
                </div>
               
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card">
                                <div class="card-body">
                                    <div class="px-3">

                                        <form name="frm" id="frm" class="form form-horizontal" method="POST" action="" enctype="multipart/form-data" onsubmit="return chkFrm();">
                                            <h4 class="form-section"><i class="ft-life-buoy"></i>About Page Info</h4>
                                                
											
											
											<div class="form-group row">
												<label class="col-md-3 label-control">Address: </label>
												<div class="col-md-9">
												<textarea class="form-control" name="description" id="editor1"><?php echo $row[0]->description ?></textarea>

												</div>
											</div>
											<script>
												CKEDITOR.replace( 'editor1' );
											</script>
											
											
											
											
											
											
						</div>
						<div class="form-group row">
						<div class="col-md-3"></div>
						<div class="col-md-9">
                         
                                                <button type="submit" name="btn_submit" id="btn_submit" class="btn btn-raised btn-primary"><i class="fa fa-check-square-o"></i>Update</button>
												
                        </div>
						</div>						
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                

            </section>
            <!-- // Basic form layout section end -->
        </div>
    </div>
	
	
	
											
											
<?php include ('footer.php'); ?>
<script type="text/javascript">
function chkFrm()
{
	if(document.getElementById("editor1").value == "")
	{
		document.getElementById("editor1").focus();
		alert("Please enter about us detail.");
		return false;
	}
return true;
}
</script>

