Current path: home/webdevt/cryptoimpot.fr/module/Application/view/application/autres-transactions/
?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/view/application
<?php
$this->headTitle()->append('Autres transactions');
//$this->HeadLink()->appendStylesheet('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.css');
//$this->headScript()
// ->appendFile('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js')
// ->appendFile('https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js')
;
//<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
//<link rel="stylesheet" href="" />
//<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
?>
<!--<div class="container-fluid" style="background-color: #F7F7FB; padding: 15px;">
<div class="row shadow bg-white p-4" style="margin: 15px 150px;">
<div class="col">
<h2>Informations sur les exchanges</h2>
<dl class="zend-form">
Echanges
<div id="select-exchange-container" class="form-group <?php echo $erreurNom ?>">
<?php foreach ($this->exchangeArray as $idExchange => $nameExchange) : ?>
<img data-type="<?= !empty($this->arrayIdExchangesUser) && !empty($this->arrayIdExchangesUser[$idExchange]) ? 'remove' : 'add' ?>" data-id="<?= $idExchange ?>" width="180" src="dist/img/exchange/<?= strtolower($nameExchange) ?>.png" alt="<?= $nameExchange ?>" class="exchange-selectable shadow m-2 bg-white rounded d-inline p-1 border border-3 <?= !empty($this->arrayIdExchangesUser) && !empty($this->arrayIdExchangesUser[$idExchange]) ? 'border-primary' : '' ?>">
<div class="d-inline p-10 border border-primary <?= !empty($this->arrayIdExchangesUser) && !empty($this->arrayIdExchangesUser[$idExchange]) ? 'selected' : '' ?>">
<img style="width:200px" src="dist/img/exchange/<?= strtolower($nameExchange) ?>.png" alt="<?= $nameExchange ?>">
</div>
<?php endforeach; ?>
</div>
./ Echanges
</dl>
</div>
</div>
</div>-->
<div class="container-fluid">
<div class="row justify-content-center align-items-center mt-5 mb-3" style="margin:0 150px;">
<div class="col col-sm-12">
<h3>Autres transactions</h3>
<p>Indiquez les transactions non présentes dans vos fichiers de trade d'exchange.</p>
<p>Si vous avez de nombreuses lignes à ajouter nous vous conseillons d'utiliser le fichier d'importation de transactions génériques et de l'importer dans l'onglet exchange générique</p>
<p>Vous pouvez ajouter par exemple un don, un achat sur une plateform n'existant plus, ...</p>
</div>
</div>
<?php $messages = $form->getMessages(); ?>
<?php if ($messages) : ?>
<div class="row justify-content-center align-items-center mt-5 ">
<div class="col col-sm-12 col-md-6 col-md-offset-3">
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<?php foreach ($messages as $field => $messageArray) : ?>
<b><?= $field ?></b>
<ul>
<?php foreach ($messageArray as $message) : ?>
<li><?= print_r($message) ?></li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
<?php endif ?>
<!--<div class="row justify-content-center align-items-center h-100">-->
<div class="shadow bg-white mt-5 p-4" style="border-bottom: 1px solid #dee2e6; margin: 15px 100px;">
<div class="row justify-content-center align-items-center mt-5 ">
<div class="col col-sm-12">
<?php
$form->setAttribute('class', 'form-inline');
echo $this->form()->openTag($form)
?>
<!-- datetimeTransaction -->
<?php
$datetimeTransaction = $form->get('datetimeTransaction');
$datetimeTransaction->setAttribute('class', 'form-control mb-2 mr-sm-2')
->setAttribute('placeholder', 'Date de la transaction')
?>
<!--<div class="form-group <?php echo ($this->formElementErrors($datetimeTransaction)) ? ' has-error' : '' ?>">-->
<?php //echo $this->formLabel($datetimeTransaction); ?>
<?php echo $this->formElement($datetimeTransaction); ?>
<!--</div>-->
<!--./ datetimeTransaction -->
<!-- tradedAmount -->
<?php
$tradedAmount = $form->get('tradedAmount');
$tradedAmount->setAttribute('class', 'form-control mb-2 mr-sm-2')
->setAttribute('placeholder', 'Montant vendu')
?>
<!--<div class="form-group <?php echo ($this->formElementErrors($tradedAmount)) ? ' has-error' : '' ?>">-->
<?php //echo $this->formLabel($tradedAmount); ?>
<?php echo $this->formElement($tradedAmount); ?>
<!--</div>-->
<!--./ tradedAmount -->
<!-- Devise_traded -->
<?php
$tradedCurrency = $form->get('tradedCurrency');
$tradedCurrency->setAttribute('class', 'form-control mb-2 mr-sm-1')
->setAttribute('placeholder', 'Devise vendu')
?>
<?php //echo ($this->formElementErrors($form->get('tradedCurrency'))) ? ' has-error' : '' ?>
<?php //echo $this->formLabel($tradedCurrency); ?>
<?php echo $this->formElement($tradedCurrency); ?>
<!--./ Devise_traded -->
<!-- Qty received-->
<?php
$receivedAmount = $form->get('receivedAmount');
$receivedAmount->setAttribute('class', 'form-control mb-2 mr-sm-2')
->setAttribute('placeholder', 'Montant reçu')
?>
<?php //echo ($this->formElementErrors($form->get('receivedAmount'))) ? ' has-error' : '' ?>
<?php //echo $this->formLabel($form->get('receivedAmount')); ?>
<?php echo $this->formElement($receivedAmount); ?>
<!--./ Qty received -->
<!-- Devise received -->
<?php
$receivedCurrency = $form->get('receivedCurrency');
$receivedCurrency->setAttribute('class', 'form-control mb-2 mr-sm-1')
->setAttribute('placeholder', 'Devise reçu')
?>
<!--<div class="form-group <?php echo ($this->formElementErrors($form->get('receivedCurrency'))) ? ' has-error' : '' ?>">-->
<?php //echo $this->formLabel($receivedCurrency); ?>
<?php echo $this->formElement($receivedCurrency); ?>
<!--./ Devise received -->
<!-- Fees-->
<?php
$fees = $form->get('fees');
$fees->setAttribute('class', 'form-control mb-2 mr-sm-2')
->setAttribute('placeholder', 'Frais de la plateforme')
?>
<!--<div class="form-group <?php //echo ($this->formElementErrors($form->get('fees'))) ? ' has-error' : '' ?>">-->
<?php // echo $this->formLabel($fees); ?>
<?php echo $this->formElement($fees); ?>
<!--</div>-->
<!--./ Fees -->
<!-- Fees currency -->
<?php
$feesCurrency = $form->get('feesCurrency');
$feesCurrency->setAttribute('class', 'form-control mb-2 mr-sm-1')
->setAttribute('placeholder', 'Devise frais')
?>
<!--<div class="form-group <?php //echo ($this->formElementErrors($form->get('feesCurrency'))) ? ' has-error' : '' ?>">-->
<?php //echo $this->formLabel($feesCurrency); ?>
<?php echo $this->formElement($feesCurrency); ?>
<!--./ Fees currency -->
<?php echo $this->formElement($form->get('csrf')) ?>
<?php
$formButton = $form->get('submit');
$formButton->setAttribute('class', 'form-control btn btn-primary btn-lg btn-block mb-2');
//$formButton->setLabel($this->translate('Login to your account'));
?>
<?php echo $this->formButton($formButton) ?>
<?php echo $this->form()->closeTag() ?>
</div>
</div>
</div>
<!--</div>-->
</div>
<script>
$(function () {
$('.exchange-selectable').hover(function () {
$(this).css('cursor', 'pointer');
}).click(function () {
console.log($(this).data('id'));
$.ajax({
method: "POST",
//contentType: "application/json",
url: '<?= $this->basePath() ?>/information/update-exchange',
data: {id: $(this).data('id'), type: $(this).data('type')},
//dataType: 'json',
timeout: 600000,
success: function (data) {
//
console.log("SUCCESS: ", data.response);
console.log("SUCCESS: ", data.type);
var selectedDiv = $('img[data-id="' + data.id + '"]');
if (data.response === 'success' && data.type === "add") {
console.log(selectedDiv.hasClass('border-primary'));
selectedDiv.removeClass('border-primary');
console.log($(this).hasClass('border-primary'));
selectedDiv.addClass('border-primary');
console.log(selectedDiv.hasClass('border-primary'));
selectedDiv.data('type', 'remove');
} else if (data.response === 'success' && data.type === "remove") {
selectedDiv.removeClass('border-primary');
selectedDiv.data('type', 'add');
}
},
error: function (e) {
console.log("ERROR: ", e);
}
});
});
});
</script>