Skip to content

Commit a92381e

Browse files
committed
fix footer organization and structure, reduce common code
* pending reduce common js loading on necessary only * pending styling when get into mobile view of footer * now all the rendering loading view from controllers needs footer
1 parent 960aa2e commit a92381e

File tree

14 files changed

+104
-132
lines changed

14 files changed

+104
-132
lines changed

cweb/elcurrencyweb/controllers/Currency_History.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function listcurrencies($id = NULL)
113113
$this->load->view('header.php',$data);
114114
$this->load->view('menu',$data);
115115
$this->load->view('history',$data);
116+
$this->load->view('footer',$data);
116117

117118
}
118119

cweb/elcurrencyweb/controllers/Currency_Manager.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function listcurrencies()
6868
$this->load->view('header',$data);
6969
$this->load->view('menu',$data);
7070
$this->load->view('currency',$data);
71+
$this->load->view('footer',$data);
7172
}
7273

7374
public function updatecurrency()
@@ -113,7 +114,7 @@ public function updatecurrency()
113114
$result = $this->dbcm->updateCurrencyMount($cod_tasa, $mon_tasa_moneda);
114115
}
115116

116-
log_message('error', __METHOD__ .' POST : ' . print_r($result, TRUE) . ' why: '.print_r("Ocurrio un error al guardar", TRUE));
117+
log_message('info', __METHOD__ .' DB result : ' . print_r($result, TRUE) );
117118

118119
// TODO: use this only with desesperate end of time : $this->listcurrencies();
119120
echo json_encode(array('result' =>$result));
@@ -129,7 +130,7 @@ public function callapitodb($codkey = NULL)
129130
{
130131
$this->load->model('Usuario_m','users');
131132
$this->load->library('Userlib');
132-
$this->userlib->initialize('lenz_gerardo');
133+
$this->userlib->initialize('gonzalez_angel');
133134

134135
if(!$this->userlib->isActive())
135136
{
@@ -148,8 +149,11 @@ public function callapitodb($codkey = NULL)
148149

149150
$this->load->config('currencyweb');
150151
$codkeyconf = $this->config->item('codkey');
151-
if( $codkey == $codkeyconf)
152+
if( $codkey != $codkeyconf)
153+
{
152154
log_message('error', __METHOD__ .' invalid codkey ' .print_r($codkey,TRUE). ' from config: '.print_r($codkeyconf, TRUE));
155+
// return json_encode(array('result'=>'unauthorized access'));
156+
}
153157
$config['language'] = 'spanish';
154158
$data = array();
155159
// example invokation http://localhost/~general/codeigniter-currencylib/cweb/index.php/Currency_Manager/callapitodb/SHAR265ql-23krjhnou2q34rhi2?dateapi=2023-02-03&curbase=USD

cweb/elcurrencyweb/controllers/Currency_Users.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function listusers()
5050
$this->load->view('header',$data);
5151
$this->load->view('menu');
5252
$this->load->view('empty',$data);
53+
$this->load->view('footer',$data);
5354
}
5455
}
5556

cweb/elcurrencyweb/controllers/Home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function index()
4040
$this->load->view('header',$data);
4141
$this->load->view('menu',$data);
4242
$this->load->view('home',$data);
43-
// $this->load->view('footer.php',$data);
43+
$this->load->view('footer',$data);
4444
}
4545

4646
}

cweb/elcurrencyweb/controllers/Login.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function home($idcheck = NULL)
8080
$this->load->view('header',$data);
8181
$this->load->view('menu');
8282
$this->load->view('home',$data);
83+
$this->load->view('footer',$data);
8384
}
8485

8586
/**

cweb/elcurrencyweb/views/currency.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,4 @@
235235

236236

237237
</script>
238-
</div>
239-
</div>
240-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
241-
echo link_js("https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js", 'integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"');
242-
?>
243-
</body>
244-
</html>
238+

cweb/elcurrencyweb/views/empty.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,3 @@
4343
</tbody>
4444
</table>
4545
</div>
46-
47-
48-
</div>
49-
</div>
50-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
51-
echo link_js("https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js", 'integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"');
52-
?>
53-
</body>
54-
</html>
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2-
echo '<p style="display: flex; justify-content: center;"><small>'.br().br();
3-
if (ENVIRONMENT !== 'production')
4-
echo 'DEVEL MODE: ON (<strong>render: {elapsed_time}</strong> s).'. PHP_EOL;
5-
echo br();
6-
echo anchor('https://gitlab.com/codeigniterpower','Powered by &copy Codeigniterpowered'), PHP_EOL;
7-
echo '</p></small>'. PHP_EOL;
8-
echo link_js("https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js", 'integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"');
2+
3+
4+
echo link_js("https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js", 'integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"');
5+
echo '</div>'.PHP_EOL;
6+
echo '</div>'.PHP_EOL;
7+
98
echo '</body>', PHP_EOL,'</html>', PHP_EOL;
109
?>

cweb/elcurrencyweb/views/header.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@
2626
// TODO : here the CSS and JS links use HTTP urls or just the name of the file
2727
echo '</head>'. PHP_EOL;
2828
echo '<body>'.PHP_EOL;
29+
30+
echo '<div class="container-fluid">'.PHP_EOL;
31+
echo '<div class="row flex-nowrap">'.PHP_EOL;

cweb/elcurrencyweb/views/history.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
});
5757
});
5858
</script>
59-
</div>
6059
<?php
6160
/* ** GROCERYCRUP ONLY dont touch, this is same data but only if you used mysql
6261
echo $output;
@@ -68,9 +67,3 @@
6867
}
6968
*/
7069
?>
71-
</div>
72-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
73-
echo link_js("https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js", 'integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"');
74-
?>
75-
</body>
76-
</html>

0 commit comments

Comments
 (0)