<!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>
                        Edit language
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li><a href="languages.php">Languages</a></li>
						<li class="active">Edit language</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(); ?>
							<?php else: ?>
								<?php if ($session->get('success')): ?>
								 <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>
									Language edited successfully! 
								 </div>
								 <?php $session->delete('success'); endif; ?>
							<?php endif; ?>
							
							<?php if (isset($_GET['language_code']) && $rowCount > 0): ?>
							<!-- form start -->
                            <form role="form" action="" method="post" enctype="multipart/form-data">
                                 
								<div class="box box-primary">
									<div class="box-header">
                                        <!--<h3 class="box-title">Quick Example</h3>-->
                                    </div><!-- /.box-header -->
									<div class="box-body">
										<div class="form-group col-md-12 no-padding">
											<label class="control-label col-md-2">Language Name</label>
											<div class="col-md-10 no-padding">
												<input type="text" class="form-control" name="language_name" value="<?php echo $lang['language_name']; ?>">
											</div>
										</div>
										<div class="form-group col-md-12 no-padding">
											<label class="control-label col-md-2">Language status</label>
											<div class="col-md-10 no-padding">
												<?php if ($lang['language_status']): ?>
													 <div class="radio-inline">
														<label><input type="radio" class="iradio_minimal" name="language_status" value="1" checked="checked"> Active </label>
													 </div>
													 <div class="radio-inline">															
														<label><input type="radio" class="iradio_minimal" name="language_status" value="0"> Inactive </label>
													 </div>
													 <?php else: ?>
													 <div class="radio-inline">
														<label><input type="radio" class="iradio_minimal" name="language_status" value="1"> Active </label>
													 </div>
													 <div class="radio-inline">															
														<label><input type="radio" class="iradio_minimal" name="language_status" value="0" checked="checked"> Inactive </label>
													 </div>
												<?php endif; ?>
											</div>
										</div>
									</div><!-- /.box-body -->  
									<div class="box-footer">
										<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><!-- /.box-footer -->                                                                        
							    
								<div class="clearfix"></div>
								
								</div><!-- /.box -->
                            </form><!-- /.form -->
							
							<?php else: ?>
								<div class="alert alert-info alert-dismissable">
									<i class="fa fa-info"></i>
									<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
									<p>Languages not found.</p>
								</div>
							<?php endif; ?>
							
                        </div><!--/.col -->
                    </div>   <!-- /.row -->
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
        
    <?php require_once('footer' . cfg('template', 'template_extension')); ?>
	
    </body>
</html>
