Current path: home/webdevt/cryptoimpot.fr/module/Application/view/application/information/
?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/view/application
<?php
$this->headTitle()->append('Information sur les exchanges');
//$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">
<h3>Informations sur les exchanges</h3>
<dl class="zend-form">
<!-- Echanges -->
<div id="select-exchange-container" class="form-group <?php echo !empty($erreurNom) ? $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>
<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>