feat(cadline): add Cadline-own components
9 Cadline-only components (no public upstream): showroom, albanner, alworkshops, followedlinks, nonprofit, presentation, project, tcexam, versions. Vetted live files. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<access component="com_albanner">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
|
||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||
</section>
|
||||
|
||||
</access>
|
||||
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package Com_Albanner
|
||||
* @author Zsolt Fekete <mcleod78@gmail.com>
|
||||
* @copyright 2017 Zsolt Fekete
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_albanner'))
|
||||
{
|
||||
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
}
|
||||
|
||||
// Include dependancies
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
JLoader::registerPrefix('Albanner', JPATH_COMPONENT_ADMINISTRATOR);
|
||||
JLoader::register('AlbannerHelper', JPATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'albanner.php');
|
||||
|
||||
$controller = JControllerLegacy::getInstance('Albanner');
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
$controller->redirect();
|
||||
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.0" method="upgrade">
|
||||
<name>com_albanner</name>
|
||||
<creationDate>2017-09-20</creationDate>
|
||||
<copyright>2017 Zsolt Fekete</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<author>Zsolt Fekete</author>
|
||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||
<authorUrl>https://www.facebook.com/mcleod78</authorUrl>
|
||||
<version>CVS: 1.0.0</version>
|
||||
<description>ARCHLine splashscreen banner content editor</description>
|
||||
|
||||
<install> <!-- Runs on install -->
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
|
||||
</sql>
|
||||
</install>
|
||||
<update> <!-- Runs on update -->
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/update.mysql.utf8.sql</file>
|
||||
</sql>
|
||||
</update>
|
||||
<uninstall> <!-- Runs on uninstall -->
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
|
||||
</sql>
|
||||
</uninstall>
|
||||
|
||||
<administration>
|
||||
<menu>COM_ALBANNER</menu>
|
||||
<submenu>
|
||||
<menu link="option=com_albanner&view=banners">COM_ALBANNER_CONTROL_PANEL</menu>
|
||||
<menu link="option=com_albanner&view=list">COM_ALBANNER</menu>
|
||||
<menu link="option=com_albanner&view=test">COM_ALBANNER_TEST</menu>
|
||||
</submenu>
|
||||
<files folder="administrator">
|
||||
<filename>access.xml</filename>
|
||||
<filename>controller.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>albanner.php</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>controllers</folder>
|
||||
<folder>helpers</folder>
|
||||
<folder>models</folder>
|
||||
<folder>sql</folder>
|
||||
<folder>views</folder>
|
||||
</files>
|
||||
<languages folder="administrator/languages">
|
||||
<language tag="en-GB">en-GB/en-GB.com_albanner.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.com_albanner.sys.ini</language>
|
||||
<language tag="hu-HU">hu-HU/hu-HU.com_albanner.ini</language>
|
||||
<language tag="hu-HU">hu-HU/hu-HU.com_albanner.sys.ini</language>
|
||||
</languages>
|
||||
</administration>
|
||||
</extension>
|
||||
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE','`albanner`');
|
||||
|
||||
class Controller extends BaseController {
|
||||
protected $lang;
|
||||
public $pf='BannerController';
|
||||
|
||||
public function procEvent() {
|
||||
if (!isset($_SESSION[$this->pf]["_POST"]) || trim($_POST['refresh'])=='' ) $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||
$se=&$_SESSION[$this->pf]['_POST'];
|
||||
$felt="";
|
||||
$arrIcons=array(
|
||||
'smallEdit'=>array("href"=>"index.php?option=com_albanner&view=edit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"ban_id","alttext"=>"Edit" ),
|
||||
'smallEnable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','disable','tablediv');setField('".$this->pf."','".$this->pf."_value','REPLACE','tablediv');}","img"=>IconHelper::getIcon("smallEnable") ),
|
||||
'smallDisable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','enable','tablediv');setField('".$this->pf."','".$this->pf."_value','REPLACE','tablediv');}",'img'=>IconHelper::getIcon("smallDisable") ),
|
||||
'smallDel'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','delete','tablediv');setField('".$this->pf."','".$this->pf."_value','REPLACE','tablediv');}",'img'=>IconHelper::getIcon("smallDel") ),
|
||||
);
|
||||
|
||||
if ($this->auth()==FALSE) die();
|
||||
|
||||
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||
{
|
||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||
if ((int)$value>0)
|
||||
{
|
||||
switch ($event)
|
||||
{
|
||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value." LIMIT 1;");break; }
|
||||
case 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value." LIMIT 1;");break; }
|
||||
case 'delete' : { MySqlHelper::getInstance()->query("DELETE FROM ".TABLE." WHERE id=".$value." LIMIT 1;");break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$this->pf]['tableorder'])) $_SESSION[$this->pf]['tableorder']='ban_id DESC';
|
||||
|
||||
if (isset($se['ban_id']) && $se['ban_id']>"")
|
||||
{
|
||||
if (strpos($se['ban_id'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['ban_id']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND id>=".(int)$reszek[0]." AND id<=".(int)$reszek[1] : " AND id>=".(int)$reszek[1]." AND id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND id=".(int)$se['ban_id'];
|
||||
}
|
||||
}
|
||||
if (isset($se['pattern']) && trim($se['pattern'])>"") $felt.=" AND `pattern` LIKE '%".trim($se['pattern'])."%'";
|
||||
if (isset($se['build']) && (int)$se['build']>0) $felt.=" AND `build`=".(int)$se['build'];
|
||||
if (isset($se['message']) && trim($se['message'])>"") $felt.=" AND `message` LIKE '%".trim($se['message'])."%'";
|
||||
if (isset($se['lang']) && trim($se['lang'])>"") $felt.=" AND `lang`='".trim($se['lang'])."'";
|
||||
if (isset($se['published']) && $se['published']!='A') $felt.=" AND published='".$se['published']."'";
|
||||
if (isset($se['from_date']) && $se['from_date']>"") $felt.=" AND from_date>='".trim($se['from_date'])."'";
|
||||
if (isset($se['end_date']) && $se['end_date']>"") $felt.=" AND end_date<='".trim($se['end_date'])."'";
|
||||
if (isset($se['priority']) && (int)$se['priority']>0) $felt.=" AND `priority`=".(int)$se['priority'];
|
||||
|
||||
$cl=($this->getLang()=='hun' ? 'hu-HU' : 'en-GB');
|
||||
$LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$cl."/".$cl.".com_albanner.ini");
|
||||
|
||||
$objTabla=New TableHelper();
|
||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>'tablediv'));
|
||||
$v=$objTabla->setSession();
|
||||
$objTabla->setColumn('ban_id',array('header'=>'ID','width'=>'40px','link'=>'index.php?option=com_albanner&view=edit&id=REPLACE'));
|
||||
$objTabla->setColumn('pattern',array('header'=>$LANG['COM_ALBANNER_PATTERN'],'format'=>'text','align'=>'left','width'=>'100px'));
|
||||
$objTabla->setColumn('build',array('header'=>$LANG['COM_ALBANNER_BUILD'],'format'=>'text','align'=>'left','width'=>'50px'));
|
||||
$objTabla->setColumn('message',array('header'=>$LANG['COM_ALBANNER_MESSAGE'],'format'=>'text','align'=>'left'));
|
||||
$objTabla->setColumn('from_date',array('header'=>str_replace(" ", "<br />", $LANG['COM_ALBANNER_FROM']),'format'=>'text','align'=>'left','width'=>'100px'));
|
||||
$objTabla->setColumn('end_date',array('header'=>str_replace(" ", "<br />", $LANG['COM_ALBANNER_TO']),'format'=>'text','align'=>'left','width'=>'100px'));
|
||||
$objTabla->setColumn('lang',array('header'=>$LANG['COM_ALBANNER_LANG'],'format'=>'text','align'=>'center','width'=>'70px','replacevalues'=>array('hun'=>$LANG['COM_ALBANNER_HUN'],'eng'=>$LANG['COM_ALBANNER_ENG'])));
|
||||
$objTabla->setColumn('priority',array('header'=>$LANG['COM_ALBANNER_PRIORITY'],'format'=>'text','align'=>'center','width'=>'70px','replacevalues'=>array('1'=>'1-'.$LANG['COM_ALBANNER_LOW'],'2'=>'2-'.$LANG['COM_ALBANNER_MED'],'3'=>'3-'.$LANG['COM_ALBANNER_HIG'])));
|
||||
$objTabla->setColumn('published',array('header'=>$LANG['COM_ALBANNER_PUBLISHED'],'format'=>'text','align'=>'center','width'=>'70px','replacevalues'=>array('Y'=>$LANG['COM_ALBANNER_YES'],'N'=>$LANG['COM_ALBANNER_NO'])));
|
||||
$objTabla->setColumn('options',array('header'=>$LANG['COM_ALBANNER_OPTIONS'],'align'=>'right','width'=>'90px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'ban_id'));
|
||||
$objTabla->setQuery(array("
|
||||
SELECT id AS ban_id,pattern,build,message,DATE(from_datetime) AS from_date,DATE(end_datetime) AS end_date,lang,priority,published,CONCAT('smallDel','|',IF(published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM albanner
|
||||
WHERE 1 ".$felt
|
||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
||||
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||
SELECT COUNT(*) AS recordCount
|
||||
FROM (
|
||||
SELECT id AS ban_id,pattern,build,message,DATE(from_datetime) AS from_date,DATE(end_datetime) AS end_date,lang,priority,published,CONCAT('smallDel','|',IF(published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM albanner
|
||||
WHERE 1 ".$felt."
|
||||
) x"
|
||||
));
|
||||
// $this->printSession($this->pf);
|
||||
// print "<pre>".print_r($_SESSION,true)."</pre>";
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function auth()
|
||||
{
|
||||
MySqlHelper::getInstance()->query("
|
||||
SELECT * FROM jml_session where session_id='".trim(addslashes($_POST['sess']))."' LIMIT 1
|
||||
UNION
|
||||
SELECT * FROM eng_session where session_id='".trim(addslashes($_POST['sess']))."' LIMIT 1;");
|
||||
$sess=MySqlHelper::getInstance()->fetchAssoc();
|
||||
if (count($sess))
|
||||
{
|
||||
MySqlHelper::getInstance()->query("SELECT * FROM jml_user_usergroup_map where group_id IN (7,8) AND user_id=".$sess[0]['userid'].";");
|
||||
$admin=MySqlHelper::getInstance()->fetchAssoc();
|
||||
return (count($admin) ? TRUE : FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
||||
return $this->lang;
|
||||
}
|
||||
} // end of class
|
||||
|
||||
$controller=new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value','');
|
||||
jQuery("#ban_id").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["ban_id"]?>');
|
||||
/*
|
||||
jQuery("#string").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["string"]?>');
|
||||
jQuery("#projectid").val('<?=$_SESSION[$controller->pf]["_POST"]["projectid"]?>');
|
||||
*/
|
||||
</script>
|
||||
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/administrator/components/com_versions/helpers/TableHelper.class.php");
|
||||
include($_SERVER['DOCUMENT_ROOT']."/administrator/components/com_versions/helpers/MySqlHelper.class.php");
|
||||
include($_SERVER['DOCUMENT_ROOT']."/administrator/components/com_versions/helpers/IconHelper.class.php");
|
||||
|
||||
abstract class BaseController
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function __destruct() {}
|
||||
|
||||
public function procEvent() {}
|
||||
|
||||
public function run() { $this->procEvent(); }
|
||||
|
||||
public function printSession($key="") { print "<pre>".print_r(($key=="" ? $_SESSION : $_SESSION[$key]),true)."</pre>"; }
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1,84 @@
|
||||
#j-sidebar-container {display:inline-block;vertical-align:top;width:14.5%;height:300px;border:0px solid #000000;}
|
||||
#j-main-container {display:inline-block;vertical-align:top;width:85%;border:0px solid #000000;}
|
||||
|
||||
#j-main-container .pagination {margin:0px;padding:0px;display:inline;}
|
||||
#j-main-container table.adminlist {width:100%;border-spacing:1px;background-color:#e7e7e7;color:#666;}
|
||||
#j-main-container table.adminlist td,
|
||||
#j-main-container table.adminlist th {padding:4px;}
|
||||
#j-main-container table.adminlist thead th {text-align:center;background:#f0f0f0;color:#666;border-bottom:1px solid #999;border-left:1px solid #fff;}
|
||||
#j-main-container table.adminlist thead a:hover { text-decoration: none; }
|
||||
#j-main-container table.adminlist thead th img { vertical-align: middle; }
|
||||
#j-main-container table.adminlist tbody th { font-weight: bold; }
|
||||
#j-main-container table.adminlist tbody tr { background-color: #fff; text-align: left; }
|
||||
#j-main-container table.adminlist tbody tr.row1 { background: #f9f9f9; border-top: 1px solid #fff; }
|
||||
#j-main-container table.adminlist tbody tr.row0:hover td,
|
||||
#j-main-container table.adminlist tbody tr.row1:hover td { background-color: #ffd ; }
|
||||
#j-main-container table.adminlist tbody tr td { height: 25px; background: #fff; border: 1px solid #fff; }
|
||||
#j-main-container table.adminlist tbody tr.row1 td { background: #f9f9f9; border-top: 1px solid #FFF; }
|
||||
#j-main-container table.adminlist tfoot tr { text-align: center; color: #333; }
|
||||
#j-main-container table.adminlist tfoot td,
|
||||
#j-main-container table.adminlist tfoot th { background-color: #f3f3f3; border-top: 1px solid #999; text-align: center; }
|
||||
#j-main-container table.adminlist td.order { text-align: center; white-space: nowrap; }
|
||||
#j-main-container table.adminlist td.order span { float: left; display: block; width: 20px; text-align: center; }
|
||||
|
||||
|
||||
#j-main-container .clear {clear:both;margin:0px;padding:0px;height:0px;width:0px;}
|
||||
#j-main-container div.hasab {display:inline-block;width:340px;vertical-align:top;border:0px solid #000;}
|
||||
#j-main-container div.hasab div.inputholder {display:block;height:38px;border:0px solid #ff0000;}
|
||||
#j-main-container div.inputholder label,
|
||||
#j-main-container div.hasab div.inputholder label {display:inline-block;width:120px;font-weight:bold;border:0px solid #00ff00;}
|
||||
#j-main-container div.hasab div.inputholder input[type="text"],
|
||||
#j-main-container div.hasab div.inputholder select {display:inline;margin:0px;width:190px;}
|
||||
#j-main-container div.hasab div.inputholder textarea {width:320px;height:260px;}
|
||||
#j-main-container div.hasab div.inputholder input[type="file"] {width:190px;}
|
||||
#j-main-container div.hasab div.inputholder fieldset {display:inline;width:190px;white-space:nowrap;border:0px solid #ff00ff;}
|
||||
#j-main-container div.hasab div.inputholder fieldset label {width:50px;font-weight:normal;}
|
||||
|
||||
|
||||
|
||||
/* TableHelper */
|
||||
div.tableholder table { border: 1px solid #dddddd; font-size: 11px; }
|
||||
div.tableholder table thead, div.tableholder table tfoot { background-color: #ddd; }
|
||||
div.tableholder table thead tr td { padding-left: 3px; border-bottom: 1px solid #dddddd; white-space:nowrap; vertical-align:middle; }
|
||||
div.tableholder table tfoot tr td { padding-left: 3px; border-top: 1px solid #dddddd; white-space:nowrap; vertical-align:middle; }
|
||||
div.tableholder table thead tr th,
|
||||
div.tableholder table tfoot tr th { white-space:nowrap; vertical-align:middle; }
|
||||
div.tableholder table thead tr th span { display: block; float: left; text-align: center; margin-left:3px; float: left; height: 30px; line-height: 14px; font-weight: bold; }
|
||||
div.tableholder table thead tr th div.shortlinks { display: inline-block; margin: 1px; width: 9px; height: 24px; float: right; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-up { display: block; text-decoration: none; width: 9px; height: 11px; background: #ececec url(/administrator/components/com_showroom/assets/images/tableshort-up.jpg) no-repeat left top; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-up:hover { background: #ececec url(/administrator/components/com_showroom/assets/images/tableshort-up.jpg) no-repeat left -11px; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-down { margin-top:2px;display: block; text-decoration: none; width: 9px; height: 11px; background: #ececec url(/administrator/components/com_showroom/assets/images/tableshort-down.jpg) no-repeat left top; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-down:hover { margin-top:2px;background: #ececec url(/administrator/components/com_showroom/assets/images/tableshort-down.jpg) no-repeat left -11px; }
|
||||
|
||||
div.tableholder table tbody tr.even { background-color: #ebebeb; }
|
||||
div.tableholder table tbody tr.odd { background-color: #ffffff; }
|
||||
div.tableholder table tbody tr.selected { background-color: #f5c0b8;color:#000000; }
|
||||
div.tableholder table tbody tr.selected a { color: #000000;}
|
||||
div.tableholder table tbody tr td { padding: 3px; text-align: left; border-top: 0px solid #afc4d2; border-right: 1px solid #e0eef7; }
|
||||
div.tableholder table tbody tr td img { padding: 0px; margin:0px; border:0px;vertical-align: middle; }
|
||||
div.tableholder table tbody tr.even:hover,
|
||||
div.tableholder table tbody tr.odd:hover,
|
||||
div.tableholder table tbody tr.selected:hover { cursor: pointer; background-color: #c5e6a1; color: #000000; }
|
||||
div.tableholder table tbody tr td input { padding: 0px; margin:0; vertical-align:middle; }
|
||||
div.tableholder table tbody tr td img { margin: 0px 2px; }
|
||||
div.tableholder table tfoot { height: 30px; font-size: 11px; font-weight: bold; }
|
||||
div.tableholder table a {text-decoration:none;cursor:pointer;}
|
||||
div.tableholder table a:hover {text-decoration:none;cursor:pointer;}
|
||||
div.tablenav select { margin: 0px; float: left; width: auto; padding: 2px 2px 3px 2px;border: 1px solid #afc4d2;font-size: 11px;font-family: Tahoma;font-weight: normal;text-align: left;color: #484947;cursor: pointer;}
|
||||
div.tablenav {margin: 10px 0px 10px 0px;height: 32px;overflow: hidden;}
|
||||
div.tablenav p {margin: 0px 0px 0px 3px;float: left;line-height: 32px; float:left;}
|
||||
div.tablenav ul.pager {margin: 0px 0px 0px 20px;float: right;height: 22px;}
|
||||
div.tablenav ul.pager li {display: inline;}
|
||||
div.tablenav ul.pager li a,
|
||||
div.tablenav ul.pager li a.inactive,
|
||||
div.tablenav ul.pager li a.inactive:hover { background: none; display: inline-block; float: left; margin: 0px 0px 0px 3px; width: 20px; height: 20px; line-height: 20px; font-size: 10px; font-weight: normal; text-align: center; vertical-align: middle; border: 1px solid #e7efdb; color: #009cff; cursor:pointer;}
|
||||
div.tablenav ul.pager li a.nextfive { border: none; line-height: 22px; cursor:pointer; }
|
||||
div.tablenav ul.pager li a.inactive,
|
||||
div.tablenav ul.pager li a.inactive:hover { color: #c3c4c1; cursor:pointer;}
|
||||
div.tablenav ul.pager li a.activepage,
|
||||
div.tablenav ul.pager li a.activepage:hover { background-color: #b4c799; color: #ffffff; border-color: #577046; font-weight: bold; cursor:pointer;}
|
||||
div.tablenav ul.pager li a:hover {background-color: #009cff;color: #ffffff;border-color: #2d4e63; cursor:pointer; }
|
||||
|
||||
|
||||
#preview {position:absolute; border:1px solid #ccc;display:none;color:#fff;background:#fff;padding:5px;white-space:normal; }
|
||||
#tooltip {position:absolute; border:1px solid #333;display:none;color:#333;background:#f7f5d1;padding:2px 5px; }
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
|
After Width: | Height: | Size: 453 B |
|
After Width: | Height: | Size: 473 B |
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1,16 @@
|
||||
function submitForm(formid,targetdiv)
|
||||
{
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: jQuery('#'+formid).attr('action'),
|
||||
data: jQuery('#'+formid).serialize(),
|
||||
success: function(html) {jQuery('#'+targetdiv).html(html);}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function setField(formid,elementid,value,targetdiv)
|
||||
{
|
||||
jQuery('#'+elementid).val(value);
|
||||
if (formid>'') submitForm(formid,targetdiv);
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Image preview script
|
||||
* powered by jQuery (http://www.jquery.com)
|
||||
*
|
||||
* written by Alen Grakalic (http://cssglobe.com)
|
||||
*
|
||||
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
|
||||
*
|
||||
*/
|
||||
|
||||
this.imagePreview = function(){
|
||||
/* CONFIG */
|
||||
|
||||
xOffset = -35;
|
||||
yOffset = 20;
|
||||
|
||||
imgHeight=0;
|
||||
imgWidth=0;
|
||||
|
||||
|
||||
// these 2 variable determine popup's distance from the cursor
|
||||
// you might want to adjust to get the right result
|
||||
|
||||
/* END CONFIG */
|
||||
jQuery("a.preview").hover(function(e){
|
||||
|
||||
var newImg = new Image();
|
||||
newImg.src = this.href;
|
||||
imgHeight = newImg.height;
|
||||
imgWidth = newImg.width;
|
||||
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
var c = (this.t != "") ? "<br/>" + this.t : "";
|
||||
if (imgWidth) {
|
||||
jQuery("body").append("<p id='preview' style='width:"+imgWidth+"px;'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
|
||||
jQuery("#preview")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - imgWidth) + "px")
|
||||
.fadeIn("fast");
|
||||
}
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
jQuery("#preview").remove();
|
||||
});
|
||||
jQuery("a.preview").mousemove(function(e){
|
||||
if (imgWidth==0) {
|
||||
var newImg = new Image();
|
||||
newImg.src = this.href;
|
||||
imgHeight = newImg.height;
|
||||
imgWidth = newImg.width;
|
||||
}
|
||||
jQuery("#preview")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - imgWidth) + "px");
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Tooltip script
|
||||
* powered by jQuery (http://www.jquery.com)
|
||||
* written by Alen Grakalic (http://cssglobe.com)
|
||||
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
|
||||
*/
|
||||
this.tooltip = function(){
|
||||
/* CONFIG */
|
||||
xOffset = -20;
|
||||
yOffset = 10;
|
||||
width = 200;
|
||||
// these 2 variable determine popup's distance from the cursor
|
||||
// you might want to adjust to get the right result
|
||||
/* END CONFIG */
|
||||
jQuery("a.tooltip").hover(function(e){
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
jQuery("body").append("<p id='tooltip' style='width:"+width+"px'>"+ this.t +"</p>");
|
||||
jQuery("#tooltip")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - width) + "px")
|
||||
.fadeIn("fast");
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
jQuery("#tooltip").remove();
|
||||
});
|
||||
jQuery("a.tooltip").mousemove(function(e){
|
||||
jQuery("#tooltip")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - width) + "px");
|
||||
});
|
||||
};
|
||||
|
||||
function checkAll()
|
||||
{
|
||||
jQuery("input:checkbox").each(function() {
|
||||
jQuery(this).attr('checked','checked');
|
||||
});
|
||||
}
|
||||
|
||||
function unCheckAll()
|
||||
{
|
||||
jQuery("input:checkbox").each(function() {
|
||||
jQuery(this).removeAttr('checked');
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package Com_Albanner
|
||||
* @author Zsolt Fekete <mcleod78@gmail.com>
|
||||
* @copyright 2017 Zsolt Fekete
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.controller'); // import Joomla controller library
|
||||
|
||||
$view=JFactory::getApplication()->input->get('view');
|
||||
$option=JFactory::getApplication()->input->get('option');
|
||||
|
||||
$l=array(
|
||||
array('COM_ALBANNER_CONTROL_PANER', 'banners'),
|
||||
array('COM_ALBANNER_LIST', 'list'),
|
||||
array('COM_ALBANNER_TEST', 'test'),
|
||||
);
|
||||
|
||||
foreach ($l as $v)
|
||||
{
|
||||
JHtmlSidebar::addEntry(JText::_($v[0]),'index.php?option='.$option.($v[1]==''?'':'&view=').$v[1],($view==$v[1] || $view==$v[1]."edit" ? true : false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Class AlbannerController
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class AlbannerController extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Method to display a view.
|
||||
*
|
||||
* @param boolean $cachable If true, the view output will be cached
|
||||
* @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return JController This object to support chaining.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
$view = JFactory::getApplication()->input->getCmd('view', 'XXX_DEFAULT_VIEW_XXX');
|
||||
JFactory::getApplication()->input->set('view', $view);
|
||||
|
||||
parent::display($cachable, $urlparams);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
class IconHelper {
|
||||
public static $ico;
|
||||
|
||||
private static $icons=array(
|
||||
'smallAdd'=>'/administrator/components/com_showroom/assets/images/iconset/add.png',
|
||||
'mediumAdd'=>'',
|
||||
'largeAdd'=>'',
|
||||
'smallEdit'=>'/administrator/components/com_showroom/assets/images/iconset/pencil.png',
|
||||
'mediumEdit'=>'',
|
||||
'largeEdit'=>'',
|
||||
'smallDel'=>'/administrator/components/com_showroom/assets/images/iconset/cross.png',
|
||||
'mediumDel'=>'',
|
||||
'largeDel'=>'',
|
||||
'smallEnable'=>'/administrator/components/com_showroom/assets/images/iconset/accept.png',
|
||||
'mediumEnable'=>'',
|
||||
'largeEnable'=>'',
|
||||
'smallDisable'=>'/administrator/components/com_showroom/assets/images/iconset/delete.png',
|
||||
'mediumDisable'=>'',
|
||||
'largeDisable'=>'',
|
||||
'smallView'=>'/administrator/components/com_showroom/assets/images/iconset/photo.png',
|
||||
'mediumView'=>'',
|
||||
'largeView'=>'',
|
||||
'smallMissingView'=>'/administrator/components/com_showroom/assets/images/iconset/link_break.png',
|
||||
'mediumMissingView'=>'',
|
||||
'largeMissingView'=>'',
|
||||
'smallRightOn'=>'/administrator/components/com_showroom/assets/images/iconset/layout_join.png',
|
||||
'mediumRightOn'=>'',
|
||||
'largeRightOn'=>'',
|
||||
'smallRightOff'=>'/administrator/components/com_showroom/assets/images/iconset/layout_split.png',
|
||||
'mediumRightOff'=>'',
|
||||
'largeRightOff'=>'',
|
||||
'smallBack'=>'/administrator/components/com_showroom/assets/images/iconset/arrow_undo.png',
|
||||
'mediumBack'=>'',
|
||||
'largeBack'=>'',
|
||||
'smallEmail'=>'/administrator/components/com_showroom/assets/images/iconset/email.png',
|
||||
'mediumEmail'=>'',
|
||||
'largeEmail'=>'',
|
||||
);
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
/**
|
||||
* Return the instance
|
||||
*
|
||||
* @return IconHelper
|
||||
*/
|
||||
public static function getInstance() {
|
||||
if(!empty(self::$ico)) return self::$ico;
|
||||
self::$ico=new IconHelper();
|
||||
self::$ico->init();
|
||||
return self::$ico;
|
||||
}
|
||||
|
||||
public static function init() { }
|
||||
|
||||
public static function getIcon($i='') {
|
||||
$str='';
|
||||
if ($i>'') $str=self::$icons[$i];
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function getAllIcon() {
|
||||
return self::$icons;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
include($_SERVER['DOCUMENT_ROOT']."/components/com_mightysites/configuration/default.php");
|
||||
|
||||
class MySqlHelper
|
||||
{
|
||||
public static $msh;
|
||||
private $host;
|
||||
private $name;
|
||||
private $user;
|
||||
private $pass;
|
||||
private $connection;
|
||||
private $queryString;
|
||||
private $queryResult;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->config=New JConfig();
|
||||
$this->connection=false;
|
||||
$this->host='';
|
||||
$this->user='';
|
||||
$this->pass='';
|
||||
$this->name='';
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
if(!empty(self::$msh)) return self::$msh;
|
||||
self::$msh=new MySqlHelper();
|
||||
self::$msh->init();
|
||||
return self::$msh;
|
||||
}
|
||||
|
||||
public function init($host="", $name="", $user="", $pass="")
|
||||
{
|
||||
$this->host=($host>"" ? $host : $this->config->host);
|
||||
$this->name=($name>"" ? $name : $this->config->db);
|
||||
$this->user=($user>"" ? $user : $this->config->user);
|
||||
$this->pass=($pass>"" ? $pass : $this->config->password);
|
||||
}
|
||||
|
||||
private function connect()
|
||||
{
|
||||
if($this->connection) return;
|
||||
|
||||
$this->connection=mysql_connect($this->host, $this->user, $this->pass);
|
||||
|
||||
if(false===$this->connection) throw new Exception('Can\'t connect to db');
|
||||
|
||||
mysql_select_db($this->name, $this->connection);
|
||||
mysql_query('SET CHARACTER SET UTF8', $this->connection);
|
||||
mysql_query('SET NAMES \'UTF8\' ', $this->connection);
|
||||
mysql_set_charset('utf8', $this->connection);
|
||||
|
||||
if(mysql_error($this->connection)) throw new Exception(mysql_error($this->connection));
|
||||
}
|
||||
|
||||
public function query($query) {
|
||||
$this->connect();
|
||||
$this->queryString=$query;
|
||||
$this->queryResult=mysql_query($query, $this->connection);
|
||||
if(mysql_error($this->connection)) throw new Exception(mysql_error($this->connection).' Query: '.$this->queryString);
|
||||
}
|
||||
|
||||
public function fetchNext() {
|
||||
$back=array();
|
||||
if($row=mysql_fetch_assoc($this->queryResult)) {
|
||||
foreach($row as $key => $value) {
|
||||
$row[$key]=stripslashes($value);
|
||||
}
|
||||
$back=$row;
|
||||
return $back;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function fetchAssoc() {
|
||||
$back=array();
|
||||
while($row=mysql_fetch_assoc($this->queryResult)) {
|
||||
foreach($row as $key => $value) {
|
||||
$row[$key]=stripslashes($value);
|
||||
}
|
||||
$back[]=$row;
|
||||
}
|
||||
|
||||
return $back;
|
||||
}
|
||||
|
||||
public function getInsertedId() {
|
||||
return mysql_insert_id($this->connection);
|
||||
}
|
||||
|
||||
public function select($table, $where=false, $offset=false, $limit=false, $order=false) {
|
||||
$whereStr='';
|
||||
$limitStr='';
|
||||
$orderStr='';
|
||||
|
||||
if(is_array($where)) $whereStr='WHERE '.$this->whereMakerPriv($where);
|
||||
elseif($where) $whereStr='WHERE '.$where;
|
||||
|
||||
if(($offset!==false and $offset!==null)&&($limit!==false and $limit!==null)) {
|
||||
$limitStr='LIMIT '.$offset.', '.$limit;
|
||||
}
|
||||
|
||||
if(is_array($order)) {
|
||||
$orderStr='ORDER BY ';
|
||||
foreach($order as $key => $value) {
|
||||
$orderStr.=$key.' '.$value.' ';
|
||||
}
|
||||
}
|
||||
elseif($order) $orderStr='ORDER BY '.$order;
|
||||
|
||||
return $this->query('SELECT * FROM '.$table.' '.$whereStr.' '.$orderStr.' '.$limitStr);
|
||||
}
|
||||
|
||||
public function getProp($table, $func, $field, $where=false) {
|
||||
$whereStr='';
|
||||
if(is_array($where)) $whereStr='WHERE '.$this->whereMakerPriv($where);
|
||||
elseif($where) $whereStr='WHERE '.$where;
|
||||
|
||||
$this->query('SELECT '.$func.'('.$field.') as p FROM '.$table.' '.$whereStr);
|
||||
|
||||
$arr=$this->fetchAssoc();
|
||||
|
||||
return $arr[0]['p'];
|
||||
}
|
||||
|
||||
public function getCount($table, $field='id', $where=false) {
|
||||
return $this->getProp($table, 'COUNT', $field, $where);
|
||||
}
|
||||
|
||||
public function getSum($table, $field='id', $where=false) {
|
||||
return $this->getProp($table, 'SUM', $field, $where);
|
||||
}
|
||||
|
||||
public function getAvg($table, $field='id', $where=false) {
|
||||
return $this->getProp($table, 'AVG', $field, $where);
|
||||
}
|
||||
|
||||
public function delete($table, $where=false) {
|
||||
$whereStr='';
|
||||
if(is_array($where)) $whereStr='WHERE '.$this->whereMakerPriv($where);
|
||||
elseif($where) $whereStr='WHERE '.$where;
|
||||
|
||||
return $this->query('DELETE FROM '.$table.' '.$whereStr);
|
||||
}
|
||||
|
||||
public function update($table, $infoArr, $where=false) {
|
||||
if(!is_array($infoArr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$whereStr='';
|
||||
$dataArr=array();
|
||||
$data='';
|
||||
if(is_array($where)) $whereStr='WHERE '.$this->whereMakerPriv($where);
|
||||
elseif($where) $whereStr='WHERE '.$where;
|
||||
|
||||
foreach($infoArr as $key => $value) {
|
||||
$dataArr[]='`'.$key.'`="'.mysql_real_escape_string($value, $this->connection).'" ';
|
||||
}
|
||||
$data=implode(',',$dataArr);
|
||||
|
||||
return $this->query('UPDATE '.$table.' SET '.$data.' '.$whereStr);
|
||||
}
|
||||
|
||||
public function insert($table, $infoArr) {
|
||||
$this->connect();
|
||||
|
||||
$columArr=array();
|
||||
$valueArr=array();
|
||||
$colums='';
|
||||
$values='';
|
||||
|
||||
foreach($infoArr as $key => $value) {
|
||||
$columArr[]='`'.$key.'`';
|
||||
$valueArr[]='"'.mysql_real_escape_string($value, $this->connection).'"';
|
||||
}
|
||||
|
||||
$colums=implode(',',$columArr);
|
||||
$values=implode(',', $valueArr);
|
||||
|
||||
return $this->query('INSERT INTO '.$table.' ('.$colums.') VALUES ('.$values.')');
|
||||
}
|
||||
|
||||
public function affectedRows() {
|
||||
return mysql_affected_rows($this->connection);
|
||||
}
|
||||
|
||||
public function whereMakerPriv($where) {
|
||||
if(!is_array($where)) return 1;
|
||||
$this->connect();
|
||||
$back='1 ';
|
||||
foreach($where as $key=>$value) {
|
||||
if(is_array($value)) $back.='AND `'.$key.'`'.$value[0].'"'.$value[1].'" ';
|
||||
else $back.='AND `'.$key.'`="'.mysql_real_escape_string($value, $this->connection).'" ';
|
||||
}
|
||||
return $back;
|
||||
}
|
||||
|
||||
public static function whereMaker($where) {
|
||||
if(!is_array($where)) return 1;
|
||||
$back='1 ';
|
||||
foreach($where as $key=>$value) {
|
||||
if(is_array($value)) $back.='AND `'.$key.'`'.$value[0].'"'.$value[1].'" ';
|
||||
else $back.='AND `'.$key.'`="'.$value.'" ';
|
||||
}
|
||||
return $back;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1,719 @@
|
||||
<?php
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
class TableHelper {
|
||||
public $html_table="";
|
||||
public $arrQuery=array();
|
||||
public $arrResult=array();
|
||||
public $result=false;
|
||||
public $column=array(); // header, width, height, order (y|n), align, link, linkjoin, linktitle, target, strlen, decimal, sum, sumamount, visible, format (time,link,mailto,openlink,text,number,percent,ratio,checkbox,none)
|
||||
public $dataset=array("RecordCount"=>0,"FieldCount"=>0,"FieldName"=>array());
|
||||
public $ajax=false;
|
||||
public $params=array(
|
||||
"prefix"=>"ctb_",
|
||||
"cbprefix"=>"cb",
|
||||
"tablediv"=>"tablediv",
|
||||
"ippvals"=>array("0"=>"none","1"=>"1","2"=>"2","3"=>"3","5"=>"5","10"=>"10","20"=>"20","50"=>"50","100"=>"100","200"=>"200","500"=>"500"),
|
||||
"rowEffect"=>true,
|
||||
"sort"=>false,
|
||||
"border"=>"0",
|
||||
"cellspacing"=>"0",
|
||||
"cellpadding"=>"0",
|
||||
"tablewidth"=>"100%",
|
||||
"thheight"=>"30px",
|
||||
"tdheight"=>"20px",
|
||||
"pagerwidth"=>"380px",
|
||||
"valign"=>"middle",
|
||||
"linktarget"=>"_top",
|
||||
"draganddrop"=>false,
|
||||
"simple"=>false,
|
||||
"footer"=>true,
|
||||
"rowcounter"=>false,
|
||||
"pageJump"=>true,
|
||||
"downloadLink"=>false,
|
||||
"csvExport"=>false,
|
||||
"forceDownload"=>false,
|
||||
"imagePreview"=>false,
|
||||
"imagePreviewClass"=>'preview',
|
||||
"toolTip"=>false,
|
||||
"toolTipClass"=>'tooltip',
|
||||
"ipp"=>"20",
|
||||
"page"=>"1",
|
||||
"order"=>"",
|
||||
"vege"=>1,
|
||||
"kezdet"=>1,
|
||||
"lapozomax"=>5,
|
||||
"decimal"=>2,
|
||||
"event"=>'',
|
||||
"value"=>'',
|
||||
"tableclass"=>"",
|
||||
"row0"=>"tds", // onmouseover sorszin
|
||||
"row1"=>"even", // onmouseout sorszin1
|
||||
"row2"=>"odd", // onmouseout sorszin2
|
||||
"row_selected"=>"selected", // klikkel<65>ssel kijel<65>lt sor css oszt<7A>lya
|
||||
);
|
||||
|
||||
public $arrLang=array('ipp'=>'elem/lap','result'=>'Találat','results'=>'Találatok','pages'=>'Lapok','page'=>'Lap','record_result'=>'sor találat');
|
||||
|
||||
public $arrDownload=array('tbl'=>true,'separator'=>';','newline'=>"\r\n");
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function __destruct() {}
|
||||
|
||||
function parseTable() {
|
||||
$this->arrDownload['tbl']=( ($this->params['downloadLink'] and trim($_POST[$this->params["prefix"]."_download"])>'') ? false : true);
|
||||
|
||||
if ($this->params['forceDownload']==true) $this->arrDownload['tbl']=false; // overwrite when forced download
|
||||
|
||||
$tbl=&$this->arrDownload['tbl'];
|
||||
if (!$tbl) {
|
||||
$separator=&$this->arrDownload['separator'];
|
||||
$newline=&$this->arrDownload['newline'];
|
||||
}
|
||||
|
||||
$eredm = $this->arrResult[0];
|
||||
if (isset($this->arrResult[1][0])) {
|
||||
$sumrow=$this->arrResult[1][0];
|
||||
$sm=$sumrow;
|
||||
if (isset($sm['recordCount'])) unset ($sm['recordCount']);
|
||||
}
|
||||
else {
|
||||
$sumrow=$sm=array();
|
||||
}
|
||||
|
||||
$this->dataset["FieldCount"]=((isset($eredm[0]) and count(array_keys($eredm[0]))) ? count(array_keys($eredm[0])) : 0 ) ;
|
||||
$this->dataset["FieldName"]=((isset($eredm[0]) and is_array($eredm[0]) and count($eredm[0])) ? array_keys($eredm[0]) : array());
|
||||
$this->dataset["RecordCount"]=(isset($sumrow["recordCount"]) ? $sumrow["recordCount"] : 0);
|
||||
|
||||
$mezok=(count($this->dataset["FieldName"]) ? $this->dataset["FieldName"] : array_keys($sm) );
|
||||
|
||||
// starting the table html string
|
||||
$_str='';
|
||||
if ($tbl) {
|
||||
$_str.='<div class="tableholder" '.($this->params["tablewidth"]>'' ? ' style="width:'.$this->params["tablewidth"].';"' : '' ).'>'
|
||||
.($this->params['simple'] ? '' : $this->addControllers())
|
||||
.'<table border="'.$this->params["border"]
|
||||
.'" cellspacing="'.$this->params["cellspacing"]
|
||||
.'" cellpadding="'.$this->params["cellpadding"]
|
||||
.'" class="'.$this->params["tableclass"]
|
||||
.'" id="tbl'.$this->params["prefix"]
|
||||
.'" style="width:'.$this->params["tablewidth"]
|
||||
.';"><thead>';
|
||||
|
||||
// header row, row nb
|
||||
$_str.=$this->addRow(array('valign'=>'middle'));
|
||||
}
|
||||
|
||||
// sor szamlalo
|
||||
if ($this->params["rowcounter"]) {
|
||||
$_str.=($tbl ? $this->addCell('th',array('width'=>'30px','height'=>$this->params['thheight'])).'<span>Nb.</span></th>' : '"Nb"'.$separator);
|
||||
}
|
||||
|
||||
// header th fields and order arrows + links
|
||||
foreach ($mezok as $key=>$val) {
|
||||
$field_name=(isset($this->column[$key]) ? $key : $val);
|
||||
|
||||
if (!isset($this->column[$field_name]["visible"]) or $this->column[$field_name]["visible"]!==false) {
|
||||
$thWidth=(isset($this->column[$field_name]["width"]) ? $this->column[$field_name]["width"] : "");
|
||||
$thHeight=(isset($this->column[$field_name]["height"]) ? $this->column[$field_name]["height"] : $this->params["thheight"]);
|
||||
$fejlec=(isset($this->column[$field_name]["header"]) ? $this->column[$field_name]["header"] : $val);
|
||||
|
||||
if ($tbl) {
|
||||
$_str.=$this->addCell('th',array('width'=>$thWidth,'height'=>$thHeight,'valign'=>'middle')).'<span>'.$fejlec.'</span>';
|
||||
|
||||
// order arrows - default: visible
|
||||
if (!isset($this->column[$field_name]["order"]) or (isset($this->column[$field_name]["order"]) and $this->column[$field_name]["order"])) {
|
||||
$_str.='<div class="shortlinks">'
|
||||
.'<a href="javascript:setField(\''.$this->params['prefix'].'\',\''.$this->params['prefix'].'_tableorder\',\''.(isset($this->column[$field_name]["orderby"]) ? $this->column[$field_name]["orderby"] : $val).' ASC\',\''.$this->params['tablediv'].'\');" class="tableshort-up" title="Short by '.(isset($this->column[$field_name]["orderby"]) ? $this->column[$field_name]["orderby"] : $val).' ASC"></a>'
|
||||
.'<a href="javascript:setField(\''.$this->params['prefix'].'\',\''.$this->params['prefix'].'_tableorder\',\''.(isset($this->column[$field_name]["orderby"]) ? $this->column[$field_name]["orderby"] : $val).' DESC\',\''.$this->params['tablediv'].'\');" class="tableshort-down" title="Short by '.(isset($this->column[$field_name]["orderby"]) ? $this->column[$field_name]["orderby"] : $val).' DESC"></a>'
|
||||
.'</div>';
|
||||
}
|
||||
$_str.='</th>';
|
||||
}
|
||||
else {
|
||||
$_str.=($field_name!=='options' ? '"'.$fejlec.'"'.$separator : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($tbl) $_str.='</tr></thead>';
|
||||
|
||||
// add part
|
||||
$this->html_table=$_str.$newline;
|
||||
|
||||
// row of the table
|
||||
if (empty($eredm)) {
|
||||
if ($tbl) $this->html_table.='<tbody>'
|
||||
.$this->addRow(array('class'=>$this->params["row1"],'row'=>1,'effect'=>$this->params['rowEffect']))
|
||||
.$this->addCell('td',array('align'=>'center','height'=>$this->params['tdheight'],'colspan'=>($this->params["rowcounter"] ? 1 : 0)+count($mezok) ))
|
||||
.$this->dataset['RecordCount'].' '.$this->arrLang['record_result'].'</td></tr></tbody>';
|
||||
}
|
||||
else {
|
||||
$_str=($tbl ? "<tbody>" : '');
|
||||
|
||||
foreach ($eredm as $sorszam=>$sor) {
|
||||
$cnt=0;
|
||||
$nr=($this->params["ipp"]*($this->params["page"]-1));
|
||||
|
||||
// line begin
|
||||
if ($tbl) $_str.=$this->addRow(array(
|
||||
'class'=>($sorszam%2 ? $this->params["row1"] : $this->params["row2"]),
|
||||
'row'=>($sor['id']),
|
||||
'effect'=>$this->params['rowEffect'],
|
||||
) );
|
||||
|
||||
// rowcounter
|
||||
if ($this->params["rowcounter"]) {
|
||||
$_str.=($tbl ? $this->addCell('td',array('align'=>'right','height'=>$this->params['tdheight'])).($nr+$sorszam+1)."</td>" : '"'.($nr+$sorszam+1).'"'.$separator);
|
||||
}
|
||||
|
||||
// tovabbi oszlopok
|
||||
foreach ($sor as $key=>$val) {
|
||||
$field_name=(isset($this->column[$cnt]) ? $cnt : $key);
|
||||
|
||||
if ($field_name=="sort" and $this->params["sort"] and $tbl) {
|
||||
// sort nyilak
|
||||
$ljid=(isset($this->column[$field_name]["linkjoin"]) ? $sor[$this->column[$field_name]["linkjoin"]] : (trim($val)>"" ? $val : "") );
|
||||
$_str.=$this->addCell('td',array('align'=>'center'))
|
||||
.'<div class="shortlinks">'
|
||||
.'<a href="javascript:setField(\'\',\''.$this->params['prefix'].'_event\',\'sort\',\''.$this->params['tablediv'].'\');setField(\''.$this->params['prefix'].'\',\''.$this->params['prefix'].'_value\',\''.$ljid.' INC\',\''.$this->params['tablediv'].'\');" class="tableshort-up" title="ASC"></a>'
|
||||
.'<a href="javascript:setField(\'\',\''.$this->params['prefix'].'_event\',\'sort\',\''.$this->params['tablediv'].'\');setField(\''.$this->params['prefix'].'\',\''.$this->params['prefix'].'_value\',\''.$ljid.' DEC\',\''.$this->params['tablediv'].'\');" class="tableshort-down" title="DESC"></a>'
|
||||
.'</div>'.$val.'</td>';
|
||||
}
|
||||
else {
|
||||
if (!isset($this->column[$field_name]["visible"]) or $this->column[$field_name]["visible"]!==false) {
|
||||
|
||||
if ($tbl) {
|
||||
// cell begin
|
||||
$_str.=$this->addCell('td', array(
|
||||
'align'=>(isset($this->column[$field_name]['align']) ? $this->column[$field_name]['align'] : (is_numeric($val) ? 'right' : 'left') ),
|
||||
'height'=>$this->params['tdheight']
|
||||
) );
|
||||
|
||||
// link in cell
|
||||
if (isset($this->column[$field_name]["link"])) {
|
||||
$replace=(isset($this->column[$field_name]["linkjoin"]) ? $sor[$this->column[$field_name]["linkjoin"]] : (trim($val)>"" ? $val : "") );
|
||||
$title=(isset($this->column[$field_name]["linktitle"]) ? $sor[$this->column[$field_name]["linktitle"]] : (trim($val)>"" ? $val : "") );
|
||||
$_str.='<a href="'.str_replace("REPLACE", $replace, $this->column[$field_name]["link"]).'"'
|
||||
.' target="'.(isset($this->column[$field_name]["target"]) ? $this->column[$field_name]["target"] : $this->params["linktarget"] ).'"'
|
||||
.' title="'.strip_tags($title)
|
||||
.'">';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_str.=($field_name!=='options' ? '"': '');
|
||||
}
|
||||
|
||||
// writing cell content in the given format
|
||||
if (trim($val)>"") {
|
||||
if ( $tbl and isset ($this->column[$field_name]["addicons"]) and is_array($this->column[$field_name]["addicons"]) ) {
|
||||
$reszek=explode("|",$val);
|
||||
foreach ($reszek as $resz) {
|
||||
if (trim($resz)>'') {
|
||||
if (isset($this->column[$field_name]["addicons"][$resz]["linkjoin"])) {
|
||||
$replace=$sor[$this->column[$field_name]["addicons"][$resz]["linkjoin"]];
|
||||
}
|
||||
else {
|
||||
$replace=(isset($this->column[$field_name]["linkjoin"]) ? $sor[$this->column[$field_name]["linkjoin"]] : $val);
|
||||
}
|
||||
|
||||
$str='<a '
|
||||
.((isset($this->column[$field_name]['linkjoin']) and isset($this->column[$field_name]["addicons"][$resz]['href'])) ? ' href="'.str_replace('REPLACE',$replace,$this->column[$field_name]["addicons"][$resz]['href']).'"' : '' )
|
||||
.((isset($this->column[$field_name]['linkjoin']) and isset($this->column[$field_name]["addicons"][$resz]['onclick'])) ? ' onclick="'.str_replace('REPLACE',$replace,$this->column[$field_name]["addicons"][$resz]['onclick']) : '').'" title="'
|
||||
.str_replace("\"", " ", ($resz=="smallView") ? (isset($this->column[$field_name]["addicons"][$resz]['alttext']) ? $sor[$this->column[$field_name]["addicons"][$resz]['alttext']] : "") : str_replace(array('small','medium','large'),'',$resz)).'"'
|
||||
.(($resz=="smallView" and $this->params['imagePreview']) ? ' class="'.$this->params['imagePreviewClass'].'" ' : '')
|
||||
.(($resz=="smallView" and $this->params['toolTip']) ? ' class="'.$this->params['toolTipClass'].'" ' : '')
|
||||
.'><img src="'
|
||||
.($resz=="smallView" && !is_file($_SERVER['DOCUMENT_ROOT'].'/'.str_replace('REPLACE',$replace,$this->column[$field_name]["addicons"][$resz]['href'])) ? $this->column[$field_name]["addicons"]['smallMissingView']['img'] : $this->column[$field_name]["addicons"][$resz]['img'] ) .'" alt="'
|
||||
.str_replace("\"", " ", ($resz=="smallView") ? (isset($this->column[$field_name]["addicons"][$resz]['alttext']) ? $sor[$this->column[$field_name]["addicons"][$resz]['alttext']] : "") : str_replace(array('small','medium','large'),'',$resz)).'" /></a>';
|
||||
$val=str_replace($resz,$str,$val);
|
||||
}
|
||||
}
|
||||
$_str.=str_replace('|',' ',$val);
|
||||
}
|
||||
elseif ( isset ($this->column[$field_name]["replacevalues"]) and is_array($this->column[$field_name]["replacevalues"]) ) {
|
||||
$_str.=str_replace(array_keys($this->column[$field_name]["replacevalues"]),array_values($this->column[$field_name]["replacevalues"]),$val);
|
||||
}
|
||||
else {
|
||||
if (isset($this->column[$field_name]["format"])) {
|
||||
switch ($this->column[$field_name]["format"]) {
|
||||
case "text" : {
|
||||
$_str.=( (isset($this->column[$field_name]["strlen"]) and strlen($val)>$this->column[$field_name]["strlen"]) ? trim(mb_substr($val,0,$this->column[$field_name]["strlen"])).($tbl ? '…' : '...') : $val) ;
|
||||
break;
|
||||
}
|
||||
case "time" : {
|
||||
$_str.=DateTimeStatic::changeSecToTime($val);
|
||||
break;
|
||||
}
|
||||
case "ratio" : {
|
||||
$c1=$this->column[$field_name]['ratio'][0];
|
||||
$c2=$this->column[$field_name]['ratio'][1];
|
||||
$_str.=($sor[$c1]>0 ? '1' : '0').':'.($sor[$c1]>0 ? number_format($sor[$c2]/$sor[$c1], ($sor[$c2]<$sor[$c1] ? 2 : 0),'.',($tbl ? ',':' ') ) : $sor[$c2]);
|
||||
break;
|
||||
}
|
||||
case "percent": {
|
||||
$_str.=(!isset($this->column[$field_name]["decimal"]) ? number_format($val,$this->params["decimal"],'.',($tbl ? ',':' ')).'%' : number_format($val,$this->column[$field_name]["decimal"],'.',($tbl ? ',':' ')).'%' );
|
||||
break;
|
||||
}
|
||||
case "number" : {
|
||||
$_str.=number_format($val,(isset($this->column[$field_name]["decimal"]) ? $this->column[$field_name]["decimal"] : $this->params["decimal"]),'.',($tbl ? ',':''));
|
||||
break;
|
||||
}
|
||||
case "link" : {
|
||||
$_x='<a href="'.$val.'"'
|
||||
.' target="'.(isset($this->column[$field_name]["target"]) ? $this->column[$field_name]["target"] : $this->params['linktarget']).'"'
|
||||
.' title="'.(isset($this->column[$field_name]["linkjoin"]) ? $sor[$this->column[$field_name]["linkjoin"]] : $val).'">'
|
||||
.((isset($this->column[$field_name]['strlen']) and strlen($val)>$this->column[$field_name]['strlen']) ? trim(mb_substr($val,0,$this->column[$field_name]['strlen'])).'…' : $val)
|
||||
.'</a>';
|
||||
$_str.=($tbl ? $_x : strip_tags( str_replace('…','...',$_x) ));
|
||||
break;
|
||||
}
|
||||
case "mailto" : {
|
||||
$_x='<a href="mailto:'.$val.'"'
|
||||
.' title="mailto:'.$val.'">'
|
||||
.((isset($this->column[$field_name]['strlen']) and strlen($val)>$this->column[$field_name]['strlen']) ? trim(mb_substr($val,0,$this->column[$field_name]['strlen'])).'…' : $val)
|
||||
.'</a>';
|
||||
$_str.=($tbl ? $_x : strip_tags( str_replace('…','...',$_x) ));
|
||||
break;
|
||||
}
|
||||
case "openlink" : {
|
||||
$_x='<a href="'.$val.'"'
|
||||
.' target="'.(isset($this->column[$field_name]["target"]) ? $this->column[$field_name]["target"] : $this->params['linktarget']).'"'
|
||||
.' title="'.$val.'">open'
|
||||
.'</a>';
|
||||
$_str.=($tbl ? $_x : strip_tags( str_replace('open',$val,$_x) ) );
|
||||
break;
|
||||
}
|
||||
case "checkbox" : {
|
||||
if ($tbl) {
|
||||
$_str.='<input type="checkbox" name="'
|
||||
.$this->params['cbprefix'].'[]" id="'
|
||||
.$this->params['cbprefix'].'_'
|
||||
.(isset($this->column[$field_name]['linkjoin']) ? $sor[$this->column[$field_name]['linkjoin']] : $val )
|
||||
.'" value="'.(isset($this->column[$field_name]['linkjoin']) ? $sor[$this->column[$field_name]['linkjoin']] : $val )
|
||||
.'" />';
|
||||
}
|
||||
else {
|
||||
$_str.='x';
|
||||
}
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
if (isset($this->column[$field_name]["strlen"]) and strlen($val)>$this->column[$field_name]["strlen"]) {
|
||||
$_str.=trim(mb_substr($val, 0, $this->column[$field_name]["strlen"])).($tbl ? '…' : '...');
|
||||
}
|
||||
elseif (is_numeric($val)) {
|
||||
$_str.=(isset($this->column[$field_name]["decimal"]) ? number_format($val,$this->column[$field_name]["decimal"],($tbl ? ',':' ')) : number_format($val,$this->params["decimal"],($tbl ? ',':' ')));
|
||||
}
|
||||
else {
|
||||
$_str.=$val;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($tbl or (!$tbl and $field_name!=='options')) {
|
||||
$_str.=((isset($this->column[$field_name]['strlen']) and strlen($val)>$this->column[$field_name]['strlen']) ? trim(mb_substr($val,0,$this->column[$field_name]['strlen'])).($tbl ? '…' : '...') : $val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_str.=($this->column[$field_name]["format"]=='number' ? 0 : " ") ;
|
||||
}
|
||||
|
||||
if ($tbl) {
|
||||
if (isset($this->column[$field_name]["link"])) $_str.="</a>";
|
||||
$_str.="</td>";
|
||||
}
|
||||
else {
|
||||
$_str.=($field_name!=='options' ? '"'.$separator : '');
|
||||
}
|
||||
$cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add part when a row is ready
|
||||
$this->html_table.=($tbl ? $_str."</tr>" : $_str.$newline);
|
||||
$_str="";
|
||||
}
|
||||
if ($tbl) $this->html_table.="</tbody>";
|
||||
}
|
||||
|
||||
// tabla lablec
|
||||
if ($this->params["footer"]) {
|
||||
if ($tbl) $_strFooter="<thead>".$this->addRow(array('valign'=>'middle') );
|
||||
|
||||
// rowcounter (recordok szamat irja bele
|
||||
if ($this->params["rowcounter"]) {
|
||||
$_strFooter.=($tbl ? $this->addCell('th',array('height'=>$this->params['thheight'],'align'=>'right')).'<strong>'.number_format($this->dataset["RecordCount"],0).'</strong></th>' : number_format($this->dataset["RecordCount"],0,'.',' ').$separator);
|
||||
}
|
||||
|
||||
foreach ($mezok as $key=>$val) {
|
||||
$field_name=(isset($this->column[$key]) ? $key : $val);
|
||||
|
||||
if (!isset($this->column[$field_name]["visible"]) or $this->column[$field_name]["visible"]!==false) {
|
||||
if (isset($sumrow[$field_name])) {
|
||||
if ($tbl) {
|
||||
$_strFooter.=$this->addCell('th',array(
|
||||
'align'=>(isset($this->column[$field_name]["align"]) ? $this->column[$field_name]["align"] : (is_numeric($sumrow[$field_name]) ? 'right' : 'left') ),
|
||||
'height'=>$this->params['thheight'],
|
||||
) ).' <strong>';
|
||||
}
|
||||
if (isset($this->column[$field_name]["format"])) {
|
||||
switch ($this->column[$field_name]["format"]) {
|
||||
case "time" : {
|
||||
$_strFooter.=DateTimeStatic::changeSecToTime($sumrow[$field_name]);
|
||||
break;
|
||||
}
|
||||
case "percent": {
|
||||
$_strFooter.=number_format((double)$sumrow[$field_name],(!isset($this->column[$field_name]["decimal"]) ? $this->params["decimal"] : $this->column[$field_name]["decimal"]),'.',' ')."%";
|
||||
break;
|
||||
}
|
||||
case "number" : {
|
||||
$_strFooter.=number_format((double)$sumrow[$field_name],(isset($this->column[$field_name]["decimal"]) ? $this->column[$field_name]["decimal"] : $this->params["decimal"]),'.',' ');
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
$_strFooter.=$sumrow[$field_name];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_strFooter.=$sumrow[$field_name];
|
||||
}
|
||||
$_strFooter.=($tbl ? "</strong></th>" : $separator);
|
||||
}
|
||||
else {
|
||||
$_strFooter.=($tbl ? $this->addCell('th',array('height'=>$this->params['thheight']))." </th>" : $separator);
|
||||
}
|
||||
}
|
||||
}
|
||||
$_strFooter.=($tbl ? "</tr></thead>" : $newline);
|
||||
}
|
||||
|
||||
// Table end
|
||||
$this->html_table.=((isset($_strFooter) and trim($_strFooter)>'') ? $_strFooter : '');
|
||||
if ($tbl) $this->html_table.="</table></div>";
|
||||
if ($tbl and $this->params["draganddrop"]) $this->html_table.="<script type=\"text/javascript\">dragAndDrop('".$this->params['prefix']."');</script>";
|
||||
if ($tbl and $this->params["imagePreview"]) $this->html_table.="<script type=\"text/javascript\">imagePreview();</script>";
|
||||
if ($tbl and $this->params["toolTip"]) $this->html_table.="<script type=\"text/javascript\">tooltip();</script>";
|
||||
}
|
||||
|
||||
|
||||
function addControllers() {
|
||||
$str='<input type="hidden" name="'.$this->params["prefix"].'_tableipp" id="'.$this->params["prefix"].'_tableipp" value="'.$this->params["ipp"].'" />'
|
||||
.'<input type="hidden" name="'.$this->params["prefix"].'_tableorder" id="'.$this->params["prefix"].'_tableorder" value="'.$this->params["order"].'" />'
|
||||
.'<input type="hidden" name="'.$this->params["prefix"].'_tablepage" id="'.$this->params["prefix"].'_tablepage" value="'.$this->params["page"].'" />'
|
||||
.'<input type="hidden" name="'.$this->params["prefix"].'_event" id="'.$this->params["prefix"].'_event" value="" />'
|
||||
.'<input type="hidden" name="'.$this->params["prefix"].'_value" id="'.$this->params["prefix"].'_value" value="" />'
|
||||
// .($this->params["draganddrop"] ? '<input type="text" name="'.$this->params["prefix"].'_displacement" id="'.$this->params["prefix"].'_displacement" value="" />' : '')
|
||||
.($this->params["downloadLink"] ? '<input type="hidden" name="'.$this->params["prefix"].'_download" id="'.$this->params["prefix"].'_download" value="" />' : '')
|
||||
.'<div class="tablenav" '
|
||||
.($this->params['tablewidth']>'' ? ' style="width:'.$this->params["tablewidth"].';" ' : '' ).'>'
|
||||
.$this->addSelectFields($this->params["ipp"], '', $this->params["ippvals"], true, ' onchange="javascript:setField(\''.$this->params['prefix'].'\',\''.$this->params['prefix'].'_tableipp\',this.value,\''.$this->params['tablediv'].'\');" ')
|
||||
.'<p>'.$this->arrLang['ipp'].'</p>'
|
||||
.'<p><b>'.(($this->dataset["RecordCount"]==1)? $this->arrLang['result'] : $this->arrLang['results']).':</b> '.number_format($this->dataset["RecordCount"],0).'</p>'
|
||||
.(($this->params["downloadLink"] && $this->params["csvExport"]==false) ? "<p><b>Export:</b> <a onclick=\"javascript:setField('".$this->params['prefix']."','".$this->params['prefix']."_download',',','".$this->params['tablediv']."');\">CSV</a></p>" : "")
|
||||
.(($this->params["downloadLink"] && $this->params["csvExport"]==true) ? "<p><b>Export:</b> <a href=\"".str_replace("Controller", "DownloadController", $this->params['prefix'])."/csv\" target=\"_blank\">CSV</a> | <a href=\"".str_replace("Controller", "DownloadController", $this->params['prefix'])."/xlsx\" target=\"_blank\">EXCEL</a></p>" : "")
|
||||
.'<p>'.($this->params["ipp"]>0 ? $this->AddPager() :'').'</p>'
|
||||
.'</div>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a 'tr' tag to the table
|
||||
*
|
||||
* @param array $params['valign']
|
||||
* @param array $params['class']
|
||||
* @param array $params['row']
|
||||
* @param array $params['effect'] - optional, default: true - selects the clicked row
|
||||
*/
|
||||
function addRow($params=array()) {
|
||||
if (!isset($params['effect'])) $params['effect']=true;
|
||||
$str='<tr '
|
||||
.((isset($params['valign']) and $params['valign']>'') ? ' valign="'.$params['valign'].'"' : ' valign="middle"')
|
||||
.(isset($params['row']) ? ' id="'.(int)$params['row'].'"' : '')
|
||||
.((isset($params['class']) and $params['class']) ? ' class="'.$params['class'].'"' : '')
|
||||
.((isset($params['effect']) and $params['effect'] and isset($params['row']) and !$this->params['draganddrop']) ? '' : '')
|
||||
.($this->params['draganddrop'] ? 'style="cursor: move;"' : "")
|
||||
.'>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $type ('td','th')
|
||||
* @param array $params['align']
|
||||
* @param array $params['width']
|
||||
* @param array $params['height']
|
||||
* @param array $params['class']
|
||||
*/
|
||||
function addCell($type='td',$params=array()) {
|
||||
$str='<'.$type
|
||||
.(isset($params["valign"]) ? ' valign="'.$params["valign"].'"' : '' )
|
||||
.(isset($params["colspan"]) ? ' colspan="'.$params["colspan"].'"' : '' )
|
||||
.(isset($params["rowspan"]) ? ' rowspan="'.$params["rowspan"].'"' : '' )
|
||||
.' style="'
|
||||
.((isset($params["align"]) and $params["align"])>'' ? ' text-align:'.$params["align"].';' : '')
|
||||
.((isset($params['width']) and $params['width'])>'' ? ' width:'.$params['width'].';' : '')
|
||||
.((isset($params['height']) and $params["height"])>'' ? ' height:'.$params["height"].';' : '').'"'
|
||||
.((isset($params['class']) and $params['class'])>'' ? ' class="'.$params["class"].'"' : '')
|
||||
.'>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
function addPager() {
|
||||
$lapok=(($this->params["ipp"]=="-1" or $this->params["ipp"]=="0") ? 1 : ceil($this->dataset["RecordCount"]/$this->params["ipp"]));
|
||||
$_lap=&$this->params["page"];
|
||||
$vege=&$this->params["vege"];
|
||||
$kezdet=&$this->params["kezdet"];
|
||||
$lapozomax=&$this->params["lapozomax"];
|
||||
$lapozoszel=round(($this->params["lapozomax"]-1)/2);
|
||||
|
||||
if ($_lap==1) { // ha az elso lapon vagyunk
|
||||
$kezdet = 1;
|
||||
($lapok>=$lapozomax) ? $vege=$lapozomax: $vege=$lapok;
|
||||
}
|
||||
elseif ($_lap>1 and $_lap<$lapok) { // koztes lapon vagyunk
|
||||
if ($lapok>=$lapozomax) { // csonkolni kell
|
||||
if ($_lap-$lapozoszel<=1) { // minuszba log
|
||||
$kezdet = 1;
|
||||
$vege=$lapozomax;
|
||||
}
|
||||
elseif ($_lap-$lapozoszel>1 and $_lap+$lapozoszel<=$lapok) { // kozepen van
|
||||
$kezdet=$_lap-$lapozoszel;
|
||||
$vege=$_lap+$lapozoszel;
|
||||
}
|
||||
elseif ($_lap+$lapozoszel>$lapok) { // pluszba log
|
||||
$vege=$lapok;
|
||||
($lapok-$lapozomax) ? $kezdet=$lapok-$lapozomax+1 : $kezdet=1;
|
||||
}
|
||||
}
|
||||
else { // nem kell csonkolni, mert belefer a $lapok szama a $lapozomax-ba
|
||||
$kezdet=1;
|
||||
$vege=$lapok;
|
||||
}
|
||||
}
|
||||
elseif ($_lap==$lapok) { // ha az utolso lapon vagyunk
|
||||
$vege=$lapok;
|
||||
($lapok-$lapozomax>0) ? $kezdet=$lapok-$lapozomax+1 : $kezdet=1;
|
||||
}
|
||||
|
||||
($_lap-1>0) ? $prev=$_lap-1 : $prev=1;
|
||||
($_lap+1>$lapok) ? $next=$_lap : $next=$_lap+1;
|
||||
|
||||
|
||||
$lapozo ='<ul class="pager">'
|
||||
.'<li><p><b>'.$this->arrLang['pages'].'</b> '.$this->params["page"].' / '.$lapok.'</p></li>'
|
||||
.$this->addPagerLink(1,"«", false)
|
||||
.$this->addPagerLink($prev,"‹", false)
|
||||
.( ($this->params["lapozomax"]<$lapok and $this->params['pageJump'])? $this->addPagerLink( ($this->params["page"]-$this->params["lapozomax"]<0 ? 1 : $this->params["page"]-$this->params["lapozomax"]), '…', false) : '');
|
||||
for ($i=$kezdet; $i<=$vege; $i++) $lapozo.=$this->addPagerLink($i,$i);
|
||||
$lapozo.=(($this->params["lapozomax"]<$lapok and $this->params['pageJump']) ? $this->addPagerLink( ($this->params["page"]+$this->params["lapozomax"]>$lapok ? $lapok : $this->params["page"]+$this->params["lapozomax"]), "…", false) : '')
|
||||
.$this->addPagerLink($next,"›", false)
|
||||
.$this->addPagerLink($lapok,"»", false)
|
||||
.'</ul>';
|
||||
return $lapozo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $page - azt jelenti, hogy hanyadik oldalra ugorjon
|
||||
* @param string $felirat - dobozban levo felirat (szamok, nyilak)
|
||||
* @param boolean $effect - legyen-e rajta effect vagy ne
|
||||
*/
|
||||
function addPagerLink($page=0, $felirat="", $effect=true) {
|
||||
$js="javascript:setField('".$this->params['prefix']."','".$this->params['prefix']."_tablepage','".$page."','".$this->params['tablediv']."');";
|
||||
$str='<li><a onclick="'.$js.'" title="'.$this->arrLang['page'].' '.$page.'"'.(($this->params["page"]==$page and $effect) ? ' class="activepage" ' : '').'>'.$felirat.'</a></li>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Makes a selectfield
|
||||
*
|
||||
* @param string $selected - selected value
|
||||
* @param string $selectname - id of the DOM element
|
||||
* @param array $selectarray - option values
|
||||
* @param boolean $assoc - marks that the array is an associative or not
|
||||
* @param string $style - style string
|
||||
*/
|
||||
function addSelectFields($selected="", $selectname="", $selectarray=array(), $assoc=true, $style="") {
|
||||
$str ='<select name="'.$selectname.'" id="'.$selectname.'" '.$style.'>';
|
||||
foreach ($selectarray as $kulcs=>$ertek)
|
||||
$str.='<option value="'
|
||||
.($assoc ? $kulcs : $ertek).'"'
|
||||
.($assoc ? ($selected==$kulcs ? ' selected="selected"' : '') : ($selected==$ertek ? ' selected="selected"' : ''))
|
||||
.'>'.$ertek.'</option>';
|
||||
$str.='</select>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the Queries and runs them
|
||||
* The results will be in the $this->arrResult array
|
||||
*
|
||||
* @param array $new
|
||||
*/
|
||||
function setQuery($new=array()) {
|
||||
if (!empty($new) and is_array($new)) {
|
||||
$this->arrQuery=$new;
|
||||
foreach ($this->arrQuery as $k=>$v) {
|
||||
$this->arrResult[$k]=$this->runQuery($v);
|
||||
if(empty($this->arrResult[$k])) {
|
||||
if(preg_match("/LIMIT [0-9]+/", $v)) {
|
||||
$v=preg_replace("/LIMIT [0-9]+/", 'LIMIT 0', $v);
|
||||
$this->arrQuery[$k]=$v;
|
||||
$this->arrResult[$k]=$this->runQuery($v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setOrderNull($tomb=array(), $strOrder="") {
|
||||
$setOrderNull=true;
|
||||
foreach ($tomb as $key=>$val)
|
||||
{
|
||||
if ( strpos($strOrder, $val)!==false ) { $setOrderNull=false; break; }
|
||||
}
|
||||
return ($setOrderNull);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the Sessions from the _POST-ed values
|
||||
* tableipp, tablepage, tableorder
|
||||
*/
|
||||
function setSession() {
|
||||
if (isset($_POST[$this->params["prefix"]."_tableipp"])) {
|
||||
if ($_POST[$this->params["prefix"]."_tableipp"]=='-1') $_SESSION[$this->params["prefix"]]["tableipp"] = -1;
|
||||
elseif ($_POST[$this->params["prefix"]."_tableipp"]=='none') $_SESSION[$this->params["prefix"]]["tableipp"] = 0;
|
||||
else $_SESSION[$this->params["prefix"]]["tableipp"] = (int)$_POST[$this->params["prefix"]."_tableipp"];
|
||||
$this->setParams(array("ipp"=>$_SESSION[$this->params["prefix"]]["tableipp"]));
|
||||
}
|
||||
else {
|
||||
if (!isset($_SESSION[$this->params["prefix"]]["tableipp"])) {
|
||||
$_SESSION[$this->params["prefix"]]["tableipp"]=$this->params["ipp"];
|
||||
}
|
||||
}
|
||||
if (isset($_POST[$this->params["prefix"]."_tablepage"])) {
|
||||
$_SESSION[$this->params["prefix"]]["tablepage"] = (int)$_POST[$this->params["prefix"]."_tablepage"];
|
||||
$this->setParams(array("page"=>$_SESSION[$this->params["prefix"]]["tablepage"]));
|
||||
}
|
||||
else {
|
||||
if (!isset($_SESSION[$this->params["prefix"]]["tablepage"])) {
|
||||
$_SESSION[$this->params["prefix"]]["tablepage"]=$this->params["page"];
|
||||
}
|
||||
}
|
||||
if (isset($_POST[$this->params["prefix"]."_tableorder"])) {
|
||||
$_SESSION[$this->params["prefix"]]["tableorder"] = trim(addslashes((string)$_POST[$this->params["prefix"]."_tableorder"]));
|
||||
$this->setParams(array("order"=>$_SESSION[$this->params["prefix"]]["tableorder"]));
|
||||
}
|
||||
|
||||
if (!isset($_POST[$this->params["prefix"]."_tableipp"]) and !isset($_POST[$this->params["prefix"]."_tablepage"]) and !isset($_POST[$this->params["prefix"]."_tableorder"]) and
|
||||
isset($_SESSION[$this->params["prefix"]]["tableipp"]) and isset($_SESSION[$this->params["prefix"]]["tablepage"]) and isset($_SESSION[$this->params["prefix"]]["tableorder"]) ) {
|
||||
$this->setParams(array(
|
||||
"ipp"=>$_SESSION[$this->params["prefix"]]["tableipp"],
|
||||
"page"=>$_SESSION[$this->params["prefix"]]["tablepage"],
|
||||
"order"=>$_SESSION[$this->params["prefix"]]["tableorder"],
|
||||
));
|
||||
}
|
||||
return $_SESSION[$this->params['prefix']];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parameters of the column
|
||||
*
|
||||
* @param string $oszlopszam
|
||||
* @param array $tomb
|
||||
*/
|
||||
function setColumn($oszlopnev=null, $tomb=array()) {
|
||||
if ($oszlopnev!==null and !empty($tomb)) {
|
||||
$this->column[$oszlopnev]=$tomb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the params array with the given values
|
||||
*
|
||||
* @param array $tomb
|
||||
*/
|
||||
function setParams($tomb=array()) {
|
||||
if (!empty($tomb)) {
|
||||
foreach ($tomb as $k=>$v) {
|
||||
if (isset($this->params[$k])) {
|
||||
$this->params[$k]=$v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets all inner values to the default
|
||||
*/
|
||||
function setDefault() {
|
||||
$this->html_table="";
|
||||
$this->arrQuery=array();
|
||||
$this->arrResult=array();
|
||||
$this->column=array();
|
||||
$this->dataset=array("RecordCount"=>0,"FieldCount"=>0,"FieldName"=>array());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runs the Query string, and returns the result
|
||||
*
|
||||
* @param string $strQuery
|
||||
* @return result $res
|
||||
*/
|
||||
function runQuery($strQuery='') {
|
||||
$res=false;
|
||||
if ($strQuery>'')
|
||||
{
|
||||
MySqlHelper::getInstance()->query($strQuery);
|
||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
||||
/*
|
||||
$msh=New MySqlHelper();
|
||||
$msh->init('localhost','dev_cadline_hu','mycadline','Shea6hoo');
|
||||
$msh->query($strQuery);
|
||||
$res=$msh->fetchAssoc();
|
||||
*/
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Draws the table
|
||||
* param=true => echo content
|
||||
* param=false => return content
|
||||
*
|
||||
* @param boolean $print
|
||||
*/
|
||||
function drawTable($print=true){
|
||||
$this->parseTable();
|
||||
|
||||
if ($print)
|
||||
{
|
||||
echo $this->html_table;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->html_table;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package Com_Albanner
|
||||
* @author Zsolt Fekete <mcleod78@gmail.com>
|
||||
* @copyright 2017 Zsolt Fekete
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Albanner helper.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class AlbannerHelper
|
||||
{
|
||||
public static function addSubmenu($vName = '')
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
jimport('joomla.application.component.modelitem');
|
||||
|
||||
class AlbannerModelBanners extends JModelItem
|
||||
{
|
||||
protected $lang;
|
||||
protected $tabla='albanner';
|
||||
public $count;
|
||||
|
||||
public function getCount()
|
||||
{
|
||||
if ( !isset($this->count) )
|
||||
{
|
||||
$db=JFactory::getDBO();
|
||||
$db->setQuery("SELECT COUNT(*) AS darab FROM ".$this->tabla." v;");
|
||||
$tmp=$db->loadObjectList();
|
||||
$this->count=$tmp[0]->darab;
|
||||
}
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
jimport('joomla.application.component.modelitem');
|
||||
|
||||
class AlbannerModelEdit extends JModelItem
|
||||
{
|
||||
protected $tabla='albanner';
|
||||
protected $item;
|
||||
protected $lang;
|
||||
protected $dbCRM;
|
||||
|
||||
public function getCRMConfig()
|
||||
{
|
||||
if (empty($this->dbCRM))
|
||||
{
|
||||
require($_SERVER['DOCUMENT_ROOT'].'/maintenance/config.crm.php');
|
||||
$this->dbCRM=$dbCRM;
|
||||
}
|
||||
return($this->dbCRM);
|
||||
}
|
||||
|
||||
public function getCRMctrCode()
|
||||
{
|
||||
$crm=JDatabaseDriver::getInstance($this->getCRMConfig());
|
||||
$crm->setQuery("SELECT DISTINCT(LEFT(prPass,2)) AS ctrCode FROM `h_programs` WHERE LEFT(prPass,2) IS NOT NULL ORDER BY LEFT(prPass,2);");
|
||||
$tmp=$crm->loadObjectList();
|
||||
return (empty($tmp) ? NULL : $tmp);
|
||||
}
|
||||
|
||||
public function getCRMprgVersion()
|
||||
{
|
||||
$crm=JDatabaseDriver::getInstance($this->getCRMConfig());
|
||||
$crm->setQuery("SELECT DISTINCT(verPassword8and9) AS verCode,verName FROM `p_versions` WHERE verPassword8and9>33;");
|
||||
$tmp=$crm->loadObjectList();
|
||||
return (empty($tmp) ? NULL : $tmp);
|
||||
}
|
||||
|
||||
public function getItem($id=0)
|
||||
{
|
||||
if ((int)$id>0)
|
||||
{
|
||||
$db=JFactory::getDBO();
|
||||
$db->setQuery("SELECT * FROM ".$this->tabla." WHERE id=".(int)$id." LIMIT 1;");
|
||||
$tmp=$db->loadObjectList();
|
||||
$this->item=$tmp[0];
|
||||
}
|
||||
return $this->item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function saveItem($item=NULL,$id=NULL)
|
||||
{
|
||||
$values=array();
|
||||
|
||||
if (is_array($item))
|
||||
{
|
||||
$db=JFactory::getDbo();
|
||||
$user=JFactory::getUser();
|
||||
$query=$db->getQuery(true);
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$item['mod_datetime']=date('Y-m-d H:i:s');
|
||||
$item['mod_user']=$user->id;
|
||||
$item['mod_ip']=$_SERVER['REMOTE_ADDR'];
|
||||
|
||||
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
||||
|
||||
$query->update($db->quoteName($this->tabla))->set($values)->where(array('`id`='.(int)$id));
|
||||
$db->setQuery($query);
|
||||
$result=$db->execute();
|
||||
}
|
||||
else
|
||||
{
|
||||
$item['add_datetime']=date('Y-m-d H:i:s');
|
||||
$item['add_user']=$user->id;
|
||||
$item['add_ip']=$_SERVER['REMOTE_ADDR'];
|
||||
$item['mod_datetime']=date('Y-m-d H:i:s');
|
||||
$item['mod_user']=$user->id;
|
||||
$item['mod_ip']=$_SERVER['REMOTE_ADDR'];
|
||||
|
||||
foreach ($item as $v) $values[]=$db->quote($v);
|
||||
|
||||
$query->insert($db->quoteName($this->tabla))->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
$result=$db->insertid();
|
||||
}
|
||||
return ($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
jimport('joomla.application.component.modelitem');
|
||||
|
||||
class AlbannerModelList extends JModelItem
|
||||
{
|
||||
protected $lang;
|
||||
protected $tabla='albanner';
|
||||
public $count;
|
||||
|
||||
public function getCount()
|
||||
{
|
||||
if ( !isset($this->count) )
|
||||
{
|
||||
$db=JFactory::getDBO();
|
||||
$db->setQuery("SELECT COUNT(*) AS darab FROM ".$this->tabla." v;");
|
||||
$tmp=$db->loadObjectList();
|
||||
$this->count=$tmp[0]->darab;
|
||||
}
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
jimport('joomla.application.component.modelitem');
|
||||
|
||||
class AlbannerModelTest extends JModelItem
|
||||
{
|
||||
protected $tabla='albanner';
|
||||
protected $item;
|
||||
protected $lang;
|
||||
protected $dbCRM;
|
||||
|
||||
public function getCRMConfig()
|
||||
{
|
||||
if (empty($this->dbCRM))
|
||||
{
|
||||
require($_SERVER['DOCUMENT_ROOT'].'/maintenance/config.crm.php');
|
||||
$this->dbCRM=$dbCRM;
|
||||
}
|
||||
return($this->dbCRM);
|
||||
}
|
||||
|
||||
public function getCRMctrCode()
|
||||
{
|
||||
$crm=JDatabaseDriver::getInstance($this->getCRMConfig());
|
||||
$crm->setQuery("SELECT DISTINCT(LEFT(prPass,2)) AS ctrCode FROM `h_programs` WHERE LEFT(prPass,2) IS NOT NULL ORDER BY LEFT(prPass,2);");
|
||||
$tmp=$crm->loadObjectList();
|
||||
return (empty($tmp) ? NULL : $tmp);
|
||||
}
|
||||
|
||||
public function getCRMprgVersion()
|
||||
{
|
||||
$crm=JDatabaseDriver::getInstance($this->getCRMConfig());
|
||||
$crm->setQuery("SELECT DISTINCT(verPassword8and9) AS verCode,verName FROM `p_versions` WHERE verPassword8and9>33;");
|
||||
$tmp=$crm->loadObjectList();
|
||||
return (empty($tmp) ? NULL : $tmp);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
JHtml::_('behavior.tooltip');
|
||||
?>
|
||||
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
||||
|
||||
<div id="j-main-container">
|
||||
<?=JText::_('COM_ALBANNER_COUNT')?>: <?=$this->count?>
|
||||
</div>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_VERSIONS_VERSIONS">
|
||||
<message>
|
||||
<![CDATA[COM_VERSIONS_VERSIONS_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
|
||||
jimport('joomla.application.component.view'); // import Joomla view library
|
||||
|
||||
class AlbannerViewBanners extends JViewLegacy
|
||||
{
|
||||
public $count;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
||||
|
||||
$model=$this->getModel();
|
||||
|
||||
$this->count=$model->getCount();
|
||||
|
||||
$this->addToolBar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_ALBANNER').' - '.JText::_('COM_ALBANNER_CONTROL_PANER'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,158 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
JHtml::_('behavior.tooltip');
|
||||
?>
|
||||
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
||||
|
||||
<div id="j-main-container">
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="ban_id"><?=JText::_('COM_ALBANNER_ID')?>:</label>
|
||||
<input type="text" name="ban_id" id="ban_id" value="<?=$this->item->id?>" maxlength="8" readonly="readonly" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="build"><?=JText::_('COM_ALBANNER_BUILD')?>:</label>
|
||||
<input type="text" name="build" id="build" value="<?=$this->item->build?>" maxlength="4" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="link"><?=JText::_('COM_ALBANNER_LINK')?>:</label>
|
||||
<input type="text" name="link" id="link" value="<?=$this->item->link?>" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="lang"><?=JText::_('COM_ALBANNER_LANG')?>:</label>
|
||||
<select name="lang" id="lang">
|
||||
<option value="hun" <?=($this->item && $this->item->lang=='hun' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_HUN')?></option>
|
||||
<option value="eng" <?=($this->item && $this->item->lang=='eng' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ENG')?></option>
|
||||
<option disabled="disabled">-----</option>
|
||||
<option value="ita" <?=($this->item && $this->item->lang=='ita' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ITA')?></option>
|
||||
<option value="esp" <?=($this->item && $this->item->lang=='esp' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ESP')?></option>
|
||||
<option value="ger" <?=($this->item && $this->item->lang=='ger' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_GER')?></option>
|
||||
<option value="gre" <?=($this->item && $this->item->lang=='gre' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_GRE')?></option>
|
||||
<option value="cze" <?=($this->item && $this->item->lang=='cze' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_CZE')?></option>
|
||||
<option value="pol" <?=($this->item && $this->item->lang=='pol' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_POL')?></option>
|
||||
<option value="hrv" <?=($this->item && $this->item->lang=='hrv' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_HRV')?></option>
|
||||
<option value="kor" <?=($this->item && $this->item->lang=='kor' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_KOR')?></option>
|
||||
<option value="chi" <?=($this->item && $this->item->lang=='chi' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_CHI')?></option>
|
||||
<option value="nno" <?=($this->item && $this->item->lang=='nno' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_NNO')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="pattern"><?=JText::_('COM_ALBANNER_PATTERN')?>:</label>
|
||||
<input type="text" name="pattern" id="pattern" value="<?=$this->item->pattern?>" maxlength="16" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="ctrCode"><?=JText::_('COM_ALBANNER_CTRCODE')?>:</label>
|
||||
<select name="ctrCode" id="ctrCode">
|
||||
<option value="xx">xx</option>
|
||||
<?php foreach ($this->ctrCode as $row):?>
|
||||
<option value="<?=$row->ctrCode?>" <?=($this->ctrCodeSel==$row->ctrCode ? 'selected="selected"' : '')?>><?=$row->ctrCode?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="prgType"><?=JText::_('COM_ALBANNER_TYPE')?>:</label>
|
||||
<select name="prgType" id="prgType">
|
||||
<option value="x" <?=($this->prgTypeSel==='x' ? 'selected="selected"' : '')?>>x</option>
|
||||
<?php foreach (range(0,9) as $row):?>
|
||||
<option value="<?=$row?>" <?=($this->prgTypeSel===$row ? 'selected="selected"' : '')?>><?=$row?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="prgCode"><?=JText::_('COM_ALBANNER_VERSION')?>:</label>
|
||||
<select name="prgCode" id="prgCode">
|
||||
<option value="xx">xx</option>
|
||||
<?php foreach ($this->prgCode as $row):?>
|
||||
<option value="<?=$row->verCode?>" <?=($this->prgCodeSel==$row->verCode ? 'selected="selected"' : '')?>><?=$row->verCode?> - <?=$row->verName?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label><?=JText::_('COM_ALBANNER_GENERATE')?>:</label>
|
||||
<input type="button" name="generate" id="generate" value="<?=JText::_('COM_ALBANNER_GENERATE')?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="from_datetime"><?=JText::_('COM_ALBANNER_FROM')?>:</label>
|
||||
<input type="text" name="from_datetime" id="from_datetime" value="<?=substr($this->item->from_datetime,0,10)?>" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="end_datetime"><?=JText::_('COM_ALBANNER_TO')?>:</label>
|
||||
<input type="text" name="end_datetime" id="end_datetime" value="<?=substr($this->item->end_datetime,0,10)?>" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="priority"><?=JText::_('COM_ALBANNER_PRIORITY')?>:</label>
|
||||
<select name="priority" id="priority">
|
||||
<option value="1" <?=($this->item && $this->item->priority==1 ? 'selected="selected"' : '')?>>1 - <?=JText::_('COM_ALBANNER_LOW')?></option>
|
||||
<option value="2" <?=($this->item && $this->item->priority==2 ? 'selected="selected"' : '')?>>2 - <?=JText::_('COM_ALBANNER_MED')?></option>
|
||||
<option value="3" <?=($this->item && $this->item->priority==3 ? 'selected="selected"' : '')?>>3 - <?=JText::_('COM_ALBANNER_HIG')?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="published"><?=JText::_('COM_ALBANNER_PUBLISHED')?>:</label>
|
||||
<select name="published" id="published">
|
||||
<option value="N"<?=($this->item->published=='N' ? ' selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_NO')?></option>
|
||||
<option value="Y"<?=($this->item->published=='Y' ? ' selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_YES')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<label for="message"><?=JText::_('COM_ALBANNER_MESSAGE')?>: <strong>(<?=JText::_('COM_ALBANNER_WARNING')?>!)</strong></label>
|
||||
<?=$this->editor->display('message',$this->item->message,'100%','150','50','15',false)?><br />
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="inputholder">
|
||||
<input type="submit" name="save" id="save" value="<?=JText::_('COM_ALBANNER_SAVE')?>" />
|
||||
<input type="submit" name="savenew" id="savenew" value="<?=JText::_('COM_ALBANNER_SAVE')?> & <?=JText::_('COM_ALBANNER_NEW')?>" />
|
||||
<input type="submit" name="saveexit" id="saveexit" value="<?=JText::_('COM_ALBANNER_SAVE')?> & <?=JText::_('COM_ALBANNER_EXIT')?>" />
|
||||
<input type="reset" name="reset" id="reset" value="<?=JText::_('COM_ALBANNER_RESET')?>" />
|
||||
<input type="button" name="exit" id="exit" value="<?=JText::_('COM_ALBANNER_EXIT')?>" onclick="document.location.href='index.php?option=<?=JFactory::getApplication()->input->get('option')?>&view=list';" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ($this->item->id>0) :?>
|
||||
<label><strong><?=JText::_('COM_ALBANNER_PREVIEW')?>:</strong></label>
|
||||
<iframe src="https://www.archlinexp.com/maintenance/banner.php?bid=<?=base64_encode($this->item->id)?>" scrolling="no" width="100%" height="80" border="0"></iframe>
|
||||
<?php endif;?>
|
||||
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
jQuery("#from_datetime").datepicker({dateFormat: "yy-mm-dd"});
|
||||
jQuery("#end_datetime").datepicker({dateFormat: "yy-mm-dd"});
|
||||
});
|
||||
|
||||
jQuery('#generate').click(function(){ general(); });
|
||||
jQuery('#ctrCode').change(function(){ general(); });
|
||||
jQuery('#prgCode').change(function(){ general(); });
|
||||
jQuery('#prgType').change(function(){ general(); });
|
||||
|
||||
function general()
|
||||
{
|
||||
jQuery('#pattern').val(jQuery('#ctrCode').val()+'xxxx'+jQuery('#prgType').val()+jQuery('#prgCode').val()+'xxxxxx');
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
|
||||
jimport('joomla.application.component.view'); // import Joomla view library
|
||||
|
||||
class AlbannerViewEdit extends JViewLegacy
|
||||
{
|
||||
public $id;
|
||||
public $pf='EditController';
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
||||
$model=$this->getModel();
|
||||
|
||||
$this->id=(int)$_GET['id'];
|
||||
|
||||
if (isset($_POST['save']) || isset($_POST['saveexit']) || isset($_POST['savenew']))
|
||||
{
|
||||
$tomb=array(
|
||||
"pattern"=>(isset($_POST["pattern"]) && $_POST["pattern"]>"" ? trim($_POST["pattern"]) : ""),
|
||||
"message"=>(isset($_POST["message"]) && $_POST["message"]>"" ? trim($_POST["message"]) : ""),
|
||||
"link"=>(isset($_POST["link"]) && $_POST["link"]>"" ? trim($_POST["link"]) : ""),
|
||||
"lang"=>(isset($_POST["lang"]) && $_POST["lang"]>"" ? trim(strtolower($_POST["lang"])) : "eng"),
|
||||
"priority"=>(int)$_POST["priority"],
|
||||
"from_datetime"=>(isset($_POST["from_datetime"]) && $_POST["from_datetime"]>"" ? trim($_POST["from_datetime"]) : date('Y-m-d',time())).' 00:00:00',
|
||||
"end_datetime"=>(isset($_POST["end_datetime"]) && $_POST["end_datetime"]>"" ? trim($_POST["end_datetime"]) : date('Y-m-d',time())).' 23:59:59',
|
||||
"published"=>(isset($_POST["published"]) && $_POST["published"]>"" ? trim($_POST["published"]) : 'N'),
|
||||
);
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
$model->saveItem($tomb,$this->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$newID=$model->saveItem($tomb,NULL);
|
||||
}
|
||||
|
||||
if (isset($_POST['save']) && !$this->id) { JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view=edit&id='.$newID); }
|
||||
if (isset($_POST['savenew'])) { JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view=edit&id=0'); }
|
||||
if (isset($_POST['saveexit'])){ JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view=list'); }
|
||||
}
|
||||
|
||||
$this->item=$model->getItem($this->id);
|
||||
$this->ctrCode=$model->getCRMctrCode();
|
||||
$this->prgCode=$model->getCRMprgVersion();
|
||||
$this->ctrCodeSel=substr($this->item->pattern, 0, 2);
|
||||
$this->prgTypeSel=substr($this->item->pattern, 6, 1);
|
||||
$this->prgCodeSel=substr($this->item->pattern, 7, 2);
|
||||
$this->editor=&JFactory::getEditor();
|
||||
$this->addToolBar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_ALBANNER').' - '.($this->id=="0" ? jText::_('COM_ALBANNER_NEW') : jText::_('COM_ALBANNER_EDIT').": ".$this->id ));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
JHtml::_('behavior.tooltip');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function resetForm()
|
||||
{
|
||||
jQuery(':text').each(function() { jQuery(this).val(''); });
|
||||
/* jQuery("#projectid").val('');*/
|
||||
submitForm('<?=$this->pf?>','tablediv');
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
||||
|
||||
<div id="j-main-container">
|
||||
<form id="<?=$this->pf?>" action="/administrator/components/<?=JFactory::getApplication()->input->get('option')?>/assets/ajax/Ajax<?=$this->pf?>.class.php" method="post" onsubmit="return submitForm('<?=$this->pf?>','tablediv');">
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="ban_id"><?=JText::_('COM_ALBANNER_ID')?>:</label>
|
||||
<input type="text" name="ban_id" id="ban_id" value="<?=$this->item->ban_id?>" maxlength="6" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="pattern"><?=JText::_('COM_ALBANNER_PATTERN')?>:</label>
|
||||
<input type="text" name="pattern" id="pattern" value="<?=$this->item->pattern?>" maxlength="16" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="build"><?=JText::_('COM_ALBANNER_BUILD')?>:</label>
|
||||
<input type="text" name="build" id="build" value="<?=$this->item->build?>" maxlength="4" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="message"><?=JText::_('COM_ALBANNER_MESSAGE')?>:</label>
|
||||
<input type="text" name="message" id="message" value="<?=$this->item->message?>" maxlength="255" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="lang"><?=JText::_('COM_ALBANNER_LANG')?>:</label>
|
||||
<select name="lang" id="lang">
|
||||
<option value="" <?=($this->item && $this->item->lang=='' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ALL')?></option>
|
||||
<option value="hun" <?=($this->item && $this->item->lang=='hun' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_HUN')?></option>
|
||||
<option value="eng" <?=($this->item && $this->item->lang=='eng' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ENG')?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="deleted_a"><?=JText::_('COM_ALBANNER_PUBLISHED')?>:</label>
|
||||
<fieldset>
|
||||
<input type="radio" name="published" id="published_y" value="Y" onclick="javascript:submitForm('<?=$this->pf?>','tablediv');" /><label for="published_y"><?=JText::_('COM_ALBANNER_YES')?></label>
|
||||
<input type="radio" name="published" id="published_n" value="N" onclick="javascript:submitForm('<?=$this->pf?>','tablediv');" /><label for="published_n"><?=JText::_('COM_ALBANNER_NO')?></label>
|
||||
<input type="radio" name="published" id="published_a" value="A" onclick="javascript:submitForm('<?=$this->pf?>','tablediv');" checked="checked" /><label for="published_a"><?=JText::_('COM_ALBANNER_ALL')?></label>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="from_datetime"><?=JText::_('COM_ALBANNER_FROM')?>:</label>
|
||||
<input type="text" name="from_datetime" id="from_datetime" value="<?=substr($this->item->from_datetime,0,10)?>" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="end_datetime"><?=JText::_('COM_ALBANNER_TO')?>:</label>
|
||||
<input type="text" name="end_datetime" id="end_datetime" value="<?=substr($this->item->end_datetime,0,10)?>" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="priority"><?=JText::_('COM_ALBANNER_PRIORITY')?>:</label>
|
||||
<select name="priority" id="priority">
|
||||
<option value="0" <?=($this->item && $this->item->priority==0 ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ALL')?></option>
|
||||
<option disabled="disabled">-----</option>
|
||||
<option value="1" <?=($this->item && $this->item->priority==1 ? 'selected="selected"' : '')?>>1 - <?=JText::_('COM_ALBANNER_LOW')?></option>
|
||||
<option value="2" <?=($this->item && $this->item->priority==2 ? 'selected="selected"' : '')?>>2 - <?=JText::_('COM_ALBANNER_MED')?></option>
|
||||
<option value="3" <?=($this->item && $this->item->priority==3 ? 'selected="selected"' : '')?>>3 - <?=JText::_('COM_ALBANNER_HIG')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<input type="submit" name="search" id="search" value="<?=JText::_('COM_ALBANNER_SEARCH')?>" />
|
||||
<input type="button" name="alap" id="alap" value="<?=JText::_('COM_ALBANNER_RESET')?>" onclick="resetForm();" />
|
||||
<input type="hidden" name="refresh" id="refresh" value="refresh" />
|
||||
<input type="hidden" name="sess" id="sess" value="<?=JFactory::getSession()->getId()?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="tablediv"></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
submitForm('<?=$this->pf?>','tablediv');
|
||||
jQuery("#from_datetime").datepicker({dateFormat: "yy-mm-dd"});
|
||||
jQuery("#end_datetime").datepicker({dateFormat: "yy-mm-dd"});
|
||||
});
|
||||
</script>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
|
||||
jimport('joomla.application.component.view'); // import Joomla view library
|
||||
|
||||
class AlbannerViewList extends JViewLegacy
|
||||
{
|
||||
public $pf='BannerController';
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
||||
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/ajax.js');
|
||||
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/main.js');
|
||||
|
||||
$model=$this->getModel();
|
||||
$this->addToolBar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_ALBANNER').' - '.JText::_('COM_ALBANNER_LIST'));
|
||||
JToolBarHelper::back(JText::_('COM_ALBANNER_NEW'), 'index.php?option='.JFactory::getApplication()->input->get('option').'&view=edit&id=0');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
JHtml::_('behavior.tooltip');
|
||||
?>
|
||||
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
||||
|
||||
<div id="j-main-container">
|
||||
<form id="<?=$this->pf?>" method="post">
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="pattern"><?=JText::_('COM_ALBANNER_PATTERN')?>:</label>
|
||||
<input type="text" name="pattern" id="pattern" value="<?=(isset($_POST['pattern']) ? $_POST['pattern'] : 'xxxxxxxxxxxxxxxx')?>" maxlength="16" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="ctrCode"><?=JText::_('COM_ALBANNER_CTRCODE')?>:</label>
|
||||
<select name="ctrCode" id="ctrCode">
|
||||
<option value="xx">xx</option>
|
||||
<?php foreach ($this->ctrCode as $row):?>
|
||||
<option value="<?=$row->ctrCode?>" <?=($row->ctrCode==$_POST['ctrCode'] ? 'selected="selected"' : '')?>><?=$row->ctrCode?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="prgType"><?=JText::_('COM_ALBANNER_TYPE')?>:</label>
|
||||
<select name="prgType" id="prgType">
|
||||
<option value="x" <?=($this->prgTypeSel==='x' ? 'selected="selected"' : '')?>>x</option>
|
||||
<?php foreach (range(0,9) as $row):?>
|
||||
<option value="<?=$row?>" <?=($row===$_POST['prgType'] ? 'selected="selected"' : '')?>><?=$row?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="prgCode"><?=JText::_('COM_ALBANNER_VERSION')?>:</label>
|
||||
<select name="prgCode" id="prgCode">
|
||||
<option value="xx">xx</option>
|
||||
<?php foreach ($this->prgCode as $row):?>
|
||||
<option value="<?=$row->verCode?>" <?=($row->verCode==$_POST['prgCode'] ? 'selected="selected"' : '')?>><?=$row->verCode?> - <?=$row->verName?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!--div class="inputholder">
|
||||
<label><?=JText::_('COM_ALBANNER_GENERATE')?>:</label>
|
||||
<input type="button" name="generate" id="generate" value="<?=JText::_('COM_ALBANNER_GENERATE')?>" />
|
||||
</div-->
|
||||
</div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<label for="build"><?=JText::_('COM_ALBANNER_BUILD')?>:</label>
|
||||
<input type="text" name="build" id="build" value="<?=$_POST['build']?>" maxlength="4" />
|
||||
</div>
|
||||
|
||||
<div class="inputholder">
|
||||
<label for="lang"><?=JText::_('COM_ALBANNER_LANG')?>:</label>
|
||||
<select name="lang" id="lang">
|
||||
<option value="" <?=(!isset($_POST) ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ALL')?></option>
|
||||
<option value="hun" <?=($_POST['lang']=='hun' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_HUN')?></option>
|
||||
<option value="eng" <?=($_POST['lang']=='eng' ? 'selected="selected"' : '')?>><?=JText::_('COM_ALBANNER_ENG')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="hasab">
|
||||
<div class="inputholder">
|
||||
<input type="submit" name="search" id="search" value="<?=JText::_('COM_ALBANNER_TEST')?>" />
|
||||
<input type="button" name="alap" id="alap" value="<?=JText::_('COM_ALBANNER_RESET')?>" onclick="resetForm();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if (count($_POST)) :?>
|
||||
<label><strong>URL:</strong></label> <a href="<?=$this->URL?>" target="_blank"><?=$this->URL?></a><br /><br />
|
||||
<label><strong><?=JText::_('COM_ALBANNER_PREVIEW')?>:</strong></label><br />
|
||||
<iframe src="<?=$this->URL?>&test=test" scrolling="no" width="100%" height="150" border="0"></iframe>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery('#generate').click(function(){ general(); });
|
||||
jQuery('#ctrCode').change(function(){ general(); });
|
||||
jQuery('#prgCode').change(function(){ general(); });
|
||||
jQuery('#prgType').change(function(){ general(); });
|
||||
|
||||
function general() { jQuery('#pattern').val(jQuery('#ctrCode').val()+'xxxx'+jQuery('#prgType').val()+jQuery('#prgCode').val()+'xxxxxxx'); }
|
||||
function resetForm()
|
||||
{
|
||||
jQuery(':text').each(function() { jQuery(this).val(''); });
|
||||
jQuery('#ctrCode').get(0).selectedIndex = 0;
|
||||
jQuery('#prgType').get(0).selectedIndex = 0;
|
||||
jQuery('#prgCode').get(0).selectedIndex = 0;
|
||||
jQuery('#lang').get(0).selectedIndex = 0;
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||
|
||||
jimport('joomla.application.component.view'); // import Joomla view library
|
||||
|
||||
class AlbannerViewTest extends JViewLegacy
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
||||
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/ajax.js');
|
||||
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/main.js');
|
||||
|
||||
$model=$this->getModel();
|
||||
$this->ctrCode=$model->getCRMctrCode();
|
||||
$this->prgCode=$model->getCRMprgVersion();
|
||||
$this->ctrCodeSel=substr($_POST['pattern'], 0, 2);
|
||||
$this->prgTypeSel=substr($_POST['pattern'], 6, 1);
|
||||
$this->prgCodeSel=substr($_POST['pattern'], 7, 2);
|
||||
$this->URL="https://www.archlinexp.com/maintenance/banner.php?serial=".base64_encode($_POST['pattern'])."&build=".base64_encode($_POST['build'])."&lang=".$_POST['lang'];
|
||||
$this->addToolBar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_ALBANNER').' - '.JText::_('COM_ALBANNER_TEST'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<access component="com_alworkshops">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
|
||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||
</section>
|
||||
|
||||
</access>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package Com_Alworkshops
|
||||
* @author Zsolt Fekete <mcleod78@gmail.com>
|
||||
* @copyright 2017 Zsolt Fekete
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
error_reporting(E_ERROR | E_PARSE);
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_alworkshops'))
|
||||
{
|
||||
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
}
|
||||
|
||||
// Include dependancies
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
JLoader::registerPrefix('Alworkshops', JPATH_COMPONENT_ADMINISTRATOR);
|
||||
|
||||
$controller = JControllerLegacy::getInstance('Alworkshops');
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
$controller->redirect();
|
||||
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.0" method="upgrade">
|
||||
<name>com_alworkshops</name>
|
||||
<creationDate>2017-04-14</creationDate>
|
||||
<copyright>2017 Zsolt Fekete</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<author>Zsolt Fekete</author>
|
||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||
<authorUrl>https://www.facebook.com/mcleod78</authorUrl>
|
||||
<version>CVS: 1.0.0</version>
|
||||
<description>Manage workshops</description>
|
||||
|
||||
<administration>
|
||||
<menu img="" link="option=com_alworkshops">COM_ALWORKSHOPS</menu>
|
||||
<submenu>
|
||||
<menu img="" alt="COM_ALWORKSHOPS_CONTROL_PANEL_HELP" view="alworkshops" link="option=com_alworkshops&view=alworkshops">COM_ALWORKSHOPS_CONTROL_PANEL_HELP</menu>
|
||||
<menu img="" alt="COM_ALWORKSHOPS_APPLICATIONS" view="application" link="option=com_alworkshops&view=application">COM_ALWORKSHOPS_APPLICATIONS</menu>
|
||||
<menu img="" alt="COM_ALWORKSHOPS_COURSES" view="course" link="option=com_alworkshops&view=course">COM_ALWORKSHOPS_COURSES</menu>
|
||||
<menu img="" alt="COM_ALWORKSHOPS_SESSIONS" view="session" link="option=com_alworkshops&view=session">COM_ALWORKSHOPS_SESSIONS</menu>
|
||||
<menu img="" alt="COM_ALWORKSHOPS_SWITCH" view="switch" link="option=com_alworkshops&view=switch">COM_ALWORKSHOPS_SWITCH</menu>
|
||||
<menu img="" alt="COM_ALWORKSHOPS_ONLINE_SESSIONS" view="onlinesession" link="option=com_alworkshops&view=onlinesession">COM_ALWORKSHOPS_ONLINE_SESSIONS</menu>
|
||||
</submenu>
|
||||
|
||||
<files folder="administrator">
|
||||
<filename>access.xml</filename>
|
||||
<filename>config.xml</filename>
|
||||
<filename>controller.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>alworkshops.php</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>helpers</folder>
|
||||
<folder>models</folder>
|
||||
<folder>views</folder>
|
||||
</files>
|
||||
<languages folder="languages/administrator">
|
||||
<language tag="en-GB">en-GB/en-GB.com_alworkshops.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.com_alworkshops.sys.ini</language>
|
||||
<language tag="hu-HU">hu-HU/hu-HU.com_alworkshops.ini</language>
|
||||
<language tag="hu-HU">hu-HU/hu-HU.com_alworkshops.sys.ini</language>
|
||||
</languages>
|
||||
</administration>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="component">
|
||||
<field name="save_history" default="0" />
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE','`alworkshops_application`');
|
||||
|
||||
class Controller extends BaseController {
|
||||
public $pf='ApplicationController';
|
||||
public $lang;
|
||||
public $targetdiv='tablediv';
|
||||
|
||||
public function procEvent()
|
||||
{
|
||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||
if (isset($_POST['targetdiv'])) $this->targetdiv=$_POST['targetdiv'];
|
||||
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='a.id DESC';
|
||||
|
||||
$se=&$_SESSION[$this->pf]['_POST'];
|
||||
$felt=" AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ";
|
||||
$arrIcons=array(
|
||||
'smallDel'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','delete','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}",'img'=>IconHelper::getIcon("smallDel") ),
|
||||
'smallEnable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','disable','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}","img"=>IconHelper::getIcon("smallEnable") ),
|
||||
'smallDisable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','enable','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}",'img'=>IconHelper::getIcon("smallDisable") ),
|
||||
'smallEdit'=>array("href"=>"index.php?option=com_alworkshops&view=applicationedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
||||
);
|
||||
$_LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$this->getLang()."/".$this->getLang().".com_alworkshops.ini");
|
||||
|
||||
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||
{
|
||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||
if ((int)$value>0)
|
||||
{
|
||||
switch ($event)
|
||||
{
|
||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value);break; }
|
||||
case 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value);break; }
|
||||
case 'delete' : { MySqlHelper::getInstance()->query("DELETE FROM ".TABLE." WHERE id=".$value." LIMIT 1;");break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($se['aid']) && $se['aid']>"")
|
||||
{
|
||||
if (strpos($se['aid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['aid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND a.id>=".(int)$reszek[0]." AND a.id<=".(int)$reszek[1] : " AND a.id>=".(int)$reszek[1]." AND a.id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND a.id=".(int)$se['aid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['wid']) && $se['wid']>"")
|
||||
{
|
||||
if (strpos($se['wid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['wid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND c.id>=".(int)$reszek[0]." AND c.id<=".(int)$reszek[1] : " AND c.id>=".(int)$reszek[1]." AND c.id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND c.id=".(int)$se['wid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['uid']) && $se['uid']>"")
|
||||
{
|
||||
if (strpos($se['uid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['uid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND a.user_id>=".(int)$reszek[0]." AND a.user_id<=".(int)$reszek[1] : " AND a.user_id>=".(int)$reszek[1]." AND a.user_id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND a.user_id=".(int)$se['uid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['title']) && $se['title']>"") $felt.=" AND c.title LIKE '%".trim($se['title'])."%' ";
|
||||
if (isset($se['name']) && $se['name']>"") $felt.=" AND u.name LIKE '%".trim($se['name'])."%' ";
|
||||
if (isset($se['email']) && $se['email']>"") $felt.=" AND u.email LIKE '%".trim($se['email'])."%' ";
|
||||
if (isset($se['start_date']) && $se['start_date']>"") $felt.=" AND c.start_date>='".trim($se['start_date'])."'";
|
||||
if (isset($se['finish_date']) && $se['finish_date']>"") $felt.=" AND c.finish_date<='".trim($se['finish_date'])."'";
|
||||
if (isset($se['published']) && $se['published']!='A') $felt.=" AND a.published='".$se['published']."'";
|
||||
if (isset($se['onlypay']) && $se['onlypay']!='A') $felt.=" AND ".($se['onlypay']=='Y' ? " a.price_total>0 " : " (a.price_total=0 OR a.price_total IS NULL) ");
|
||||
|
||||
$objTabla=New TableHelper();
|
||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
||||
$v=$objTabla->setSession();
|
||||
$objTabla->setColumn('id',array('header'=>'AID','width'=>'40px','format'=>'text','link'=>'index.php?option=com_alworkshops&view=applicationedit&id=REPLACE'));
|
||||
$objTabla->setColumn('cid',array('visible'=>FALSE/*'header'=>'CID','width'=>'60px','format'=>'number','decimal'=>0*/));
|
||||
$objTabla->setColumn('title',array('header'=>$_LANG['COM_ALWORKSHOPS_TITLE'],'width'=>'200px','linkjoin'=>'cid','link'=>'index.php?option=com_alworkshops&view=courseedit&id=REPLACE'));
|
||||
$objTabla->setColumn('uid',array('visible'=>FALSE));
|
||||
$objTabla->setColumn('name',array('header'=>$_LANG['COM_ALWORKSHOPS_NAME'],'width'=>'100px','strlen'=>20,'linkjoin'=>'nUserID','link'=>'http://crm.cadline.hu/hu/users/show/REPLACE','target'=>'_blank'));
|
||||
$objTabla->setColumn('email',array('header'=>$_LANG['COM_ALWORKSHOPS_EMAIL'],'strlen'=>20,'width'=>'100px','format'=>'mailto'));
|
||||
$objTabla->setColumn('nUserID',array('visible'=>FALSE));
|
||||
$objTabla->setColumn('attendees',array('header'=>$_LANG['COM_ALWORKSHOPS_ATTEND'],'width'=>'50px','align'=>'center'));
|
||||
$objTabla->setColumn('price_per_attendee',array('visible'=>FALSE));
|
||||
$objTabla->setColumn('price_total',array('header'=>$_LANG['COM_ALWORKSHOPS_PRICE'],'width'=>'50px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('vat',array('header'=>$_LANG['COM_ALWORKSHOPS_VAT'],'width'=>'50px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('fullprice',array('header'=>str_replace(" ","<br />",$_LANG['COM_ALWORKSHOPS_FULLPRICE']),'width'=>'60px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('gepet_kerek',array('header'=>$_LANG['COM_ALWORKSHOPS_COMP'],'width'=>'50px','align'=>'center','replacevalues'=>array('Y'=>'Yes','N'=>'No')));
|
||||
$objTabla->setColumn('berletem_van',array('header'=>$_LANG['COM_ALWORKSHOPS_LEASE'],'width'=>'50px','align'=>'center','replacevalues'=>array('Y'=>'Yes','N'=>'No')));
|
||||
$objTabla->setColumn('start_date',array('header'=>$_LANG['COM_ALWORKSHOPS_START_DATE'],'align'=>'center','width'=>'110px'));
|
||||
$objTabla->setColumn('start_time',array('header'=>$_LANG['COM_ALWORKSHOPS_START_TIME'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('finish_date',array('header'=>$_LANG['COM_ALWORKSHOPS_FINISH_DATE'],'align'=>'center','width'=>'110px'));
|
||||
$objTabla->setColumn('finish_time',array('header'=>$_LANG['COM_ALWORKSHOPS_FINISH_TIME'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('published',array('visible'=>FALSE));
|
||||
$objTabla->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'90px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||
$objTabla->setQuery(array("
|
||||
SELECT DISTINCT a.id AS id,c.id AS cid,CONCAT(c.title,IF(s.kurzus='Y',' *','')) AS title,a.user_id AS uid,IF(a.`user_id`=0,a.`name`,u.`name`) AS `name`,IF(a.`user_id`=0,a.`email`,u.`email`) AS `email`,u.nUserID,CONCAT(c.start_date,' ',SUBSTRING(c.start_time,1,5)) AS start_date,CONCAT(c.finish_date,' ',SUBSTRING(c.finish_time,1,5)) AS finish_date,a.attendees,a.price_per_attendee,price_total,price_vat AS vat,price_total*(1+(price_vat/100)) AS fullprice,a.gepet_kerek,a.berletem_van,a.published,CONCAT('smallDel','|',IF(a.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM alworkshops_application a
|
||||
LEFT OUTER JOIN alworkshops_courses c ON a.course_id=c.id
|
||||
LEFT OUTER JOIN alworkshops_switch s ON c.alias=s.alias
|
||||
LEFT OUTER JOIN jml_users u ON a.user_id=u.id
|
||||
WHERE 1 ".$felt
|
||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
||||
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||
SELECT COUNT(*) AS recordCount,SUM(attendees) AS attendees,SUM(price_total) AS price_total,SUM(fullprice) AS fullprice
|
||||
FROM (
|
||||
SELECT a.id AS id,c.id AS cid,CONCAT(c.title,IF(s.kurzus='Y',' *','')) AS title,a.user_id AS uid,u.`name`,u.email,u.`nUserID`,CONCAT(c.start_date,' ',c.start_time) AS start_date,CONCAT(c.finish_date,' ',c.finish_time) AS finish_date,a.attendees,a.price_per_attendee,price_total,price_vat,price_total*(1+(price_vat/100)) AS fullprice,a.gepet_kerek,a.berletem_van,a.published
|
||||
FROM alworkshops_application a
|
||||
LEFT OUTER JOIN alworkshops_courses c ON a.course_id=c.id
|
||||
LEFT OUTER JOIN alworkshops_switch s ON c.alias=s.alias
|
||||
LEFT OUTER JOIN jml_users u ON a.user_id=u.id WHERE 1 ".$felt.") z;"
|
||||
));
|
||||
// $this->printSession($this->pf);
|
||||
// print_r($objTabla->arrQuery);
|
||||
// print_r($se);
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
|
||||
$controller=new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value','');
|
||||
<?php if (!isset($_POST['nojs'])):?>
|
||||
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
||||
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
||||
jQuery("#name").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["name"]?>');
|
||||
jQuery("#uid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["uid"]?>');
|
||||
jQuery("#email").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["email"]?>');
|
||||
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
||||
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
||||
jQuery("input[name=published]").each(function() {
|
||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
||||
});
|
||||
<?php endif;?>
|
||||
</script>
|
||||
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE','`alworkshops_courses`');
|
||||
|
||||
class Controller extends BaseController {
|
||||
public $pf='CourseController';
|
||||
public $lang;
|
||||
|
||||
public function procEvent() {
|
||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='c.id DESC';
|
||||
|
||||
$se=&$_SESSION[$this->pf]['_POST'];
|
||||
$felt=" AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ";
|
||||
$arrIcons=array(
|
||||
'smallEnable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','disable','tablediv');setField('".$this->pf."','".$this->pf."_value','REPLACE','tablediv');}","img"=>IconHelper::getIcon("smallEnable") ),
|
||||
'smallDisable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','enable','tablediv');setField('".$this->pf."','".$this->pf."_value','REPLACE','tablediv');}",'img'=>IconHelper::getIcon("smallDisable") ),
|
||||
'smallEdit'=>array("href"=>"index.php?option=com_alworkshops&view=courseedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
||||
);
|
||||
$_LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$this->getLang()."/".$this->getLang().".com_alworkshops.ini");
|
||||
|
||||
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||
{
|
||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||
if ((int)$value>0)
|
||||
{
|
||||
switch ($event)
|
||||
{
|
||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value);break; }
|
||||
case 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value);break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($se['wid']) && $se['wid']>"")
|
||||
{
|
||||
if (strpos($se['wid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['wid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND c.id>=".(int)$reszek[0]." AND c.id<=".(int)$reszek[1] : " AND c.id>=".(int)$reszek[1]." AND c.id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND c.id=".(int)$se['wid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['name']) && $se['name']>"") $felt.=" AND (c.title LIKE '%".trim($se['name'])."%' OR c.alias LIKE '%".trim($se['name'])."%')";
|
||||
if (isset($se['start_date']) && $se['start_date']>"") $felt.=" AND c.start_date>='".trim($se['start_date'])."'";
|
||||
if (isset($se['finish_date']) && $se['finish_date']>"") $felt.=" AND c.finish_date<='".trim($se['finish_date'])."'";
|
||||
if (isset($se['published']) && $se['published']!='A') $felt.=" AND c.published='".$se['published']."'";
|
||||
if (isset($se['onlypay']) && $se['onlypay']!='A') $felt.=" AND c.price".(trim($se['onlypay'])=='Y'?">":"=")."0 ";
|
||||
|
||||
$objTabla=New TableHelper();
|
||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','imagePreview'=>true,'tablediv'=>'tablediv'));
|
||||
$v=$objTabla->setSession();
|
||||
$objTabla->setColumn('id',array('header'=>$_LANG['COM_ALWORKSHOPS_ID'],'width'=>'40px','format'=>'number','decimal'=>0,'link'=>'index.php?option=com_alworkshops&view=courseedit&id=REPLACE'));
|
||||
$objTabla->setColumn('title',array('header'=>$_LANG['COM_ALWORKSHOPS_TITLE'],'linkjoin'=>'id','link'=>'index.php?option=com_alworkshops&view=courseedit&id=REPLACE'));
|
||||
$objTabla->setColumn('price',array('header'=>$_LANG['COM_ALWORKSHOPS_PRICE'],'width'=>'60px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('vat',array('header'=>$_LANG['COM_ALWORKSHOPS_VAT'],'width'=>'60px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('fullprice',array('header'=>str_replace(' ','<br />',$_LANG['COM_ALWORKSHOPS_FULLPRICE']),'width'=>'70px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('capacity',array('header'=>$_LANG['COM_ALWORKSHOPS_CAPACITY']."<br />".$_LANG['COM_ALWORKSHOPS_MIN_ATTEND'],'width'=>'70px','order'=>false,'align'=>'center'));
|
||||
$objTabla->setColumn('attendees',array('header'=>$_LANG['COM_ALWORKSHOPS_ATTENDEES']."<br />".$_LANG['COM_ALWORKSHOPS_APPLICATIONS'],'width'=>'70px','order'=>false,'align'=>'center'));
|
||||
$objTabla->setColumn('start_date',array('header'=>$_LANG['COM_ALWORKSHOPS_START_DATE'],'align'=>'center','width'=>'100px'));
|
||||
$objTabla->setColumn('finish_date',array('header'=>$_LANG['COM_ALWORKSHOPS_FINISH_DATE'],'align'=>'center','width'=>'100px'));
|
||||
$objTabla->setColumn('sessions',array('header'=>$_LANG['COM_ALWORKSHOPS_SESSIONS'],'align'=>'center','width'=>'70px'));
|
||||
$objTabla->setColumn('published',array('visible'=>FALSE/*'header'=>$_LANG['COM_ALWORKSHOPS_PUBLISHED'],'align'=>'center','width'=>'70px'*/));
|
||||
$objTabla->setColumn('percent',array('header'=>'%','width'=>'40px','format'=>'percent','decimal'=>2));
|
||||
$objTabla->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'70px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||
$objTabla->setQuery(array("
|
||||
SELECT DISTINCT c.id,CONCAT(c.title,IF(s.kurzus='Y',' *','')) AS title,c.price,c.vat,c.price*(1+(vat/100)) AS fullprice,CONCAT(c.start_date,' ',SUBSTRING(c.start_time,1,5)) AS start_date,CONCAT(c.finish_date,' ',SUBSTRING(c.finish_time,1,5)) AS finish_date,sess.sessions,c.published,CONCAT(c.capacity,'|',c.min_attend) AS capacity,CONCAT(a.attendees,'|',a.application) AS attendees,(a.attendees/c.capacity)*100 AS percent,CONCAT(IF(c.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM ".TABLE." c
|
||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||
LEFT OUTER JOIN (SELECT course_id, SUM(attendees) AS attendees, COUNT(*) AS application FROM alworkshops_application GROUP BY course_id) a ON c.id=a.course_id
|
||||
LEFT OUTER JOIN (SELECT courseid,COUNT(*) as `sessions` FROM alworkshops_sessions GROUP BY courseid) sess ON c.id=sess.courseid
|
||||
WHERE 1 ".$felt
|
||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
||||
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||
SELECT COUNT(*) AS recordCount
|
||||
FROM (SELECT c.id FROM ".TABLE." c LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias WHERE 1 ".$felt.") z;"
|
||||
));
|
||||
// $this->printSession($this->pf);
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
|
||||
$controller=new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value','');
|
||||
jQuery("#name").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["name"]?>');
|
||||
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
||||
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
||||
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
||||
jQuery("input[name=published]").each(function() {
|
||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
||||
});
|
||||
</script>
|
||||
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE', '`aleducation_courses`');
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
public $pf = 'EducationController';
|
||||
public $lang;
|
||||
|
||||
public function procEvent()
|
||||
{
|
||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"]) == "") $_SESSION[$this->pf]["_POST"] = $_POST;
|
||||
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder']) == '') $_SESSION[$this->pf]['tableorder'] = 's.id DESC';
|
||||
|
||||
$se = &$_SESSION[$this->pf]['_POST'];
|
||||
$felt = " AND `lang`='" . ($this->getLang() == 'hu-HU' ? 'hun' : 'eng') . "' ";
|
||||
$arrIcons = array(
|
||||
'smallEnable' => array("onclick" => "javascript:if (confirm('Are you sure?')) {setField('','" . $this->pf . "_event','disable','" . $this->targetdiv . "');setField('" . $this->pf . "','" . $this->pf . "_value','REPLACE','" . $this->targetdiv . "');}", "img" => IconHelper::getIcon("smallEnable")),
|
||||
'smallDisable' => array("onclick" => "javascript:if (confirm('Are you sure?')) {setField('','" . $this->pf . "_event','enable','" . $this->targetdiv . "');setField('" . $this->pf . "','" . $this->pf . "_value','REPLACE','" . $this->targetdiv . "');}", 'img' => IconHelper::getIcon("smallDisable")),
|
||||
'smallEdit' => array("href" => "index.php?option=com_alworkshops&view=educationedit&id=REPLACE", "img" => IconHelper::getIcon("smallEdit"), "linkjoin" => "id", "alttext" => "Edit"),
|
||||
);
|
||||
$_LANG = parse_ini_file($_SERVER['DOCUMENT_ROOT'] . "/administrator/language/" . $this->getLang() . "/" . $this->getLang() . ".com_alworkshops.ini");
|
||||
|
||||
if (isset($_POST[$this->pf . '_event']) and trim($_POST[$this->pf . '_event']) > '') {
|
||||
$event = trim(strtolower(addslashes((string)$_POST[$this->pf . '_event'])));
|
||||
$value = trim(strtolower(addslashes((string)$_POST[$this->pf . '_value'])));
|
||||
if ((int)$value > 0) {
|
||||
switch ($event) {
|
||||
case 'enable': {
|
||||
MySqlHelper::getInstance()->query("UPDATE " . TABLE . " SET published='Y' WHERE id=" . $value);
|
||||
break;
|
||||
}
|
||||
case 'disable': {
|
||||
MySqlHelper::getInstance()->query("UPDATE " . TABLE . " SET published='N' WHERE id=" . $value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($se['sid']) && $se['sid'] > "") {
|
||||
if (strpos($se['sid'], "-")) {
|
||||
$reszek = explode("-", $se['sid']);
|
||||
$felt .= ((int)$reszek[0] < (int)$reszek[1] ? " AND id>=" . (int)$reszek[0] . " AND id<=" . (int)$reszek[1] : " AND id>=" . (int)$reszek[1] . " AND id<=" . (int)$reszek[0]);
|
||||
} else {
|
||||
$felt .= " AND id=" . (int)$se['sid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['tipus']) && $se['tipus'] != 'mind') $felt .= " AND `" . $se['tipus'] . "`='Y'";
|
||||
if (isset($se['alias']) && $se['alias'] > "") $felt .= " AND alias LIKE '%" . trim($se['alias']) . "%' ";
|
||||
|
||||
$objTabla = new TableHelper();
|
||||
$objTabla->setParams(array('prefix' => $this->pf, 'tablewidth' => '100%', 'tablediv' => 'tablediv'));
|
||||
$v = $objTabla->setSession();
|
||||
$objTabla->setColumn('id', array('header' => $_LANG['COM_ALWORKSHOPS_ID'], 'width' => '40px', 'format' => 'number', 'decimal' => 0, 'link' => 'index.php?option=com_alworkshops&view=educationedit&id=REPLACE'));
|
||||
$objTabla->setColumn('options', array('header' => $_LANG['COM_ALWORKSHOPS_OPTIONS'], 'align' => 'right', 'width' => '70px', 'order' => false, 'addicons' => $arrIcons, 'linkjoin' => 'id'));
|
||||
$objTabla->setQuery(array(
|
||||
"
|
||||
SELECT id, title, url, image, published, CONCAT(IF(published='N','smallDisable','smallEnable'),'|','smallEdit') AS options FROM " . TABLE . " s WHERE 1 " . $felt
|
||||
. ((isset($v['tableorder']) and $v['tableorder'] > '') ? ' ORDER BY ' . $v['tableorder'] : '')
|
||||
. ((isset($v['tableipp'])) ? ' LIMIT ' . ($v['tableipp'] > 0 ? ($v['tablepage'] - 1) * $v['tableipp'] : 0) . ',' . $v['tableipp'] : ''), "
|
||||
SELECT COUNT(*) AS recordCount
|
||||
FROM (
|
||||
SELECT id, title, url, image, published, CONCAT(IF(published='N','smallDisable','smallEnable'),'|','smallEdit') AS options FROM " . TABLE . " s WHERE 1 " . $felt . ") z;"
|
||||
));
|
||||
//print_r($objTabla->arrQuery);
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) {
|
||||
$this->lang = (strpos($_SERVER['HTTP_HOST'], ".com") ? "en-GB" : "hu-HU");
|
||||
}
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
|
||||
$controller = new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value', '');
|
||||
<?php if (!isset($_POST['nojs'])) : ?>
|
||||
jQuery("#title").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["title"] ?>');
|
||||
jQuery("#sid").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["sid"] ?>');
|
||||
jQuery("input[name=published]").each(function() {
|
||||
if (jQuery(this).val() == '<?= $_SESSION[$controller->pf]["_POST"]["published"] ?>') {
|
||||
jQuery(this).attr('checked', 'checked');
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE','`alworkshops_online_sessions`');
|
||||
|
||||
class Controller extends BaseController {
|
||||
public $pf='OnlineSessionController';
|
||||
public $lang;
|
||||
public $targetdiv='tablediv';
|
||||
|
||||
public function procEvent()
|
||||
{
|
||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||
if (isset($_POST['targetdiv'])) $this->targetdiv=$_POST['targetdiv'];
|
||||
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='s.id DESC';
|
||||
|
||||
$se=&$_SESSION[$this->pf]['_POST'];
|
||||
|
||||
if($this->getLang() == 'hu-HU') {
|
||||
$webinar = "webinariumok";
|
||||
} else {
|
||||
$webinar = "webinars";
|
||||
}
|
||||
$felt=" AND c.`alias`='{$webinar}' ";
|
||||
|
||||
$arrIcons=array(
|
||||
'smallEnable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','disable','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}","img"=>IconHelper::getIcon("smallEnable") ),
|
||||
'smallDisable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','enable','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}",'img'=>IconHelper::getIcon("smallDisable") ),
|
||||
'smallEdit'=>array("href"=>"index.php?option=com_alworkshops&view=onlinesessionedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
||||
);
|
||||
$_LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$this->getLang()."/".$this->getLang().".com_alworkshops.ini");
|
||||
|
||||
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||
{
|
||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||
if ((int)$value>0)
|
||||
{
|
||||
switch ($event)
|
||||
{
|
||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value);break; }
|
||||
case 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value);break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($se['sid']) && $se['sid']>"")
|
||||
{
|
||||
if (strpos($se['sid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['sid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND id>=".(int)$reszek[0]." AND id<=".(int)$reszek[1] : " AND id>=".(int)$reszek[1]." AND id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND id=".(int)$se['sid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['wid']) && $se['wid']>"")
|
||||
{
|
||||
if (strpos($se['wid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['wid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND courseid>=".(int)$reszek[0]." AND courseid<=".(int)$reszek[1] : " AND courseid>=".(int)$reszek[1]." AND courseid<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND courseid=".(int)$se['wid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['title']) && $se['title']>"") $felt.=" AND title LIKE '%".trim($se['title'])."%' ";
|
||||
if (isset($se['start_date']) && $se['start_date']>"") $felt.=" AND session_date>='".trim($se['start_date'])."'";
|
||||
if (isset($se['finish_date']) && $se['finish_date']>"") $felt.=" AND session_date<='".trim($se['finish_date'])."'";
|
||||
if (isset($se['published']) && $se['published']!='A') $felt.=" AND published='".$se['published']."'";
|
||||
|
||||
$objTabla=New TableHelper();
|
||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
||||
$v=$objTabla->setSession();
|
||||
$objTabla->setColumn('id',array('header'=>'SID','width'=>'50px','format'=>'number','decimal'=>0,'link'=>'index.php?option=com_alworkshops&view=onlinesessionedit&id=REPLACE'));
|
||||
$objTabla->setColumn('courseid',array('header'=>'CID','align'=>'center','width'=>'50px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('title',array('header'=>$_LANG['COM_ALWORKSHOPS_TITLE'],'width'=>'200px'));
|
||||
$objTabla->setColumn('session_date',array('header'=>$_LANG['COM_ALWORKSHOPS_START_DATE'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('start_time',array('header'=>$_LANG['COM_ALWORKSHOPS_START_TIME'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('finish_time',array('header'=>$_LANG['COM_ALWORKSHOPS_FINISH_TIME'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('duration',array('header'=>$_LANG['COM_ALWORKSHOPS_DURATION'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('ordering',array('header'=>$_LANG['COM_ALWORKSHOPS_ORDERING'],'width'=>'70px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('published',array('header'=>$_LANG['COM_ALWORKSHOPS_PUBLISHED'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'70px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||
$objTabla->setQuery(array("
|
||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM alworkshops_online_sessions s
|
||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||
WHERE 1 ".$felt
|
||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
||||
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||
SELECT COUNT(*) AS recordCount
|
||||
FROM (
|
||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM alworkshops_online_sessions s
|
||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||
WHERE 1 ".$felt.") z;"
|
||||
));
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
|
||||
$controller=new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value','');
|
||||
<?php if (!isset($_POST['nojs'])):?>
|
||||
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
||||
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
||||
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
||||
jQuery("#description").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["description"]?>');
|
||||
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
||||
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
||||
jQuery("input[name=published]").each(function() {
|
||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
||||
});
|
||||
<?php endif;?>
|
||||
</script>
|
||||
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE','`alworkshops_sessions`');
|
||||
|
||||
class Controller extends BaseController {
|
||||
public $pf='SessionController';
|
||||
public $lang;
|
||||
public $targetdiv='tablediv';
|
||||
|
||||
public function procEvent()
|
||||
{
|
||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||
if (isset($_POST['targetdiv'])) $this->targetdiv=$_POST['targetdiv'];
|
||||
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='s.id DESC';
|
||||
|
||||
$se=&$_SESSION[$this->pf]['_POST'];
|
||||
$felt=" AND sw.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ";
|
||||
|
||||
$arrIcons=array(
|
||||
'smallEnable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','disable','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}","img"=>IconHelper::getIcon("smallEnable") ),
|
||||
'smallDisable'=>array("onclick"=>"javascript:if (confirm('Are you sure?')) {setField('','".$this->pf."_event','enable','".$this->targetdiv."');setField('".$this->pf."','".$this->pf."_value','REPLACE','".$this->targetdiv."');}",'img'=>IconHelper::getIcon("smallDisable") ),
|
||||
'smallEdit'=>array("href"=>"index.php?option=com_alworkshops&view=sessionedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
||||
);
|
||||
$_LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$this->getLang()."/".$this->getLang().".com_alworkshops.ini");
|
||||
|
||||
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||
{
|
||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||
if ((int)$value>0)
|
||||
{
|
||||
switch ($event)
|
||||
{
|
||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value);break; }
|
||||
case 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value);break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($se['sid']) && $se['sid']>"")
|
||||
{
|
||||
if (strpos($se['sid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['sid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND id>=".(int)$reszek[0]." AND id<=".(int)$reszek[1] : " AND id>=".(int)$reszek[1]." AND id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND id=".(int)$se['sid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['wid']) && $se['wid']>"")
|
||||
{
|
||||
if (strpos($se['wid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['wid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND courseid>=".(int)$reszek[0]." AND courseid<=".(int)$reszek[1] : " AND courseid>=".(int)$reszek[1]." AND courseid<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND courseid=".(int)$se['wid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['title']) && $se['title']>"") $felt.=" AND title LIKE '%".trim($se['title'])."%' ";
|
||||
if (isset($se['description']) && $se['description']>"") $felt.=" AND description LIKE '%".trim($se['description'])."%' ";
|
||||
if (isset($se['start_date']) && $se['start_date']>"") $felt.=" AND session_date>='".trim($se['start_date'])."'";
|
||||
if (isset($se['finish_date']) && $se['finish_date']>"") $felt.=" AND session_date<='".trim($se['finish_date'])."'";
|
||||
if (isset($se['published']) && $se['published']!='A') $felt.=" AND published='".$se['published']."'";
|
||||
$felt .= " GROUP BY id";
|
||||
|
||||
$objTabla=New TableHelper();
|
||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
||||
$v=$objTabla->setSession();
|
||||
$objTabla->setColumn('id',array('header'=>'SID','width'=>'50px','format'=>'number','decimal'=>0,'link'=>'index.php?option=com_alworkshops&view=sessionedit&id=REPLACE'));
|
||||
$objTabla->setColumn('switchid',array('header'=>'SID','align'=>'center','width'=>'50px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('courseid',array('header'=>'CID','align'=>'center','width'=>'50px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('title',array('header'=>$_LANG['COM_ALWORKSHOPS_TITLE'],'width'=>'200px'));
|
||||
$objTabla->setColumn('session_date',array('header'=>$_LANG['COM_ALWORKSHOPS_START_DATE'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('start_time',array('header'=>$_LANG['COM_ALWORKSHOPS_START_TIME'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('finish_time',array('header'=>$_LANG['COM_ALWORKSHOPS_FINISH_TIME'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('duration',array('header'=>$_LANG['COM_ALWORKSHOPS_DURATION'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('description',array('header'=>$_LANG['COM_ALWORKSHOPS_SESSIONDESC']));
|
||||
$objTabla->setColumn('ordering',array('header'=>$_LANG['COM_ALWORKSHOPS_ORDERING'],'width'=>'70px','format'=>'number','decimal'=>0));
|
||||
$objTabla->setColumn('published',array('header'=>$_LANG['COM_ALWORKSHOPS_PUBLISHED'],'align'=>'center','width'=>'80px'));
|
||||
$objTabla->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'70px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||
$objTabla->setQuery(array("
|
||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM alworkshops_sessions s
|
||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||
LEFT OUTER JOIN alworkshops_switch sw ON sw.alias=c.alias
|
||||
WHERE 1 ".$felt
|
||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
||||
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||
SELECT COUNT(*) AS recordCount
|
||||
FROM (
|
||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||
FROM alworkshops_sessions s
|
||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||
LEFT OUTER JOIN alworkshops_switch sw ON sw.alias=c.alias
|
||||
WHERE 1 ".$felt.") z;"
|
||||
));
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
|
||||
$controller=new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value','');
|
||||
<?php if (!isset($_POST['nojs'])):?>
|
||||
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
||||
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
||||
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
||||
jQuery("#description").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["description"]?>');
|
||||
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
||||
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
||||
jQuery("input[name=published]").each(function() {
|
||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
||||
});
|
||||
<?php endif;?>
|
||||
</script>
|
||||
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
require_once('BaseController.class.php');
|
||||
|
||||
define('TABLE','`alworkshops_switch`');
|
||||
|
||||
class Controller extends BaseController {
|
||||
public $pf='SwitchController';
|
||||
public $lang;
|
||||
|
||||
public function procEvent() {
|
||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='s.id DESC';
|
||||
|
||||
$se=&$_SESSION[$this->pf]['_POST'];
|
||||
$felt=" AND `lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ";
|
||||
$arrIcons=array(
|
||||
'smallEdit'=>array("href"=>"index.php?option=com_alworkshops&view=switchedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
||||
);
|
||||
$_LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$this->getLang()."/".$this->getLang().".com_alworkshops.ini");
|
||||
|
||||
if (isset($se['sid']) && $se['sid']>"")
|
||||
{
|
||||
if (strpos($se['sid'], "-"))
|
||||
{
|
||||
$reszek=explode("-", $se['sid']);
|
||||
$felt.=( (int)$reszek[0]<(int)$reszek[1] ? " AND id>=".(int)$reszek[0]." AND id<=".(int)$reszek[1] : " AND id>=".(int)$reszek[1]." AND id<=".(int)$reszek[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$felt.=" AND id=".(int)$se['sid'];
|
||||
}
|
||||
}
|
||||
if (isset($se['tipus']) && $se['tipus']!='mind') $felt.=" AND `".$se['tipus']."`='Y'";
|
||||
if (isset($se['alias']) && $se['alias']>"") $felt.=" AND alias LIKE '%".trim($se['alias'])."%' ";
|
||||
|
||||
$objTabla=New TableHelper();
|
||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>'tablediv'));
|
||||
$v=$objTabla->setSession();
|
||||
$objTabla->setColumn('id',array('header'=>$_LANG['COM_ALWORKSHOPS_ID'],'width'=>'40px','format'=>'number','decimal'=>0,'link'=>'index.php?option=com_alworkshops&view=switchedit&id=REPLACE'));
|
||||
$objTabla->setColumn('lang',array('visible'=>FALSE));
|
||||
$objTabla->setColumn('path',array('visible'=>FALSE/*'header'=>$_LANG['COM_ALWORKSHOPS_PATH'],'format'=>'text','strlen'=>20*/));
|
||||
$objTabla->setColumn('title',array('header'=>$_LANG['COM_ALWORKSHOPS_TITLE']));
|
||||
$objTabla->setColumn('alias',array('header'=>$_LANG['COM_ALWORKSHOPS_ALIAS']));
|
||||
$objTabla->setColumn('alias2',array('header'=>$_LANG['COM_ALWORKSHOPS_ALIAS'].'-1'));
|
||||
$objTabla->setColumn('alias3',array('header'=>$_LANG['COM_ALWORKSHOPS_ALIAS'].'-2'));
|
||||
$objTabla->setColumn('alias4',array('header'=>$_LANG['COM_ALWORKSHOPS_ALIAS'].'-3'));
|
||||
$objTabla->setColumn('alias5',array('header'=>$_LANG['COM_ALWORKSHOPS_ALIAS'].'-4'));
|
||||
$objTabla->setColumn('alias6',array('header'=>$_LANG['COM_ALWORKSHOPS_ALIAS'].'-5'));
|
||||
$objTabla->setColumn('level',array('header'=>$_LANG['COM_ALWORKSHOPS_LEVEL'],'align'=>'center','width'=>'60px','replacevalues'=>array('1'=>$_LANG['COM_ALWORKSHOPS_PRELIMINARY'],'2'=>$_LANG['COM_ALWORKSHOPS_INTERMEDIATE'],'3'=>$_LANG['COM_ALWORKSHOPS_TUTOR'])));
|
||||
$objTabla->setColumn('kurzus',array('header'=>$_LANG['COM_ALWORKSHOPS_COURSE'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('workshop',array('header'=>$_LANG['COM_ALWORKSHOPS_WORKSHOP'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('webinair',array('header'=>$_LANG['COM_ALWORKSHOPS_WEBINAIR'],'align'=>'center','width'=>'6px'));
|
||||
$objTabla->setColumn('esemeny',array('header'=>$_LANG['COM_ALWORKSHOPS_EVENT_SHORT'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('vizsga',array('header'=>$_LANG['COM_ALWORKSHOPS_EXAM'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('telefonszam',array('header'=>$_LANG['COM_ALWORKSHOPS_PHONE_SHORT'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('orszag',array('header'=>$_LANG['COM_ALWORKSHOPS_COUNTRY_SHORT'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('szakma',array('header'=>$_LANG['COM_ALWORKSHOPS_PROFESSION_SHORT'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('login',array('header'=>$_LANG['COM_ALWORKSHOPS_LOGIN_SHORT'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('comment',array('header'=>$_LANG['COM_ALWORKSHOPS_COMMENT_SHORT'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('tanfsor',array('header'=>str_replace(' ','<br />',$_LANG['COM_ALWORKSHOPS_COURSENO_SHORT']),'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('vizsga_csoport',array('header'=>str_replace(' ','<br />',$_LANG['COM_ALWORKSHOPS_EXAM_GROUP']),'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('gepet_kerek',array('header'=>$_LANG['COM_ALWORKSHOPS_COMP'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('berletem_van',array('header'=>$_LANG['COM_ALWORKSHOPS_LEASE'],'align'=>'center','width'=>'60px'));
|
||||
$objTabla->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'60px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||
$objTabla->setQuery(array("
|
||||
SELECT *,'smallEdit' AS options FROM ".TABLE." s WHERE 1 ".$felt
|
||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
||||
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||
SELECT COUNT(*) AS recordCount
|
||||
FROM (
|
||||
SELECT *,'smallEdit' AS options FROM ".TABLE." s WHERE 1 ".$felt.") z;"
|
||||
));
|
||||
//print_r($objTabla->arrQuery);
|
||||
$objTabla->drawTable(TRUE);
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||
return $this->lang;
|
||||
}
|
||||
}
|
||||
|
||||
$controller=new Controller();
|
||||
$controller->run();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#refresh").attr('value','');
|
||||
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
||||
jQuery("#alias").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["alias"]?>');
|
||||
jQuery("input[name=kurzus]").each(function() {
|
||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["kurzus"]?>') { jQuery(this).attr('checked','checked'); }
|
||||
});
|
||||
</script>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/administrator/components/com_alworkshops/helpers/TableHelper.class.php");
|
||||
include($_SERVER['DOCUMENT_ROOT']."/administrator/components/com_alworkshops/helpers/MySqlHelper.class.php");
|
||||
include($_SERVER['DOCUMENT_ROOT']."/administrator/components/com_alworkshops/helpers/IconHelper.class.php");
|
||||
|
||||
abstract class BaseController
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function __destruct() {}
|
||||
|
||||
public function procEvent() {}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$this->procEvent();
|
||||
}
|
||||
|
||||
public function printSession($key="")
|
||||
{
|
||||
print "<pre>".print_r(($key=="" ? $_SESSION : $_SESSION[$key]),true)."</pre>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
1311
cadline/components/administrator/components/com_alworkshops/assets/css/jquery-ui.css
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
#j-sidebar-container {display:inline-block;vertical-align:top;width:14.5%;height:300px;border:0px solid #000000;}
|
||||
#j-main-container {display:inline-block;vertical-align:top;width:85%;border:0px solid #000000;}
|
||||
|
||||
#j-main-container .pagination {margin:0px;padding:0px;display:inline;}
|
||||
#j-main-container table.adminlist {width:100%;border-spacing:1px;background-color:#e7e7e7;color:#666;}
|
||||
#j-main-container table.adminlist td,
|
||||
#j-main-container table.adminlist th {padding:4px;}
|
||||
#j-main-container table.adminlist thead th {text-align:center;background:#f0f0f0;color:#666;border-bottom:1px solid #999;border-left:1px solid #fff;}
|
||||
#j-main-container table.adminlist thead a:hover { text-decoration: none; }
|
||||
#j-main-container table.adminlist thead th img { vertical-align: middle; }
|
||||
#j-main-container table.adminlist tbody th { font-weight: bold; }
|
||||
#j-main-container table.adminlist tbody tr { background-color: #fff; text-align: left; }
|
||||
#j-main-container table.adminlist tbody tr.row1 { background: #f9f9f9; border-top: 1px solid #fff; }
|
||||
#j-main-container table.adminlist tbody tr.row0:hover td,
|
||||
#j-main-container table.adminlist tbody tr.row1:hover td { background-color: #ffd ; }
|
||||
#j-main-container table.adminlist tbody tr td { height: 25px; background: #fff; border: 1px solid #fff; }
|
||||
#j-main-container table.adminlist tbody tr.row1 td { background: #f9f9f9; border-top: 1px solid #FFF; }
|
||||
#j-main-container table.adminlist tfoot tr { text-align: center; color: #333; }
|
||||
#j-main-container table.adminlist tfoot td,
|
||||
#j-main-container table.adminlist tfoot th { background-color: #f3f3f3; border-top: 1px solid #999; text-align: center; }
|
||||
#j-main-container table.adminlist td.order { text-align: center; white-space: nowrap; }
|
||||
#j-main-container table.adminlist td.order span { float: left; display: block; width: 20px; text-align: center; }
|
||||
|
||||
.j-sidebar-container.j-sidebar-hidden {
|
||||
margin-left: 2vw !important;
|
||||
}
|
||||
|
||||
|
||||
#j-main-container .clear {clear:both;margin:0px;padding:0px;height:0px;width:0px;}
|
||||
#j-main-container div.hasab {display:inline-block;width:340px;vertical-align:top;border:0px solid #000;}
|
||||
#j-main-container div.hasab div.inputholder {display:block;height:38px;border:0px solid #ff0000;}
|
||||
#j-main-container div.hasab div.inputholder label {display:inline-block;width:120px;font-weight:bold;border:0px solid #00ff00;}
|
||||
#j-main-container div.hasab div.inputholder input[type="text"],
|
||||
#j-main-container div.hasab div.inputholder select {display:inline;margin:0px;width:190px;}
|
||||
#j-main-container div.hasab div.inputholder textarea {width:320px;height:260px;}
|
||||
#j-main-container div.hasab div.inputholder input[type="file"] {width:190px;}
|
||||
#j-main-container div.hasab div.inputholder fieldset {display:inline;width:190px;white-space:nowrap;border:0px solid #ff00ff;}
|
||||
#j-main-container div.hasab div.inputholder fieldset label {width:50px;font-weight:normal;}
|
||||
|
||||
|
||||
/* TableHelper */
|
||||
div.tableholder table { border: 1px solid #dddddd; font-size: 11px; }
|
||||
div.tableholder table thead, div.tableholder table tfoot { background-color: #ddd; }
|
||||
div.tableholder table thead tr td { padding-left: 3px; border-bottom: 1px solid #dddddd; white-space:nowrap; vertical-align:middle; }
|
||||
div.tableholder table tfoot tr td { padding-left: 3px; border-top: 1px solid #dddddd; white-space:nowrap; vertical-align:middle; }
|
||||
div.tableholder table thead tr th,
|
||||
div.tableholder table tfoot tr th { white-space:nowrap; vertical-align:middle; }
|
||||
div.tableholder table thead tr th span { display: block; float: left; text-align: center; margin-left:3px; float: left; height: 30px; line-height: 14px; font-weight: bold; }
|
||||
div.tableholder table thead tr th div.shortlinks { display: inline-block; margin: 1px; width: 9px; height: 24px; float: right; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-up { display: block; text-decoration: none; width: 9px; height: 11px; background: #ececec url(/administrator/components/com_alworkshops/assets/images/tableshort-up.jpg) no-repeat left top; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-up:hover { background: #ececec url(/administrator/components/com_alworkshops/assets/images/tableshort-up.jpg) no-repeat left -11px; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-down { margin-top:2px;display: block; text-decoration: none; width: 9px; height: 11px; background: #ececec url(/administrator/components/com_alworkshops/assets/images/tableshort-down.jpg) no-repeat left top; }
|
||||
div.tableholder table thead tr th div.shortlinks a.tableshort-down:hover { margin-top:2px;background: #ececec url(/administrator/components/com_alworkshops/assets/images/tableshort-down.jpg) no-repeat left -11px; }
|
||||
|
||||
div.tableholder table tbody tr.even { background-color: #ebebeb; }
|
||||
div.tableholder table tbody tr.odd { background-color: #ffffff; }
|
||||
div.tableholder table tbody tr.selected { background-color: #f5c0b8;color:#000000; }
|
||||
div.tableholder table tbody tr.selected a { color: #000000;}
|
||||
div.tableholder table tbody tr td { padding: 3px; text-align: left; border-top: 0px solid #afc4d2; border-right: 1px solid #e0eef7; }
|
||||
div.tableholder table tbody tr td img { padding: 0px; margin:0px; border:0px;vertical-align: middle; }
|
||||
div.tableholder table tbody tr.even:hover,
|
||||
div.tableholder table tbody tr.odd:hover,
|
||||
div.tableholder table tbody tr.selected:hover { cursor: pointer; background-color: #c5e6a1; color: #000000; }
|
||||
div.tableholder table tbody tr td input { padding: 0px; margin:0; vertical-align:middle; }
|
||||
div.tableholder table tbody tr td img { margin: 0px 2px; }
|
||||
div.tableholder table tfoot { height: 30px; font-size: 11px; font-weight: bold; }
|
||||
div.tableholder table a {text-decoration:none;cursor:pointer;}
|
||||
div.tableholder table a:hover {text-decoration:none;cursor:pointer;}
|
||||
div.tablenav select { margin: 0px; float: left; width: auto; padding: 2px 2px 3px 2px;border: 1px solid #afc4d2;font-size: 11px;font-family: Tahoma;font-weight: normal;text-align: left;color: #484947;cursor: pointer;}
|
||||
div.tablenav {margin: 10px 0px 10px 0px;height: 32px;overflow: hidden;}
|
||||
div.tablenav p {margin: 0px 0px 0px 3px;float: left;line-height: 32px; float:left;}
|
||||
div.tablenav ul.pager {margin: 0px 0px 0px 20px;float: right;height: 22px;}
|
||||
div.tablenav ul.pager li {display: inline;}
|
||||
div.tablenav ul.pager li a,
|
||||
div.tablenav ul.pager li a.inactive,
|
||||
div.tablenav ul.pager li a.inactive:hover { background: none; display: inline-block; float: left; margin: 0px 0px 0px 3px; width: 20px; height: 20px; line-height: 20px; font-size: 12px; font-weight: bold; text-align: center; vertical-align: middle; border: 1px solid #B3B9AA; color: #009cff; cursor:pointer;}
|
||||
div.tablenav ul.pager li a.nextfive { border: none; line-height: 22px; cursor:pointer; }
|
||||
div.tablenav ul.pager li a.inactive,
|
||||
div.tablenav ul.pager li a.inactive:hover { color: #c3c4c1; cursor:pointer;}
|
||||
div.tablenav ul.pager li a.activepage,
|
||||
div.tablenav ul.pager li a.activepage:hover { background-color: #b4c799; color: #ffffff; border-color: #577046; font-weight: bold; cursor:pointer;}
|
||||
div.tablenav ul.pager li a:hover {background-color: #009cff;color: #ffffff;border-color: #2d4e63; cursor:pointer; }
|
||||
|
||||
|
||||
#preview {position:absolute; border:1px solid #ccc;display:none;color:#fff;background:#fff;padding:5px;white-space:normal; }
|
||||
#tooltip {position:absolute; border:1px solid #333;display:none;color:#333;background:#f7f5d1;padding:2px 5px; }
|
||||
|
After Width: | Height: | Size: 643 B |
|
After Width: | Height: | Size: 331 B |
|
After Width: | Height: | Size: 731 B |
|
After Width: | Height: | Size: 764 B |
|
After Width: | Height: | Size: 957 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 284 B |
|
After Width: | Height: | Size: 270 B |
|
After Width: | Height: | Size: 509 B |
|
After Width: | Height: | Size: 632 B |
|
After Width: | Height: | Size: 578 B |
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 826 B |
|
After Width: | Height: | Size: 453 B |
|
After Width: | Height: | Size: 473 B |
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@ -0,0 +1,16 @@
|
||||
function submitForm(formid,targetdiv)
|
||||
{
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: jQuery('#'+formid).attr('action'),
|
||||
data: jQuery('#'+formid).serialize(),
|
||||
success: function(html) {jQuery('#'+targetdiv).html(html);}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function setField(formid,elementid,value,targetdiv)
|
||||
{
|
||||
jQuery('#'+elementid).val(value);
|
||||
if (formid>'') submitForm(formid,targetdiv);
|
||||
}
|
||||
18706
cadline/components/administrator/components/com_alworkshops/assets/js/jquery-ui.js
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Image preview script
|
||||
* powered by jQuery (http://www.jquery.com)
|
||||
*
|
||||
* written by Alen Grakalic (http://cssglobe.com)
|
||||
*
|
||||
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
|
||||
*
|
||||
*/
|
||||
|
||||
this.imagePreview = function(){
|
||||
/* CONFIG */
|
||||
|
||||
xOffset = -35;
|
||||
yOffset = 20;
|
||||
|
||||
imgHeight=0;
|
||||
imgWidth=0;
|
||||
|
||||
|
||||
// these 2 variable determine popup's distance from the cursor
|
||||
// you might want to adjust to get the right result
|
||||
|
||||
/* END CONFIG */
|
||||
jQuery("a.preview").hover(function(e){
|
||||
|
||||
var newImg = new Image();
|
||||
newImg.src = this.href;
|
||||
imgHeight = newImg.height;
|
||||
imgWidth = newImg.width;
|
||||
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
var c = (this.t != "") ? "<br/>" + this.t : "";
|
||||
if (imgWidth) {
|
||||
jQuery("body").append("<p id='preview' style='width:"+imgWidth+"px;'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
|
||||
jQuery("#preview")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - imgWidth) + "px")
|
||||
.fadeIn("fast");
|
||||
}
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
jQuery("#preview").remove();
|
||||
});
|
||||
jQuery("a.preview").mousemove(function(e){
|
||||
if (imgWidth==0) {
|
||||
var newImg = new Image();
|
||||
newImg.src = this.href;
|
||||
imgHeight = newImg.height;
|
||||
imgWidth = newImg.width;
|
||||
}
|
||||
jQuery("#preview")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - imgWidth) + "px");
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Tooltip script
|
||||
* powered by jQuery (http://www.jquery.com)
|
||||
* written by Alen Grakalic (http://cssglobe.com)
|
||||
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
|
||||
*/
|
||||
this.tooltip = function(){
|
||||
/* CONFIG */
|
||||
xOffset = -20;
|
||||
yOffset = 10;
|
||||
width = 200;
|
||||
// these 2 variable determine popup's distance from the cursor
|
||||
// you might want to adjust to get the right result
|
||||
/* END CONFIG */
|
||||
jQuery("a.tooltip").hover(function(e){
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
jQuery("body").append("<p id='tooltip' style='width:"+width+"px'>"+ this.t +"</p>");
|
||||
jQuery("#tooltip")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - width) + "px")
|
||||
.fadeIn("fast");
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
jQuery("#tooltip").remove();
|
||||
});
|
||||
jQuery("a.tooltip").mousemove(function(e){
|
||||
jQuery("#tooltip")
|
||||
.css("top",(e.pageY + yOffset) + "px")
|
||||
.css("left",(e.pageX + xOffset - width) + "px");
|
||||
});
|
||||
};
|
||||
|
||||
function checkAll()
|
||||
{
|
||||
jQuery("input:checkbox").each(function() {
|
||||
jQuery(this).attr('checked','checked');
|
||||
});
|
||||
}
|
||||
|
||||
function unCheckAll()
|
||||
{
|
||||
jQuery("input:checkbox").each(function() {
|
||||
jQuery(this).removeAttr('checked');
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset label="COM_ALWORKSHOPS" name="alworkshops">
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="permissions" description="JCONFIG_PERMISSIONS_DESC" label="JCONFIG_PERMISSIONS_LABEL">
|
||||
<field name="rules" type="rules" component="com_alworkshops" class="inputbox" filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL" section="component" />
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="component">
|
||||
<field name="save_history" type="radio" class="btn-group btn-group-yesno" default="0" label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL" description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="history_limit" type="text" filter="integer" label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL" description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC" default="5"/>
|
||||
</fieldset>
|
||||
</config>
|
||||
<!--
|
||||
########################################################################################
|
||||
The following are a list of all the different types of fields you can add to this file
|
||||
They are here for copy pasting - neat eh?
|
||||
########################################################################################
|
||||
|
||||
http://docs.joomla.org/Calendar_parameter_type
|
||||
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />
|
||||
|
||||
http://docs.joomla.org/Category_parameter_type
|
||||
<field name="mycategory" type="category" label="Select a category" description="" section="3" />
|
||||
|
||||
http://docs.joomla.org/Editors_parameter_type
|
||||
<field name="myeditor" type="editors" default="none" label="Select an editor" />
|
||||
|
||||
http://docs.joomla.org/Filelist_parameter_type
|
||||
<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />
|
||||
|
||||
http://docs.joomla.org/Folderlist_parameter_type
|
||||
<field name="myfolder" type="folderlist" default="" label="Select a folder" directory="administrator" filter="" exclude="" stripext="" />
|
||||
|
||||
http://docs.joomla.org/Helpsites_parameter_type
|
||||
<field name="myhelpsite" type="helpsites" default="" label="Select a help site" description="" />
|
||||
|
||||
http://docs.joomla.org/Hidden_parameter_type
|
||||
<field name="mysecretvariable" type="hidden" default="" />
|
||||
|
||||
http://docs.joomla.org/Imagelist_parameter_type
|
||||
<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />
|
||||
|
||||
http://docs.joomla.org/Languages_parameter_type
|
||||
<field name="mylanguage" type="languages" client="site" default="en-GB" label="Select a language" description="" />
|
||||
|
||||
http://docs.joomla.org/List_parameter_type
|
||||
<field name="mylistvalue" type="list" default="" label="Select an option" description="">
|
||||
<option value="0">Option 1</option>
|
||||
<option value="1">Option 2</option>
|
||||
</field>
|
||||
|
||||
http://docs.joomla.org/Menu_parameter_type
|
||||
<field name="mymenu" type="menu" default="mainmenu" label="Select a menu" description="Select a menu" />
|
||||
|
||||
http://docs.joomla.org/Menuitem_parameter_type
|
||||
<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />
|
||||
|
||||
http://docs.joomla.org/Password_parameter_type
|
||||
<field name="mypassword" type="password" default="secret" label="Enter a password" description="" size="5" />
|
||||
|
||||
http://docs.joomla.org/Radio_parameter_type
|
||||
<field name="myradiovalue" type="radio" default="0" label="Select an option" description="">
|
||||
<option value="0">1</option>
|
||||
<option value="1">2</option>
|
||||
</field>
|
||||
|
||||
http://docs.joomla.org/Spacer_parameter_type
|
||||
<field type="spacer" default="<b>Advanced parameters</b>" />
|
||||
|
||||
http://docs.joomla.org/Sql_parameter_type
|
||||
<field name="myfield" type="sql" default="10" label="Select an article" query="SELECT id, title FROM #__content" key_field=”id” value_field=”title” />
|
||||
|
||||
http://docs.joomla.org/Text_parameter_type
|
||||
<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />
|
||||
|
||||
http://docs.joomla.org/Textarea_parameter_type
|
||||
<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />
|
||||
|
||||
http://docs.joomla.org/Timezones_parameter_type
|
||||
<field name="mytimezone" type="timezones" default="-10" label="Select a timezone" description="" />
|
||||
|
||||
http://docs.joomla.org/Usergroup_parameter_type
|
||||
<field name="myusergroups" type="usergroup" default="" label="Select a user group" description="" />
|
||||
|
||||
|
||||
-->
|
||||
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package Com_Alworkshops
|
||||
* @author Zsolt Fekete <mcleod78@gmail.com>
|
||||
* @copyright 2017 Zsolt Fekete
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.controller'); // import Joomla controller library
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$view = $app->input->get('view');
|
||||
$option = $app->input->get('option');
|
||||
|
||||
$l = array(
|
||||
array('COM_ALWORKSHOPS_CONTROL_PANEL_HELP', ''),
|
||||
array('COM_ALWORKSHOPS_APPLICATIONS', 'application'),
|
||||
array('COM_ALWORKSHOPS_COURSES', 'course'),
|
||||
array('COM_ALWORKSHOPS_SESSIONS', 'session'),
|
||||
array('COM_ALWORKSHOPS_SWITCH', 'switch'),
|
||||
array('COM_ALWORKSHOPS_ONLINE_SESSIONS', 'onlinesession'),
|
||||
array('COM_ALWORKSHOPS_EDUCATION', 'education')
|
||||
);
|
||||
|
||||
foreach ($l as $v) {
|
||||
JHtmlSidebar::addEntry(JText::_($v[0]), 'index.php?option=' . $option . ($v[1] == '' ? '' : '&view=') . $v[1], ($view == $v[1] || $view == $v[1] . "edit" ? true : false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Class AlworkshopsController
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class AlworkshopsController extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Method to display a view.
|
||||
*
|
||||
* @param boolean $cachable If true, the view output will be cached
|
||||
* @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return JController This object to support chaining.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
$view = JFactory::getApplication()->input->getCmd('view', '');
|
||||
JFactory::getApplication()->input->set('view', $view);
|
||||
|
||||
parent::display($cachable, $urlparams);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||