<!DOCTYPE html>
<html>
    
	<?php require_once('head' . cfg('template', 'template_extension')); ?>
    
	<body class="skin-black">
        
		<?php require_once('header' . cfg('template', 'template_extension')); ?>
		
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
            <aside class="left-side sidebar-offcanvas">
                
			    <?php require_once('sidebar' . cfg('template', 'template_extension')); ?>	
				
            </aside>

            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        Ads
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li class="active">Ads</li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        
                        <div class="col-md-12">
                            
							<?php if ($error->hasErrors()): ?>
							 <div class="alert alert-danger alert-dismissable">
								<i class="fa fa-ban"></i>
								<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
								<span>
								<strong>An error occurred while processing request</strong>
								</span>
								<?php foreach ($error->displayErrors() as $value): ?>		
								<p><?php echo $value; ?></p>
								<?php endforeach; ?>
							 </div>
							 <?php $error->clearErrors(); endif; ?>
							<?php if ($session->get('success') && isset($_POST['submit'])): ?>
							 <div class="alert alert-success alert-dismissable">
								<i class="fa fa-check"></i>
								<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
								Ads edited successfully! 
							 </div>
							 <?php endif; ?>
							
							<!-- form start -->
                            <form role="form" action="" method="post" enctype="multipart/form-data">

							<!-- Custom Tabs -->
                            <div class="nav-tabs-custom">
                                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#tab_content" data-toggle="tab">Content Ad</a></li>
                                    <li><a href="#tab_sidebar" data-toggle="tab">Sidebar Ad</a></li>
								</ul>
								<div class="tab-content">
									<div class="tab-pane active" id="tab_content">
										<div class="form-group col-md-12 no-padding">
											<label class="control-label col-md-2">Content Ad</label>
											<div class="col-md-10 no-padding">
												<input type="hidden" class="form-control" name="content_ad_id" value="1">
												<textarea class="form-control" rows="15" name="content_ad"><?php echo $content_ad; ?></textarea>
											</div>
										</div>
									</div><!-- /.tab-pane -->
									<div class="tab-pane" id="tab_sidebar">
										<div class="form-group col-md-12 no-padding">
											<label class="control-label col-md-2">Sidebar Ad</label>
											<div class="col-md-10 no-padding">
												<input type="hidden" class="form-control" name="sidebar_ad_id" value="2">
												<textarea class="form-control" rows="15" name="sidebar_ad"><?php echo $sidebar_ad; ?></textarea>
											</div>
										</div>	
									</div><!-- /.tab-pane -->
								</div><!-- /.tab-content -->
								<div class="form-group col-md-12 no-padding">
									<label class="control-label col-md-2"></label>
									<div class="col-md-10 no-padding">
										<button type="submit" name="submit" class="btn btn-primary">Submit</button>
									</div>
								</div>
								<div class="clearfix"></div>
								</div><!-- nav-tabs-custom -->
                            </form><!-- /.form -->
							
                        </div><!--/.col (right) -->
                    </div>   <!-- /.row -->
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
        
    <?php require_once('footer' . cfg('template', 'template_extension')); ?>
	
    </body>
</html>
