Skip to content

Commit 329de94

Browse files
committed
added verification user
1 parent 042c8d8 commit 329de94

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

cweb/elcurrencyweb/views/currency.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
</section>
77
<br>
88
<div class="contain-table">
9-
<div class="d-flex justify-content-end">
10-
<button type="button" class="btn btn-outline-success" id="button-call">Llamar a la api</button>
11-
</div>
12-
9+
<?php
10+
if($active){
11+
echo ' <div class="d-flex justify-content-end">';
12+
echo '<button type="button" class="btn btn-outline-success" id="button-call">Llamar a la api</button>';
13+
echo '</div>';
14+
}
15+
?>
1316
<?php
1417
echo br(2);
1518
if(is_array($currency_list_dbarraypre) )
1619
{
17-
if(count($currency_list_dbarraypre) && $user_preferences[0]['user_status'] === 'ACTIVO')
20+
if(count($currency_list_dbarraypre))
1821
{
1922
echo '<h1 style="text-align: center;">Your preferences currencies</h1>';
2023
$this->table->clear();
2124
$this->table->set_template( array( 'table_open' => '<table id="table_id">',) );
2225
$this->table->set_heading(array_keys($currency_list_dbarraypre[0]));
2326
echo $this->table->generate($currency_list_dbarraypre);
2427
}
25-
// else
26-
// <h1 style="text-align: center;">History of your coins rate</h1>
27-
// echo "There's not data stored today, check if your system already call the api in backend, or check if your DB is configured.";
2828
}
2929
echo br(2);
3030

@@ -38,9 +38,6 @@
3838
$this->table->set_heading(array_keys($currency_list_dbarraynow[0]));
3939
echo $this->table->generate($currency_list_dbarraynow);
4040
}
41-
// else
42-
// <h1 style="text-align: center;">History of your coins rate</h1>
43-
// echo "There's not data stored today, check if your system already call the api in backend, or check if your DB is configured.";
4441
}
4542

4643

@@ -54,12 +51,15 @@
5451
$(document).ready( function () {
5552

5653
// ---------------------------------------------------------------------------
57-
54+
let activeUser = "<?php echo $active ?>"
55+
5856
table1 = $('#table_id').DataTable(
5957
{
6058
"order": [0]
6159
}
6260
);
61+
62+
if(activeUser){
6363
$('#table_id tbody').on('click', 'tr', function () {
6464
var data = table1.row(this).data()
6565
alert(data,'primary')
@@ -111,15 +111,19 @@
111111

112112

113113
});
114+
}
114115

115116

116117
// ---------------------------------------------------------------------------
117118

119+
118120
table2 = $('#table_id2').DataTable(
119121
{
120122
"order": [0]
121123
}
122124
);
125+
if(activeUser){
126+
123127
$('#table_id2 tbody').on('click', 'tr', function () {
124128
var data = table2.row(this).data()
125129
alert(data,'primary')
@@ -168,10 +172,9 @@
168172
});
169173

170174
})
171-
172-
173175
});
174176

177+
}
175178

176179

177180

0 commit comments

Comments
 (0)