mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
paths libary
This commit is contained in:
@@ -52,7 +52,7 @@ $autoload['packages'] = array(APPPATH.'third_party');
|
||||
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
|
||||
*/
|
||||
|
||||
$autoload['libraries'] = array('database', 'session', 'curl', 'OptionsLib', 'Frequency');
|
||||
$autoload['libraries'] = array('database', 'session', 'curl', 'OptionsLib', 'Paths', 'Frequency');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
// generic function for return eQsl path //
|
||||
function wl_getPathEqsl() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Eqsl_images');
|
||||
return $CI->Eqsl_images->get_imagePath();
|
||||
}
|
||||
|
||||
// generic function for return Qsl path //
|
||||
function wl_getPathQsl() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Qsl_model');
|
||||
return $CI->Qsl_model->get_imagePath();
|
||||
}
|
||||
|
||||
?>
|
||||
23
application/libraries/Paths.php
Normal file
23
application/libraries/Paths.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
/***
|
||||
* Paths Libary to return specific paths
|
||||
*/
|
||||
class Paths
|
||||
{
|
||||
// generic function for return eQsl path //
|
||||
function getPathEqsl()
|
||||
{
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('Eqsl_images');
|
||||
return $CI->Eqsl_images->get_imagePath();
|
||||
}
|
||||
|
||||
// generic function for return Qsl path //
|
||||
function getPathQsl()
|
||||
{
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('Qsl_model');
|
||||
return $CI->Qsl_model->get_imagePath();
|
||||
}
|
||||
}
|
||||
@@ -2384,7 +2384,7 @@ $(document).ready(function(){
|
||||
<script>
|
||||
function viewQsl(picture, callsign) {
|
||||
|
||||
var webpath_qsl = "<?php echo wl_getPathQsl(); ?>";
|
||||
var webpath_qsl = "<?php echo $this->paths->getPathQsl(); ?>";
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
var $textAndPic = $('<div></div>');
|
||||
$textAndPic.append('<center><img class="img-fluid w-qsl" style="height:auto;width:auto;"src="'+baseURL+'/'+webpath_qsl+'/'+picture+'" /><center>');
|
||||
@@ -2447,7 +2447,7 @@ function deleteQsl(id) {
|
||||
</script>
|
||||
<script>
|
||||
function viewEqsl(picture, callsign) {
|
||||
var webpath_eqsl = "<?php echo wl_getPathEqsl(); ?>";
|
||||
var webpath_eqsl = '<?php echo $this->paths->getPathEqsl(); ?>';
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
var $textAndPic = $('<div></div>');
|
||||
$textAndPic.append('<img class="img-fluid" style="height:auto;width:auto;"src="'+baseURL+webpath_eqsl+'/'+picture+'" />');
|
||||
@@ -2598,7 +2598,7 @@ function viewEqsl(picture, callsign) {
|
||||
});
|
||||
}
|
||||
function uploadQsl() {
|
||||
var webpath_qsl = "<?php echo wl_getPathQsl(); ?>";
|
||||
var webpath_qsl = "<?php echo $this->paths->getPathQsl(); ?>";
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
var formdata = new FormData(document.getElementById("fileinfo"));
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo '<img class="img-fluid w-qsl" src="' . base_url() . '/'. wl_getPathQsl() .'/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
<?php echo '<img class="img-fluid w-qsl" src="' . base_url() . '/'. $this->paths->getPathQsl() .'/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
echo ' active';
|
||||
}
|
||||
echo '">';
|
||||
echo '<img class="img-fluid w-qsl" src="' . base_url() . '/'. wl_getPathQsl() .'/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
echo '<img class="img-fluid w-qsl" src="' . base_url() . '/'. $this->paths->getPathQsl() .'/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -608,7 +608,7 @@
|
||||
<div class="tab-pane fade" id="eqslcard" role="tabpanel" aria-labelledby="table-tab">
|
||||
<?php
|
||||
if ($row->eqsl_image_file != null) {
|
||||
echo '<img class="d-block" src="' . base_url() . '/'. wl_getPathEqsl() .'/' . $row->eqsl_image_file .'" alt="eQSL picture">';
|
||||
echo '<img class="d-block" src="' . base_url() . '/'. $this->paths->getPathEqsl() .'/' . $row->eqsl_image_file .'" alt="eQSL picture">';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user