<div class="row">
	<?php if(empty($type)): ?>
		<div class="col-md-6">
			<div class="box box-info">
				<div class="box-header with-border">
					<h3 class="box-title"><?= lang('payment_method'); ?></h3>
					<div class="box-tools pull-right">
						<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
						<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
					</div>
				</div>
				<div class="box-body" >
					<div class="table-responsive">
						<table class="table table-bordered table-condensed table-vcenter card-table">
							<thead>
								<tr>
									<th><?= !empty(lang('sl'))?lang('sl'):"Sl";?></th>
									<th><?= !empty(lang('payment_method'))?lang('payment_method'):"Payment Method";?></th>
									<th><?= !empty(lang('installed'))?lang('installed'):"Installed";?></th>
									<th><?= !empty(lang('status'))?lang('status'):"status";?></th>
									<th><?= !empty(lang('action'))?lang('action'):"action";?></th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<?php $paypal = json_decode($service_settings['paypal_config'],true); ?>
									
									<td>1</td>
									<td>
										<div class="paymentImg">
											<span class="avatar" style="background-image:url(<?= base_url('assets/images/payout/paypal.png')?>);"></span>
											<p>Paypal</p>
										</div>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<span><?= !empty(lang('installed'))?lang('installed'):"Installed";?></span>
										<?php else: ?>
											<span><?= !empty(lang('not_installed'))?lang('not_installed'):"Not Installed";?></span>
										<?php endif; ?>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<?php if($paypal['is_paypal']==1): ?>
												<span class="badge bg-success"></span> <?=  !empty(lang('live'))?lang('live'):"Live";?>
											<?php else: ?>
												<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
											<?php endif;?>
										<?php else: ?>
											<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
										<?php endif; ?>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<a href="<?= base_url('admin/profile/service_settings/paypal'); ?>" class="btn btn-info btn-sm"><i class="fa fa-plus"></i> <?= !empty(lang('add'))?lang('add'):"Add";?> /<?= !empty(lang('edit'))?lang('edit'):"edit";?></a>
										<?php endif; ?>
									</td> 
								</tr>


								<!-- end paypal -->
								<tr>
									<?php $stripe = json_decode($service_settings['stripe_config'],true); ?>
									<td>2</td>
									<td>
										<div class="paymentImg">
											<span class="avatar" style="background-image:url(<?= base_url('assets/images/payout/stripe.png')?>);"></span>
											<p>Stripe</p>
										</div>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<span><?= !empty(lang('installed'))?lang('installed'):"Installed";?></span>
										<?php else: ?>
											<span><?= !empty(lang('not_installed'))?lang('not_installed'):"Not Installed";?></span>
										<?php endif; ?>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<?php if($stripe['is_stripe']==1): ?>
												<span class="badge bg-success"></span> <?=  !empty(lang('live'))?lang('live'):"Live";?>
											<?php else: ?>
												<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
											<?php endif;?>
										<?php else: ?>
											<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
										<?php endif; ?>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<a href="<?= base_url('admin/profile/service_settings/stripe'); ?>" class="btn btn-info btn-sm"><i class="fa fa-plus"></i>  <?= !empty(lang('add'))?lang('add'):"Add";?> / <?= !empty(lang('edit'))?lang('edit'):"edit";?></a>
										<?php endif; ?>
									</td> 
								</tr>



								<!-- stripe -->
								<tr>
									<?php $razorpay = json_decode($service_settings['razorpay_config'],true); ?>
									<td>3</td>
									<td>
										<div class="paymentImg">
											<span class="avatar" style="background-image:url(<?= base_url('assets/images/payout/razorpay.png')?>);"></span>
											<p>Razorpay</p>
										</div>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<span><?= !empty(lang('installed'))?lang('installed'):"Installed";?></span>
										<?php else: ?>
											<span><?= !empty(lang('not_installed'))?lang('not_installed'):"Not Installed";?></span>
										<?php endif; ?>
									</td>
									<td>
										<?php if(is_allow()==1): ?>
											<?php if($razorpay['is_razorpay']==1): ?>
												<span class="badge bg-success"></span> <?=  !empty(lang('live'))?lang('live'):"Live";?>
											<?php else: ?>
												<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
											<?php endif;?>
										<?php else: ?>
											<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
										<?php endif; ?>
									</td>
									<td >
										<?php if(is_allow()==1): ?>
											<a href="<?= base_url('admin/profile/service_settings/razorpay'); ?>" class="btn btn-info btn-sm"><i class="fa fa-plus"></i> <?= !empty(lang('add'))?lang('add'):"Add";?> / <?= !empty(lang('edit'))?lang('edit'):"edit";?></a> 
											
										<?php endif; ?>
										
									</td> 
								</tr><!-- stripe -->

								<tr>
									
									<td>4</td>
									<td>
										<div class="paymentImg">
											<span class="avatar" style="background-image:url(<?= base_url('assets/images/payout/paytm.png')?>);"></span>
											<p>Paytm</p>
										</div>
									</td>
									<td>
										<?= !empty(lang('upcoming'))?lang('upcoming'):"Upcoming";?>
									</td>
									<td>
										<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
									</td>
									<td >
										
									</td> 
								</tr>

								<tr>
									
									<td>5</td>
									<td>
										<div class="paymentImg">
											<span class="avatar" style="background-image:url(<?= base_url('assets/images/payout/mercado.png')?>);"></span>
											<p>Mercadopago</p>
										</div>
									</td>
									<td>
										<?= !empty(lang('upcoming'))?lang('upcoming'):"Upcoming";?>
									</td>
									<td>
										<span class="badge bg-danger"></span><?=  !empty(lang('inactive'))?lang('inactive'):"Inactive";?>
									</td>
									<td >
										
									</td> 
								</tr>
							</tbody>
						</table>
					</div>
				</div><!-- /.box-body -->	
			</div>
			
		</div><!-- col-8 -->
	<div class="col-md-6">
		<div class="box box-info">
			<div class="box-header with-border">
				<h3 class="box-title"><?= lang('service_settings'); ?></h3>
				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
					<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
				</div>
			</div>
			<!-- /.box-header -->
			<form action="<?= base_url('admin/profile/add_service_settings'); ?>" method="post"> 
				<div class="box-body" >
					<div class="upcoming_events">

						<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
						<div class="row">
							<div class="form-group  col-md-6 col-sm-6 col-xs-6">

								<label for=""><?= !empty(lang('currency'))?lang('currency'):"currency";?></label>
								<select name="country_id" class="form-control select2" id="currency">
									<option value=""><?= lang('select'); ?></option>
									<?php foreach ($countries as $key => $con): ?>
										<option value="<?= $con['id'] ;?>" <?= isset($service_settings['country_id']) && $service_settings['country_id']==$con['id']?'selected':'';?>><?= $con['currency_name']; ?> <?= $con['currency_code'] ;?> (<?= $con['currency_symbol'] ;?> )</option>
									<?php endforeach ?>
									
								</select>

							</div>
						</div>
						<div class="row">
							<div class="col-md-12">
								<div class="form-group">
									<label class=""><?= !empty(lang('bank_details'))?lang('bank_details'):"Bank Details";?></label>
									<div class="">
										<textarea name="bank_details" id="bank_details" class="form-control" cols="5" rows="5"><?= $service_settings['bank_details'] ;?></textarea>
									</div>
								</div>
							</div>

						</div>


						<div class="row">
							<div class="col-md-12">
								<div class="form-group">
									<label class=""><?= !empty(lang('pay_button_status'))?lang('pay_button_status'):"Pay button status";?></label>
									<div class="">
										<label class="custom-radio mr-15"><input type="radio" name="pay_button_status" value="1" checked <?= isset($service_settings['pay_button_status']) && $service_settings['pay_button_status']==1?"checked":"" ;?>> <?= lang('show');?></label> &nbsp;
										<label class="custom-radio "><input type="radio" name="pay_button_status" value="0" <?= isset($service_settings['pay_button_status']) && $service_settings['pay_button_status']==0?"checked":"" ;?>> <?= lang('hide');?></label> 
										
									</div>
								</div>
							</div>

						</div>

					</div>	
				</div><!-- /.box-body -->
				<div class="box-footer text-right">
					<input type="hidden" name="id" value="<?= isset($service_settings['id'])?$service_settings['id']:0; ?>">
					<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"save Change";?></button>
				</div>
			</form>
		</div>
	</div>

	<?php endif;?>
</div>

<div class="row">
<?php if(isset($type) && $type=="paypal"): ?>
	<?php if(is_allow()==1): ?>
		<div class="col-md-6">
			<div class="box box-info">
				<div class="box-header with-border">
					<h3 class="box-title"><?= lang('paypal_payment'); ?></h3>
					<div class="box-tools pull-right">
						<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
						<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
					</div>
				</div>
				<!-- /.box-header -->
				<form action="<?= base_url('admin/profile/paypal_config'); ?>" method="post"> 
					<div class="box-body" >
						<div class="upcoming_events">

							<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
							<div class="row">
								<div class="form-group  col-md-6 col-sm-6 col-xs-6">
									<?php $paypal = json_decode($service_settings['paypal_config']); ?>

									<label for=""><?= !empty(lang('status'))?lang('status'):"Status";?></label>
									<select name="is_paypal" class="form-control" id="paypal_staus">
										<option value="1" <?= isset($paypal->is_paypal) && $paypal->is_paypal==1?'selected':'';?>><?= lang('active'); ?></option>
										<option value="0" <?= isset($paypal->is_paypal) && $paypal->is_paypal==0?'selected':'';?>><?= lang('deactive'); ?></option>
									</select>
									
								</div>

								<div class="form-group  col-md-6 col-sm-6 col-xs-6">
									<label for=""><?= !empty(lang('mode'))?lang('mode'):"Mode";?></label>
									<select name="is_live" class="form-control" id="paypal_staus">
										<option value="1" <?= isset($paypal->is_live) && $paypal->is_live==1?'selected':'';?>><?= lang('live'); ?></option>
										<option value="0" <?= isset($paypal->is_live) && $paypal->is_live==0?'selected':'';?>><?= lang('sandbox'); ?></option>
									</select>
								</div>
							</div>
							<div class="row">
								<div class="col-md-12">
									<div class="form-group">
										<label class=""><?= !empty(lang('paypal_email'))?lang('paypal_email'):"Paypal Email";?></label>
										<div class="">
											<input type="text" name="paypal_email" placeholder="<?= !empty(lang('paypal_business_email'))?lang('paypal_business_email'):"Paypal Business Email";?>" class="form-control" value="<?= !empty($paypal->paypal_email)?html_escape($paypal->paypal_email):'';  ?>">
										</div>
									</div>
								</div>

							</div>
								
						</div>	
					</div><!-- /.box-body -->
					<div class="box-footer text-right">
						<div class="pull-left">
			          		<a href="<?= base_url('admin/profile/service_settings'); ?>" class="btn btn-default btn-block btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"cancel";?></a>
			          	</div>
						<input type="hidden" name="id" value="<?= isset($service_settings['id'])?$service_settings['id']:0; ?>">
						<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"save Change";?></button>
					</div>
				</form>
			</div>
		</div><!-- col-12 -->
	<?php endif; ?>
<?php endif;?>

<?php if(isset($type) && $type=="stripe"): ?>
	<?php if(is_allow()==1): ?>
		<div class="col-md-6">
			<div class="box box-info">
				<div class="box-header with-border">
					<h3 class="box-title"><?= lang('stripe_payment'); ?></h3>
					<div class="box-tools pull-right">
						<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
						<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
					</div>
				</div>
				<!-- /.box-header -->
				<form action="<?= base_url('admin/profile/stripe_config'); ?>" method="post"> 
					<div class="box-body" >
						<div class="upcoming_events">

							<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">

							<div class="row">
								<?php $stripe =  json_decode($service_settings['stripe_config']); ?>
								<div class="form-group  col-md-6 col-sm-6 col-xs-12">
									<label for=""><?= !empty(lang('stripe_payment'))?lang('stripe_payment'):"Stripe Payment Gateway";?></label>
									<div class="">
										<input type="checkbox" name="is_stripe" class="" value="1"  <?= isset($stripe->is_stripe) && $stripe->is_stripe==1?'checked':'';?> data-toggle="toggle" data-on="<i class='fa fa-check'></i> <?= lang('active'); ?>" data-off="<i class='fa fa-pause'></i> <?= lang('off'); ?>">

									</div>
								</div>
							</div><!-- row -->
							<div class="row">
								<div class="col-md-6 col-sm-6 col-xs-12">
									<div class="form-group">
										<label class=""><?= !empty(lang('stripe_public_key'))?lang('stripe_public_key'):"Stripe Public key";?></label>
										<div class="">
											<input type="text" name="public_key" placeholder="<?= !empty(lang('stripe_public_key'))?lang('stripe_public_key'):"Stripe Public key";?>" class="form-control" value="<?= !empty($stripe->public_key)?html_escape($stripe->public_key):'';  ?>">
										</div>
									</div>
								</div>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<div class="form-group">
										<label class=""><?= !empty(lang('stripe_secret_key'))?lang('stripe_secret_key'):"Stripe Secret key";?></label>
										<div class="">
											<input type="text" name="secret_key" placeholder="<?= !empty(lang('stripe_secret_key'))?lang('stripe_secret_key'):"Stripe Secret key";?>" class="form-control" value="<?= !empty($stripe->secret_key)?html_escape($stripe->secret_key):'';  ?>">
										</div>
									</div>
								</div>
							</div>	
						</div>	
					</div><!-- /.box-body -->
					<div class="box-footer text-right">
						<div class="pull-left">
			          		<a href="<?= base_url('admin/profile/service_settings'); ?>" class="btn btn-default btn-block btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"cancel";?></a>
			          	</div>
						<input type="hidden" name="id" value="<?= isset($service_settings['id'])?$service_settings['id']:0; ?>">
						<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"save Change";?></button>
					</div>
				</form>
			</div>
		</div><!-- col-12 -->
	<?php endif; ?>
<?php endif;?>

<?php if(isset($type) && $type=="razorpay"): ?>
	<?php if(is_allow()==1): ?>
		<div class="col-md-6">
			<div class="box box-info">
				<div class="box-header with-border">
					<h3 class="box-title"><?= lang('razorpay_payment'); ?></h3>
					<div class="box-tools pull-right">
						<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
						<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
					</div>
				</div>
				<!-- /.box-header -->
				<form action="<?= base_url('admin/profile/razorpay_config'); ?>" method="post"> 
					<div class="box-body" >
						<div class="upcoming_events">

							<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
							<div class="row">
								<div class="form-group  col-md-6 col-sm-6 col-xs-6">
									<?php $razorpay = json_decode($service_settings['razorpay_config']); ?>
									<label for=""><?= !empty(lang('status'))?lang('status'):"Status";?></label>
									<div class="">
										<input type="checkbox" name="is_razorpay" class=""  value="1"  <?= isset($razorpay->is_razorpay) && $razorpay->is_razorpay==1?'checked':'';?> data-toggle="toggle" data-on="<i class='fa fa-check'></i> <?= lang('active');?>" data-off="<i class='fa fa-pause'></i> <?= lang('off'); ?>">
										
									</div>
								</div>
								
							</div>
							<div class="row">
								<div class="col-md-12">
									<div class="form-group">
										<label class=""><?= !empty(lang('key_id'))?lang('key_id'):"Key Id";?></label>
										<div class="">
											<input type="text" name="key_id" placeholder="<?= !empty(lang('key_id'))?lang('key_id'):"razorpay Key id";?>" class="form-control" value="<?= !empty($razorpay->key_id)?html_escape($razorpay->key_id):'';  ?>">
										</div>
									</div>
								</div>
								<div class="col-md-12">
									<div class="form-group">
										<label class=""><?= !empty(lang('secret_key'))?lang('secret_key'):"secret_key";?></label>
										<div class="">
											<input type="text" name="secret_key" placeholder="<?= !empty(lang('secret_key'))?lang('secret_key'):"Secret key";?>" class="form-control" value="<?= !empty($razorpay->secret_key)?html_escape($razorpay->secret_key):'';  ?>">
										</div>
									</div>
								</div>

							</div>
								
						</div>	
					</div><!-- /.box-body -->
					<div class="box-footer text-right">
						<div class="pull-left">
			          		<a href="<?= base_url('admin/profile/service_settings'); ?>" class="btn btn-default btn-block btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"cancel";?></a>
			          	</div>
						<input type="hidden" name="id" value="<?= isset($service_settings['id'])?$service_settings['id']:0; ?>">
						<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"save Change";?></button>
					</div>
				</form>
			</div>
		</div><!-- col-12 -->
	<?php endif; ?>
<?php endif;?>
</div>