<?php  session_start(); error_reporting(0); ?>
<?php if(!isset($_SESSION['j_admin'])){ 
    $url = urlencode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); header('location:../login/?url='.$url.'');  
} ?>
<!doctype html>
<html lang="en"> 
<head>
	<?php
    require_once("../j_conn/url.php");
    require_once("../j_conn/dbc.php");
    require_once("../j_incs/functions.php");
    $page_name="Settings";
    $page_desc="$page_name";
    $page_img="".$dir."j_files/j_img/logo/logo-meta.png";
    $page_author="$company";
    $page_keywords="".$company.", $page_name, $page_desc, ".$company_motto.", $company_desc";
    $page_url="".$dir."settings/";
    require_once("../j_incs/metas.php");
    require_once("../j_incs/scripts-top.php");
    ?>
</head>
<body>
    <div class="app">
        <div class="layout">
            <?php 
            require_once("../j_incs/header.php");
            require_once("../j_incs/nav.php");
            ?>
            <!-- Page Container START -->
            <div class="page-container">
                

                <!-- Content Wrapper START -->
                <div class="main-content">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-1"></div>
                            <div class="col-md-10">
                                <div class="page-header">
									<div class="header-sub-title">
										<nav class="breadcrumb breadcrumb-dash">
											<a href="<?php echo $dir; ?>" class="breadcrumb-item"><i class="anticon anticon-dashboard m-r-5"></i>Dashboard</a>
											<!--<a class="breadcrumb-item" href="#"> </a>-->
											<span class="breadcrumb-item active"><?php echo $page_name; ?></span>
										</nav>
									</div>
								</div>
                            </div>
                        </div>
                    </div>
        
					<div class="container-fluid">
						<div class="row">
							<div class="col-md-1"></div>
							<div class="col-md-10">
								
								
								
								<div class="accordion" id="accordion-default4"> <!--verify action-->
									<div class="card">
										<div class="card-header">
											<h5 class="card-title">
												<a data-toggle="collapse" href="#acc_4">
													<span><?php echo $page_name; ?></span>
												</a>
											</h5>
										</div>
										<div id="acc_4" class="collapse show" data-parent="#accordion-default4">
											<div class="card-body">
												
							
		
                        
												<form method="POST" action="" enctype="multipart/form-data" id="form">
													
													
													
													
													
													<div class="row">	
																<div class="col-md-6">
																	<div class="form-group">
																		<label>Company </label>
																		<input value="<?php echo $company; ?>" placeholder="Company" style="font-size:13px;" type="text" name="company" class="form-control"/>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Company's Motto </label>
																		<input value="<?php echo $company_motto; ?>" placeholder="Company's Motto" style="font-size:13px;" type="text" name="motto" class="form-control"/>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Company's Short Description </label>
																		<input value="<?php echo $company_desc; ?>" placeholder="Company's Description" style="font-size:13px;" type="text" name="desc" class="form-control"/>
																	</div>
																 </div>
																 
														
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Phone Number </label>
																		<input value="<?php echo $company_phone; ?>" placeholder="Phone Number" style="font-size:13px;" type="text" name="phone" class="form-control"/>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Email Address </label>
																		<input value="<?php echo $company_email; ?>" placeholder="Email Address" style="font-size:13px;" type="text" name="email" class="form-control"/>
																	</div>
																 </div>
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Website </label>
																		<input value="<?php echo $company_website; ?>" placeholder="Website" style="font-size:13px;" type="text" name="website" class="form-control"/>
																	</div>
																 </div>
																
																<div class="col-md-12">
																	<div class="form-group">
																		<label> Office Address </label>
																		<input value="<?php echo $company_address; ?>" placeholder="Office Address" style="font-size:13px;" type="text" name="address" class="form-control"/>
																	</div>
																 </div>
																
																
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Logo </label>
																		<input style="font-size:10px;" type="file" name="file1" class="form-control"/>
																		<span class="text-muted"> For Mails and display on web pages (200px X 200px)</span>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Nav Bar Logo</label>
																		<input style="font-size:10px;" type="file" name="file2" class="form-control"/>
																		<span class="text-muted"> For Navigation Bar on all web pages. (120px X 27px) 
																		</span>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Logo Meta </label>
																		<input style="font-size:10px;" type="file" name="file3" class="form-control"/>
																		<span class="text-muted"> Display when a web page is shared online. (300px X 200px)</span>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Favicon </label>
																		<input style="font-size:10px;" type="file" name="file4" class="form-control"/>
																		<span class="text-muted"> Small Icon beside the title of all web pages. (32px X 32px)</span>
																	</div>
																 </div>
											  
																
																
							 
															</div>
															
															
															
															
															
															<div class="row">	
														
																<div class="col-md-6">
																	<div class="form-group">
																		<label> BTC Wallet Address </label>
																		<input value="<?php echo $company_btc_address; ?>" placeholder="BTC Address" style="font-size:13px;" type="text" name="btc" class="form-control"/>
																	</div>
																 </div>
																 
																 <div class="col-md-6">
																	<div class="form-group">
																		<label> ETH Wallet Address  </label>
																		<input value="<?php echo $company_eth_address; ?>" placeholder="ETH Address" style="font-size:13px;" type="text" name="eth" class="form-control"/>
																	</div>
																 </div>
																 
																 
																 <div class="col-md-6">
																	<div class="form-group">
																		<label> Registration Fee (<?php echo $currency_in_use ?>)</label>
																		<input value="<?php echo $company_reg_fee; ?>" placeholder="Registration Fee" style="font-size:13px;" type="text" name="reg_fee" class="form-control"/>
																	</div>
																 </div>
																 
																 <div class="col-md-6">
																	<div class="form-group">
																		<label> Bank Account</label>
																		<input value="<?php echo $company_bank_info; ?>" placeholder="Bank Account" style="font-size:13px;" type="text" name="bank_info" class="form-control"/>
																	</div>
																 </div>
																 
																 <div class="col-md-6">
																	<div class="form-group">
																		<label> Referral Bonus (%)</label>
																		<input value="<?php echo $company_referral_perc; ?>" placeholder="Referral Bonus" style="font-size:13px;" type="text" name="referral_bonus" class="form-control"/>
																	</div>
																 </div>
																 
																 <?php 
																 /*
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Paystack Public Key </label>
																		<input value="<?php echo $ppk; ?>" placeholder="Paystack Public Key" style="font-size:13px;" type="text" name="ppk" class="form-control"/>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Paystack Secret Key </label>
																		<input value="<?php echo $psk; ?>" placeholder="Paystack Public Key" style="font-size:13px;" type="text" name="psk" class="form-control"/>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Flutterwave Rave Public Key </label>
																		<input value="<?php echo $fpk; ?>" placeholder="Rave Public Key" style="font-size:13px;" type="text" name="fpk" class="form-control"/>
																	</div>
																 </div>
																
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Flutterwave Rave Secret Key </label>
																		<input value="<?php echo $fsk; ?>" placeholder="Rave Public Key" style="font-size:13px;" type="text" name="fsk" class="form-control"/>
																	</div>
																 </div>
																*/
																?>
																
																
															</div>
															
															
															
															<div class="row">	
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Company Prefix for Transaction ID </label>
																		<input value="<?php echo $acr; ?>" placeholder="Company Acronyms" style="font-size:13px;" type="text" name="acr" class="form-control"/>
																	</div>
																 </div>
																
														
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Facebook </label>
																		<input value="<?php echo $facebook; ?>" placeholder="Facebook" style="font-size:13px;" type="text" name="facebook" class="form-control"/>
																	</div>
																 </div>
																 
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Twitter </label>
																		<input value="<?php echo $twitter; ?>" placeholder="Twitter" style="font-size:13px;" type="text" name="twitter" class="form-control"/>
																	</div>
																 </div>
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Instagram </label>
																		<input value="<?php echo $instagram; ?>" placeholder="Instagram" style="font-size:13px;" type="text" name="instagram" class="form-control"/>
																	</div>
																 </div>
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Whatsapp </label>
																		<input value="<?php echo $whatsapp; ?>" placeholder="Whatsapp" style="font-size:13px;" type="text" name="whatsapp" class="form-control"/>
																	</div>
																 </div>
																 
																 <div class="col-md-6">
																	<div class="form-group">
																		<label> Telegram </label>
																		<input value="<?php echo $telegram; ?>" placeholder="Telegram" style="font-size:13px;" type="text" name="telegram" class="form-control"/>
																	</div>
																 </div>
																
																<div class="col-md-6">
																	<div class="form-group">
																		<label> Youtube </label>
																		<input value="<?php echo $youtube; ?>" placeholder="Youtube" style="font-size:13px;" type="text" name="youtube" class="form-control"/>
																	</div>
																 </div>
															
																 
															
																
																
																
																
																
																
																
																
															</div>
															
															
															
														
															
													
													
													
													
													<div class="row">
														<div class="col-md-4">
															<button type="submit" id="submit" class="btn btn-primary glow w-100 position-relative"> Update Settings <i id="icon-arrow" class="fa fa-arrow-right"></i></button>
														</div>
													</div>
												</form>
												<br/>
												<div id="formresult"></div>
                        

						
                        
                        
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>




    <?php  require_once("../j_incs/footer.php"); ?>
    <?php  require_once("../j_incs/scripts-bottom.php"); ?>
     <script>
        var form = "#form";
        var button = "#submit";
        var button_val = $(button).html();
        var result = "#formresult";
        $(form).on('submit',(function(e) {
        e.preventDefault();
        $(button).attr('disabled', '');
        $(button).html("<i class='fa fa-cog fa fa-spin white'></i> Processing");
        $(result).html("<div class='alert alert-warning'> Taking too long? <a href=''>Reload </a></div>");
         $.ajax({
        url: "save.php",
        type: "POST",
        data: new FormData(this),
        contentType: false,
        cache: false,
        processData:false,
        success: function(data)
        {
        if(data){
         $(button).removeAttr('disabled');
        $(button).html(button_val);
        $(result).html(data);
        }else{
        $(result).html("Error occurred.");
        $(button).removeAttr('disabled');
        $(button).html(button_val);
        }
        }
        });
        }));
        </script>

</body>
</html>
