mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Added directory application/controllers/system/infocenter/
- Moved controller TestFilterWidget to system/infocenter/ - Renamed controller TestFilterWidget to InfoCenter - Added directory application/views/system/infocenter/ - Added views system/infocenter/infocenter.php and system/infocenter/infocenterFilters.php - Added new header views/templates/FHC-Footer - Added new header views/templates/FHC-Header - FHC-Header still using old JQuery and missing others includes
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class TestFilterWidget extends VileSci_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('WidgetLib');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function sql()
|
||||
{
|
||||
echo $this->widgetlib->widget(
|
||||
'FilterWidget',
|
||||
array(
|
||||
'app' => 'core',
|
||||
'datasetName' => 'kontakts',
|
||||
'filterKurzbz' => 'This filter filters',
|
||||
'query' => '
|
||||
SELECT p.person_id AS "PersonId",
|
||||
p.nachname AS "Nachname",
|
||||
p.vorname AS "Vorname",
|
||||
k.kontakt AS "Email",
|
||||
p.aktiv AS "Aktiv",
|
||||
k.updateamum AS "UpdateDate"
|
||||
FROM public.tbl_person p INNER JOIN public.tbl_kontakt k USING(person_id)
|
||||
WHERE p.aktiv = TRUE
|
||||
AND p.person_id = k.person_id
|
||||
AND k.kontakttyp = \'email\'
|
||||
AND p.person_id < 1000
|
||||
',
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'checkboxes' => array('PersonId'),
|
||||
'additionalColumns' => array('Delete', 'Edit'),
|
||||
'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {
|
||||
|
||||
if ($fieldName == 'PersonId')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = '<a href="view/'.$datasetRaw->PersonId.'">'.$fieldValue.'</a>';
|
||||
}
|
||||
elseif ($fieldName == 'Delete')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = '<a href="delete/'.$datasetRaw->PersonId.'">Delete</a>';
|
||||
}
|
||||
elseif ($fieldName == 'Edit')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = '<a href="edit/'.$datasetRaw->PersonId.'">Edit</a>';
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class InfoCenter extends VileSci_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('WidgetLib');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$listFiltersSent = array(
|
||||
'Sent 1' => 100,
|
||||
'Sent 2' => 200,
|
||||
'Sent 3' => 300
|
||||
);
|
||||
|
||||
$listFiltersNotSent = array(
|
||||
'Not Sent 1' => 400,
|
||||
'Not Sent 2' => 500,
|
||||
'Not Sent 3' => 600
|
||||
);
|
||||
|
||||
$this->load->view(
|
||||
'system/infocenter/infocenter.php',
|
||||
array(
|
||||
'listFiltersSent' => $listFiltersSent,
|
||||
'listFiltersNotSent' => $listFiltersNotSent
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function filter($filterId = null)
|
||||
{
|
||||
$filterWidgetArray = array(
|
||||
'query' => '
|
||||
SELECT p.person_id AS "PersonId",
|
||||
p.nachname AS "Nachname",
|
||||
p.vorname AS "Vorname",
|
||||
k.kontakt AS "Email",
|
||||
p.aktiv AS "Aktiv",
|
||||
k.updateamum AS "UpdateDate"
|
||||
FROM public.tbl_person p INNER JOIN public.tbl_kontakt k USING(person_id)
|
||||
WHERE p.aktiv = TRUE
|
||||
AND p.person_id = k.person_id
|
||||
AND k.kontakttyp = \'email\'
|
||||
AND p.person_id < 1000
|
||||
',
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'checkboxes' => array('PersonId'),
|
||||
'additionalColumns' => array('Delete', 'Edit'),
|
||||
'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {
|
||||
|
||||
if ($fieldName == 'PersonId')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = '<a href="view/'.$datasetRaw->PersonId.'">'.$fieldValue.'</a>';
|
||||
}
|
||||
elseif ($fieldName == 'Delete')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = '<a href="delete/'.$datasetRaw->PersonId.'">Delete</a>';
|
||||
}
|
||||
elseif ($fieldName == 'Edit')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = '<a href="edit/'.$datasetRaw->PersonId.'">Edit</a>';
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
}
|
||||
);
|
||||
|
||||
if ($filterId == null)
|
||||
{
|
||||
$filterWidgetArray['app'] = 'core';
|
||||
$filterWidgetArray['datasetName'] = 'kontakts';
|
||||
$filterWidgetArray['filterKurzbz'] = 'This filter filters';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterWidgetArray['filterId'] = $filterId;
|
||||
}
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php $this->load->view('templates/FHC-Header', array('title' => 'Info Center', 'jquery3' => true)); ?>
|
||||
|
||||
<?php $iFrameSrc = base_url('index.ci.php/system/infocenter/InfoCenter/filter'); ?>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
// $("#iFrameFilter").attr('width', $(window).width());
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<span>
|
||||
<?php
|
||||
$this->load->view(
|
||||
'system/infocenter/infocenterFilters.php',
|
||||
array(
|
||||
'listFiltersSent' => $listFiltersSent,
|
||||
'listFiltersNotSent' => $listFiltersNotSent
|
||||
)
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<iframe id="iFrameFilter" name="iFrameFilter" src="<?php echo $iFrameSrc; ?>" width="800" height="700" frameborder="0">
|
||||
Your browser does not support iframes, please update it
|
||||
</iframe>
|
||||
</span>
|
||||
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
function _printLists($listFilters)
|
||||
{
|
||||
foreach ($listFilters as $name => $filterId)
|
||||
{
|
||||
$toPrint = '<div><a href="%s/%s" target="iFrameFilter">%s</a></div>';
|
||||
|
||||
echo sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter/filter'), $filterId, $name).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
// HTML
|
||||
// body
|
||||
// span
|
||||
?>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
Abgeschickt:
|
||||
</div>
|
||||
|
||||
<?php _printLists($listFiltersSent); ?>
|
||||
|
||||
<div>
|
||||
Nicht abgeschickt:
|
||||
</div>
|
||||
|
||||
<?php _printLists($listFiltersNotSent); ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<!-- Footer start -->
|
||||
</html>
|
||||
<!-- Footer end -->
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// By default set the parameters to null
|
||||
$title = isset($title) ? $title : null;
|
||||
$customCSSs = isset($customCSSs) ? $customCSSs : null;
|
||||
$customJSs = isset($customJSs) ? $customJSs : null;
|
||||
|
||||
// By default set the parameters to false
|
||||
$jquery3 = isset($jquery3) ? $jquery3 : false;
|
||||
|
||||
/**
|
||||
* Print the given title of the page
|
||||
* NOTE: this is a required field, must be specified otherwise an error is shown
|
||||
*/
|
||||
function _printTitle($title)
|
||||
{
|
||||
if ($title != null)
|
||||
{
|
||||
echo $title;
|
||||
}
|
||||
else
|
||||
{
|
||||
show_error('The title for this page is not set');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the style sheets you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
function _generateCSSsInclude($CSSs)
|
||||
{
|
||||
$cssLink = '<link rel="stylesheet" type="text/css" href="%s" />';
|
||||
|
||||
if (isset($CSSs))
|
||||
{
|
||||
$tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs);
|
||||
|
||||
for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++)
|
||||
{
|
||||
$toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL;
|
||||
|
||||
if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint;
|
||||
|
||||
echo $toPrint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
function _generateJSsInclude($JSs)
|
||||
{
|
||||
$jsInclude = '<script type="text/javascript" src="%s"></script>';
|
||||
|
||||
if (isset($JSs))
|
||||
{
|
||||
$tmpJSs = is_array($JSs) ? $JSs : array($JSs);
|
||||
|
||||
for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++)
|
||||
{
|
||||
$toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).PHP_EOL;
|
||||
|
||||
if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint;
|
||||
|
||||
echo $toPrint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!-- Header start -->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php _printTitle($title); ?></title>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url('skin/images/Vilesci.ico'); ?>" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('skin/vilesci.css'); ?>" />
|
||||
|
||||
<?php
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// CSS
|
||||
|
||||
// Eventually required CSS
|
||||
_generateCSSsInclude($customCSSs); // Eventually required CSS
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// Javascripts
|
||||
|
||||
// JQuery V3
|
||||
if ($jquery3 === true) _generateJSsInclude('vendor/components/jquery/jquery.min.js');
|
||||
|
||||
// Eventually required JS
|
||||
_generateJSsInclude($customJSs);
|
||||
?>
|
||||
|
||||
</head>
|
||||
<!-- Header end -->
|
||||
Reference in New Issue
Block a user