<?php

$admin_username = $this->registry->get('user')->getUserName();

?>
<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">

	<div class="page-header">
		<div class="container-fluid">
			<div class="pull-right">
				<button type="submit" form="form-pagseguro" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
				<a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
			<h1><?php echo $heading_title; ?></h1>
			<ul class="breadcrumb">
				<?php foreach ($breadcrumbs as $breadcrumb) { ?>
				<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
				<?php } ?>
			</ul>
		</div>
	</div>

	<div class="container-fluid">

		<?php if ($error_warning) { ?>
		<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
			<button type="button" class="close" data-dismiss="alert">&times;</button>
		</div>
		<?php } ?>

		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
			</div>
			<div class="panel-body">

				<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-pagseguro" class="form-horizontal">

					<ul class="nav nav-tabs">
						<li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $tab_general; ?></a></li>
						<li><a href="#tab-status" data-toggle="tab"><?php echo $tab_order_status; ?></a></li>
					</ul>

					<div class="tab-content">
						<div class="tab-pane active" id="tab-general">
							<div class="form-group">
								<label class="col-sm-2 control-label"><?php echo $entry_title; ?></label>
								<div class="col-sm-10">
									<?php foreach ($languages as $language) { ?>
									<div class="input-group">
										<span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span>
										<input type="text" name="pagseguro_title[<?php echo $language['language_id']; ?>]" placeholder="<?php echo $heading_title; ?>" class="form-control" value="<?php echo isset($pagseguro_title[$language['language_id']]) ? $pagseguro_title[$language['language_id']] : ''; ?>">
									</div>
									<?php } ?>
								</div>
							</div>
							<br>
							<div class="form-group required">
								<label class="col-sm-2 control-label" for="input-token"><span data-toggle="tooltip" title="<?php echo $help_token; ?>"><?php echo $entry_token; ?></span></label>
								<div class="col-sm-10">
									<input type="text" name="pagseguro_token" value="<?php echo $pagseguro_token; ?>" placeholder="<?php echo $entry_token; ?>" id="input-token" class="form-control" />
									<?php if ($error_token) { ?>
									<div class="text-danger"><?php echo $error_token; ?></div>
									<?php } ?>
								</div>
							</div>
							<div class="form-group required">
								<label class="col-sm-2 control-label" for="input-email"><span data-toggle="tooltip" title="<?php echo $help_email; ?>"><?php echo $entry_email; ?></span></label>
								<div class="col-sm-10">
									<input type="text" name="pagseguro_email" value="<?php echo $pagseguro_email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control" />
									<?php if ($error_email) { ?>
									<div class="text-danger"><?php echo $error_email; ?></div>
									<?php } ?>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-posfixo"><span data-toggle="tooltip" title="<?php echo $help_posfixo; ?>"><?php echo $entry_posfixo; ?></span></label>
								<div class="col-sm-10">
									<input type="text" name="pagseguro_posfixo" value="<?php echo $pagseguro_posfixo; ?>" placeholder="<?php echo $entry_posfixo; ?>" id="input-posfixo" class="form-control" />
								</div>
							</div>
							<br>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-minimo"><span data-toggle="tooltip" title="<?php echo $help_minimo; ?>"><?php echo $entry_minimo; ?></span></label>
								<div class="col-sm-10">
									<input type="text" name="pagseguro_minimo" value="<?php echo $pagseguro_minimo; ?>" placeholder="<?php echo $entry_minimo; ?>" id="input-minimo" class="form-control" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-maximo"><span data-toggle="tooltip" title="<?php echo $help_maximo; ?>"><?php echo $entry_maximo; ?></span></label>
								<div class="col-sm-10">
									<input type="text" name="pagseguro_maximo" value="<?php echo $pagseguro_maximo; ?>" placeholder="<?php echo $entry_maximo; ?>" id="input-maximo" class="form-control" />
								</div>
							</div>
							<br>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-geo-zone-id"><?php echo $entry_geo_zone; ?></label>
								<div class="col-sm-10">
									<select name="pagseguro_geo_zone_id" id="input-geo-zone-id" class="form-control">
									<option value="0"><?php echo $text_all_zones; ?></option>
									<?php foreach ($geo_zones as $geo_zone) { ?>
										<option value="<?php echo $geo_zone['geo_zone_id']; ?>" <?php if ($geo_zone['geo_zone_id'] == $pagseguro_geo_zone_id) { echo('selected'); } ?> ><?php echo $geo_zone['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
								<div class="col-sm-10">
									<select name="pagseguro_status" id="input-status" class="form-control">
									<option value="1" <?php if ($pagseguro_status == '1') { echo('selected'); } ?> ><?php echo $text_enabled; ?></option>
									<option value="0" <?php if ($pagseguro_status == '0') { echo('selected'); } ?> ><?php echo $text_disabled; ?></option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-sort-order"><?php echo $entry_sort_order; ?></label>
								<div class="col-sm-10">
									<input type="text" name="pagseguro_sort_order" value="<?php echo $pagseguro_sort_order; ?>" placeholder="<?php echo $entry_sort_order; ?>" id="input-sort-order" class="form-control" />
								</div>
							</div>
						</div>

						<div class="tab-pane" id="tab-status">
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-update-status-alert"><span data-toggle="tooltip" title="<?php echo $help_update_status_alert; ?>"><?php echo $entry_update_status_alert; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_update_status_alert" id="input-update-status-alert" class="form-control">
									<option value="1" <?php if ($pagseguro_update_status_alert == '1') { echo('selected'); } ?> ><?php echo $text_yes; ?></option>
									<option value="0" <?php if ($pagseguro_update_status_alert == '0') { echo('selected'); } ?> ><?php echo $text_no; ?></option>
									</select>
								</div>
							</div>
							<br>
							<div class="form-group required">
								<label class="col-sm-2 control-label" for="input-order-ag-retorno"><span data-toggle="tooltip" title="<?php echo $help_order_ag_retorno; ?>"><?php echo $entry_order_ag_retorno; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_aguardando_retorno" id="input-order-ag-retorno" class="form-control">
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_aguardando_retorno) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-ag-pagamento"><span data-toggle="tooltip" title="<?php echo $help_order_ag_pagamento; ?>"><?php echo $entry_order_ag_pagamento; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_aguardando_pagamento" id="input-order-ag-pagamento" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_aguardando_pagamento) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-analise"><span data-toggle="tooltip" title="<?php echo $help_order_analise; ?>"><?php echo $entry_order_analise; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_analise" id="input-order-analise" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_analise) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group required">
								<label class="col-sm-2 control-label" for="input-order-paga"><span data-toggle="tooltip" title="<?php echo $help_order_paga; ?>"><?php echo $entry_order_paga; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_paga" id="input-order-paga" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_paga) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-disponivel"><span data-toggle="tooltip" title="<?php echo $help_order_disponivel; ?>"><?php echo $entry_order_disponivel; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_disponivel" id="input-order-disponivel" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_disponivel) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-disputa"><span data-toggle="tooltip" title="<?php echo $help_order_disputa; ?>"><?php echo $entry_order_disputa; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_disputa" id="input-order-disputa" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_disputa) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-devolvida"><span data-toggle="tooltip" title="<?php echo $help_order_devolvida; ?>"><?php echo $entry_order_devolvida; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_devolvida" id="input-order-devolvida" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_devolvida) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-cancelada"><span data-toggle="tooltip" title="<?php echo $help_order_cancelada; ?>"><?php echo $entry_order_cancelada; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_cancelada" id="input-order-cancelada" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_cancelada) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-chargeback"><span data-toggle="tooltip" title="<?php echo $help_order_chargeback; ?>"><?php echo $entry_order_chargeback; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_chargeback" id="input-order-chargeback" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_chargeback) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-order-contestacao"><span data-toggle="tooltip" title="<?php echo $help_order_contestacao; ?>"><?php echo $entry_order_contestacao; ?></span></label>
								<div class="col-sm-10">
									<select name="pagseguro_order_contestacao" id="input-order-contestacao" class="form-control">
									<option value="">--- não modificar status ---</option>
									<?php foreach ($order_statuses as $order_status) { ?>
										<option value="<?php echo $order_status['order_status_id']; ?>" <?php if ($order_status['order_status_id'] == $pagseguro_order_contestacao) { echo('selected'); } ?> ><?php echo $order_status['name']; ?></option>
									<?php } ?>
									</select>
								</div>
							</div>
						</div>
					</div>

				</form>

			</div>
		</div>

	</div>

</div>
<?php echo $footer; ?>