paths libary

This commit is contained in:
HB9HIL
2024-02-02 14:57:27 +01:00
parent ae8c2efa4f
commit 39616c6a69
8 changed files with 30 additions and 25 deletions

View File

@@ -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');
/*

View File

@@ -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();
}
?>

View 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();
}
}

View File

@@ -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"));

View File

@@ -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>';
}
?>

View File

@@ -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>';
}
?>

View File

@@ -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>

View File

@@ -317,5 +317,4 @@ switch (ENVIRONMENT)
*
* And away we go...
*/
require_once APPPATH.'core/genericFunctions.php';
require_once BASEPATH.'core/CodeIgniter.php';