Compare commits
9 Commits
add-gitatt
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 4af8e06eff | |||
| 24f8e95c92 | |||
|
|
4e4046f093 | ||
|
|
ca4d61d6c0 | ||
| 974beee429 | |||
| 846a6cdb6a | |||
| a7dc9bcfab | |||
| 8318cae110 | |||
| f8ed190894 |
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,6 +1,8 @@
|
|||||||
[submodule "cadline/backend/common_cadline_libraries"]
|
[submodule "cadline/backend/common_cadline_libraries"]
|
||||||
path = cadline/backend/common_cadline_libraries
|
path = cadline/backend/common_cadline_libraries
|
||||||
url = ssh://git@git.cadline.hu:22222/cadline_web/cadcommonlib.git
|
url = ssh://git@git.cadline.hu:22222/cadline_web/cadcommonlib.git
|
||||||
|
branch = master
|
||||||
[submodule "cadline/backend/maintenance"]
|
[submodule "cadline/backend/maintenance"]
|
||||||
path = cadline/backend/maintenance
|
path = cadline/backend/maintenance
|
||||||
url = ssh://git@git.cadline.hu:22222/cadline_web/maintenance.git
|
url = ssh://git@git.cadline.hu:22222/cadline_web/maintenance.git
|
||||||
|
branch = master
|
||||||
|
|||||||
@ -102,4 +102,14 @@ if [ -f "$ROOT/malware-iocs.paths" ]; then
|
|||||||
done < "$ROOT/malware-iocs.paths"
|
done < "$ROOT/malware-iocs.paths"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# (d) .htaccess-based PHP-enable persistence — apache-config droppers the
|
||||||
|
# content/extension filters above miss (no <?php tag, not *.php.json).
|
||||||
|
# Mirrors the malware_htaccess_php_enable YARA rule (illusion/hids#183).
|
||||||
|
log "exclude: .htaccess-based php-enable persistence"
|
||||||
|
find "$OUT" -type f \( -name '.htaccess' -o -name '.htaccess.*' \) 2>/dev/null | while IFS= read -r h; do
|
||||||
|
if grep -IlqE 'Add(Type|Handler)[[:space:]]+application/x-httpd-php[0-9]?[[:space:]]+\.(json|jpe?g|png|gif|txt|ico|css|html?|xml|svg|bak|log)|php_flag[[:space:]]+engine[[:space:]]+on' "$h" 2>/dev/null; then
|
||||||
|
log " drop (htaccess-php-enable): ${h#"$OUT"/}"; rm -f "$h"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
log "baseline built at: $OUT ($(find "$OUT" -type f | wc -l) files)"
|
log "baseline built at: $OUT ($(find "$OUT" -type f | wc -l) files)"
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 423fec9b929b381339d71623fc621a998a6e3e0f
|
Subproject commit 6bd9cb2e1c0844e57fa9cad83ba2baa6e056418d
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 11f1a543340bb7a2f03c3647dca03b7bd79783d0
|
Subproject commit 7e8036235b05d493363791b46bb2ebdc33bb5f2e
|
||||||
@ -1,544 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*******************************************************************************
|
|
||||||
* eredeti url: http://www.archlinexp.com/index.php?menu=tips2012&lang=hun&version=1&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
|
||||||
* eredeti url: http://old.archlinexp.com/tips/tips2009/hun/1/OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=/46.139.109.235
|
|
||||||
* új url: http://www.archlinexp.com/maintenance/tips.php?lang=hun&version=2&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
|
||||||
* logfilter=0 - csak a legfontosabb logok;
|
|
||||||
* logfilter=10 - minden logot küld;
|
|
||||||
******************************************************************************/
|
|
||||||
include ("config.php");
|
|
||||||
include ("version.php");
|
|
||||||
include ("functions.php");
|
|
||||||
include ("mtips.php");
|
|
||||||
if (!class_exists('crmHelper')) require_once("class/crmHelper.class.php");
|
|
||||||
|
|
||||||
error_log(print_r($_GET,TRUE),3,"../tmp/error_tips.log");
|
|
||||||
|
|
||||||
$version = New Version();
|
|
||||||
$mtips = New Mtips();
|
|
||||||
|
|
||||||
$user_lang_db = $user_lang = $origlang = (isset($_GET['lang']) ? trim($_GET['lang']) : NULL);
|
|
||||||
$user_version = (isset($_GET['version']) ? trim($_GET['version']) : NULL);
|
|
||||||
$user_ssID = (isset($_GET['session']) ? trim($_GET['session']) : NULL);
|
|
||||||
$user_IP = $_SERVER['REMOTE_ADDR'];
|
|
||||||
$osdata = '';
|
|
||||||
$time=time();
|
|
||||||
$namirialRangeMin=940001;
|
|
||||||
$namirialRangeMax=949999;
|
|
||||||
$BIMLadderRangeMin=920001;
|
|
||||||
$BIMLadderRangeMax=929999;
|
|
||||||
|
|
||||||
if( strstr($_SERVER['REQUEST_URI'],"ize") ) print $mtips->tips_src.$data['current_lang'].'/';
|
|
||||||
|
|
||||||
if(!$user_lang) { print('No language id given, try to add /en to the uri'); }
|
|
||||||
|
|
||||||
if(!is_numeric($user_version)) { print('Invalid version id sent: '.$user_version); }
|
|
||||||
|
|
||||||
if(!in_array($user_lang,$mtips->existing_lang)) { $user_lang = 'eng'; }
|
|
||||||
|
|
||||||
$user_lang = $mtips->lang_check($user_lang);
|
|
||||||
|
|
||||||
$settings = $mtips->read_settings($user_lang);
|
|
||||||
|
|
||||||
//get country name from ip
|
|
||||||
$locale=@file_get_contents("http://freegeoip.net/xml/".$user_IP,FALSE, stream_context_create(array('http'=>array('timeout'=>2)) ) );
|
|
||||||
$tomb = json_decode(json_encode(simplexml_load_string($locale)),TRUE);
|
|
||||||
$ctrname=$tomb["CountryName"];
|
|
||||||
$temp=explode(".", gethostbyaddr($user_IP));
|
|
||||||
|
|
||||||
if(!isset($ctrname) || $ctrname=='') $ctrname = 'unknown';
|
|
||||||
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {print "user_lang_db: ".$user_lang_db." user_version: ".$user_version." user_ssID: ".$user_ssID; die(); }
|
|
||||||
|
|
||||||
if($user_lang_db && /*$user_version && */ $user_ssID!='')
|
|
||||||
{
|
|
||||||
$str_decoded = base64_decode($user_ssID); //decode the session string
|
|
||||||
|
|
||||||
sscanf(substr($str_decoded,0,4),'%04x',$keyDec);
|
|
||||||
$encoded = str_split(substr($str_decoded,4),4);
|
|
||||||
$decoded = '';
|
|
||||||
|
|
||||||
foreach($encoded as $e)
|
|
||||||
{
|
|
||||||
sscanf($e,'%04x',$temp);
|
|
||||||
if(strlen(substr(sprintf('%x',$temp^$keyDec),2))>0)
|
|
||||||
{
|
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),0,2)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$pos = strpos($decoded, '#'); //ba 2018.07.04. atterunk a # separatorra. Ezidaig nem fordulhatott elo benne ilyen jel
|
|
||||||
if($pos === false)
|
|
||||||
{
|
|
||||||
$separator = '_';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$separator = '#';
|
|
||||||
}
|
|
||||||
$numdata = substr_count($decoded, $separator); //ba most már kapunk adatot az oprendszerrol is
|
|
||||||
|
|
||||||
//error_log("decoded = ".print_r($decoded,FALSE)." pwd: ".$pwd." build: ".$build." user_version: ".$user_version." idokod: ".$idokod."\n",3,"../tmp/error.log");
|
|
||||||
if( $numdata >= 11 )
|
|
||||||
{
|
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $idokod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID, $name, $email, $company, $phone, $newsletter) = split($separator, $decoded);
|
|
||||||
}
|
|
||||||
elseif( $numdata >= 6 )
|
|
||||||
{
|
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $idokod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID) = split($separator, $decoded);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $idokod) = split($separator, $decoded);
|
|
||||||
}
|
|
||||||
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='46.139.14.111') { print "decoded = ".print_r( explode("_",$decoded),FALSE)."\n\n<br>user_version: ".$user_version." , idokod: ".$idokod." npID: ".$npID." partnerID: ".$partnerID." pwd: ".$pwd; /*die();*/ }
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if(isset($npID)){
|
|
||||||
$compid = crmHelper::AddOrUpdateComputer($npID);
|
|
||||||
}
|
|
||||||
|
|
||||||
=======
|
|
||||||
|
|
||||||
>>>>>>> f2ebce6b191a229c054099f929f7145b78d46007
|
|
||||||
/*******************************************************************************
|
|
||||||
*NAMIRIAL-os automata kulcskiadás és program létrehozás
|
|
||||||
******************************************************************************/
|
|
||||||
if (isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='2nt' && isset($idokod) && $idokod>'' && isset($pwd) && $pwd>'')
|
|
||||||
<<<<<<< HEAD
|
|
||||||
{
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid."' AND partnerID = '2nt' LIMIT 1;");
|
|
||||||
=======
|
|
||||||
{
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`computers` WHERE `computer_id`='".$npID."' LIMIT 1;");
|
|
||||||
$res4=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
|
|
||||||
if(empty($res4)){
|
|
||||||
$comp=array(
|
|
||||||
'computer_id'=>$npID,
|
|
||||||
'last_mod'=>date('Y-m-d',time()));
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`computers`",$comp);
|
|
||||||
}
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`computers` WHERE `computer_id`='".$npID."' LIMIT 1;");
|
|
||||||
$compid=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
|
|
||||||
$programVersion=substr($pwd, 7, 2);
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid[0]['id']."' AND partnerID = '2nt' AND verID =".$programVersion." LIMIT 1;");
|
|
||||||
>>>>>>> f2ebce6b191a229c054099f929f7145b78d46007
|
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
//ba nincs ehhez a gephez meg non-profit program regisztralva
|
|
||||||
if (empty($res))
|
|
||||||
{
|
|
||||||
$hlNum=tryToAlloc($namirialRangeMin,$namirialRangeMax);
|
|
||||||
$arrIdokod=explode("-", $idokod);
|
|
||||||
$isid=$arrIdokod[1];
|
|
||||||
$type=substr($pwd, 6, 1);
|
|
||||||
$verid=substr($pwd, 7, 2);
|
|
||||||
$ver=$version->getVersion(array('verPassword8and9'=>$verid));
|
|
||||||
$interval=90;
|
|
||||||
$pass=generatePassword($hlNum,0,$type,$ver['verCode']);
|
|
||||||
$aktKod=generateTimeCode($pass,$isid,$interval);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`u_emails` WHERE `email`='{$email}' LIMIT 1;");
|
|
||||||
$exist=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
if (!$exist) //ba elsodleges szempont, hogy a megadott email cimmel van-e crm bejegyzes
|
|
||||||
{
|
|
||||||
//ba felvesszuk a user-t
|
|
||||||
$userdata=array(
|
|
||||||
'strName'=>$name,
|
|
||||||
'strEMail'=>$email,
|
|
||||||
'strCompany'=>$company,
|
|
||||||
'strTel'=>$phone,
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'nCtrID'=>39,
|
|
||||||
'dateInsert'=>$time);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`users`",$userdata);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT nUserID as nUserID FROM `".CRMADATBAZIS."`.`users` WHERE strEMail='{$email}' AND strName='{$name}' limit 1");
|
|
||||||
$userQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$userID = $userQuery[0]['nUserID'];
|
|
||||||
|
|
||||||
//ba felvesszuk az email cimet a userhez
|
|
||||||
$emaildata=array(
|
|
||||||
'email'=>$email,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'newsletter'=>$newsletter
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_emails`",$emaildata);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba a meglevo userhez fogjuk kotni a programot
|
|
||||||
$userID=$exist[0]['nUserID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//ba regisztraljuk hozza a non-profit programot
|
|
||||||
$nonprofit=array(
|
|
||||||
'isid'=>$isid,
|
|
||||||
'verid'=>$verid,
|
|
||||||
'hlID'=>$hlNum,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'add_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'expire_datetime'=>date('Y-m-d H:i:s', strtotime('+90 day', $time)),
|
|
||||||
'activation_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'partnerID'=>$partnerID,
|
|
||||||
'enabled'=>'Y',
|
|
||||||
'computer_id'=>$compid);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`nonprofit`",$nonprofit);
|
|
||||||
|
|
||||||
//Namirial non-profit kód aktiválás beszúrása crm -> u_history táblába
|
|
||||||
$esemeny=array(
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'nTopicID'=>366,
|
|
||||||
'dateEvent'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'strPlace'=>'',
|
|
||||||
'strInfo'=>'Namirial nonprofit kulcs aktiválás',
|
|
||||||
'nManagerID'=>36,
|
|
||||||
'insertDate'=>date('Y-m-d H:i:s',$time));
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_history`",$esemeny);
|
|
||||||
|
|
||||||
$hardlock=array(
|
|
||||||
'hlNum'=>$hlNum,
|
|
||||||
'hlCtrID'=>39,
|
|
||||||
'hlLan'=>0,
|
|
||||||
'hlStat'=>1,
|
|
||||||
'hlDateIssue'=>date('Y-m-d',$time),
|
|
||||||
'hlManID'=>36,
|
|
||||||
'hlTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'hlUser'=>$userID,
|
|
||||||
'hlDealer'=>62103,
|
|
||||||
'bUjithato'=>1,
|
|
||||||
'old_db'=>'clusers_eng');
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`hardlock`",$hardlock);
|
|
||||||
|
|
||||||
$program=array(
|
|
||||||
'prTypeID'=>$type,
|
|
||||||
'prVerID'=>$ver['verID'],
|
|
||||||
'prLan'=>0,
|
|
||||||
'prPass'=>trim($pass),
|
|
||||||
'prSellDate'=>date('Y-m-d',$time),
|
|
||||||
'prActDate'=>date('Y-m-d',$time+$interval*86400), // 90 nap
|
|
||||||
'prFizetve'=>date('Y-m-d',$time+$interval*86400),
|
|
||||||
'prActCode'=>trim($aktKod),
|
|
||||||
'prTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prLastMod'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prContact'=>8, // Non-profit
|
|
||||||
'prHlNum'=>$hlNum, // 99xxxx
|
|
||||||
'prManID'=>36, // web
|
|
||||||
'prStat'=>0,
|
|
||||||
'prHiType'=>1, // 1 Rendelés | 2 Típus Váltás | 3 Frissítés | 4 Auto Friss.
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`h_programs`",$program);
|
|
||||||
|
|
||||||
$pwd = $pass; //ba 2018.07.02. mostantol az uj jelszava a usernek a most generalt, 94-es lesz, nem pedig a 93-as!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba ehhez a gephez mar volt non-profit regisztracio, keressuk ki a sorozatszamot neki
|
|
||||||
$hardlockID = $res[0]['hlID'];
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prHlNum='{$hardlockID}' limit 1");
|
|
||||||
$programQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$pwd = $programQuery[0]['prPass'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*******************************************************************************
|
|
||||||
*BIMLadder-es automata kulcskiadás és program létrehozás
|
|
||||||
******************************************************************************/
|
|
||||||
else if (isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='kbl' && isset($idokod) && $idokod>'' && isset($pwd) && $pwd>'')
|
|
||||||
{
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid."' AND partnerID = 'kbl' LIMIT 1;");
|
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
//ba nincs ehhez a gephez meg non-profit program regisztralva
|
|
||||||
if (empty($res))
|
|
||||||
{
|
|
||||||
$hlNum=tryToAlloc($BIMLadderRangeMin,$BIMLadderRangeMax);
|
|
||||||
$arrIdokod=explode("-", $idokod);
|
|
||||||
$isid=$arrIdokod[1];
|
|
||||||
$type=substr($pwd, 6, 1);
|
|
||||||
$verid=substr($pwd, 7, 2);
|
|
||||||
$ver=$version->getVersion(array('verPassword8and9'=>$verid));
|
|
||||||
$interval=30; //ba !!! nem 90!!!
|
|
||||||
$pass=generatePassword($hlNum,0,$type,$ver['verCode']);
|
|
||||||
$aktKod=generateTimeCode($pass,$isid,$interval);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`u_emails` WHERE `email`='{$email}' LIMIT 1;");
|
|
||||||
$exist=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
if (!$exist) //ba elsodleges szempont, hogy a megadott email cimmel van-e crm bejegyzes
|
|
||||||
{
|
|
||||||
//ba felvesszuk a user-t
|
|
||||||
$userdata=array(
|
|
||||||
'strName'=>$name,
|
|
||||||
'strEMail'=>$email,
|
|
||||||
'strCompany'=>$company,
|
|
||||||
'strTel'=>$phone,
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'nCtrID'=>82,
|
|
||||||
'dateInsert'=>$time);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`users`",$userdata);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT nUserID as nUserID FROM `".CRMADATBAZIS."`.`users` WHERE strEMail='{$email}' AND strName='{$name}' limit 1");
|
|
||||||
$userQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$userID = $userQuery[0]['nUserID'];
|
|
||||||
|
|
||||||
//ba felvesszuk az email cimet a userhez
|
|
||||||
$emaildata=array(
|
|
||||||
'email'=>$email,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'newsletter'=>$newsletter
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_emails`",$emaildata);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba a meglevo userhez fogjuk kotni a programot
|
|
||||||
$userID=$exist[0]['nUserID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//ba regisztraljuk hozza a non-profit programot
|
|
||||||
$nonprofit=array(
|
|
||||||
'isid'=>$isid,
|
|
||||||
'verid'=>$verid,
|
|
||||||
'hlID'=>$hlNum,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'add_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'expire_datetime'=>date('Y-m-d H:i:s', strtotime('+30 day', $time)), //ba 30 nap!!!!
|
|
||||||
'activation_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'partnerID'=>$partnerID,
|
|
||||||
'enabled'=>'Y',
|
|
||||||
'computer_id'=>$compid);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`nonprofit`",$nonprofit);
|
|
||||||
|
|
||||||
//BIMLadder non-profit kód aktiválás beszúrása crm -> u_history táblába
|
|
||||||
$esemeny=array(
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'nTopicID'=>368,
|
|
||||||
'dateEvent'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'strPlace'=>'',
|
|
||||||
'strInfo'=>'BIMLadder nonprofit kulcs aktiválás',
|
|
||||||
'nManagerID'=>36,
|
|
||||||
'insertDate'=>date('Y-m-d H:i:s',$time));
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_history`",$esemeny);
|
|
||||||
|
|
||||||
$hardlock=array(
|
|
||||||
'hlNum'=>$hlNum,
|
|
||||||
'hlCtrID'=>82,
|
|
||||||
'hlLan'=>0,
|
|
||||||
'hlStat'=>1,
|
|
||||||
'hlDateIssue'=>date('Y-m-d',$time),
|
|
||||||
'hlManID'=>36,
|
|
||||||
'hlTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'hlUser'=>$userID,
|
|
||||||
'hlDealer'=>62103,
|
|
||||||
'bUjithato'=>1,
|
|
||||||
'old_db'=>'clusers_eng');
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`hardlock`",$hardlock);
|
|
||||||
|
|
||||||
$program=array(
|
|
||||||
'prTypeID'=>$type,
|
|
||||||
'prVerID'=>$ver['verID'],
|
|
||||||
'prLan'=>0,
|
|
||||||
'prPass'=>trim($pass),
|
|
||||||
'prSellDate'=>date('Y-m-d',$time),
|
|
||||||
'prActDate'=>date('Y-m-d',$time+$interval*86400), // 90 nap helyett 30 nap!!!!
|
|
||||||
'prFizetve'=>date('Y-m-d',$time+$interval*86400),
|
|
||||||
'prActCode'=>trim($aktKod),
|
|
||||||
'prTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prLastMod'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prContact'=>9,
|
|
||||||
'prHlNum'=>$hlNum, // 99xxxx
|
|
||||||
'prManID'=>36, // web
|
|
||||||
'prStat'=>0,
|
|
||||||
'prHiType'=>1, // 1 Rendelés | 2 Típus Váltás | 3 Frissítés | 4 Auto Friss.
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`h_programs`",$program);
|
|
||||||
|
|
||||||
$pwd = $pass; //ba 2018.11.26. mostantol az uj jelszava a usernek a most generalt, 92-es lesz, nem pedig a 91-es!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba ehhez a gephez mar volt non-profit regisztracio, keressuk ki a sorozatszamot neki
|
|
||||||
$hardlockID = $res[0]['hlID'];
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prHlNum='{$hardlockID}' limit 1");
|
|
||||||
$programQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$pwd = $programQuery[0]['prPass'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//insert stats to the userstats table
|
|
||||||
|
|
||||||
$stats = array(
|
|
||||||
'usLang' => $user_lang_db,
|
|
||||||
'usDate' => time(),
|
|
||||||
'usPwd' => $pwd,
|
|
||||||
'usVer'=>substr($pwd,7,2),
|
|
||||||
'usCompID' => $compID,
|
|
||||||
'usCtrID' => $ctrID,
|
|
||||||
'usBuild' => $build,
|
|
||||||
'usCtrName' => $ctrname,
|
|
||||||
'usIP' => $user_IP,
|
|
||||||
'usOSData' => $osdata,
|
|
||||||
// 'usISID' => $isid,
|
|
||||||
);
|
|
||||||
|
|
||||||
$liveKey = $version->isLiveKey($pwd) == 'true'; // Live kulcs 2019
|
|
||||||
$softwareKey = $version->isSoftwareKey($pwd) == 'true'; // Software kulcs 2019
|
|
||||||
|
|
||||||
if($softwareKey)
|
|
||||||
$stats['usISID'] = substr($idokod, 5, 4);
|
|
||||||
|
|
||||||
if (trim($usGCMan)>'' && trim($usGCType)>'' && trim($usGCDriverVer)>'')
|
|
||||||
{
|
|
||||||
$arrGCData=array(
|
|
||||||
'usGCMan'=>trim($usGCMan), // graphic card manufacture
|
|
||||||
'usGCType'=>trim($usGCType), // graphic card type
|
|
||||||
'usGCDriverVer'=>trim($usGCDriverVer), // graphic card driver version
|
|
||||||
);
|
|
||||||
|
|
||||||
$stats['usGCMan']=$arrGCData['usGCMan'];
|
|
||||||
$stats['usGCType']=$arrGCData['usGCType'];
|
|
||||||
$stats['usGCDriverVer']=$arrGCData['usGCDriverVer'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($softwareKey)
|
|
||||||
{
|
|
||||||
if($liveKey || in_array(substr($pwd,0,2), array('99','98','95')) ) // Azok a programok, amik regisztrálódnak a CRM-ben 2019
|
|
||||||
{
|
|
||||||
$msh->query("SELECT hlCtrID FROM ".CRMADATBAZIS.".hardlock WHERE hlNum='".substr($pwd,0,6)."'");
|
|
||||||
$res=$msh->fetchAssoc();
|
|
||||||
$hlnum=$res[0];
|
|
||||||
if(isset($hlnum['hlCtrID'])) $stats['usHlCtrID'] = $hlnum['hlCtrID'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$stats['usHlCtrID'] = substr($pwd,0,2);
|
|
||||||
}
|
|
||||||
|
|
||||||
$msh2->insert('userstats2013',$stats);
|
|
||||||
$usstatid=$msh2->getInsertedId();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {print "haha"; die();}
|
|
||||||
$rec=array(
|
|
||||||
'hiba'=>"Valami hianyzik: {$pwd}\nlang: {$user_lang_db}\nverzio: {$user_version}\nssID: {$user_ssID}",
|
|
||||||
'datum'=>date('Y-m-d H:i:s',time())
|
|
||||||
);
|
|
||||||
$msh2->insert('a_hibak',$rec);
|
|
||||||
}
|
|
||||||
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {var_dump($pwd); die();}
|
|
||||||
|
|
||||||
//loading the xml tips if necessary
|
|
||||||
if(!$settings)
|
|
||||||
{
|
|
||||||
print('Unable to load the corresponding settings.xml file!');
|
|
||||||
$rec=array(
|
|
||||||
'hiba'=>"beallitas hianyzik: {$pwd}\nlang: {$user_lang_db}\nverzio: {$user_version}\nssID: {$user_ssID}",
|
|
||||||
'datum'=>date('Y-m-d H:i:s',time())
|
|
||||||
);
|
|
||||||
// if($_SERVER['REMOTE_ADDR'] == "188.36.217.1") var_dump($rec);
|
|
||||||
$msh2->insert('a_hibak',$rec);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(substr($pwd,7,2)>29 && substr($pwd,0,2)!='96')
|
|
||||||
{
|
|
||||||
$isid=($softwareKey ? substr($idokod,5,4) : substr($pwd,0,2).substr($pwd,7,2));
|
|
||||||
$kulcsszam = substr($pwd,0,6);
|
|
||||||
|
|
||||||
$msh->query("SELECT hlStat,hlUser FROM `".CRMADATBAZIS."`.`hardlock` WHERE hlNum='{$kulcsszam}'");
|
|
||||||
$res=$msh->fetchAssoc();
|
|
||||||
$kulcs=$res[0];
|
|
||||||
|
|
||||||
$aktivalokod = $version->ujaktivalasikod2($pwd,$isid,$idokod);
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {var_dump($aktivalokod); die();}
|
|
||||||
if (in_array((int)substr($pwd,0,3),array(995,996,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989)) && (int)$kulcs['hlUser']>0) // nonprofitos program első indítása
|
|
||||||
{
|
|
||||||
$msh->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`h_aktivalas_infok` WHERE kulcs='".$kulcsszam."';");
|
|
||||||
$tmp=$msh->fetchAssoc();
|
|
||||||
$darab=(int)$tmp[0]['darab'];
|
|
||||||
|
|
||||||
$msh->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`u_history` WHERE `nUserID`=".(int)$kulcs['hlUser']." AND nTopicID IN (314,315);");
|
|
||||||
$tmp=$msh->fetchAssoc();
|
|
||||||
$esem=(int)$tmp[0]['darab'];
|
|
||||||
|
|
||||||
$msh->query("SELECT * FROM `".CRMADATBAZIS."`.`users` WHERE nUserID='".(int)$kulcs['hlUser']."';");
|
|
||||||
$usr=$msh->fetchAssoc();
|
|
||||||
$usr=$usr[0];
|
|
||||||
|
|
||||||
if (!empty($usr) && ($darab==0 || $esem==0))
|
|
||||||
{
|
|
||||||
$msh->insert("`".CRMADATBAZIS."`.`u_history`",array(
|
|
||||||
'nUserID'=>(int)$kulcs['hlUser'],
|
|
||||||
'nTopicID'=>($usr['old_db']=='clusers' ? 314 : 315),
|
|
||||||
'dateEvent'=>date('Y-m-d'),
|
|
||||||
'strPlace'=>'web',
|
|
||||||
'strInfo'=>($usr['old_db']=='clusers' ? 'Non-profit kód regisztráció' : 'Non-profit code registration').': '.$kulcsszam,
|
|
||||||
'nManagerID'=>36,
|
|
||||||
'insertDate'=>date('Y-m-d H:i:s'),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$virtualization = ($kulcs['hlStat']=='2' ? "false" : "true"); // letiltott kulcs visszajelzése a programnak
|
|
||||||
|
|
||||||
$valasz = ($aktivalokod!="") ? $aktivalokod : "(( nem kapott valaszt ))";
|
|
||||||
$version->_hibajelento("tips",substr($pwd,0,6),"programinditas - pw: {$pwd}, build: {$build}, isid: {$isid}, időkód: {$idokod}, valasz: ".$valasz,(isset($arrGCData)?$arrGCData:array()),(isset($usstatid)?$usstatid:NULL));
|
|
||||||
|
|
||||||
if(is_numeric($usstatid)) $msh2->update("userstats2013",array('valasz'=>$valasz),array('usID'=>$usstatid));
|
|
||||||
}
|
|
||||||
|
|
||||||
//logFilter
|
|
||||||
$logfilter=0;
|
|
||||||
if ($pwd>0)
|
|
||||||
{
|
|
||||||
$msh->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE `prPass`='".$pwd."' LIMIT 1;");
|
|
||||||
$res=$msh->fetchAssoc();
|
|
||||||
$logfilter=$res[0]['prLogFilter'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$verid=substr($pwd, 7, 2);
|
|
||||||
if($verid >= 36){
|
|
||||||
$hlnum = substr($pwd,0,6);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`hardlock_computers` WHERE hlNum='".$hlnum."' AND computer_id='".$compid."' LIMIT 1;");
|
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
|
|
||||||
if(empty($res)){
|
|
||||||
$comp=array(
|
|
||||||
'hlNum'=>$hlnum,
|
|
||||||
'computer_id'=>$compid);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`hardlock_computers`",$comp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if ($_SERVER['REMOTE_ADDR']!='46.139.109.235') return; //ba hibás válaszok ideiglenes kikötése
|
|
||||||
|
|
||||||
header('Content-Type: text/xml; charset=utf-8');
|
|
||||||
header('Content-Disposition: inline; filename=response.xml');
|
|
||||||
|
|
||||||
print '<'.'?'.'xml version="1.0" encoding="UTF-8" standalone="yes"'.'?'.'>
|
|
||||||
<Tips>
|
|
||||||
<Tip lang="'.$settings->lang.'" version="'.$settings->version.'">
|
|
||||||
<path>'.str_replace('..','',$mtips->tips_src).$settings->lang.'/'.'</path>
|
|
||||||
</Tip>
|
|
||||||
'.((isset($aktivalokod) && $aktivalokod) ? '<actcode>'.$aktivalokod.'</actcode>' : '').'
|
|
||||||
'.((isset($virtualization) && $virtualization) ? '<Virtualization>'.$virtualization.'</Virtualization>' : '').'
|
|
||||||
'.((isset($usstatid) && (int)$usstatid>0) ? '<actid>'.(int)$usstatid.'</actid>' : '').'
|
|
||||||
<logfilter>'.$logfilter.'</logfilter>
|
|
||||||
<loginEnabled>'.($kulcsszam=='360006' ? 'true' : 'false').'</loginEnabled>
|
|
||||||
</Tips>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -1,544 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*******************************************************************************
|
|
||||||
* eredeti url: http://www.archlinexp.com/index.php?menu=tips2012&lang=hun&version=1&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
|
||||||
* eredeti url: http://old.archlinexp.com/tips/tips2009/hun/1/OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=/46.139.109.235
|
|
||||||
* új url: http://www.archlinexp.com/maintenance/tips.php?lang=hun&version=2&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
|
||||||
* logfilter=0 - csak a legfontosabb logok;
|
|
||||||
* logfilter=10 - minden logot küld;
|
|
||||||
******************************************************************************/
|
|
||||||
include ("config.php");
|
|
||||||
include ("version.php");
|
|
||||||
include ("functions.php");
|
|
||||||
include ("mtips.php");
|
|
||||||
if (!class_exists('crmHelper')) require_once("class/crmHelper.class.php");
|
|
||||||
|
|
||||||
error_log(print_r($_GET,TRUE),3,"../tmp/error_tips.log");
|
|
||||||
|
|
||||||
$version = New Version();
|
|
||||||
$mtips = New Mtips();
|
|
||||||
|
|
||||||
$user_lang_db = $user_lang = $origlang = (isset($_GET['lang']) ? trim($_GET['lang']) : NULL);
|
|
||||||
$user_version = (isset($_GET['version']) ? trim($_GET['version']) : NULL);
|
|
||||||
$user_ssID = (isset($_GET['session']) ? trim($_GET['session']) : NULL);
|
|
||||||
$user_IP = $_SERVER['REMOTE_ADDR'];
|
|
||||||
$osdata = '';
|
|
||||||
$time=time();
|
|
||||||
$namirialRangeMin=940001;
|
|
||||||
$namirialRangeMax=949999;
|
|
||||||
$BIMLadderRangeMin=920001;
|
|
||||||
$BIMLadderRangeMax=929999;
|
|
||||||
|
|
||||||
if( strstr($_SERVER['REQUEST_URI'],"ize") ) print $mtips->tips_src.$data['current_lang'].'/';
|
|
||||||
|
|
||||||
if(!$user_lang) { print('No language id given, try to add /en to the uri'); }
|
|
||||||
|
|
||||||
if(!is_numeric($user_version)) { print('Invalid version id sent: '.$user_version); }
|
|
||||||
|
|
||||||
if(!in_array($user_lang,$mtips->existing_lang)) { $user_lang = 'eng'; }
|
|
||||||
|
|
||||||
$user_lang = $mtips->lang_check($user_lang);
|
|
||||||
|
|
||||||
$settings = $mtips->read_settings($user_lang);
|
|
||||||
|
|
||||||
//get country name from ip
|
|
||||||
$locale=@file_get_contents("http://freegeoip.net/xml/".$user_IP,FALSE, stream_context_create(array('http'=>array('timeout'=>2)) ) );
|
|
||||||
$tomb = json_decode(json_encode(simplexml_load_string($locale)),TRUE);
|
|
||||||
$ctrname=$tomb["CountryName"];
|
|
||||||
$temp=explode(".", gethostbyaddr($user_IP));
|
|
||||||
|
|
||||||
if(!isset($ctrname) || $ctrname=='') $ctrname = 'unknown';
|
|
||||||
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {print "user_lang_db: ".$user_lang_db." user_version: ".$user_version." user_ssID: ".$user_ssID; die(); }
|
|
||||||
|
|
||||||
if($user_lang_db && /*$user_version && */ $user_ssID!='')
|
|
||||||
{
|
|
||||||
$str_decoded = base64_decode($user_ssID); //decode the session string
|
|
||||||
|
|
||||||
sscanf(substr($str_decoded,0,4),'%04x',$keyDec);
|
|
||||||
$encoded = str_split(substr($str_decoded,4),4);
|
|
||||||
$decoded = '';
|
|
||||||
|
|
||||||
foreach($encoded as $e)
|
|
||||||
{
|
|
||||||
sscanf($e,'%04x',$temp);
|
|
||||||
if(strlen(substr(sprintf('%x',$temp^$keyDec),2))>0)
|
|
||||||
{
|
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),0,2)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$pos = strpos($decoded, '#'); //ba 2018.07.04. atterunk a # separatorra. Ezidaig nem fordulhatott elo benne ilyen jel
|
|
||||||
if($pos === false)
|
|
||||||
{
|
|
||||||
$separator = '_';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$separator = '#';
|
|
||||||
}
|
|
||||||
$numdata = substr_count($decoded, $separator); //ba most már kapunk adatot az oprendszerrol is
|
|
||||||
|
|
||||||
//error_log("decoded = ".print_r($decoded,FALSE)." pwd: ".$pwd." build: ".$build." user_version: ".$user_version." idokod: ".$idokod."\n",3,"../tmp/error.log");
|
|
||||||
if( $numdata >= 11 )
|
|
||||||
{
|
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $idokod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID, $name, $email, $company, $phone, $newsletter) = split($separator, $decoded);
|
|
||||||
}
|
|
||||||
elseif( $numdata >= 6 )
|
|
||||||
{
|
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $idokod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID) = split($separator, $decoded);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $idokod) = split($separator, $decoded);
|
|
||||||
}
|
|
||||||
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='46.139.14.111') { print "decoded = ".print_r( explode("_",$decoded),FALSE)."\n\n<br>user_version: ".$user_version." , idokod: ".$idokod." npID: ".$npID." partnerID: ".$partnerID." pwd: ".$pwd; /*die();*/ }
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if(isset($npID)){
|
|
||||||
$compid = crmHelper::AddOrUpdateComputer($npID);
|
|
||||||
}
|
|
||||||
|
|
||||||
=======
|
|
||||||
|
|
||||||
>>>>>>> f2ebce6b191a229c054099f929f7145b78d46007
|
|
||||||
/*******************************************************************************
|
|
||||||
*NAMIRIAL-os automata kulcskiadás és program létrehozás
|
|
||||||
******************************************************************************/
|
|
||||||
if (isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='2nt' && isset($idokod) && $idokod>'' && isset($pwd) && $pwd>'')
|
|
||||||
<<<<<<< HEAD
|
|
||||||
{
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid."' AND partnerID = '2nt' LIMIT 1;");
|
|
||||||
=======
|
|
||||||
{
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`computers` WHERE `computer_id`='".$npID."' LIMIT 1;");
|
|
||||||
$res4=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
|
|
||||||
if(empty($res4)){
|
|
||||||
$comp=array(
|
|
||||||
'computer_id'=>$npID,
|
|
||||||
'last_mod'=>date('Y-m-d',time()));
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`computers`",$comp);
|
|
||||||
}
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`computers` WHERE `computer_id`='".$npID."' LIMIT 1;");
|
|
||||||
$compid=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
|
|
||||||
$programVersion=substr($pwd, 7, 2);
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid[0]['id']."' AND partnerID = '2nt' AND verID =".$programVersion." LIMIT 1;");
|
|
||||||
>>>>>>> f2ebce6b191a229c054099f929f7145b78d46007
|
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
//ba nincs ehhez a gephez meg non-profit program regisztralva
|
|
||||||
if (empty($res))
|
|
||||||
{
|
|
||||||
$hlNum=tryToAlloc($namirialRangeMin,$namirialRangeMax);
|
|
||||||
$arrIdokod=explode("-", $idokod);
|
|
||||||
$isid=$arrIdokod[1];
|
|
||||||
$type=substr($pwd, 6, 1);
|
|
||||||
$verid=substr($pwd, 7, 2);
|
|
||||||
$ver=$version->getVersion(array('verPassword8and9'=>$verid));
|
|
||||||
$interval=90;
|
|
||||||
$pass=generatePassword($hlNum,0,$type,$ver['verCode']);
|
|
||||||
$aktKod=generateTimeCode($pass,$isid,$interval);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`u_emails` WHERE `email`='{$email}' LIMIT 1;");
|
|
||||||
$exist=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
if (!$exist) //ba elsodleges szempont, hogy a megadott email cimmel van-e crm bejegyzes
|
|
||||||
{
|
|
||||||
//ba felvesszuk a user-t
|
|
||||||
$userdata=array(
|
|
||||||
'strName'=>$name,
|
|
||||||
'strEMail'=>$email,
|
|
||||||
'strCompany'=>$company,
|
|
||||||
'strTel'=>$phone,
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'nCtrID'=>39,
|
|
||||||
'dateInsert'=>$time);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`users`",$userdata);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT nUserID as nUserID FROM `".CRMADATBAZIS."`.`users` WHERE strEMail='{$email}' AND strName='{$name}' limit 1");
|
|
||||||
$userQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$userID = $userQuery[0]['nUserID'];
|
|
||||||
|
|
||||||
//ba felvesszuk az email cimet a userhez
|
|
||||||
$emaildata=array(
|
|
||||||
'email'=>$email,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'newsletter'=>$newsletter
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_emails`",$emaildata);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba a meglevo userhez fogjuk kotni a programot
|
|
||||||
$userID=$exist[0]['nUserID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//ba regisztraljuk hozza a non-profit programot
|
|
||||||
$nonprofit=array(
|
|
||||||
'isid'=>$isid,
|
|
||||||
'verid'=>$verid,
|
|
||||||
'hlID'=>$hlNum,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'add_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'expire_datetime'=>date('Y-m-d H:i:s', strtotime('+90 day', $time)),
|
|
||||||
'activation_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'partnerID'=>$partnerID,
|
|
||||||
'enabled'=>'Y',
|
|
||||||
'computer_id'=>$compid);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`nonprofit`",$nonprofit);
|
|
||||||
|
|
||||||
//Namirial non-profit kód aktiválás beszúrása crm -> u_history táblába
|
|
||||||
$esemeny=array(
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'nTopicID'=>366,
|
|
||||||
'dateEvent'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'strPlace'=>'',
|
|
||||||
'strInfo'=>'Namirial nonprofit kulcs aktiválás',
|
|
||||||
'nManagerID'=>36,
|
|
||||||
'insertDate'=>date('Y-m-d H:i:s',$time));
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_history`",$esemeny);
|
|
||||||
|
|
||||||
$hardlock=array(
|
|
||||||
'hlNum'=>$hlNum,
|
|
||||||
'hlCtrID'=>39,
|
|
||||||
'hlLan'=>0,
|
|
||||||
'hlStat'=>1,
|
|
||||||
'hlDateIssue'=>date('Y-m-d',$time),
|
|
||||||
'hlManID'=>36,
|
|
||||||
'hlTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'hlUser'=>$userID,
|
|
||||||
'hlDealer'=>62103,
|
|
||||||
'bUjithato'=>1,
|
|
||||||
'old_db'=>'clusers_eng');
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`hardlock`",$hardlock);
|
|
||||||
|
|
||||||
$program=array(
|
|
||||||
'prTypeID'=>$type,
|
|
||||||
'prVerID'=>$ver['verID'],
|
|
||||||
'prLan'=>0,
|
|
||||||
'prPass'=>trim($pass),
|
|
||||||
'prSellDate'=>date('Y-m-d',$time),
|
|
||||||
'prActDate'=>date('Y-m-d',$time+$interval*86400), // 90 nap
|
|
||||||
'prFizetve'=>date('Y-m-d',$time+$interval*86400),
|
|
||||||
'prActCode'=>trim($aktKod),
|
|
||||||
'prTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prLastMod'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prContact'=>8, // Non-profit
|
|
||||||
'prHlNum'=>$hlNum, // 99xxxx
|
|
||||||
'prManID'=>36, // web
|
|
||||||
'prStat'=>0,
|
|
||||||
'prHiType'=>1, // 1 Rendelés | 2 Típus Váltás | 3 Frissítés | 4 Auto Friss.
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`h_programs`",$program);
|
|
||||||
|
|
||||||
$pwd = $pass; //ba 2018.07.02. mostantol az uj jelszava a usernek a most generalt, 94-es lesz, nem pedig a 93-as!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba ehhez a gephez mar volt non-profit regisztracio, keressuk ki a sorozatszamot neki
|
|
||||||
$hardlockID = $res[0]['hlID'];
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prHlNum='{$hardlockID}' limit 1");
|
|
||||||
$programQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$pwd = $programQuery[0]['prPass'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*******************************************************************************
|
|
||||||
*BIMLadder-es automata kulcskiadás és program létrehozás
|
|
||||||
******************************************************************************/
|
|
||||||
else if (isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='kbl' && isset($idokod) && $idokod>'' && isset($pwd) && $pwd>'')
|
|
||||||
{
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid."' AND partnerID = 'kbl' LIMIT 1;");
|
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
//ba nincs ehhez a gephez meg non-profit program regisztralva
|
|
||||||
if (empty($res))
|
|
||||||
{
|
|
||||||
$hlNum=tryToAlloc($BIMLadderRangeMin,$BIMLadderRangeMax);
|
|
||||||
$arrIdokod=explode("-", $idokod);
|
|
||||||
$isid=$arrIdokod[1];
|
|
||||||
$type=substr($pwd, 6, 1);
|
|
||||||
$verid=substr($pwd, 7, 2);
|
|
||||||
$ver=$version->getVersion(array('verPassword8and9'=>$verid));
|
|
||||||
$interval=30; //ba !!! nem 90!!!
|
|
||||||
$pass=generatePassword($hlNum,0,$type,$ver['verCode']);
|
|
||||||
$aktKod=generateTimeCode($pass,$isid,$interval);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`u_emails` WHERE `email`='{$email}' LIMIT 1;");
|
|
||||||
$exist=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
if (!$exist) //ba elsodleges szempont, hogy a megadott email cimmel van-e crm bejegyzes
|
|
||||||
{
|
|
||||||
//ba felvesszuk a user-t
|
|
||||||
$userdata=array(
|
|
||||||
'strName'=>$name,
|
|
||||||
'strEMail'=>$email,
|
|
||||||
'strCompany'=>$company,
|
|
||||||
'strTel'=>$phone,
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'nCtrID'=>82,
|
|
||||||
'dateInsert'=>$time);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`users`",$userdata);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT nUserID as nUserID FROM `".CRMADATBAZIS."`.`users` WHERE strEMail='{$email}' AND strName='{$name}' limit 1");
|
|
||||||
$userQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$userID = $userQuery[0]['nUserID'];
|
|
||||||
|
|
||||||
//ba felvesszuk az email cimet a userhez
|
|
||||||
$emaildata=array(
|
|
||||||
'email'=>$email,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'newsletter'=>$newsletter
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_emails`",$emaildata);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba a meglevo userhez fogjuk kotni a programot
|
|
||||||
$userID=$exist[0]['nUserID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//ba regisztraljuk hozza a non-profit programot
|
|
||||||
$nonprofit=array(
|
|
||||||
'isid'=>$isid,
|
|
||||||
'verid'=>$verid,
|
|
||||||
'hlID'=>$hlNum,
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'add_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'expire_datetime'=>date('Y-m-d H:i:s', strtotime('+30 day', $time)), //ba 30 nap!!!!
|
|
||||||
'activation_datetime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'old_db'=>'clusers_eng',
|
|
||||||
'partnerID'=>$partnerID,
|
|
||||||
'enabled'=>'Y',
|
|
||||||
'computer_id'=>$compid);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`nonprofit`",$nonprofit);
|
|
||||||
|
|
||||||
//BIMLadder non-profit kód aktiválás beszúrása crm -> u_history táblába
|
|
||||||
$esemeny=array(
|
|
||||||
'nUserID'=>$userID,
|
|
||||||
'nTopicID'=>368,
|
|
||||||
'dateEvent'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'strPlace'=>'',
|
|
||||||
'strInfo'=>'BIMLadder nonprofit kulcs aktiválás',
|
|
||||||
'nManagerID'=>36,
|
|
||||||
'insertDate'=>date('Y-m-d H:i:s',$time));
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`u_history`",$esemeny);
|
|
||||||
|
|
||||||
$hardlock=array(
|
|
||||||
'hlNum'=>$hlNum,
|
|
||||||
'hlCtrID'=>82,
|
|
||||||
'hlLan'=>0,
|
|
||||||
'hlStat'=>1,
|
|
||||||
'hlDateIssue'=>date('Y-m-d',$time),
|
|
||||||
'hlManID'=>36,
|
|
||||||
'hlTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'hlUser'=>$userID,
|
|
||||||
'hlDealer'=>62103,
|
|
||||||
'bUjithato'=>1,
|
|
||||||
'old_db'=>'clusers_eng');
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`hardlock`",$hardlock);
|
|
||||||
|
|
||||||
$program=array(
|
|
||||||
'prTypeID'=>$type,
|
|
||||||
'prVerID'=>$ver['verID'],
|
|
||||||
'prLan'=>0,
|
|
||||||
'prPass'=>trim($pass),
|
|
||||||
'prSellDate'=>date('Y-m-d',$time),
|
|
||||||
'prActDate'=>date('Y-m-d',$time+$interval*86400), // 90 nap helyett 30 nap!!!!
|
|
||||||
'prFizetve'=>date('Y-m-d',$time+$interval*86400),
|
|
||||||
'prActCode'=>trim($aktKod),
|
|
||||||
'prTime'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prLastMod'=>date('Y-m-d H:i:s',$time),
|
|
||||||
'prContact'=>9,
|
|
||||||
'prHlNum'=>$hlNum, // 99xxxx
|
|
||||||
'prManID'=>36, // web
|
|
||||||
'prStat'=>0,
|
|
||||||
'prHiType'=>1, // 1 Rendelés | 2 Típus Váltás | 3 Frissítés | 4 Auto Friss.
|
|
||||||
);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`h_programs`",$program);
|
|
||||||
|
|
||||||
$pwd = $pass; //ba 2018.11.26. mostantol az uj jelszava a usernek a most generalt, 92-es lesz, nem pedig a 91-es!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//ba ehhez a gephez mar volt non-profit regisztracio, keressuk ki a sorozatszamot neki
|
|
||||||
$hardlockID = $res[0]['hlID'];
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prHlNum='{$hardlockID}' limit 1");
|
|
||||||
$programQuery=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
$pwd = $programQuery[0]['prPass'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//insert stats to the userstats table
|
|
||||||
|
|
||||||
$stats = array(
|
|
||||||
'usLang' => $user_lang_db,
|
|
||||||
'usDate' => time(),
|
|
||||||
'usPwd' => $pwd,
|
|
||||||
'usVer'=>substr($pwd,7,2),
|
|
||||||
'usCompID' => $compID,
|
|
||||||
'usCtrID' => $ctrID,
|
|
||||||
'usBuild' => $build,
|
|
||||||
'usCtrName' => $ctrname,
|
|
||||||
'usIP' => $user_IP,
|
|
||||||
'usOSData' => $osdata,
|
|
||||||
// 'usISID' => $isid,
|
|
||||||
);
|
|
||||||
|
|
||||||
$liveKey = $version->isLiveKey($pwd) == 'true'; // Live kulcs 2019
|
|
||||||
$softwareKey = $version->isSoftwareKey($pwd) == 'true'; // Software kulcs 2019
|
|
||||||
|
|
||||||
if($softwareKey)
|
|
||||||
$stats['usISID'] = substr($idokod, 5, 4);
|
|
||||||
|
|
||||||
if (trim($usGCMan)>'' && trim($usGCType)>'' && trim($usGCDriverVer)>'')
|
|
||||||
{
|
|
||||||
$arrGCData=array(
|
|
||||||
'usGCMan'=>trim($usGCMan), // graphic card manufacture
|
|
||||||
'usGCType'=>trim($usGCType), // graphic card type
|
|
||||||
'usGCDriverVer'=>trim($usGCDriverVer), // graphic card driver version
|
|
||||||
);
|
|
||||||
|
|
||||||
$stats['usGCMan']=$arrGCData['usGCMan'];
|
|
||||||
$stats['usGCType']=$arrGCData['usGCType'];
|
|
||||||
$stats['usGCDriverVer']=$arrGCData['usGCDriverVer'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($softwareKey)
|
|
||||||
{
|
|
||||||
if($liveKey || in_array(substr($pwd,0,2), array('99','98','95')) ) // Azok a programok, amik regisztrálódnak a CRM-ben 2019
|
|
||||||
{
|
|
||||||
$msh->query("SELECT hlCtrID FROM ".CRMADATBAZIS.".hardlock WHERE hlNum='".substr($pwd,0,6)."'");
|
|
||||||
$res=$msh->fetchAssoc();
|
|
||||||
$hlnum=$res[0];
|
|
||||||
if(isset($hlnum['hlCtrID'])) $stats['usHlCtrID'] = $hlnum['hlCtrID'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$stats['usHlCtrID'] = substr($pwd,0,2);
|
|
||||||
}
|
|
||||||
|
|
||||||
$msh2->insert('userstats2013',$stats);
|
|
||||||
$usstatid=$msh2->getInsertedId();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {print "haha"; die();}
|
|
||||||
$rec=array(
|
|
||||||
'hiba'=>"Valami hianyzik: {$pwd}\nlang: {$user_lang_db}\nverzio: {$user_version}\nssID: {$user_ssID}",
|
|
||||||
'datum'=>date('Y-m-d H:i:s',time())
|
|
||||||
);
|
|
||||||
$msh2->insert('a_hibak',$rec);
|
|
||||||
}
|
|
||||||
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {var_dump($pwd); die();}
|
|
||||||
|
|
||||||
//loading the xml tips if necessary
|
|
||||||
if(!$settings)
|
|
||||||
{
|
|
||||||
print('Unable to load the corresponding settings.xml file!');
|
|
||||||
$rec=array(
|
|
||||||
'hiba'=>"beallitas hianyzik: {$pwd}\nlang: {$user_lang_db}\nverzio: {$user_version}\nssID: {$user_ssID}",
|
|
||||||
'datum'=>date('Y-m-d H:i:s',time())
|
|
||||||
);
|
|
||||||
// if($_SERVER['REMOTE_ADDR'] == "188.36.217.1") var_dump($rec);
|
|
||||||
$msh2->insert('a_hibak',$rec);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(substr($pwd,7,2)>29 && substr($pwd,0,2)!='96')
|
|
||||||
{
|
|
||||||
$isid=($softwareKey ? substr($idokod,5,4) : substr($pwd,0,2).substr($pwd,7,2));
|
|
||||||
$kulcsszam = substr($pwd,0,6);
|
|
||||||
|
|
||||||
$msh->query("SELECT hlStat,hlUser FROM `".CRMADATBAZIS."`.`hardlock` WHERE hlNum='{$kulcsszam}'");
|
|
||||||
$res=$msh->fetchAssoc();
|
|
||||||
$kulcs=$res[0];
|
|
||||||
|
|
||||||
$aktivalokod = $version->ujaktivalasikod2($pwd,$isid,$idokod);
|
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='188.6.239.155') {var_dump($aktivalokod); die();}
|
|
||||||
if (in_array((int)substr($pwd,0,3),array(995,996,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989)) && (int)$kulcs['hlUser']>0) // nonprofitos program első indítása
|
|
||||||
{
|
|
||||||
$msh->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`h_aktivalas_infok` WHERE kulcs='".$kulcsszam."';");
|
|
||||||
$tmp=$msh->fetchAssoc();
|
|
||||||
$darab=(int)$tmp[0]['darab'];
|
|
||||||
|
|
||||||
$msh->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`u_history` WHERE `nUserID`=".(int)$kulcs['hlUser']." AND nTopicID IN (314,315);");
|
|
||||||
$tmp=$msh->fetchAssoc();
|
|
||||||
$esem=(int)$tmp[0]['darab'];
|
|
||||||
|
|
||||||
$msh->query("SELECT * FROM `".CRMADATBAZIS."`.`users` WHERE nUserID='".(int)$kulcs['hlUser']."';");
|
|
||||||
$usr=$msh->fetchAssoc();
|
|
||||||
$usr=$usr[0];
|
|
||||||
|
|
||||||
if (!empty($usr) && ($darab==0 || $esem==0))
|
|
||||||
{
|
|
||||||
$msh->insert("`".CRMADATBAZIS."`.`u_history`",array(
|
|
||||||
'nUserID'=>(int)$kulcs['hlUser'],
|
|
||||||
'nTopicID'=>($usr['old_db']=='clusers' ? 314 : 315),
|
|
||||||
'dateEvent'=>date('Y-m-d'),
|
|
||||||
'strPlace'=>'web',
|
|
||||||
'strInfo'=>($usr['old_db']=='clusers' ? 'Non-profit kód regisztráció' : 'Non-profit code registration').': '.$kulcsszam,
|
|
||||||
'nManagerID'=>36,
|
|
||||||
'insertDate'=>date('Y-m-d H:i:s'),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$virtualization = ($kulcs['hlStat']=='2' ? "false" : "true"); // letiltott kulcs visszajelzése a programnak
|
|
||||||
|
|
||||||
$valasz = ($aktivalokod!="") ? $aktivalokod : "(( nem kapott valaszt ))";
|
|
||||||
$version->_hibajelento("tips",substr($pwd,0,6),"programinditas - pw: {$pwd}, build: {$build}, isid: {$isid}, időkód: {$idokod}, valasz: ".$valasz,(isset($arrGCData)?$arrGCData:array()),(isset($usstatid)?$usstatid:NULL));
|
|
||||||
|
|
||||||
if(is_numeric($usstatid)) $msh2->update("userstats2013",array('valasz'=>$valasz),array('usID'=>$usstatid));
|
|
||||||
}
|
|
||||||
|
|
||||||
//logFilter
|
|
||||||
$logfilter=0;
|
|
||||||
if ($pwd>0)
|
|
||||||
{
|
|
||||||
$msh->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE `prPass`='".$pwd."' LIMIT 1;");
|
|
||||||
$res=$msh->fetchAssoc();
|
|
||||||
$logfilter=$res[0]['prLogFilter'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$verid=substr($pwd, 7, 2);
|
|
||||||
if($verid >= 36){
|
|
||||||
$hlnum = substr($pwd,0,6);
|
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`hardlock_computers` WHERE hlNum='".$hlnum."' AND computer_id='".$compid."' LIMIT 1;");
|
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
|
||||||
|
|
||||||
if(empty($res)){
|
|
||||||
$comp=array(
|
|
||||||
'hlNum'=>$hlnum,
|
|
||||||
'computer_id'=>$compid);
|
|
||||||
MySqlHelper::getInstance()->insert("`".CRMADATBAZIS."`.`hardlock_computers`",$comp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if ($_SERVER['REMOTE_ADDR']!='46.139.109.235') return; //ba hibás válaszok ideiglenes kikötése
|
|
||||||
|
|
||||||
header('Content-Type: text/xml; charset=utf-8');
|
|
||||||
header('Content-Disposition: inline; filename=response.xml');
|
|
||||||
|
|
||||||
print '<'.'?'.'xml version="1.0" encoding="UTF-8" standalone="yes"'.'?'.'>
|
|
||||||
<Tips>
|
|
||||||
<Tip lang="'.$settings->lang.'" version="'.$settings->version.'">
|
|
||||||
<path>'.str_replace('..','',$mtips->tips_src).$settings->lang.'/'.'</path>
|
|
||||||
</Tip>
|
|
||||||
'.((isset($aktivalokod) && $aktivalokod) ? '<actcode>'.$aktivalokod.'</actcode>' : '').'
|
|
||||||
'.((isset($virtualization) && $virtualization) ? '<Virtualization>'.$virtualization.'</Virtualization>' : '').'
|
|
||||||
'.((isset($usstatid) && (int)$usstatid>0) ? '<actid>'.(int)$usstatid.'</actid>' : '').'
|
|
||||||
<logfilter>'.$logfilter.'</logfilter>
|
|
||||||
<loginEnabled>'.($kulcsszam=='360006' ? 'true' : 'false').'</loginEnabled>
|
|
||||||
</Tips>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -1,49 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.0" method="upgrade">
|
<extension type="component" version="3.0" method="upgrade">
|
||||||
<name>com_alworkshops</name>
|
<name>com_alworkshops</name>
|
||||||
<creationDate>2017-04-14</creationDate>
|
<creationDate>2017-04-14</creationDate>
|
||||||
<copyright>2017 Zsolt Fekete</copyright>
|
<copyright>2017 Zsolt Fekete</copyright>
|
||||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||||
<author>Zsolt Fekete</author>
|
<author>Zsolt Fekete</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>https://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>https://www.facebook.com/mcleod78</authorUrl>
|
||||||
<version>CVS: 1.0.0</version>
|
<version>CVS: 1.0.0</version>
|
||||||
<description>Manage workshops</description>
|
<description>Manage workshops</description>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
<menu img="" link="option=com_alworkshops">COM_ALWORKSHOPS</menu>
|
<menu img="" link="option=com_alworkshops">COM_ALWORKSHOPS</menu>
|
||||||
<submenu>
|
<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_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_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_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_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_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>
|
<menu img="" alt="COM_ALWORKSHOPS_ONLINE_SESSIONS" view="onlinesession" link="option=com_alworkshops&view=onlinesession">COM_ALWORKSHOPS_ONLINE_SESSIONS</menu>
|
||||||
</submenu>
|
</submenu>
|
||||||
|
|
||||||
<files folder="administrator">
|
<files folder="administrator">
|
||||||
<filename>access.xml</filename>
|
<filename>access.xml</filename>
|
||||||
<filename>config.xml</filename>
|
<filename>config.xml</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>alworkshops.php</filename>
|
<filename>alworkshops.php</filename>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
<folder>helpers</folder>
|
<folder>helpers</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
</files>
|
</files>
|
||||||
<languages folder="languages/administrator">
|
<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.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.com_alworkshops.sys.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.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.com_alworkshops.sys.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.com_alworkshops.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
</administration>
|
</administration>
|
||||||
<config>
|
<config>
|
||||||
<fields name="params">
|
<fields name="params">
|
||||||
<fieldset name="component">
|
<fieldset name="component">
|
||||||
<field name="save_history" default="0" />
|
<field name="save_history" default="0" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fields>
|
</fields>
|
||||||
</config>
|
</config>
|
||||||
</extension>
|
</extension>
|
||||||
|
|||||||
@ -1,95 +1,95 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
define('TABLE', '`aleducation_courses`');
|
define('TABLE', '`aleducation_courses`');
|
||||||
|
|
||||||
class Controller extends BaseController
|
class Controller extends BaseController
|
||||||
{
|
{
|
||||||
public $pf = 'EducationController';
|
public $pf = 'EducationController';
|
||||||
public $lang;
|
public $lang;
|
||||||
|
|
||||||
public function procEvent()
|
public function procEvent()
|
||||||
{
|
{
|
||||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"]) == "") $_SESSION[$this->pf]["_POST"] = $_POST;
|
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';
|
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder']) == '') $_SESSION[$this->pf]['tableorder'] = 's.id DESC';
|
||||||
|
|
||||||
$se = &$_SESSION[$this->pf]['_POST'];
|
$se = &$_SESSION[$this->pf]['_POST'];
|
||||||
$felt = " AND `lang`='" . ($this->getLang() == 'hu-HU' ? 'hun' : 'eng') . "' ";
|
$felt = " AND `lang`='" . ($this->getLang() == 'hu-HU' ? 'hun' : 'eng') . "' ";
|
||||||
$arrIcons = array(
|
$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")),
|
'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")),
|
'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"),
|
'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");
|
$_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']) > '') {
|
if (isset($_POST[$this->pf . '_event']) and trim($_POST[$this->pf . '_event']) > '') {
|
||||||
$event = trim(strtolower(addslashes((string)$_POST[$this->pf . '_event'])));
|
$event = trim(strtolower(addslashes((string)$_POST[$this->pf . '_event'])));
|
||||||
$value = trim(strtolower(addslashes((string)$_POST[$this->pf . '_value'])));
|
$value = trim(strtolower(addslashes((string)$_POST[$this->pf . '_value'])));
|
||||||
if ((int)$value > 0) {
|
if ((int)$value > 0) {
|
||||||
switch ($event) {
|
switch ($event) {
|
||||||
case 'enable': {
|
case 'enable': {
|
||||||
MySqlHelper::getInstance()->query("UPDATE " . TABLE . " SET published='Y' WHERE id=" . $value);
|
MySqlHelper::getInstance()->query("UPDATE " . TABLE . " SET published='Y' WHERE id=" . $value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'disable': {
|
case 'disable': {
|
||||||
MySqlHelper::getInstance()->query("UPDATE " . TABLE . " SET published='N' WHERE id=" . $value);
|
MySqlHelper::getInstance()->query("UPDATE " . TABLE . " SET published='N' WHERE id=" . $value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($se['sid']) && $se['sid'] > "") {
|
if (isset($se['sid']) && $se['sid'] > "") {
|
||||||
if (strpos($se['sid'], "-")) {
|
if (strpos($se['sid'], "-")) {
|
||||||
$reszek = explode("-", $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]);
|
$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 {
|
} else {
|
||||||
$felt .= " AND id=" . (int)$se['sid'];
|
$felt .= " AND id=" . (int)$se['sid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($se['tipus']) && $se['tipus'] != 'mind') $felt .= " AND `" . $se['tipus'] . "`='Y'";
|
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']) . "%' ";
|
if (isset($se['alias']) && $se['alias'] > "") $felt .= " AND alias LIKE '%" . trim($se['alias']) . "%' ";
|
||||||
|
|
||||||
$objTabla = new TableHelper();
|
$objTabla = new TableHelper();
|
||||||
$objTabla->setParams(array('prefix' => $this->pf, 'tablewidth' => '100%', 'tablediv' => 'tablediv'));
|
$objTabla->setParams(array('prefix' => $this->pf, 'tablewidth' => '100%', 'tablediv' => 'tablediv'));
|
||||||
$v = $objTabla->setSession();
|
$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('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->setColumn('options', array('header' => $_LANG['COM_ALWORKSHOPS_OPTIONS'], 'align' => 'right', 'width' => '70px', 'order' => false, 'addicons' => $arrIcons, 'linkjoin' => 'id'));
|
||||||
$objTabla->setQuery(array(
|
$objTabla->setQuery(array(
|
||||||
"
|
"
|
||||||
SELECT id, title, url, image, published, CONCAT(IF(published='N','smallDisable','smallEnable'),'|','smallEdit') AS options FROM " . TABLE . " s WHERE 1 " . $felt
|
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['tableorder']) and $v['tableorder'] > '') ? ' ORDER BY ' . $v['tableorder'] : '')
|
||||||
. ((isset($v['tableipp'])) ? ' LIMIT ' . ($v['tableipp'] > 0 ? ($v['tablepage'] - 1) * $v['tableipp'] : 0) . ',' . $v['tableipp'] : ''), "
|
. ((isset($v['tableipp'])) ? ' LIMIT ' . ($v['tableipp'] > 0 ? ($v['tablepage'] - 1) * $v['tableipp'] : 0) . ',' . $v['tableipp'] : ''), "
|
||||||
SELECT COUNT(*) AS recordCount
|
SELECT COUNT(*) AS recordCount
|
||||||
FROM (
|
FROM (
|
||||||
SELECT id, title, url, image, published, CONCAT(IF(published='N','smallDisable','smallEnable'),'|','smallEdit') AS options FROM " . TABLE . " s WHERE 1 " . $felt . ") z;"
|
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);
|
//print_r($objTabla->arrQuery);
|
||||||
$objTabla->drawTable(TRUE);
|
$objTabla->drawTable(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) {
|
if (!isset($this->lang)) {
|
||||||
$this->lang = (strpos($_SERVER['HTTP_HOST'], ".com") ? "en-GB" : "hu-HU");
|
$this->lang = (strpos($_SERVER['HTTP_HOST'], ".com") ? "en-GB" : "hu-HU");
|
||||||
}
|
}
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$controller = new Controller();
|
$controller = new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery("#refresh").attr('value', '');
|
jQuery("#refresh").attr('value', '');
|
||||||
<?php if (!isset($_POST['nojs'])) : ?>
|
<?php if (!isset($_POST['nojs'])) : ?>
|
||||||
jQuery("#title").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["title"] ?>');
|
jQuery("#title").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["title"] ?>');
|
||||||
jQuery("#sid").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["sid"] ?>');
|
jQuery("#sid").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["sid"] ?>');
|
||||||
jQuery("input[name=published]").each(function() {
|
jQuery("input[name=published]").each(function() {
|
||||||
if (jQuery(this).val() == '<?= $_SESSION[$controller->pf]["_POST"]["published"] ?>') {
|
if (jQuery(this).val() == '<?= $_SESSION[$controller->pf]["_POST"]["published"] ?>') {
|
||||||
jQuery(this).attr('checked', 'checked');
|
jQuery(this).attr('checked', 'checked');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</script>
|
</script>
|
||||||
@ -1,130 +1,130 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
define('TABLE','`alworkshops_online_sessions`');
|
define('TABLE','`alworkshops_online_sessions`');
|
||||||
|
|
||||||
class Controller extends BaseController {
|
class Controller extends BaseController {
|
||||||
public $pf='OnlineSessionController';
|
public $pf='OnlineSessionController';
|
||||||
public $lang;
|
public $lang;
|
||||||
public $targetdiv='tablediv';
|
public $targetdiv='tablediv';
|
||||||
|
|
||||||
public function procEvent()
|
public function procEvent()
|
||||||
{
|
{
|
||||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||||
if (isset($_POST['targetdiv'])) $this->targetdiv=$_POST['targetdiv'];
|
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';
|
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='s.id DESC';
|
||||||
|
|
||||||
$se=&$_SESSION[$this->pf]['_POST'];
|
$se=&$_SESSION[$this->pf]['_POST'];
|
||||||
|
|
||||||
if($this->getLang() == 'hu-HU') {
|
if($this->getLang() == 'hu-HU') {
|
||||||
$webinar = "webinariumok";
|
$webinar = "webinariumok";
|
||||||
} else {
|
} else {
|
||||||
$webinar = "webinars";
|
$webinar = "webinars";
|
||||||
}
|
}
|
||||||
$felt=" AND c.`alias`='{$webinar}' ";
|
$felt=" AND c.`alias`='{$webinar}' ";
|
||||||
|
|
||||||
$arrIcons=array(
|
$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") ),
|
'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") ),
|
'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" ),
|
'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");
|
$_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'])>'')
|
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||||
{
|
{
|
||||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||||
if ((int)$value>0)
|
if ((int)$value>0)
|
||||||
{
|
{
|
||||||
switch ($event)
|
switch ($event)
|
||||||
{
|
{
|
||||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value);break; }
|
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 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value);break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($se['sid']) && $se['sid']>"")
|
if (isset($se['sid']) && $se['sid']>"")
|
||||||
{
|
{
|
||||||
if (strpos($se['sid'], "-"))
|
if (strpos($se['sid'], "-"))
|
||||||
{
|
{
|
||||||
$reszek=explode("-", $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]);
|
$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
|
else
|
||||||
{
|
{
|
||||||
$felt.=" AND id=".(int)$se['sid'];
|
$felt.=" AND id=".(int)$se['sid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($se['wid']) && $se['wid']>"")
|
if (isset($se['wid']) && $se['wid']>"")
|
||||||
{
|
{
|
||||||
if (strpos($se['wid'], "-"))
|
if (strpos($se['wid'], "-"))
|
||||||
{
|
{
|
||||||
$reszek=explode("-", $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]);
|
$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
|
else
|
||||||
{
|
{
|
||||||
$felt.=" AND courseid=".(int)$se['wid'];
|
$felt.=" AND courseid=".(int)$se['wid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($se['title']) && $se['title']>"") $felt.=" AND title LIKE '%".trim($se['title'])."%' ";
|
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['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['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']."'";
|
if (isset($se['published']) && $se['published']!='A') $felt.=" AND published='".$se['published']."'";
|
||||||
|
|
||||||
$objTabla=New TableHelper();
|
$objTabla=New TableHelper();
|
||||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
||||||
$v=$objTabla->setSession();
|
$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('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('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('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('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('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('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('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('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('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->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'70px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||||
$objTabla->setQuery(array("
|
$objTabla->setQuery(array("
|
||||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||||
FROM alworkshops_online_sessions s
|
FROM alworkshops_online_sessions s
|
||||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||||
WHERE 1 ".$felt
|
WHERE 1 ".$felt
|
||||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
.((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'] : ''),"
|
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||||
SELECT COUNT(*) AS recordCount
|
SELECT COUNT(*) AS recordCount
|
||||||
FROM (
|
FROM (
|
||||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||||
FROM alworkshops_online_sessions s
|
FROM alworkshops_online_sessions s
|
||||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||||
WHERE 1 ".$felt.") z;"
|
WHERE 1 ".$felt.") z;"
|
||||||
));
|
));
|
||||||
$objTabla->drawTable(TRUE);
|
$objTabla->drawTable(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$controller=new Controller();
|
$controller=new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery("#refresh").attr('value','');
|
jQuery("#refresh").attr('value','');
|
||||||
<?php if (!isset($_POST['nojs'])):?>
|
<?php if (!isset($_POST['nojs'])):?>
|
||||||
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
||||||
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
||||||
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
||||||
jQuery("#description").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["description"]?>');
|
jQuery("#description").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["description"]?>');
|
||||||
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
||||||
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
||||||
jQuery("input[name=published]").each(function() {
|
jQuery("input[name=published]").each(function() {
|
||||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
||||||
});
|
});
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,130 +1,130 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
define('TABLE','`alworkshops_sessions`');
|
define('TABLE','`alworkshops_sessions`');
|
||||||
|
|
||||||
class Controller extends BaseController {
|
class Controller extends BaseController {
|
||||||
public $pf='SessionController';
|
public $pf='SessionController';
|
||||||
public $lang;
|
public $lang;
|
||||||
public $targetdiv='tablediv';
|
public $targetdiv='tablediv';
|
||||||
|
|
||||||
public function procEvent()
|
public function procEvent()
|
||||||
{
|
{
|
||||||
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
if (isset($_POST) && !empty($_POST) && trim($_POST["refresh"])=="") $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||||
if (isset($_POST['targetdiv'])) $this->targetdiv=$_POST['targetdiv'];
|
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';
|
if (!isset($_SESSION[$this->pf]['tableorder']) || trim($_SESSION[$this->pf]['tableorder'])=='' ) $_SESSION[$this->pf]['tableorder']='s.id DESC';
|
||||||
|
|
||||||
$se=&$_SESSION[$this->pf]['_POST'];
|
$se=&$_SESSION[$this->pf]['_POST'];
|
||||||
$felt=" AND sw.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ";
|
$felt=" AND sw.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ";
|
||||||
|
|
||||||
$arrIcons=array(
|
$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") ),
|
'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") ),
|
'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" ),
|
'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");
|
$_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'])>'')
|
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||||
{
|
{
|
||||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||||
if ((int)$value>0)
|
if ((int)$value>0)
|
||||||
{
|
{
|
||||||
switch ($event)
|
switch ($event)
|
||||||
{
|
{
|
||||||
case 'enable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='Y' WHERE id=".$value);break; }
|
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 'disable' : { MySqlHelper::getInstance()->query("UPDATE ".TABLE." SET published='N' WHERE id=".$value);break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($se['sid']) && $se['sid']>"")
|
if (isset($se['sid']) && $se['sid']>"")
|
||||||
{
|
{
|
||||||
if (strpos($se['sid'], "-"))
|
if (strpos($se['sid'], "-"))
|
||||||
{
|
{
|
||||||
$reszek=explode("-", $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]);
|
$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
|
else
|
||||||
{
|
{
|
||||||
$felt.=" AND id=".(int)$se['sid'];
|
$felt.=" AND id=".(int)$se['sid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($se['wid']) && $se['wid']>"")
|
if (isset($se['wid']) && $se['wid']>"")
|
||||||
{
|
{
|
||||||
if (strpos($se['wid'], "-"))
|
if (strpos($se['wid'], "-"))
|
||||||
{
|
{
|
||||||
$reszek=explode("-", $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]);
|
$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
|
else
|
||||||
{
|
{
|
||||||
$felt.=" AND courseid=".(int)$se['wid'];
|
$felt.=" AND courseid=".(int)$se['wid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($se['title']) && $se['title']>"") $felt.=" AND title LIKE '%".trim($se['title'])."%' ";
|
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['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['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['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']."'";
|
if (isset($se['published']) && $se['published']!='A') $felt.=" AND published='".$se['published']."'";
|
||||||
$felt .= " GROUP BY id";
|
$felt .= " GROUP BY id";
|
||||||
|
|
||||||
$objTabla=New TableHelper();
|
$objTabla=New TableHelper();
|
||||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>$this->targetdiv));
|
||||||
$v=$objTabla->setSession();
|
$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('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('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('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('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('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('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('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('duration',array('header'=>$_LANG['COM_ALWORKSHOPS_DURATION'],'align'=>'center','width'=>'60px'));
|
||||||
$objTabla->setColumn('description',array('header'=>$_LANG['COM_ALWORKSHOPS_SESSIONDESC']));
|
$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('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('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->setColumn('options',array('header'=>$_LANG['COM_ALWORKSHOPS_OPTIONS'],'align'=>'right','width'=>'70px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||||
$objTabla->setQuery(array("
|
$objTabla->setQuery(array("
|
||||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||||
FROM alworkshops_sessions s
|
FROM alworkshops_sessions s
|
||||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||||
LEFT OUTER JOIN alworkshops_switch sw ON sw.alias=c.alias
|
LEFT OUTER JOIN alworkshops_switch sw ON sw.alias=c.alias
|
||||||
WHERE 1 ".$felt
|
WHERE 1 ".$felt
|
||||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
.((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'] : ''),"
|
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||||
SELECT COUNT(*) AS recordCount
|
SELECT COUNT(*) AS recordCount
|
||||||
FROM (
|
FROM (
|
||||||
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
SELECT s.*,CONCAT(IF(s.published='N','smallDisable','smallEnable'),'|','smallEdit') AS options
|
||||||
FROM alworkshops_sessions s
|
FROM alworkshops_sessions s
|
||||||
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
LEFT OUTER JOIN alworkshops_courses c ON c.id=s.courseid
|
||||||
LEFT OUTER JOIN alworkshops_switch sw ON sw.alias=c.alias
|
LEFT OUTER JOIN alworkshops_switch sw ON sw.alias=c.alias
|
||||||
WHERE 1 ".$felt.") z;"
|
WHERE 1 ".$felt.") z;"
|
||||||
));
|
));
|
||||||
$objTabla->drawTable(TRUE);
|
$objTabla->drawTable(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "en-GB" : "hu-HU"); }
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$controller=new Controller();
|
$controller=new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery("#refresh").attr('value','');
|
jQuery("#refresh").attr('value','');
|
||||||
<?php if (!isset($_POST['nojs'])):?>
|
<?php if (!isset($_POST['nojs'])):?>
|
||||||
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
jQuery("#title").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["title"]?>');
|
||||||
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
jQuery("#sid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["sid"]?>');
|
||||||
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
jQuery("#wid").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["wid"]?>');
|
||||||
jQuery("#description").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["description"]?>');
|
jQuery("#description").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["description"]?>');
|
||||||
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
jQuery("#start_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["start_date"]?>');
|
||||||
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
jQuery("#finish_date").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["finish_date"]?>');
|
||||||
jQuery("input[name=published]").each(function() {
|
jQuery("input[name=published]").each(function() {
|
||||||
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
if (jQuery(this).val()=='<?=$_SESSION[$controller->pf]["_POST"]["published"]?>') { jQuery(this).attr('checked','checked'); }
|
||||||
});
|
});
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,86 +1,86 @@
|
|||||||
#j-sidebar-container {display:inline-block;vertical-align:top;width:14.5%;height:300px;border:0px solid #000000;}
|
#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 {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 .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 {width:100%;border-spacing:1px;background-color:#e7e7e7;color:#666;}
|
||||||
#j-main-container table.adminlist td,
|
#j-main-container table.adminlist td,
|
||||||
#j-main-container table.adminlist th {padding:4px;}
|
#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 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 a:hover { text-decoration: none; }
|
||||||
#j-main-container table.adminlist thead th img { vertical-align: middle; }
|
#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 th { font-weight: bold; }
|
||||||
#j-main-container table.adminlist tbody tr { background-color: #fff; text-align: left; }
|
#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.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.row0:hover td,
|
||||||
#j-main-container table.adminlist tbody tr.row1:hover td { background-color: #ffd ; }
|
#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 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 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 tr { text-align: center; color: #333; }
|
||||||
#j-main-container table.adminlist tfoot td,
|
#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 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 { 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 table.adminlist td.order span { float: left; display: block; width: 20px; text-align: center; }
|
||||||
|
|
||||||
.j-sidebar-container.j-sidebar-hidden {
|
.j-sidebar-container.j-sidebar-hidden {
|
||||||
margin-left: 2vw !important;
|
margin-left: 2vw !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#j-main-container .clear {clear:both;margin:0px;padding:0px;height:0px;width:0px;}
|
#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 {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 {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 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 input[type="text"],
|
||||||
#j-main-container div.hasab div.inputholder select {display:inline;margin:0px;width:190px;}
|
#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 textarea {width:320px;height:260px;}
|
||||||
#j-main-container div.hasab div.inputholder input[type="file"] {width:190px;}
|
#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 {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;}
|
#j-main-container div.hasab div.inputholder fieldset label {width:50px;font-weight:normal;}
|
||||||
|
|
||||||
|
|
||||||
/* TableHelper */
|
/* TableHelper */
|
||||||
div.tableholder table { border: 1px solid #dddddd; font-size: 11px; }
|
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, 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 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 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 thead tr th,
|
||||||
div.tableholder table tfoot tr th { white-space:nowrap; vertical-align:middle; }
|
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 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 { 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 { 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-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 { 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 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.even { background-color: #ebebeb; }
|
||||||
div.tableholder table tbody tr.odd { background-color: #ffffff; }
|
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 { background-color: #f5c0b8;color:#000000; }
|
||||||
div.tableholder table tbody tr.selected a { 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 { 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 td img { padding: 0px; margin:0px; border:0px;vertical-align: middle; }
|
||||||
div.tableholder table tbody tr.even:hover,
|
div.tableholder table tbody tr.even:hover,
|
||||||
div.tableholder table tbody tr.odd: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.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 input { padding: 0px; margin:0; vertical-align:middle; }
|
||||||
div.tableholder table tbody tr td img { margin: 0px 2px; }
|
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 tfoot { height: 30px; font-size: 11px; font-weight: bold; }
|
||||||
div.tableholder table a {text-decoration:none;cursor:pointer;}
|
div.tableholder table a {text-decoration:none;cursor:pointer;}
|
||||||
div.tableholder table a:hover {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 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 {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 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 {margin: 0px 0px 0px 20px;float: right;height: 22px;}
|
||||||
div.tablenav ul.pager li {display: inline;}
|
div.tablenav ul.pager li {display: inline;}
|
||||||
div.tablenav ul.pager li a,
|
div.tablenav ul.pager li a,
|
||||||
div.tablenav ul.pager li a.inactive,
|
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.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.nextfive { border: none; line-height: 22px; cursor:pointer; }
|
||||||
div.tablenav ul.pager li a.inactive,
|
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.inactive:hover { color: #c3c4c1; cursor:pointer;}
|
||||||
div.tablenav ul.pager li a.activepage,
|
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.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; }
|
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; }
|
#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; }
|
#tooltip {position:absolute; border:1px solid #333;display:none;color:#333;background:#f7f5d1;padding:2px 5px; }
|
||||||
@ -1,59 +1,59 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version CVS: 1.0.0
|
* @version CVS: 1.0.0
|
||||||
* @package Com_Alworkshops
|
* @package Com_Alworkshops
|
||||||
* @author Zsolt Fekete <mcleod78@gmail.com>
|
* @author Zsolt Fekete <mcleod78@gmail.com>
|
||||||
* @copyright 2017 Zsolt Fekete
|
* @copyright 2017 Zsolt Fekete
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
// No direct access
|
// No direct access
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
jimport('joomla.application.component.controller'); // import Joomla controller library
|
jimport('joomla.application.component.controller'); // import Joomla controller library
|
||||||
|
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$view = $app->input->get('view');
|
$view = $app->input->get('view');
|
||||||
$option = $app->input->get('option');
|
$option = $app->input->get('option');
|
||||||
|
|
||||||
$l = array(
|
$l = array(
|
||||||
array('COM_ALWORKSHOPS_CONTROL_PANEL_HELP', ''),
|
array('COM_ALWORKSHOPS_CONTROL_PANEL_HELP', ''),
|
||||||
array('COM_ALWORKSHOPS_APPLICATIONS', 'application'),
|
array('COM_ALWORKSHOPS_APPLICATIONS', 'application'),
|
||||||
array('COM_ALWORKSHOPS_COURSES', 'course'),
|
array('COM_ALWORKSHOPS_COURSES', 'course'),
|
||||||
array('COM_ALWORKSHOPS_SESSIONS', 'session'),
|
array('COM_ALWORKSHOPS_SESSIONS', 'session'),
|
||||||
array('COM_ALWORKSHOPS_SWITCH', 'switch'),
|
array('COM_ALWORKSHOPS_SWITCH', 'switch'),
|
||||||
array('COM_ALWORKSHOPS_ONLINE_SESSIONS', 'onlinesession'),
|
array('COM_ALWORKSHOPS_ONLINE_SESSIONS', 'onlinesession'),
|
||||||
array('COM_ALWORKSHOPS_EDUCATION', 'education')
|
array('COM_ALWORKSHOPS_EDUCATION', 'education')
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($l as $v) {
|
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));
|
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
|
* Class AlworkshopsController
|
||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
class AlworkshopsController extends JControllerLegacy
|
class AlworkshopsController extends JControllerLegacy
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Method to display a view.
|
* Method to display a view.
|
||||||
*
|
*
|
||||||
* @param boolean $cachable If true, the view output will be cached
|
* @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()}.
|
* @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.
|
* @return JController This object to support chaining.
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public function display($cachable = false, $urlparams = false)
|
public function display($cachable = false, $urlparams = false)
|
||||||
{
|
{
|
||||||
$view = JFactory::getApplication()->input->getCmd('view', '');
|
$view = JFactory::getApplication()->input->getCmd('view', '');
|
||||||
JFactory::getApplication()->input->set('view', $view);
|
JFactory::getApplication()->input->set('view', $view);
|
||||||
|
|
||||||
parent::display($cachable, $urlparams);
|
parent::display($cachable, $urlparams);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,104 +1,104 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
jimport('joomla.application.component.modelitem');
|
jimport('joomla.application.component.modelitem');
|
||||||
|
|
||||||
define('TABLE','`alworkshops_courses`');
|
define('TABLE','`alworkshops_courses`');
|
||||||
|
|
||||||
class AlworkshopsModelCourseEdit extends JModelList
|
class AlworkshopsModelCourseEdit extends JModelList
|
||||||
{
|
{
|
||||||
protected $item;
|
protected $item;
|
||||||
protected $lang;
|
protected $lang;
|
||||||
|
|
||||||
public function getItem($id="")
|
public function getItem($id="")
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT c.*,s.kurzus FROM ".TABLE." c LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias WHERE c.id=".(int)$id." LIMIT 1;");
|
$db->setQuery("SELECT c.*,s.kurzus FROM ".TABLE." c LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias WHERE c.id=".(int)$id." LIMIT 1;");
|
||||||
$result=$db->loadObjectList();
|
$result=$db->loadObjectList();
|
||||||
return(count($result) ? $result[0] : FALSE);
|
return(count($result) ? $result[0] : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveItem($item=NULL,$id=NULL)
|
public function saveItem($item=NULL,$id=NULL)
|
||||||
{
|
{
|
||||||
if (is_array($item))
|
if (is_array($item))
|
||||||
{
|
{
|
||||||
$db=JFactory::getDbo();
|
$db=JFactory::getDbo();
|
||||||
$query=$db->getQuery(true);
|
$query=$db->getQuery(true);
|
||||||
$values=array();
|
$values=array();
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
||||||
$query->update(TABLE)->set($values)->where(array('`id`='.(int)$id));
|
$query->update(TABLE)->set($values)->where(array('`id`='.(int)$id));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$result=$db->execute();
|
$result=$db->execute();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($item as $v) $values[]=$db->quote($v);
|
foreach ($item as $v) $values[]=$db->quote($v);
|
||||||
$query->insert(TABLE)->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
$query->insert(TABLE)->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
$result=$db->insertid();
|
$result=$db->insertid();
|
||||||
}
|
}
|
||||||
return ($result);
|
return ($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTemplates()
|
public function getTemplates()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM #__categories WHERE alias='workshop-email-templates' LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__categories WHERE alias='workshop-email-templates' LIMIT 1;");
|
||||||
$result=$db->loadObjectList();
|
$result=$db->loadObjectList();
|
||||||
if (count($result))
|
if (count($result))
|
||||||
{
|
{
|
||||||
$db->setQuery("SELECT id,title FROM #__content WHERE catid=".$result[0]->id." AND state=1;");
|
$db->setQuery("SELECT id,title FROM #__content WHERE catid=".$result[0]->id." AND state=1;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
}
|
}
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAliases()
|
public function getAliases()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT `alias`,`kurzus` FROM alworkshops_switch WHERE `lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ORDER BY kurzus,alias;");
|
$db->setQuery("SELECT `alias`,`kurzus` FROM alworkshops_switch WHERE `lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."' ORDER BY kurzus,alias;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSwitch($alias='')
|
public function getSwitch($alias='')
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
if (trim($alias)=="") return ($ret);
|
if (trim($alias)=="") return ($ret);
|
||||||
|
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM `alworkshops_switch` WHERE `alias`='".trim($alias)."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM `alworkshops_switch` WHERE `alias`='".trim($alias)."' LIMIT 1;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return (count($ret) ? $ret[0] : array());
|
return (count($ret) ? $ret[0] : array());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitles()
|
public function getTitles()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(c.`title`) AS `title`,s.`kurzus`
|
SELECT DISTINCT(c.`title`) AS `title`,s.`kurzus`
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||||
WHERE s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
WHERE s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
||||||
ORDER BY s.`kurzus`,c.`title`;");
|
ORDER BY s.`kurzus`,c.`title`;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) { $this->lang=JFactory::getLanguage()->getTag(); }
|
if (!isset($this->lang)) { $this->lang=JFactory::getLanguage()->getTag(); }
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,99 +1,99 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
jimport('joomla.application.component.modelitem');
|
jimport('joomla.application.component.modelitem');
|
||||||
|
|
||||||
class AlworkshopsModelEducationEdit extends JModelList
|
class AlworkshopsModelEducationEdit extends JModelList
|
||||||
{
|
{
|
||||||
protected $item;
|
protected $item;
|
||||||
protected $lang;
|
protected $lang;
|
||||||
|
|
||||||
public function getItem($id = "")
|
public function getItem($id = "")
|
||||||
{
|
{
|
||||||
$db = JFactory::getDBO();
|
$db = JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM www_archline_hu.aleducation_courses WHERE id = {$id} LIMIT 1;");
|
$db->setQuery("SELECT * FROM www_archline_hu.aleducation_courses WHERE id = {$id} LIMIT 1;");
|
||||||
$result = $db->loadObjectList();
|
$result = $db->loadObjectList();
|
||||||
return (count($result) ? $result[0] : FALSE);
|
return (count($result) ? $result[0] : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveItem($item = NULL, $id = NULL)
|
public function saveItem($item = NULL, $id = NULL)
|
||||||
{
|
{
|
||||||
if (!is_array($item))
|
if (!is_array($item))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
$education = array();
|
$education = array();
|
||||||
|
|
||||||
foreach ($item['courses'] as $key => $value) {
|
foreach ($item['courses'] as $key => $value) {
|
||||||
$c_id = strtolower(str_replace(' ', '-', $value));
|
$c_id = strtolower(str_replace(' ', '-', $value));
|
||||||
$c_id = str_replace('&', '-', $c_id);
|
$c_id = str_replace('&', '-', $c_id);
|
||||||
$c_id = str_replace('---', '-', $c_id);
|
$c_id = str_replace('---', '-', $c_id);
|
||||||
$c_id = str_replace('--', '-', $c_id);
|
$c_id = str_replace('--', '-', $c_id);
|
||||||
$education[$c_id]['name'] = $value;
|
$education[$c_id]['name'] = $value;
|
||||||
$education[$c_id]['lessons'] = $item['lessons'][$key];
|
$education[$c_id]['lessons'] = $item['lessons'][$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
$encoded = json_encode($education, JSON_UNESCAPED_UNICODE);
|
$encoded = json_encode($education, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
$json = '{"courses":' . $encoded . '}';
|
$json = '{"courses":' . $encoded . '}';
|
||||||
|
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
|
|
||||||
$url = JFactory::getLanguage()->getTag() == 'hu-HU' ? "beiratkozas/tanfolyamok/" : "enrollments/courses/";
|
$url = JFactory::getLanguage()->getTag() == 'hu-HU' ? "beiratkozas/tanfolyamok/" : "enrollments/courses/";
|
||||||
$url .= strtolower(str_replace(' ', '-', $item['title']));
|
$url .= strtolower(str_replace(' ', '-', $item['title']));
|
||||||
|
|
||||||
$url = str_replace('&', '-', $url);
|
$url = str_replace('&', '-', $url);
|
||||||
$url = str_replace('---', '-', $url);
|
$url = str_replace('---', '-', $url);
|
||||||
$url = str_replace('--', '-', $url);
|
$url = str_replace('--', '-', $url);
|
||||||
|
|
||||||
$fileJson = '';
|
$fileJson = '';
|
||||||
|
|
||||||
if ($item['fileNames'][0] != '' && $item['fileLinks'][0] != '' && $item['articleID'][0] != '') {
|
if ($item['fileNames'][0] != '' && $item['fileLinks'][0] != '' && $item['articleID'][0] != '') {
|
||||||
$files['name'] = $item['fileNames'];
|
$files['name'] = $item['fileNames'];
|
||||||
$files['link'] = $item['fileLinks'];
|
$files['link'] = $item['fileLinks'];
|
||||||
$files['article'] = $item['articleID'];
|
$files['article'] = $item['articleID'];
|
||||||
$fileJson = '{"files":' . json_encode($files, JSON_UNESCAPED_UNICODE) . '}';
|
$fileJson = '{"files":' . json_encode($files, JSON_UNESCAPED_UNICODE) . '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
$tomb = array(
|
$tomb = array(
|
||||||
'title' => $item['title'],
|
'title' => $item['title'],
|
||||||
'lessons' => $json,
|
'lessons' => $json,
|
||||||
'published' => $item['published'],
|
'published' => $item['published'],
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
'fileDownloadLink' => $fileJson,
|
'fileDownloadLink' => $fileJson,
|
||||||
'lang' => JFactory::getLanguage()->getTag() == 'hu-HU' ? "hun" : "eng",
|
'lang' => JFactory::getLanguage()->getTag() == 'hu-HU' ? "hun" : "eng",
|
||||||
'overviewID' => $item['overviewID']
|
'overviewID' => $item['overviewID']
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($item['thumbnail'] != '')
|
if ($item['thumbnail'] != '')
|
||||||
$tomb['image'] = $item['thumbnail'];
|
$tomb['image'] = $item['thumbnail'];
|
||||||
|
|
||||||
if ($id) {
|
if ($id) {
|
||||||
foreach ($tomb as $k => $v)
|
foreach ($tomb as $k => $v)
|
||||||
$values[] = $db->quoteName($k) . "=" . $db->quote($v);
|
$values[] = $db->quoteName($k) . "=" . $db->quote($v);
|
||||||
|
|
||||||
$query->update('`www_archline_hu`.`aleducation_courses`')->set($values)->where(array('`id`=' . (int)$id));
|
$query->update('`www_archline_hu`.`aleducation_courses`')->set($values)->where(array('`id`=' . (int)$id));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$result = $db->execute();
|
$result = $db->execute();
|
||||||
} else {
|
} else {
|
||||||
foreach ($tomb as $v)
|
foreach ($tomb as $v)
|
||||||
$values[] = $db->quote($v);
|
$values[] = $db->quote($v);
|
||||||
|
|
||||||
$query->insert('`www_archline_hu`.`aleducation_courses`')->columns($db->quoteName(array_keys($tomb)))->values(implode(',', $values));
|
$query->insert('`www_archline_hu`.`aleducation_courses`')->columns($db->quoteName(array_keys($tomb)))->values(implode(',', $values));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
|
|
||||||
$result = $db->insertid();
|
$result = $db->insertid();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) {
|
if (!isset($this->lang)) {
|
||||||
$this->lang = JFactory::getLanguage()->getTag();
|
$this->lang = JFactory::getLanguage()->getTag();
|
||||||
}
|
}
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,118 +1,118 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
jimport('joomla.application.component.modelitem');
|
jimport('joomla.application.component.modelitem');
|
||||||
|
|
||||||
define('TABLE','`alworkshops_online_sessions`');
|
define('TABLE','`alworkshops_online_sessions`');
|
||||||
|
|
||||||
class AlworkshopsModelOnlineSessionEdit extends JModelList
|
class AlworkshopsModelOnlineSessionEdit extends JModelList
|
||||||
{
|
{
|
||||||
protected $item;
|
protected $item;
|
||||||
protected $lang;
|
protected $lang;
|
||||||
|
|
||||||
public function getItem($id="")
|
public function getItem($id="")
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM ".TABLE." WHERE id=".(int)$id." LIMIT 1;");
|
$db->setQuery("SELECT * FROM ".TABLE." WHERE id=".(int)$id." LIMIT 1;");
|
||||||
$result=$db->loadObjectList();
|
$result=$db->loadObjectList();
|
||||||
return(count($result) ? $result[0] : FALSE);
|
return(count($result) ? $result[0] : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSwitch($id=0)
|
public function getSwitch($id=0)
|
||||||
{
|
{
|
||||||
if ((int)$id==0) return (FALSE);
|
if ((int)$id==0) return (FALSE);
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM `alworkshops_switch` WHERE id=".(int)$id." LIMIT 1;");
|
$db->setQuery("SELECT * FROM `alworkshops_switch` WHERE id=".(int)$id." LIMIT 1;");
|
||||||
$result=$db->loadObjectList();
|
$result=$db->loadObjectList();
|
||||||
return(count($result) ? $result[0] : FALSE);
|
return(count($result) ? $result[0] : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveItem($item=NULL,$id=NULL)
|
public function saveItem($item=NULL,$id=NULL)
|
||||||
{
|
{
|
||||||
if (is_array($item))
|
if (is_array($item))
|
||||||
{
|
{
|
||||||
/*$switch=$this->getSwitch($item['switchid']);
|
/*$switch=$this->getSwitch($item['switchid']);
|
||||||
$item['description']=$switch->title;*/
|
$item['description']=$switch->title;*/
|
||||||
$values=array();
|
$values=array();
|
||||||
|
|
||||||
$db=JFactory::getDbo();
|
$db=JFactory::getDbo();
|
||||||
$query=$db->getQuery(true);
|
$query=$db->getQuery(true);
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
||||||
$query->update(TABLE)->set($values)->where(array('`id`='.(int)$id));
|
$query->update(TABLE)->set($values)->where(array('`id`='.(int)$id));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$result=$db->execute();
|
$result=$db->execute();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($item as $v) $values[]=$db->quote($v);
|
foreach ($item as $v) $values[]=$db->quote($v);
|
||||||
$query->insert(TABLE)->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
$query->insert(TABLE)->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
$result=$db->insertid();
|
$result=$db->insertid();
|
||||||
}
|
}
|
||||||
return ($result);
|
return ($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCourses()
|
public function getCourses()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$webinar = "";
|
$webinar = "";
|
||||||
|
|
||||||
if($this->getLang() == 'hu-HU') {
|
if($this->getLang() == 'hu-HU') {
|
||||||
$webinar = "webinariumok";
|
$webinar = "webinariumok";
|
||||||
} else {
|
} else {
|
||||||
$webinar = "webinars";
|
$webinar = "webinars";
|
||||||
}
|
}
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT c.*
|
SELECT c.*
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
WHERE c.alias = '{$webinar}'
|
WHERE c.alias = '{$webinar}'
|
||||||
ORDER BY c.id DESC;");
|
ORDER BY c.id DESC;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitles()
|
public function getTitles()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(c.`title`) AS `title`
|
SELECT DISTINCT(c.`title`) AS `title`
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||||
WHERE s.kurzus='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
WHERE s.kurzus='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
||||||
ORDER BY `title`;");
|
ORDER BY `title`;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescriptions()
|
public function getDescriptions()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(c.`title`) AS `title`,s.id AS switchid
|
SELECT DISTINCT(c.`title`) AS `title`,s.id AS switchid
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||||
WHERE s.workshop='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
WHERE s.workshop='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
||||||
ORDER BY `title`;");
|
ORDER BY `title`;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) { $this->lang=JFactory::getLanguage()->getTag(); }
|
if (!isset($this->lang)) { $this->lang=JFactory::getLanguage()->getTag(); }
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,112 +1,112 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
jimport('joomla.application.component.modelitem');
|
jimport('joomla.application.component.modelitem');
|
||||||
|
|
||||||
define('TABLE','`alworkshops_sessions`');
|
define('TABLE','`alworkshops_sessions`');
|
||||||
|
|
||||||
class AlworkshopsModelSessionEdit extends JModelList
|
class AlworkshopsModelSessionEdit extends JModelList
|
||||||
{
|
{
|
||||||
protected $item;
|
protected $item;
|
||||||
protected $lang;
|
protected $lang;
|
||||||
|
|
||||||
public function getItem($id="")
|
public function getItem($id="")
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM ".TABLE." WHERE id=".(int)$id." LIMIT 1;");
|
$db->setQuery("SELECT * FROM ".TABLE." WHERE id=".(int)$id." LIMIT 1;");
|
||||||
$result=$db->loadObjectList();
|
$result=$db->loadObjectList();
|
||||||
return(count($result) ? $result[0] : FALSE);
|
return(count($result) ? $result[0] : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSwitch($id=0)
|
public function getSwitch($id=0)
|
||||||
{
|
{
|
||||||
if ((int)$id==0) return (FALSE);
|
if ((int)$id==0) return (FALSE);
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM `alworkshops_switch` WHERE id=".(int)$id." LIMIT 1;");
|
$db->setQuery("SELECT * FROM `alworkshops_switch` WHERE id=".(int)$id." LIMIT 1;");
|
||||||
$result=$db->loadObjectList();
|
$result=$db->loadObjectList();
|
||||||
return(count($result) ? $result[0] : FALSE);
|
return(count($result) ? $result[0] : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveItem($item=NULL,$id=NULL)
|
public function saveItem($item=NULL,$id=NULL)
|
||||||
{
|
{
|
||||||
if (is_array($item))
|
if (is_array($item))
|
||||||
{
|
{
|
||||||
$switch=$this->getSwitch($item['switchid']);
|
$switch=$this->getSwitch($item['switchid']);
|
||||||
$item['description']=$switch->title;
|
$item['description']=$switch->title;
|
||||||
$values=array();
|
$values=array();
|
||||||
|
|
||||||
$db=JFactory::getDbo();
|
$db=JFactory::getDbo();
|
||||||
$query=$db->getQuery(true);
|
$query=$db->getQuery(true);
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
foreach ($item as $k=>$v) $values[]=$db->quoteName($k)."=".$db->quote($v);
|
||||||
$query->update(TABLE)->set($values)->where(array('`id`='.(int)$id));
|
$query->update(TABLE)->set($values)->where(array('`id`='.(int)$id));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$result=$db->execute();
|
$result=$db->execute();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($item as $v) $values[]=$db->quote($v);
|
foreach ($item as $v) $values[]=$db->quote($v);
|
||||||
$query->insert(TABLE)->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
$query->insert(TABLE)->columns($db->quoteName(array_keys($item)))->values(implode(',', $values));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
$result=$db->insertid();
|
$result=$db->insertid();
|
||||||
}
|
}
|
||||||
return ($result);
|
return ($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCourses()
|
public function getCourses()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT c.*
|
SELECT c.*
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||||
WHERE s.kurzus='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
WHERE s.kurzus='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
||||||
ORDER BY c.`id` DESC;");
|
ORDER BY c.`id` DESC;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitles()
|
public function getTitles()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(c.`title`) AS `title`
|
SELECT DISTINCT(c.`title`) AS `title`
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||||
WHERE s.kurzus='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
WHERE s.kurzus='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
||||||
ORDER BY `title`;");
|
ORDER BY `title`;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescriptions()
|
public function getDescriptions()
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(s.`title`) AS `title`,s.id AS switchid
|
SELECT DISTINCT(s.`title`) AS `title`,s.id AS switchid
|
||||||
FROM alworkshops_courses c
|
FROM alworkshops_courses c
|
||||||
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
LEFT OUTER JOIN `alworkshops_switch` s ON c.alias=s.alias
|
||||||
WHERE s.workshop='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
WHERE s.workshop='Y' AND s.`lang`='".($this->getLang()=='hu-HU' ? 'hun' : 'eng')."'
|
||||||
ORDER BY `title`;");
|
ORDER BY `title`;");
|
||||||
$ret=$db->loadObjectList();
|
$ret=$db->loadObjectList();
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) { $this->lang=JFactory::getLanguage()->getTag(); }
|
if (!isset($this->lang)) { $this->lang=JFactory::getLanguage()->getTag(); }
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,221 +1,221 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
JHtml::_('behavior.tooltip');
|
JHtml::_('behavior.tooltip');
|
||||||
?>
|
?>
|
||||||
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
||||||
|
|
||||||
<div id="j-main-container">
|
<div id="j-main-container">
|
||||||
<h2><?=($this->item->kurzus=='Y' ? JText::_('COM_ALWORKSHOPS_COURSE') : JText::_('COM_ALWORKSHOPS_WORKSHOP'))?></h2>
|
<h2><?=($this->item->kurzus=='Y' ? JText::_('COM_ALWORKSHOPS_COURSE') : JText::_('COM_ALWORKSHOPS_WORKSHOP'))?></h2>
|
||||||
<form method="post" enctype="multipart/form-data">
|
<form method="post" enctype="multipart/form-data">
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="wid"><?=JText::_('COM_ALWORKSHOPS_ID')?>:</label>
|
<label for="wid"><?=JText::_('COM_ALWORKSHOPS_ID')?>:</label>
|
||||||
<input type="text" name="wid" id="wid" value="<?=($this->item ? $this->item->id : 0)?>" maxlength="15" readonly="readonly" />
|
<input type="text" name="wid" id="wid" value="<?=($this->item ? $this->item->id : 0)?>" maxlength="15" readonly="readonly" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="title"><?=JText::_('COM_ALWORKSHOPS_TITLE')?>:</label>
|
<label for="title"><?=JText::_('COM_ALWORKSHOPS_TITLE')?>:</label>
|
||||||
<span id="title">
|
<span id="title">
|
||||||
<select name="title">
|
<select name="title">
|
||||||
<?php foreach($this->titles as $idx=>$title) : ?>
|
<?php foreach($this->titles as $idx=>$title) : ?>
|
||||||
<?php if ($idx>0 && $this->titles[$idx-1]->kurzus!=$this->titles[$idx]->kurzus):?>
|
<?php if ($idx>0 && $this->titles[$idx-1]->kurzus!=$this->titles[$idx]->kurzus):?>
|
||||||
<option disabled="disabled">---</option>
|
<option disabled="disabled">---</option>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<option value="<?=$title->title?>" <?=($this->item->title==$title->title ? 'selected="selected"' : "")?>><?=$title->title?></option>
|
<option value="<?=$title->title?>" <?=($this->item->title==$title->title ? 'selected="selected"' : "")?>><?=$title->title?></option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<span id="title_text" style="display:none"><input type="text" name="title_new" title="Add new" style="width:176px;"/></span>
|
<span id="title_text" style="display:none"><input type="text" name="title_new" title="Add new" style="width:176px;"/></span>
|
||||||
<input type="checkbox" onclick="javascript:switchController('title','title_text')" />
|
<input type="checkbox" onclick="javascript:switchController('title','title_text')" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="alias"><?=JText::_('COM_ALWORKSHOPS_ALIAS')?>:</label>
|
<label for="alias"><?=JText::_('COM_ALWORKSHOPS_ALIAS')?>:</label>
|
||||||
<span id="alias">
|
<span id="alias">
|
||||||
<select name="alias">
|
<select name="alias">
|
||||||
<?php foreach($this->aliases as $idx=>$alias) : ?>
|
<?php foreach($this->aliases as $idx=>$alias) : ?>
|
||||||
<?php if ($idx>0 && $this->aliases[$idx-1]->kurzus!=$this->aliases[$idx]->kurzus):?>
|
<?php if ($idx>0 && $this->aliases[$idx-1]->kurzus!=$this->aliases[$idx]->kurzus):?>
|
||||||
<option disabled="disabled">---</option>
|
<option disabled="disabled">---</option>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<option value="<?=$alias->alias?>" <?=($this->item->alias==$alias->alias ? 'selected="selected"' : "")?>><?=$alias->alias?></option>
|
<option value="<?=$alias->alias?>" <?=($this->item->alias==$alias->alias ? 'selected="selected"' : "")?>><?=$alias->alias?></option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<!--span id="alias_text" style="display:none"><input type="text" name="alias" title="Add new" style="width:176px;"/></span>
|
<!--span id="alias_text" style="display:none"><input type="text" name="alias" title="Add new" style="width:176px;"/></span>
|
||||||
<input type="checkbox" onclick="javascript:switchController('alias','alias_text')" /-->
|
<input type="checkbox" onclick="javascript:switchController('alias','alias_text')" /-->
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="price"><?=JText::_('COM_ALWORKSHOPS_PRICE')?>:</label>
|
<label for="price"><?=JText::_('COM_ALWORKSHOPS_PRICE')?>:</label>
|
||||||
<input type="text" name="price" id="price" value="<?=($this->item ? $this->item->price : 0)?>" maxlength="15" />
|
<input type="text" name="price" id="price" value="<?=($this->item ? $this->item->price : 0)?>" maxlength="15" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="vat"><?=JText::_('COM_ALWORKSHOPS_VAT')?>:</label>
|
<label for="vat"><?=JText::_('COM_ALWORKSHOPS_VAT')?>:</label>
|
||||||
<input type="text" name="vat" id="vat" value="<?=($this->item ? $this->item->vat : 0)?>" maxlength="2" />
|
<input type="text" name="vat" id="vat" value="<?=($this->item ? $this->item->vat : 0)?>" maxlength="2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="course_info">Info:</label>
|
<label for="course_info">Info:</label>
|
||||||
<input type="text" name="course_info" id="course_info" value="<?=($this->item ? $this->item->course_info : "")?>" maxlength="100" />
|
<input type="text" name="course_info" id="course_info" value="<?=($this->item ? $this->item->course_info : "")?>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="external_link">External link:</label>
|
<label for="external_link">External link:</label>
|
||||||
<input type="text" name="external_link" id="external_link" value="<?=($this->item ? $this->item->external_link : "")?>" maxlength="100" />
|
<input type="text" name="external_link" id="external_link" value="<?=($this->item ? $this->item->external_link : "")?>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="thumbnail">Thumbnail:</label>
|
<label for="thumbnail">Thumbnail:</label>
|
||||||
<input type="file" name="thumbnail" id="thumbnail">
|
<input type="file" name="thumbnail" id="thumbnail">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<a href="<?=($this->item ? $this->item->thumbnail : "")?>" target="_blank"><?=($this->item ? $this->item->thumbnail : "")?></a>
|
<a href="<?=($this->item ? $this->item->thumbnail : "")?>" target="_blank"><?=($this->item ? $this->item->thumbnail : "")?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="min_attend"><?=JText::_('COM_ALWORKSHOPS_MIN_ATTEND')?>:</label>
|
<label for="min_attend"><?=JText::_('COM_ALWORKSHOPS_MIN_ATTEND')?>:</label>
|
||||||
<input type="text" name="min_attend" id="min_attend" value="<?=($this->item ? $this->item->min_attend : 0)?>" maxlength="3" />
|
<input type="text" name="min_attend" id="min_attend" value="<?=($this->item ? $this->item->min_attend : 0)?>" maxlength="3" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="capacity"><?=JText::_('COM_ALWORKSHOPS_CAPACITY')?>:</label>
|
<label for="capacity"><?=JText::_('COM_ALWORKSHOPS_CAPACITY')?>:</label>
|
||||||
<input type="text" name="capacity" id="capacity" value="<?=($this->item ? $this->item->capacity : 0)?>" maxlength="3" />
|
<input type="text" name="capacity" id="capacity" value="<?=($this->item ? $this->item->capacity : 0)?>" maxlength="3" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="location"><?=JText::_('COM_ALWORKSHOPS_LOCATION')?>:</label>
|
<label for="location"><?=JText::_('COM_ALWORKSHOPS_LOCATION')?>:</label>
|
||||||
<input type="text" name="location" id="location" value="<?=($this->item ? $this->item->location : "")?>" maxlength="100" />
|
<input type="text" name="location" id="location" value="<?=($this->item ? $this->item->location : "")?>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="email_template"><?=JText::_('COM_ALWORKSHOPS_EMAIL_TEMPLATE')?>:</label>
|
<label for="email_template"><?=JText::_('COM_ALWORKSHOPS_EMAIL_TEMPLATE')?>:</label>
|
||||||
<select name="email_template" id="email_template">
|
<select name="email_template" id="email_template">
|
||||||
<?php foreach ($this->templates as $template) :?>
|
<?php foreach ($this->templates as $template) :?>
|
||||||
<option value="<?=$template->id?>" <?=($this->item && $template->id==$this->item->email_template ? 'selected="selected"' : '')?>><?=$template->title?></option>
|
<option value="<?=$template->id?>" <?=($this->item && $template->id==$this->item->email_template ? 'selected="selected"' : '')?>><?=$template->title?></option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="course_level">Course level:</label>
|
<label for="course_level">Course level:</label>
|
||||||
<select name="course_level" id="course_level">
|
<select name="course_level" id="course_level">
|
||||||
<option value="0" <?=($this->item && $this->item->course_level == 0 ? 'selected="selected"' : '')?>>Nem</option>
|
<option value="0" <?=($this->item && $this->item->course_level == 0 ? 'selected="selected"' : '')?>>Nem</option>
|
||||||
<option value="1" <?=($this->item && $this->item->course_level == 1 ? 'selected="selected"' : '')?>>Alapfokú tanfolyam</option>
|
<option value="1" <?=($this->item && $this->item->course_level == 1 ? 'selected="selected"' : '')?>>Alapfokú tanfolyam</option>
|
||||||
<option value="2" <?=($this->item && $this->item->course_level == 2 ? 'selected="selected"' : '')?>>Középfokú tanfolyam</option>
|
<option value="2" <?=($this->item && $this->item->course_level == 2 ? 'selected="selected"' : '')?>>Középfokú tanfolyam</option>
|
||||||
<option value="3" <?=($this->item && $this->item->course_level == 3 ? 'selected="selected"' : '')?>>Felsőfokú tanfolyam</option>
|
<option value="3" <?=($this->item && $this->item->course_level == 3 ? 'selected="selected"' : '')?>>Felsőfokú tanfolyam</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="course_name">Topic:</label>
|
<label for="course_name">Topic:</label>
|
||||||
<input type="text" name="course_name" id="course_name" value="<?=($this->item ? $this->item->course_name : "")?>" maxlength="100" />
|
<input type="text" name="course_name" id="course_name" value="<?=($this->item ? $this->item->course_name : "")?>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="start_date"><?=JText::_('COM_ALWORKSHOPS_START_DATE')?>:</label>
|
<label for="start_date"><?=JText::_('COM_ALWORKSHOPS_START_DATE')?>:</label>
|
||||||
<input type="text" name="start_date" id="start_date" value="<?=($this->item ? $this->item->start_date : "")?>" maxlength="10" />
|
<input type="text" name="start_date" id="start_date" value="<?=($this->item ? $this->item->start_date : "")?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="start_time"><?=JText::_('COM_ALWORKSHOPS_START_TIME')?>:</label>
|
<label for="start_time"><?=JText::_('COM_ALWORKSHOPS_START_TIME')?>:</label>
|
||||||
<input type="text" name="start_time" id="start_time" value="<?=($this->item ? $this->item->start_time : "")?>" maxlength="10" />
|
<input type="text" name="start_time" id="start_time" value="<?=($this->item ? $this->item->start_time : "")?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="finish_date"><?=JText::_('COM_ALWORKSHOPS_FINISH_DATE')?>:</label>
|
<label for="finish_date"><?=JText::_('COM_ALWORKSHOPS_FINISH_DATE')?>:</label>
|
||||||
<input type="text" name="finish_date" id="finish_date" value="<?=($this->item ? $this->item->finish_date : "")?>" maxlength="10" />
|
<input type="text" name="finish_date" id="finish_date" value="<?=($this->item ? $this->item->finish_date : "")?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="finish_time"><?=JText::_('COM_ALWORKSHOPS_FINISH_TIME')?>:</label>
|
<label for="finish_time"><?=JText::_('COM_ALWORKSHOPS_FINISH_TIME')?>:</label>
|
||||||
<input type="text" name="finish_time" id="finish_time" value="<?=($this->item ? $this->item->finish_time : "")?>" maxlength="10" />
|
<input type="text" name="finish_time" id="finish_time" value="<?=($this->item ? $this->item->finish_time : "")?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="published"><?=JText::_('COM_ALWORKSHOPS_PUBLISHED')?>:</label>
|
<label for="published"><?=JText::_('COM_ALWORKSHOPS_PUBLISHED')?>:</label>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="radio" name="published" id="published_y" value="Y" <?=($this->item && $this->item->published==='Y' ? 'checked="checked"' : '')?> /><label for="published_y"><?=JText::_('COM_ALWORKSHOPS_YES')?></label>
|
<input type="radio" name="published" id="published_y" value="Y" <?=($this->item && $this->item->published==='Y' ? 'checked="checked"' : '')?> /><label for="published_y"><?=JText::_('COM_ALWORKSHOPS_YES')?></label>
|
||||||
<input type="radio" name="published" id="published_n" value="N" <?=(!$this->item || $this->item->published==='N' || trim($this->item->published)=='' ? 'checked="checked"' : '')?> /><label for="published_n"><?=JText::_('COM_ALWORKSHOPS_NO')?></label>
|
<input type="radio" name="published" id="published_n" value="N" <?=(!$this->item || $this->item->published==='N' || trim($this->item->published)=='' ? 'checked="checked"' : '')?> /><label for="published_n"><?=JText::_('COM_ALWORKSHOPS_NO')?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="yt_link">YouTube Link:</label>
|
<label for="yt_link">YouTube Link:</label>
|
||||||
<input type="text" name="yt_link" id="yt_link" value="<?=($this->item ? $this->item->yt_link : "")?>" maxlength="100" />
|
<input type="text" name="yt_link" id="yt_link" value="<?=($this->item ? $this->item->yt_link : "")?>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
<?php if (isset($this->switch->comment) && $this->switch->comment==='Y') : ?>
|
<?php if (isset($this->switch->comment) && $this->switch->comment==='Y') : ?>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="comment"><strong><?=JText::_('COM_ALWORKSHOPS_COMMENT')?></strong>:</label>
|
<label for="comment"><strong><?=JText::_('COM_ALWORKSHOPS_COMMENT')?></strong>:</label>
|
||||||
<?=$this->editor->display('comment',$this->item->comment,'100%','150','50','15',false)?><br /><br />
|
<?=$this->editor->display('comment',$this->item->comment,'100%','150','50','15',false)?><br /><br />
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<input type="submit" name="save" id="save" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?>" />
|
<input type="submit" name="save" id="save" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?>" />
|
||||||
<input type="submit" name="savenew" id="savenew" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_NEW')?>" />
|
<input type="submit" name="savenew" id="savenew" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_NEW')?>" />
|
||||||
<input type="submit" name="saveexit" id="saveexit" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_EXIT')?>" />
|
<input type="submit" name="saveexit" id="saveexit" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_EXIT')?>" />
|
||||||
<input type="button" name="exit" id="exit" value="<?=JText::_('COM_ALWORKSHOPS_EXIT')?>" onclick="document.location.href='index.php?option=<?=JFactory::getApplication()->input->get('option')?>&view=<?=substr(JFactory::getApplication()->input->get('view'),0,-4)?>';" />
|
<input type="button" name="exit" id="exit" value="<?=JText::_('COM_ALWORKSHOPS_EXIT')?>" onclick="document.location.href='index.php?option=<?=JFactory::getApplication()->input->get('option')?>&view=<?=substr(JFactory::getApplication()->input->get('view'),0,-4)?>';" />
|
||||||
<input type="reset" name="reset" id="reset" value="<?=JText::_('COM_ALWORKSHOPS_RESET')?>" />
|
<input type="reset" name="reset" id="reset" value="<?=JText::_('COM_ALWORKSHOPS_RESET')?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
<?php if ($this->item->kurzus=='Y') :?>
|
<?php if ($this->item->kurzus=='Y') :?>
|
||||||
<h2><?=JText::_('COM_ALWORKSHOPS_SESSIONS')?></h2>
|
<h2><?=JText::_('COM_ALWORKSHOPS_SESSIONS')?></h2>
|
||||||
<form id="SessionController" action="/administrator/components/com_alworkshops/assets/ajax/AjaxSessionController.class.php" method="post" onsubmit="return submitForm('SessionController','tablediv2');">
|
<form id="SessionController" action="/administrator/components/com_alworkshops/assets/ajax/AjaxSessionController.class.php" method="post" onsubmit="return submitForm('SessionController','tablediv2');">
|
||||||
<input type="hidden" name="title" value="" />
|
<input type="hidden" name="title" value="" />
|
||||||
<input type="hidden" name="sid" value="" />
|
<input type="hidden" name="sid" value="" />
|
||||||
<input type="hidden" name="wid" value="<?=($this->item ? $this->item->id : 0)?>" />
|
<input type="hidden" name="wid" value="<?=($this->item ? $this->item->id : 0)?>" />
|
||||||
<input type="hidden" name="description" value="" />
|
<input type="hidden" name="description" value="" />
|
||||||
<input type="hidden" name="published" value="A" />
|
<input type="hidden" name="published" value="A" />
|
||||||
<input type="hidden" name="start_date" value="" />
|
<input type="hidden" name="start_date" value="" />
|
||||||
<input type="hidden" name="finish_date" value="" />
|
<input type="hidden" name="finish_date" value="" />
|
||||||
<input type="hidden" name="refresh" value="" />
|
<input type="hidden" name="refresh" value="" />
|
||||||
<input type="hidden" name="nojs" value="nojs" />
|
<input type="hidden" name="nojs" value="nojs" />
|
||||||
<input type="hidden" name="targetdiv" value="tablediv2" />
|
<input type="hidden" name="targetdiv" value="tablediv2" />
|
||||||
<div id="tablediv2"></div>
|
<div id="tablediv2"></div>
|
||||||
</form>
|
</form>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<h2><?=JText::_('COM_ALWORKSHOPS_APPLICATIONS')?></h2>
|
<h2><?=JText::_('COM_ALWORKSHOPS_APPLICATIONS')?></h2>
|
||||||
<form id="ApplicationController" action="/administrator/components/com_alworkshops/assets/ajax/AjaxApplicationController.class.php" method="post" onsubmit="return submitForm('ApplicationController','tablediv');">
|
<form id="ApplicationController" action="/administrator/components/com_alworkshops/assets/ajax/AjaxApplicationController.class.php" method="post" onsubmit="return submitForm('ApplicationController','tablediv');">
|
||||||
<input type="hidden" name="title" id="title" value="" />
|
<input type="hidden" name="title" id="title" value="" />
|
||||||
<input type="hidden" name="wid" id="wid" value="<?=($this->item ? $this->item->id : 0)?>" />
|
<input type="hidden" name="wid" id="wid" value="<?=($this->item ? $this->item->id : 0)?>" />
|
||||||
<input type="hidden" name="published" id="published" value="A" />
|
<input type="hidden" name="published" id="published" value="A" />
|
||||||
<input type="hidden" name="name" id="name" value="" />
|
<input type="hidden" name="name" id="name" value="" />
|
||||||
<input type="hidden" name="uid" id="uid" value="" />
|
<input type="hidden" name="uid" id="uid" value="" />
|
||||||
<input type="hidden" name="email" id="email" value="" />
|
<input type="hidden" name="email" id="email" value="" />
|
||||||
<input type="hidden" name="start_date" value="" />
|
<input type="hidden" name="start_date" value="" />
|
||||||
<input type="hidden" name="finish_date" value="" />
|
<input type="hidden" name="finish_date" value="" />
|
||||||
<input type="hidden" name="refresh" value="" />
|
<input type="hidden" name="refresh" value="" />
|
||||||
<input type="hidden" name="nojs" value="nojs" />
|
<input type="hidden" name="nojs" value="nojs" />
|
||||||
<input type="hidden" name="targetdiv" value="tablediv" />
|
<input type="hidden" name="targetdiv" value="tablediv" />
|
||||||
<div id="tablediv"></div>
|
<div id="tablediv"></div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
<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 src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function()
|
jQuery(document).ready(function()
|
||||||
{
|
{
|
||||||
jQuery("#start_date").datepicker({dateFormat: "yy-mm-dd"});
|
jQuery("#start_date").datepicker({dateFormat: "yy-mm-dd"});
|
||||||
jQuery("#finish_date").datepicker({dateFormat: "yy-mm-dd"});
|
jQuery("#finish_date").datepicker({dateFormat: "yy-mm-dd"});
|
||||||
submitForm('ApplicationController','tablediv');
|
submitForm('ApplicationController','tablediv');
|
||||||
<?php if ($this->item->kurzus=='Y') :?>
|
<?php if ($this->item->kurzus=='Y') :?>
|
||||||
submitForm('SessionController','tablediv2');
|
submitForm('SessionController','tablediv2');
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
});
|
});
|
||||||
|
|
||||||
function switchController(sel,txt)
|
function switchController(sel,txt)
|
||||||
{
|
{
|
||||||
jQuery("#"+sel).toggle();
|
jQuery("#"+sel).toggle();
|
||||||
jQuery("#"+txt).toggle();
|
jQuery("#"+txt).toggle();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,90 +1,90 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
|
|
||||||
class AlworkshopsViewCourseEdit extends JViewLegacy
|
class AlworkshopsViewCourseEdit extends JViewLegacy
|
||||||
{
|
{
|
||||||
public $id;
|
public $id;
|
||||||
public $editor;
|
public $editor;
|
||||||
public $pf='CourseEditController';
|
public $pf='CourseEditController';
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
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/ajax.js');
|
||||||
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/main.js');
|
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/main.js');
|
||||||
|
|
||||||
// JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/jquery-ui.css');
|
// JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/jquery-ui.css');
|
||||||
// JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/jquery-ui.js');
|
// JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/jquery-ui.js');
|
||||||
|
|
||||||
$this->id=(int)$_GET['id'];
|
$this->id=(int)$_GET['id'];
|
||||||
|
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
if (isset($_POST['save']) || isset($_POST['saveexit']) || isset($_POST['savenew']))
|
if (isset($_POST['save']) || isset($_POST['saveexit']) || isset($_POST['savenew']))
|
||||||
{
|
{
|
||||||
$tomb = array(
|
$tomb = array(
|
||||||
"title"=>trim(addslashes( ($_POST['title_new']>'' ? $_POST['title_new'] : $_POST['title']) )),
|
"title"=>trim(addslashes( ($_POST['title_new']>'' ? $_POST['title_new'] : $_POST['title']) )),
|
||||||
"alias"=>trim(addslashes($_POST['alias'])),
|
"alias"=>trim(addslashes($_POST['alias'])),
|
||||||
"price"=>trim(addslashes($_POST['price'])),
|
"price"=>trim(addslashes($_POST['price'])),
|
||||||
"vat"=>(int)$_POST['vat'],
|
"vat"=>(int)$_POST['vat'],
|
||||||
"min_attend"=>(int)$_POST['min_attend'],
|
"min_attend"=>(int)$_POST['min_attend'],
|
||||||
"capacity"=>trim(addslashes($_POST['capacity'])),
|
"capacity"=>trim(addslashes($_POST['capacity'])),
|
||||||
"location"=>trim(addslashes($_POST['location'])),
|
"location"=>trim(addslashes($_POST['location'])),
|
||||||
"email_template"=>trim(addslashes($_POST['email_template'])),
|
"email_template"=>trim(addslashes($_POST['email_template'])),
|
||||||
"start_date"=>trim(addslashes($_POST['start_date'])),
|
"start_date"=>trim(addslashes($_POST['start_date'])),
|
||||||
"start_time"=>trim(addslashes($_POST['start_time'])),
|
"start_time"=>trim(addslashes($_POST['start_time'])),
|
||||||
"finish_date"=>trim(addslashes($_POST['finish_date'])),
|
"finish_date"=>trim(addslashes($_POST['finish_date'])),
|
||||||
"finish_time"=>trim(addslashes($_POST['finish_time'])),
|
"finish_time"=>trim(addslashes($_POST['finish_time'])),
|
||||||
"published"=>strtoupper(trim(addslashes($_POST['published']))),
|
"published"=>strtoupper(trim(addslashes($_POST['published']))),
|
||||||
"comment"=>trim($_POST['comment']),
|
"comment"=>trim($_POST['comment']),
|
||||||
"course_level"=>trim($_POST['course_level']),
|
"course_level"=>trim($_POST['course_level']),
|
||||||
"course_info"=>trim($_POST['course_info']),
|
"course_info"=>trim($_POST['course_info']),
|
||||||
"course_name"=>trim($_POST['course_name']),
|
"course_name"=>trim($_POST['course_name']),
|
||||||
"yt_link"=>trim($_POST['yt_link']),
|
"yt_link"=>trim($_POST['yt_link']),
|
||||||
"external_link"=>trim($_POST['external_link'])
|
"external_link"=>trim($_POST['external_link'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($_FILES['thumbnail']['size'] > 0) {
|
if ($_FILES['thumbnail']['size'] > 0) {
|
||||||
$thumbnail_dir = "/public/img/webinar_thumbnails/";
|
$thumbnail_dir = "/public/img/webinar_thumbnails/";
|
||||||
$target_dir = $_SERVER["DOCUMENT_ROOT"].$thumbnail_dir;
|
$target_dir = $_SERVER["DOCUMENT_ROOT"].$thumbnail_dir;
|
||||||
$target_file = $target_dir.basename($_FILES["thumbnail"]["name"]);
|
$target_file = $target_dir.basename($_FILES["thumbnail"]["name"]);
|
||||||
|
|
||||||
$tomb['thumbnail'] = $thumbnail_dir.basename($_FILES["thumbnail"]["name"]);
|
$tomb['thumbnail'] = $thumbnail_dir.basename($_FILES["thumbnail"]["name"]);
|
||||||
|
|
||||||
if (!file_exists($target_file)) {
|
if (!file_exists($target_file)) {
|
||||||
move_uploaded_file($_FILES["thumbnail"]["tmp_name"], $target_file);
|
move_uploaded_file($_FILES["thumbnail"]["tmp_name"], $target_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->id)
|
if ($this->id)
|
||||||
{
|
{
|
||||||
$model->saveItem($tomb,$this->id);
|
$model->saveItem($tomb,$this->id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$newID=$model->saveItem($tomb,NULL);
|
$newID=$model->saveItem($tomb,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['save']) && !$this->id) { JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view='.JFactory::getApplication()->input->get('view').'&id='.$newID); }
|
if (isset($_POST['save']) && !$this->id) { JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view='.JFactory::getApplication()->input->get('view').'&id='.$newID); }
|
||||||
if (isset($_POST['savenew'])) { JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view='.JFactory::getApplication()->input->get('view').'&id=0'); }
|
if (isset($_POST['savenew'])) { JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view='.JFactory::getApplication()->input->get('view').'&id=0'); }
|
||||||
if (isset($_POST['saveexit'])){ JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view='.substr(JFactory::getApplication()->input->get('view'),0,-4)); }
|
if (isset($_POST['saveexit'])){ JFactory::getApplication()->redirect('index.php?option='.JFactory::getApplication()->input->get('option').'&view='.substr(JFactory::getApplication()->input->get('view'),0,-4)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->item=$model->getItem($this->id);
|
$this->item=$model->getItem($this->id);
|
||||||
$this->aliases=$model->getAliases();
|
$this->aliases=$model->getAliases();
|
||||||
$this->switch=$model->getSwitch($this->item->alias);
|
$this->switch=$model->getSwitch($this->item->alias);
|
||||||
$this->titles=$model->getTitles();
|
$this->titles=$model->getTitles();
|
||||||
$this->templates=$model->getTemplates();
|
$this->templates=$model->getTemplates();
|
||||||
if (isset($this->switch->comment) && $this->switch->comment==='Y') $this->editor=&JFactory::getEditor();
|
if (isset($this->switch->comment) && $this->switch->comment==='Y') $this->editor=&JFactory::getEditor();
|
||||||
$this->addToolBar();
|
$this->addToolBar();
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_ALWORKSHOPS').' - '.($this->id=="0" ? jText::_('COM_ALWORKSHOPS_NEW') : jText::_('COM_ALWORKSHOPS_EDIT').": ".$this->item->title )." - ".$this->id);
|
JToolBarHelper::title(JText::_('COM_ALWORKSHOPS').' - '.($this->id=="0" ? jText::_('COM_ALWORKSHOPS_NEW') : jText::_('COM_ALWORKSHOPS_EDIT').": ".$this->item->title )." - ".$this->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,91 +1,91 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
JHtml::_('behavior.tooltip');
|
JHtml::_('behavior.tooltip');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="j-sidebar-container" class="span2"><?= JHtmlSidebar::render() ?></div>
|
<div id="j-sidebar-container" class="span2"><?= JHtmlSidebar::render() ?></div>
|
||||||
|
|
||||||
<div id="j-main-container" class="span10">
|
<div id="j-main-container" class="span10">
|
||||||
<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');">
|
<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="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="name"><?= JText::_('COM_ALWORKSHOPS_NAME') ?>:</label>
|
<label for="name"><?= JText::_('COM_ALWORKSHOPS_NAME') ?>:</label>
|
||||||
<input type="text" name="name" id="name" value="<?= $_SESSION[$this->pf]['_POST']['name'] ?>" maxlength="30" />
|
<input type="text" name="name" id="name" value="<?= $_SESSION[$this->pf]['_POST']['name'] ?>" maxlength="30" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="wid"><?= JText::_('COM_ALWORKSHOPS_ID') ?>:</label>
|
<label for="wid"><?= JText::_('COM_ALWORKSHOPS_ID') ?>:</label>
|
||||||
<input type="text" name="wid" id="wid" value="" maxlength="15" />
|
<input type="text" name="wid" id="wid" value="" maxlength="15" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="start_date"><?= JText::_('COM_ALWORKSHOPS_START_DATE') ?>:</label>
|
<label for="start_date"><?= JText::_('COM_ALWORKSHOPS_START_DATE') ?>:</label>
|
||||||
<input type="text" name="start_date" id="start_date" value="" maxlength="10" />
|
<input type="text" name="start_date" id="start_date" value="" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="finish_date"><?= JText::_('COM_ALWORKSHOPS_FINISH_DATE') ?>:</label>
|
<label for="finish_date"><?= JText::_('COM_ALWORKSHOPS_FINISH_DATE') ?>:</label>
|
||||||
<input type="text" name="finish_date" id="finish_date" value="" maxlength="10" />
|
<input type="text" name="finish_date" id="finish_date" value="" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="deleted_a"><?= JText::_('COM_ALWORKSHOPS_ONLYPAY') ?>:</label>
|
<label for="deleted_a"><?= JText::_('COM_ALWORKSHOPS_ONLYPAY') ?>:</label>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="radio" name="onlypay" id="onlypay_y" value="Y" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="onlypay_y"><?= JText::_('COM_ALWORKSHOPS_YES') ?></label>
|
<input type="radio" name="onlypay" id="onlypay_y" value="Y" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="onlypay_y"><?= JText::_('COM_ALWORKSHOPS_YES') ?></label>
|
||||||
<input type="radio" name="onlypay" id="onlypay_n" value="N" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="onlypay_n"><?= JText::_('COM_ALWORKSHOPS_NO') ?></label>
|
<input type="radio" name="onlypay" id="onlypay_n" value="N" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="onlypay_n"><?= JText::_('COM_ALWORKSHOPS_NO') ?></label>
|
||||||
<input type="radio" name="onlypay" id="onlypay_a" value="A" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" checked="checked" /><label for="onlypay_a"><?= JText::_('COM_ALWORKSHOPS_ALL') ?></label>
|
<input type="radio" name="onlypay" id="onlypay_a" value="A" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" checked="checked" /><label for="onlypay_a"><?= JText::_('COM_ALWORKSHOPS_ALL') ?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="deleted_a"><?= JText::_('COM_ALWORKSHOPS_PUBLISHED') ?>:</label>
|
<label for="deleted_a"><?= JText::_('COM_ALWORKSHOPS_PUBLISHED') ?>:</label>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="radio" name="published" id="published_y" value="Y" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="published_y"><?= JText::_('COM_ALWORKSHOPS_YES') ?></label>
|
<input type="radio" name="published" id="published_y" value="Y" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="published_y"><?= JText::_('COM_ALWORKSHOPS_YES') ?></label>
|
||||||
<input type="radio" name="published" id="published_n" value="N" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="published_n"><?= JText::_('COM_ALWORKSHOPS_NO') ?></label>
|
<input type="radio" name="published" id="published_n" value="N" onclick="javascript:submitForm('<?= $this->pf ?>','tablediv');" /><label for="published_n"><?= JText::_('COM_ALWORKSHOPS_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_ALWORKSHOPS_ALL') ?></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_ALWORKSHOPS_ALL') ?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<input type="submit" name="search" id="search" value="<?= JText::_('COM_ALWORKSHOPS_SEARCH') ?>" />
|
<input type="submit" name="search" id="search" value="<?= JText::_('COM_ALWORKSHOPS_SEARCH') ?>" />
|
||||||
<input type="button" name="alap" id="alap" value="<?= JText::_('COM_ALWORKSHOPS_RESET') ?>" onclick="resetForm();" />
|
<input type="button" name="alap" id="alap" value="<?= JText::_('COM_ALWORKSHOPS_RESET') ?>" onclick="resetForm();" />
|
||||||
<input type="hidden" name="refresh" id="refresh" value="refresh" />
|
<input type="hidden" name="refresh" id="refresh" value="refresh" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
<div id="tablediv"></div>
|
<div id="tablediv"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
<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 src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
jQuery(':text').each(function() {
|
jQuery(':text').each(function() {
|
||||||
jQuery(this).val('');
|
jQuery(this).val('');
|
||||||
});
|
});
|
||||||
jQuery('#onlypay_a').attr('checked', 'checked');
|
jQuery('#onlypay_a').attr('checked', 'checked');
|
||||||
jQuery('#published_a').attr('checked', 'checked');
|
jQuery('#published_a').attr('checked', 'checked');
|
||||||
submitForm('<?= $this->pf ?>', 'tablediv');
|
submitForm('<?= $this->pf ?>', 'tablediv');
|
||||||
}
|
}
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery("#start_date").datepicker({
|
jQuery("#start_date").datepicker({
|
||||||
dateFormat: "yy-mm-dd"
|
dateFormat: "yy-mm-dd"
|
||||||
});
|
});
|
||||||
jQuery("#finish_date").datepicker({
|
jQuery("#finish_date").datepicker({
|
||||||
dateFormat: "yy-mm-dd"
|
dateFormat: "yy-mm-dd"
|
||||||
});
|
});
|
||||||
submitForm('<?= $this->pf ?>', 'tablediv');
|
submitForm('<?= $this->pf ?>', 'tablediv');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
|
|
||||||
class AlworkshopsViewEducation extends JViewLegacy
|
class AlworkshopsViewEducation extends JViewLegacy
|
||||||
{
|
{
|
||||||
public $pf='EducationController';
|
public $pf='EducationController';
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/style.css');
|
||||||
// JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/jquery-ui.css');
|
// JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/jquery-ui.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/ajax.js');
|
||||||
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/main.js');
|
JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/main.js');
|
||||||
// JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/jquery-ui.js');
|
// JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/jquery-ui.js');
|
||||||
|
|
||||||
$this->addToolBar();
|
$this->addToolBar();
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_ALWORKSHOPS').' - '.JText::_('COM_ALWORKSHOPS_EDUCATION'));
|
JToolBarHelper::title(JText::_('COM_ALWORKSHOPS').' - '.JText::_('COM_ALWORKSHOPS_EDUCATION'));
|
||||||
JToolBarHelper::back(JText::_('COM_ALWORKSHOPS_NEW'), 'index.php?option='.JFactory::getApplication()->input->get('option').'&view='.JFactory::getApplication()->input->get('view').'edit&id=0');
|
JToolBarHelper::back(JText::_('COM_ALWORKSHOPS_NEW'), 'index.php?option='.JFactory::getApplication()->input->get('option').'&view='.JFactory::getApplication()->input->get('view').'edit&id=0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,286 +1,286 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
JHtml::_('behavior.tooltip');
|
JHtml::_('behavior.tooltip');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.button {
|
.button {
|
||||||
font: bold 12px Arial;
|
font: bold 12px Arial;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background-color: #EEEEEE;
|
background-color: #EEEEEE;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
padding: 2px 6px 2px 6px;
|
padding: 2px 6px 2px 6px;
|
||||||
border-top: 1px solid #CCCCCC;
|
border-top: 1px solid #CCCCCC;
|
||||||
border-right: 1px solid #333333;
|
border-right: 1px solid #333333;
|
||||||
border-bottom: 1px solid #333333;
|
border-bottom: 1px solid #333333;
|
||||||
border-left: 1px solid #CCCCCC;
|
border-left: 1px solid #CCCCCC;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:link {
|
.button:link {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:visited {
|
.button:visited {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover {
|
.button:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:active {
|
.button:active {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-txt {
|
.custom-txt {
|
||||||
width: 50% !important;
|
width: 50% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lessons-div {
|
.lessons-div {
|
||||||
margin-left: 10%;
|
margin-left: 10%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="j-sidebar-container"><?= JHtmlSidebar::render() ?></div>
|
<div id="j-sidebar-container"><?= JHtmlSidebar::render() ?></div>
|
||||||
|
|
||||||
<div id="j-main-container">
|
<div id="j-main-container">
|
||||||
<form method="post" enctype="multipart/form-data">
|
<form method="post" enctype="multipart/form-data">
|
||||||
<div id="education_form" class="hasab">
|
<div id="education_form" class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="eid"><?= JText::_('COM_ALWORKSHOPS_ID') ?>:</label>
|
<label for="eid"><?= JText::_('COM_ALWORKSHOPS_ID') ?>:</label>
|
||||||
<input type="text" name="eid" id="eid" value="<?= $this->item->id ?>" maxlength="15" readonly="readonly" />
|
<input type="text" name="eid" id="eid" value="<?= $this->item->id ?>" maxlength="15" readonly="readonly" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="ename"><?= JText::_('COM_ALWORKSHOPS_TITLE') ?>:</label>
|
<label for="ename"><?= JText::_('COM_ALWORKSHOPS_TITLE') ?>:</label>
|
||||||
<input type="text" name="ename" id="ename" value="<?= $this->item->title ?>" />
|
<input type="text" name="ename" id="ename" value="<?= $this->item->title ?>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="published"><?= JText::_('COM_ALWORKSHOPS_PUBLISHED') ?>:</label>
|
<label for="published"><?= JText::_('COM_ALWORKSHOPS_PUBLISHED') ?>:</label>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="radio" name="published" id="published_y" value="Y" <?= ($this->item && $this->item->published === 'Y' ? 'checked="checked"' : '') ?> /><label for="published_y"><?= JText::_('COM_ALWORKSHOPS_YES') ?></label>
|
<input type="radio" name="published" id="published_y" value="Y" <?= ($this->item && $this->item->published === 'Y' ? 'checked="checked"' : '') ?> /><label for="published_y"><?= JText::_('COM_ALWORKSHOPS_YES') ?></label>
|
||||||
<input type="radio" name="published" id="published_n" value="N" <?= (!$this->item || $this->item->published === 'N' || trim($this->item->published) == '' ? 'checked="checked"' : '') ?> /><label for="published_n"><?= JText::_('COM_ALWORKSHOPS_NO') ?></label>
|
<input type="radio" name="published" id="published_n" value="N" <?= (!$this->item || $this->item->published === 'N' || trim($this->item->published) == '' ? 'checked="checked"' : '') ?> /><label for="published_n"><?= JText::_('COM_ALWORKSHOPS_NO') ?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($this->item->id > 0) : ?>
|
<?php if ($this->item->id > 0) : ?>
|
||||||
<?php $j = 0; ?>
|
<?php $j = 0; ?>
|
||||||
|
|
||||||
<?php foreach ($this->item->courses as $course) : ?>
|
<?php foreach ($this->item->courses as $course) : ?>
|
||||||
<div class="row-div" id="row_<?= $j ?>">
|
<div class="row-div" id="row_<?= $j ?>">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="courses">Course Name:</label>
|
<label for="courses">Course Name:</label>
|
||||||
<input type="text" name="courses[<?= $j ?>]" value="<?= $course->name ?>" />
|
<input type="text" name="courses[<?= $j ?>]" value="<?= $course->name ?>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<a class="button" onclick="addLesson(<?= $j ?>)">Add Lesson</a>
|
<a class="button" onclick="addLesson(<?= $j ?>)">Add Lesson</a>
|
||||||
<a class="button" onclick="deleteCourse(<?= $j ?>)">Delete Course</a>
|
<a class="button" onclick="deleteCourse(<?= $j ?>)">Delete Course</a>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<?php for ($i = 0; $i < count($course->lessons->name); $i++) : ?>
|
<?php for ($i = 0; $i < count($course->lessons->name); $i++) : ?>
|
||||||
<b><?= ($i + 1) ?>.</b>
|
<b><?= ($i + 1) ?>.</b>
|
||||||
|
|
||||||
<div class="lessons-div-<?= $j ?>" id="lesson_<?= $j ?>_<?= $i ?>">
|
<div class="lessons-div-<?= $j ?>" id="lesson_<?= $j ?>_<?= $i ?>">
|
||||||
<div class="inputholder"><label for="lessons">Lesson Name:</label><input type="text" class="custom-txt" name="lesson[<?= $j ?>][name][]" value="<?= $course->lessons->name[$i] ?>"></div>
|
<div class="inputholder"><label for="lessons">Lesson Name:</label><input type="text" class="custom-txt" name="lesson[<?= $j ?>][name][]" value="<?= $course->lessons->name[$i] ?>"></div>
|
||||||
<div class="inputholder"><label for="lessons">Youtube Link:</label><input type="text" class="custom-txt" name="lesson[<?= $j ?>][yt_link][]" value="<?= $course->lessons->yt_link[$i] ?>"></div>
|
<div class="inputholder"><label for="lessons">Youtube Link:</label><input type="text" class="custom-txt" name="lesson[<?= $j ?>][yt_link][]" value="<?= $course->lessons->yt_link[$i] ?>"></div>
|
||||||
|
|
||||||
<a class="button" onclick="deleteLesson(<?= $j ?>, <?= $i ?>)">Delete Lesson</a>
|
<a class="button" onclick="deleteLesson(<?= $j ?>, <?= $i ?>)">Delete Lesson</a>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php $j++; ?>
|
<?php $j++; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<div id="row_0">
|
<div id="row_0">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="courses">Course Name:</label>
|
<label for="courses">Course Name:</label>
|
||||||
<input type="text" name="courses[0]" value="" />
|
<input type="text" name="courses[0]" value="" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<a class="button" onclick="addLesson(0)">Add Lesson</a>
|
<a class="button" onclick="addLesson(0)">Add Lesson</a>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="thumbnail">Thumbnail:</label>
|
<label for="thumbnail">Thumbnail:</label>
|
||||||
<input type="file" name="thumbnail" id="thumbnail">
|
<input type="file" name="thumbnail" id="thumbnail">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<a href="<?= ($this->item ? $this->item->image : "") ?>" target="_blank"><?= ($this->item ? $this->item->image : "") ?></a>
|
<a href="<?= ($this->item ? $this->item->image : "") ?>" target="_blank"><?= ($this->item ? $this->item->image : "") ?></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="overview_id">Overview ID:</label>
|
<label for="overview_id">Overview ID:</label>
|
||||||
<input type="text" name="overview_id" id="overview_id" value="<?= ($this->item ? $this->item->overviewID : "") ?>" maxlength="100" />
|
<input type="text" name="overview_id" id="overview_id" value="<?= ($this->item ? $this->item->overviewID : "") ?>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<?php if ($this->item->id > 0 && $this->item->files && !empty($this->item->files)) : ?>
|
<?php if ($this->item->id > 0 && $this->item->files && !empty($this->item->files)) : ?>
|
||||||
<div id="file_row">
|
<div id="file_row">
|
||||||
<?php for ($i = 0; $i < count($this->item->files->name); $i++) : ?>
|
<?php for ($i = 0; $i < count($this->item->files->name); $i++) : ?>
|
||||||
<b><?= ($i + 1) ?>.</b>
|
<b><?= ($i + 1) ?>.</b>
|
||||||
<div class="inputholder file-div">
|
<div class="inputholder file-div">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="lessons">File name:</label>
|
<label for="lessons">File name:</label>
|
||||||
<input type="text" class="custom-txt" name="file_name[]" value="<?= $this->item->files->name[$i] ?>">
|
<input type="text" class="custom-txt" name="file_name[]" value="<?= $this->item->files->name[$i] ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="lessons">Article ID:</label>
|
<label for="lessons">Article ID:</label>
|
||||||
<input type="text" class="custom-txt" name="article_id[]" value="<?= $this->item->files->article[$i] ?>">
|
<input type="text" class="custom-txt" name="article_id[]" value="<?= $this->item->files->article[$i] ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="lessons">Download Link:</label>
|
<label for="lessons">Download Link:</label>
|
||||||
<input type="text" class="custom-txt" name="file_link[]" value="<?= $this->item->files->link[$i] ?>">
|
<input type="text" class="custom-txt" name="file_link[]" value="<?= $this->item->files->link[$i] ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr style="margin-top: 76px;">
|
<hr style="margin-top: 76px;">
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<div id="file_row">
|
<div id="file_row">
|
||||||
<b>1.</b>
|
<b>1.</b>
|
||||||
<div class="inputholder file-div">
|
<div class="inputholder file-div">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="lessons">File name:</label>
|
<label for="lessons">File name:</label>
|
||||||
<input type="text" class="custom-txt" name="file_name[]" value="">
|
<input type="text" class="custom-txt" name="file_name[]" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="lessons">Article ID:</label>
|
<label for="lessons">Article ID:</label>
|
||||||
<input type="text" class="custom-txt" name="article_id[]" value="">
|
<input type="text" class="custom-txt" name="article_id[]" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="lessons">Download Link:</label>
|
<label for="lessons">Download Link:</label>
|
||||||
<input type="text" class="custom-txt" name="file_link[]" value="">
|
<input type="text" class="custom-txt" name="file_link[]" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr style="margin-top: 76px;">
|
<hr style="margin-top: 76px;">
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<a class="button add_course">Add Course</a>
|
<a class="button add_course">Add Course</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<a class="button add_file">Add File</a>
|
<a class="button add_file">Add File</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<input type="submit" name="save" id="save" value="<?= JText::_('COM_ALWORKSHOPS_SAVE') ?>" />
|
<input type="submit" name="save" id="save" value="<?= JText::_('COM_ALWORKSHOPS_SAVE') ?>" />
|
||||||
<input type="submit" name="savenew" id="savenew" value="<?= JText::_('COM_ALWORKSHOPS_SAVE') ?> & <?= JText::_('COM_ALWORKSHOPS_NEW') ?>" />
|
<input type="submit" name="savenew" id="savenew" value="<?= JText::_('COM_ALWORKSHOPS_SAVE') ?> & <?= JText::_('COM_ALWORKSHOPS_NEW') ?>" />
|
||||||
<input type="submit" name="saveexit" id="saveexit" value="<?= JText::_('COM_ALWORKSHOPS_SAVE') ?> & <?= JText::_('COM_ALWORKSHOPS_EXIT') ?>" />
|
<input type="submit" name="saveexit" id="saveexit" value="<?= JText::_('COM_ALWORKSHOPS_SAVE') ?> & <?= JText::_('COM_ALWORKSHOPS_EXIT') ?>" />
|
||||||
<input type="button" name="exit" id="exit" value="<?= JText::_('COM_ALWORKSHOPS_EXIT') ?>" onclick="document.location.href='index.php?option=<?= JFactory::getApplication()->input->get('option') ?>&view=<?= substr(JFactory::getApplication()->input->get('view'), 0, -4) ?>';" />
|
<input type="button" name="exit" id="exit" value="<?= JText::_('COM_ALWORKSHOPS_EXIT') ?>" onclick="document.location.href='index.php?option=<?= JFactory::getApplication()->input->get('option') ?>&view=<?= substr(JFactory::getApplication()->input->get('view'), 0, -4) ?>';" />
|
||||||
<input type="reset" name="reset" id="reset" value="<?= JText::_('COM_ALWORKSHOPS_RESET') ?>" />
|
<input type="reset" name="reset" id="reset" value="<?= JText::_('COM_ALWORKSHOPS_RESET') ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
var increment = jQuery('.row-div').length;
|
var increment = jQuery('.row-div').length;
|
||||||
|
|
||||||
jQuery('.add_course').click(function(e) {
|
jQuery('.add_course').click(function(e) {
|
||||||
let html = '<div class="row-div" id="row_' + increment + '">';
|
let html = '<div class="row-div" id="row_' + increment + '">';
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<label for="courses">Course Name:</label>';
|
html += '<label for="courses">Course Name:</label>';
|
||||||
html += '<input type="text" name="courses[' + increment + ']" value="" />';
|
html += '<input type="text" name="courses[' + increment + ']" value="" />';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<a class="button" onclick="addLesson(' + increment + ')">Add Lesson</a>';
|
html += '<a class="button" onclick="addLesson(' + increment + ')">Add Lesson</a>';
|
||||||
html += '<a class="button" onclick="deleteCourse(' + increment + ')">Delete Course</a>';
|
html += '<a class="button" onclick="deleteCourse(' + increment + ')">Delete Course</a>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '<hr>';
|
html += '<hr>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
jQuery('#education_form').append(html);
|
jQuery('#education_form').append(html);
|
||||||
|
|
||||||
increment++;
|
increment++;
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('.add_file').click(function(e) {
|
jQuery('.add_file').click(function(e) {
|
||||||
let counter = jQuery('.file-div').length;
|
let counter = jQuery('.file-div').length;
|
||||||
|
|
||||||
let html = '<b>' + (counter + 1) + '.</b>';
|
let html = '<b>' + (counter + 1) + '.</b>';
|
||||||
html += '<div class="inputholder file-div">';
|
html += '<div class="inputholder file-div">';
|
||||||
|
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<label for="lessons">File name:</label>';
|
html += '<label for="lessons">File name:</label>';
|
||||||
html += '<input type="text" class="custom-txt" name="file_name[]" value="">';
|
html += '<input type="text" class="custom-txt" name="file_name[]" value="">';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<label for="lessons">Article ID:</label>';
|
html += '<label for="lessons">Article ID:</label>';
|
||||||
html += '<input type="text" class="custom-txt" name="article_id[]" value="">';
|
html += '<input type="text" class="custom-txt" name="article_id[]" value="">';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<label for="lessons">Download Link:</label>';
|
html += '<label for="lessons">Download Link:</label>';
|
||||||
html += '<input type="text" class="custom-txt" name="file_link[]" value="">';
|
html += '<input type="text" class="custom-txt" name="file_link[]" value="">';
|
||||||
html += '</div></div>';
|
html += '</div></div>';
|
||||||
html += '<hr style="margin-top: 76px;">';
|
html += '<hr style="margin-top: 76px;">';
|
||||||
|
|
||||||
jQuery('#file_row').append(html);
|
jQuery('#file_row').append(html);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function addLesson(id) {
|
function addLesson(id) {
|
||||||
let elemCount = jQuery('#row_' + id).children('.lessons-div-' + id).length + 1;
|
let elemCount = jQuery('#row_' + id).children('.lessons-div-' + id).length + 1;
|
||||||
|
|
||||||
let lessonCount = jQuery('.lessons-div-' + id).length;
|
let lessonCount = jQuery('.lessons-div-' + id).length;
|
||||||
|
|
||||||
let html = '<b>' + elemCount + '.</b><div class="lessons-div-' + id + '" id="lesson_' + id + '_' + lessonCount + '">';
|
let html = '<b>' + elemCount + '.</b><div class="lessons-div-' + id + '" id="lesson_' + id + '_' + lessonCount + '">';
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<label for="lessons">Lesson Name:</label>';
|
html += '<label for="lessons">Lesson Name:</label>';
|
||||||
html += '<input type="text" class="custom-txt" name="lesson[' + id + '][name][]" value="" />';
|
html += '<input type="text" class="custom-txt" name="lesson[' + id + '][name][]" value="" />';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="inputholder">';
|
html += '<div class="inputholder">';
|
||||||
html += '<label for="lessons">Youtube Link:</label>';
|
html += '<label for="lessons">Youtube Link:</label>';
|
||||||
html += '<input type="text" class="custom-txt" name="lesson[' + id + '][yt_link][]" value="" />';
|
html += '<input type="text" class="custom-txt" name="lesson[' + id + '][yt_link][]" value="" />';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '<a class="button" onclick="deleteLesson(' + id + ', ' + lessonCount + ')">Delete Lesson</a>';
|
html += '<a class="button" onclick="deleteLesson(' + id + ', ' + lessonCount + ')">Delete Lesson</a>';
|
||||||
html += '<hr>';
|
html += '<hr>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
jQuery('#row_' + id).append(html);
|
jQuery('#row_' + id).append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteCourse(id) {
|
function deleteCourse(id) {
|
||||||
jQuery('#row_' + id).remove();
|
jQuery('#row_' + id).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteLesson(j, i) {
|
function deleteLesson(j, i) {
|
||||||
jQuery('#lesson_' + j + '_' + i).remove();
|
jQuery('#lesson_' + j + '_' + i).remove();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -1,80 +1,80 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
|
|
||||||
class AlworkshopsViewEducationEdit extends JViewLegacy
|
class AlworkshopsViewEducationEdit extends JViewLegacy
|
||||||
{
|
{
|
||||||
public $id;
|
public $id;
|
||||||
public $pf = 'EducationEditController';
|
public $pf = 'EducationEditController';
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
JFactory::getDocument()->addStyleSheet('/administrator/components/' . JFactory::getApplication()->input->get('option') . '/assets/css/style.css');
|
JFactory::getDocument()->addStyleSheet('/administrator/components/' . JFactory::getApplication()->input->get('option') . '/assets/css/style.css');
|
||||||
// JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/jquery-ui.css');
|
// JFactory::getDocument()->addStyleSheet('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/css/jquery-ui.css');
|
||||||
// JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/jquery-ui.js');
|
// JFactory::getDocument()->addScript('/administrator/components/'.JFactory::getApplication()->input->get('option').'/assets/js/jquery-ui.js');
|
||||||
|
|
||||||
$this->id = (int)$_GET['id'];
|
$this->id = (int)$_GET['id'];
|
||||||
|
|
||||||
$model = $this->getModel();
|
$model = $this->getModel();
|
||||||
|
|
||||||
if (isset($_POST['save']) || isset($_POST['saveexit']) || isset($_POST['savenew']) && $_POST['ename'] != '') {
|
if (isset($_POST['save']) || isset($_POST['saveexit']) || isset($_POST['savenew']) && $_POST['ename'] != '') {
|
||||||
$tomb = array(
|
$tomb = array(
|
||||||
"title" => trim(addslashes($_POST['ename'])),
|
"title" => trim(addslashes($_POST['ename'])),
|
||||||
"courses" => $_POST['courses'],
|
"courses" => $_POST['courses'],
|
||||||
"published" => strtoupper(trim(addslashes($_POST['published']))),
|
"published" => strtoupper(trim(addslashes($_POST['published']))),
|
||||||
"lessons" => $_POST['lesson'],
|
"lessons" => $_POST['lesson'],
|
||||||
"fileNames" => $_POST['file_name'],
|
"fileNames" => $_POST['file_name'],
|
||||||
"fileLinks" => $_POST['file_link'],
|
"fileLinks" => $_POST['file_link'],
|
||||||
"articleID" => $_POST['article_id'],
|
"articleID" => $_POST['article_id'],
|
||||||
"overviewID" => $_POST['overview_id']
|
"overviewID" => $_POST['overview_id']
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($_FILES['thumbnail']['size'] > 0) {
|
if ($_FILES['thumbnail']['size'] > 0) {
|
||||||
$thumbnail_dir = "/public/img/education_thumbnails/";
|
$thumbnail_dir = "/public/img/education_thumbnails/";
|
||||||
$target_dir = $_SERVER["DOCUMENT_ROOT"] . $thumbnail_dir;
|
$target_dir = $_SERVER["DOCUMENT_ROOT"] . $thumbnail_dir;
|
||||||
$target_file = $target_dir . basename($_FILES["thumbnail"]["name"]);
|
$target_file = $target_dir . basename($_FILES["thumbnail"]["name"]);
|
||||||
|
|
||||||
$tomb['thumbnail'] = $thumbnail_dir . basename($_FILES["thumbnail"]["name"]);
|
$tomb['thumbnail'] = $thumbnail_dir . basename($_FILES["thumbnail"]["name"]);
|
||||||
|
|
||||||
if (!file_exists($target_file)) {
|
if (!file_exists($target_file)) {
|
||||||
move_uploaded_file($_FILES["thumbnail"]["tmp_name"], $target_file);
|
move_uploaded_file($_FILES["thumbnail"]["tmp_name"], $target_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->id && $this->id > 0) {
|
if ($this->id && $this->id > 0) {
|
||||||
$model->saveItem($tomb, $this->id);
|
$model->saveItem($tomb, $this->id);
|
||||||
} else {
|
} else {
|
||||||
$newID = $model->saveItem($tomb, NULL);
|
$newID = $model->saveItem($tomb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['save']) && !$this->id) {
|
if (isset($_POST['save']) && !$this->id) {
|
||||||
JFactory::getApplication()->redirect('index.php?option=' . JFactory::getApplication()->input->get('option') . '&view=' . JFactory::getApplication()->input->get('view') . '&id=' . $newID);
|
JFactory::getApplication()->redirect('index.php?option=' . JFactory::getApplication()->input->get('option') . '&view=' . JFactory::getApplication()->input->get('view') . '&id=' . $newID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['savenew'])) {
|
if (isset($_POST['savenew'])) {
|
||||||
JFactory::getApplication()->redirect('index.php?option=' . JFactory::getApplication()->input->get('option') . '&view=' . JFactory::getApplication()->input->get('view') . '&id=0');
|
JFactory::getApplication()->redirect('index.php?option=' . JFactory::getApplication()->input->get('option') . '&view=' . JFactory::getApplication()->input->get('view') . '&id=0');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['saveexit'])) {
|
if (isset($_POST['saveexit'])) {
|
||||||
JFactory::getApplication()->redirect('index.php?option=' . JFactory::getApplication()->input->get('option') . '&view=' . substr(JFactory::getApplication()->input->get('view'), 0, -4));
|
JFactory::getApplication()->redirect('index.php?option=' . JFactory::getApplication()->input->get('option') . '&view=' . substr(JFactory::getApplication()->input->get('view'), 0, -4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->item = $model->getItem($this->id);
|
$this->item = $model->getItem($this->id);
|
||||||
|
|
||||||
if ($this->id && $this->id > 0) {
|
if ($this->id && $this->id > 0) {
|
||||||
$this->item->courses = json_decode($this->item->lessons)->courses;
|
$this->item->courses = json_decode($this->item->lessons)->courses;
|
||||||
$this->item->files = json_decode($this->item->fileDownloadLink)->files;
|
$this->item->files = json_decode($this->item->fileDownloadLink)->files;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addToolBar();
|
$this->addToolBar();
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_ALWORKSHOPS') . ' - ' . JText::_('COM_ALWORKSHOPS_EDUCATION') . ' - ' . ($this->id == "0" ? jText::_('COM_ALWORKSHOPS_NEW') : jText::_('COM_ALWORKSHOPS_EDIT') . ": " . $this->id));
|
JToolBarHelper::title(JText::_('COM_ALWORKSHOPS') . ' - ' . JText::_('COM_ALWORKSHOPS_EDUCATION') . ' - ' . ($this->id == "0" ? jText::_('COM_ALWORKSHOPS_NEW') : jText::_('COM_ALWORKSHOPS_EDIT') . ": " . $this->id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,89 +1,89 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
JHtml::_('behavior.tooltip');
|
JHtml::_('behavior.tooltip');
|
||||||
?>
|
?>
|
||||||
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
<div id="j-sidebar-container"><?=JHtmlSidebar::render()?></div>
|
||||||
|
|
||||||
<div id="j-main-container">
|
<div id="j-main-container">
|
||||||
<form method="post" enctype="multipart/form-data">
|
<form method="post" enctype="multipart/form-data">
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="sid"><?=JText::_('COM_ALWORKSHOPS_ID')?>:</label>
|
<label for="sid"><?=JText::_('COM_ALWORKSHOPS_ID')?>:</label>
|
||||||
<input type="text" name="sid" id="sid" value="<?=($this->item ? $this->item->id : '')?>" maxlength="15" readonly="readonly" />
|
<input type="text" name="sid" id="sid" value="<?=($this->item ? $this->item->id : '')?>" maxlength="15" readonly="readonly" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="courseid"><?=JText::_('COM_ALWORKSHOPS_COURSEID')?>:</label>
|
<label for="courseid"><?=JText::_('COM_ALWORKSHOPS_COURSEID')?>:</label>
|
||||||
<select name="courseid" id="courseid">
|
<select name="courseid" id="courseid">
|
||||||
<?php foreach($this->courses as $course) : ?>
|
<?php foreach($this->courses as $course) : ?>
|
||||||
<option value="<?=$course->id?>" <?=($this->item->courseid==$course->id ? 'selected="selected"' : "")?>><?=$course->title?>: <?=$course->start_date?>-<?=$course->finish_date?> [<?=$course->id?>]</option>
|
<option value="<?=$course->id?>" <?=($this->item->courseid==$course->id ? 'selected="selected"' : "")?>><?=$course->title?>: <?=$course->start_date?>-<?=$course->finish_date?> [<?=$course->id?>]</option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="title"><?=JText::_('COM_ALWORKSHOPS_TITLE')?>:</label>
|
<label for="title"><?=JText::_('COM_ALWORKSHOPS_TITLE')?>:</label>
|
||||||
<select name="title" id="title">
|
<select name="title" id="title">
|
||||||
<?php foreach($this->titles as $title) : ?>
|
<?php foreach($this->titles as $title) : ?>
|
||||||
<option value="<?=$title->title?>" <?=($this->item->title==$title->title ? 'selected="selected"' : "")?>><?=$title->title?></option>
|
<option value="<?=$title->title?>" <?=($this->item->title==$title->title ? 'selected="selected"' : "")?>><?=$title->title?></option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="session_date"><?=JText::_('COM_ALWORKSHOPS_START_DATE')?>:</label>
|
<label for="session_date"><?=JText::_('COM_ALWORKSHOPS_START_DATE')?>:</label>
|
||||||
<input type="text" name="session_date" id="session_date" value="<?=($this->item ? $this->item->session_date : '')?>" maxlength="10" />
|
<input type="text" name="session_date" id="session_date" value="<?=($this->item ? $this->item->session_date : '')?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="start_time"><?=JText::_('COM_ALWORKSHOPS_START_TIME')?>:</label>
|
<label for="start_time"><?=JText::_('COM_ALWORKSHOPS_START_TIME')?>:</label>
|
||||||
<input type="text" name="start_time" id="start_time" value="<?=($this->item ? $this->item->start_time : '')?>" maxlength="10" />
|
<input type="text" name="start_time" id="start_time" value="<?=($this->item ? $this->item->start_time : '')?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="finish_time"><?=JText::_('COM_ALWORKSHOPS_FINISH_TIME')?>:</label>
|
<label for="finish_time"><?=JText::_('COM_ALWORKSHOPS_FINISH_TIME')?>:</label>
|
||||||
<input type="text" name="finish_time" id="finish_time" value="<?=($this->item ? $this->item->finish_time : '')?>" maxlength="10" />
|
<input type="text" name="finish_time" id="finish_time" value="<?=($this->item ? $this->item->finish_time : '')?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="duration"><?=JText::_('COM_ALWORKSHOPS_DURATION')?>:</label>
|
<label for="duration"><?=JText::_('COM_ALWORKSHOPS_DURATION')?>:</label>
|
||||||
<input type="text" name="duration" id="duration" value="<?=($this->item ? $this->item->duration : '')?>" maxlength="10" />
|
<input type="text" name="duration" id="duration" value="<?=($this->item ? $this->item->duration : '')?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="switchid"><?=JText::_('COM_ALWORKSHOPS_SESSIONDESC')?>:</label>
|
<label for="switchid"><?=JText::_('COM_ALWORKSHOPS_SESSIONDESC')?>:</label>
|
||||||
<select name="switchid" id="switchid">
|
<select name="switchid" id="switchid">
|
||||||
<?php foreach($this->descriptions as $description) : ?>
|
<?php foreach($this->descriptions as $description) : ?>
|
||||||
<option value="<?=$description->switchid?>" <?=($this->item->switchid==$description->switchid ? 'selected="selected"' : "")?>><?=$description->title?></option>
|
<option value="<?=$description->switchid?>" <?=($this->item->switchid==$description->switchid ? 'selected="selected"' : "")?>><?=$description->title?></option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="ordering"><?=JText::_('COM_ALWORKSHOPS_ORDERING')?>:</label>
|
<label for="ordering"><?=JText::_('COM_ALWORKSHOPS_ORDERING')?>:</label>
|
||||||
<input type="text" name="ordering" id="ordering" value="<?=($this->item ? $this->item->ordering : '')?>" maxlength="10" />
|
<input type="text" name="ordering" id="ordering" value="<?=($this->item ? $this->item->ordering : '')?>" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<label for="published"><?=JText::_('COM_ALWORKSHOPS_PUBLISHED')?>:</label>
|
<label for="published"><?=JText::_('COM_ALWORKSHOPS_PUBLISHED')?>:</label>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="radio" name="published" id="published_y" value="Y" <?=($this->item && $this->item->published==='Y' ? 'checked="checked"' : '')?> /><label for="published_y"><?=JText::_('COM_ALWORKSHOPS_YES')?></label>
|
<input type="radio" name="published" id="published_y" value="Y" <?=($this->item && $this->item->published==='Y' ? 'checked="checked"' : '')?> /><label for="published_y"><?=JText::_('COM_ALWORKSHOPS_YES')?></label>
|
||||||
<input type="radio" name="published" id="published_n" value="N" <?=(!$this->item || $this->item->published==='N' || trim($this->item->published)=='' ? 'checked="checked"' : '')?> /><label for="published_n"><?=JText::_('COM_ALWORKSHOPS_NO')?></label>
|
<input type="radio" name="published" id="published_n" value="N" <?=(!$this->item || $this->item->published==='N' || trim($this->item->published)=='' ? 'checked="checked"' : '')?> /><label for="published_n"><?=JText::_('COM_ALWORKSHOPS_NO')?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
<div class="hasab">
|
<div class="hasab">
|
||||||
<div class="inputholder">
|
<div class="inputholder">
|
||||||
<input type="submit" name="save" id="save" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?>" />
|
<input type="submit" name="save" id="save" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?>" />
|
||||||
<input type="submit" name="savenew" id="savenew" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_NEW')?>" />
|
<input type="submit" name="savenew" id="savenew" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_NEW')?>" />
|
||||||
<input type="submit" name="saveexit" id="saveexit" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_EXIT')?>" />
|
<input type="submit" name="saveexit" id="saveexit" value="<?=JText::_('COM_ALWORKSHOPS_SAVE')?> & <?=JText::_('COM_ALWORKSHOPS_EXIT')?>" />
|
||||||
<input type="button" name="exit" id="exit" value="<?=JText::_('COM_ALWORKSHOPS_EXIT')?>" onclick="document.location.href='index.php?option=<?=JFactory::getApplication()->input->get('option')?>&view=<?=substr(JFactory::getApplication()->input->get('view'),0,-4)?>';" />
|
<input type="button" name="exit" id="exit" value="<?=JText::_('COM_ALWORKSHOPS_EXIT')?>" onclick="document.location.href='index.php?option=<?=JFactory::getApplication()->input->get('option')?>&view=<?=substr(JFactory::getApplication()->input->get('view'),0,-4)?>';" />
|
||||||
<input type="reset" name="reset" id="reset" value="<?=JText::_('COM_ALWORKSHOPS_RESET')?>" />
|
<input type="reset" name="reset" id="reset" value="<?=JText::_('COM_ALWORKSHOPS_RESET')?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
<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 src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function()
|
jQuery(document).ready(function()
|
||||||
{
|
{
|
||||||
jQuery("#session_date").datepicker({dateFormat: "yy-mm-dd"});
|
jQuery("#session_date").datepicker({dateFormat: "yy-mm-dd"});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,85 +1,85 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
class Controller extends BaseController {
|
class Controller extends BaseController {
|
||||||
protected $lang;
|
protected $lang;
|
||||||
public $pf='FollowedlinksController';
|
public $pf='FollowedlinksController';
|
||||||
|
|
||||||
public function procEvent() {
|
public function procEvent() {
|
||||||
if (!isset($_SESSION[$this->pf]["_POST"]) || trim($_POST['refresh'])=='' ) $_SESSION[$this->pf]["_POST"]=$_POST;
|
if (!isset($_SESSION[$this->pf]["_POST"]) || trim($_POST['refresh'])=='' ) $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||||
$se=&$_SESSION[$this->pf]['_POST'];
|
$se=&$_SESSION[$this->pf]['_POST'];
|
||||||
$felt="";
|
$felt="";
|
||||||
$arrIcons=array(
|
$arrIcons=array(
|
||||||
'smallEdit'=>array("href"=>"index.php?option=com_followedlinks&view=linkedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
'smallEdit'=>array("href"=>"index.php?option=com_followedlinks&view=linkedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"id","alttext"=>"Edit" ),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->auth()==FALSE) die();
|
if ($this->auth()==FALSE) die();
|
||||||
|
|
||||||
if (!isset($_SESSION[$this->pf]['tableorder'])) $_SESSION[$this->pf]['tableorder']='id DESC';
|
if (!isset($_SESSION[$this->pf]['tableorder'])) $_SESSION[$this->pf]['tableorder']='id DESC';
|
||||||
|
|
||||||
if (isset($se['string']) && trim($se['string'])>"") $felt.=" AND (`name` LIKE '%".trim($se['string'])."%' OR `alias` LIKE '%".trim($se['string'])."%' OR `esem_cont` LIKE '%".trim($se['string'])."%' OR `redirect` LIKE '%".trim($se['string'])."%')";
|
if (isset($se['string']) && trim($se['string'])>"") $felt.=" AND (`name` LIKE '%".trim($se['string'])."%' OR `alias` LIKE '%".trim($se['string'])."%' OR `esem_cont` LIKE '%".trim($se['string'])."%' OR `redirect` LIKE '%".trim($se['string'])."%')";
|
||||||
|
|
||||||
$cl=($this->getLang()=='hun' ? 'hu-HU' : 'en-GB');
|
$cl=($this->getLang()=='hun' ? 'hu-HU' : 'en-GB');
|
||||||
$LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$cl."/".$cl.".com_followedlinks.ini");
|
$LANG=parse_ini_file($_SERVER['DOCUMENT_ROOT']."/administrator/language/".$cl."/".$cl.".com_followedlinks.ini");
|
||||||
|
|
||||||
$objTabla=New TableHelper();
|
$objTabla=New TableHelper();
|
||||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>'tablediv'));
|
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','tablediv'=>'tablediv'));
|
||||||
$v=$objTabla->setSession();
|
$v=$objTabla->setSession();
|
||||||
$objTabla->setColumn('id',array('header'=>'Id','width'=>'40px','link'=>'index.php?option=com_followedlinks&view=linkedit&id=REPLACE'));
|
$objTabla->setColumn('id',array('header'=>'Id','width'=>'40px','link'=>'index.php?option=com_followedlinks&view=linkedit&id=REPLACE'));
|
||||||
$objTabla->setColumn('name',array('header'=>$LANG['COM_FOLLOWEDLINKS_NAME'],'format'=>'text','align'=>'left','strlen'=>30,'width'=>'200px','link'=>'index.php?option=com_followedlinks&view=linkedit&id=REPLACE','linkjoin'=>'id'));
|
$objTabla->setColumn('name',array('header'=>$LANG['COM_FOLLOWEDLINKS_NAME'],'format'=>'text','align'=>'left','strlen'=>30,'width'=>'200px','link'=>'index.php?option=com_followedlinks&view=linkedit&id=REPLACE','linkjoin'=>'id'));
|
||||||
$objTabla->setColumn('alias',array('header'=>$LANG['COM_FOLLOWEDLINKS_ALIAS'],'format'=>'text','align'=>'left'));
|
$objTabla->setColumn('alias',array('header'=>$LANG['COM_FOLLOWEDLINKS_ALIAS'],'format'=>'text','align'=>'left'));
|
||||||
$objTabla->setColumn('esem_id',array('header'=>str_replace(' ', '<br />', $LANG['COM_FOLLOWEDLINKS_EVENT_NUMBER']),'format'=>'number','decimal'=>0,'width'=>'50px'));
|
$objTabla->setColumn('esem_id',array('header'=>str_replace(' ', '<br />', $LANG['COM_FOLLOWEDLINKS_EVENT_NUMBER']),'format'=>'number','decimal'=>0,'width'=>'50px'));
|
||||||
$objTabla->setColumn('esem_cont',array('header'=>$LANG['COM_FOLLOWEDLINKS_EVENT_CONTENT'],'format'=>'text','align'=>'left','strlen'=>30,'width'=>'200px'));
|
$objTabla->setColumn('esem_cont',array('header'=>$LANG['COM_FOLLOWEDLINKS_EVENT_CONTENT'],'format'=>'text','align'=>'left','strlen'=>30,'width'=>'200px'));
|
||||||
$objTabla->setColumn('redirect',array('header'=>$LANG['COM_FOLLOWEDLINKS_REDIRECT'],'format'=>'text','align'=>'left'));
|
$objTabla->setColumn('redirect',array('header'=>$LANG['COM_FOLLOWEDLINKS_REDIRECT'],'format'=>'text','align'=>'left'));
|
||||||
$objTabla->setColumn('options',array('header'=>$LANG['COM_FOLLOWEDLINKS_OPTIONS'],'align'=>'right','width'=>'60px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
$objTabla->setColumn('options',array('header'=>$LANG['COM_FOLLOWEDLINKS_OPTIONS'],'align'=>'right','width'=>'60px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'id'));
|
||||||
$objTabla->setQuery(array("
|
$objTabla->setQuery(array("
|
||||||
SELECT id,name,alias,esem_id,esem_cont,REPLACE(REPLACE(`redirect`,'http://www.archline.hu',''),'http://www.archlinexp.com','') AS redirect,'smallEdit' AS options
|
SELECT id,name,alias,esem_id,esem_cont,REPLACE(REPLACE(`redirect`,'http://www.archline.hu',''),'http://www.archlinexp.com','') AS redirect,'smallEdit' AS options
|
||||||
FROM followed_links
|
FROM followed_links
|
||||||
WHERE `lang`='".$this->getLang()."' ".$felt
|
WHERE `lang`='".$this->getLang()."' ".$felt
|
||||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
.((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'] : ''),"
|
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||||
SELECT COUNT(*) AS recordCount
|
SELECT COUNT(*) AS recordCount
|
||||||
FROM (
|
FROM (
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM followed_links
|
FROM followed_links
|
||||||
WHERE `lang`='".$this->getLang()."' ".$felt."
|
WHERE `lang`='".$this->getLang()."' ".$felt."
|
||||||
) x"
|
) x"
|
||||||
));
|
));
|
||||||
// $this->printSession($this->pf);
|
// $this->printSession($this->pf);
|
||||||
// print "<pre>".print_r($_SESSION,true)."</pre>";
|
// print "<pre>".print_r($_SESSION,true)."</pre>";
|
||||||
$objTabla->drawTable(TRUE);
|
$objTabla->drawTable(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auth()
|
public function auth()
|
||||||
{
|
{
|
||||||
MySqlHelper::getInstance()->query("
|
MySqlHelper::getInstance()->query("
|
||||||
(SELECT * FROM jml_session where session_id='".trim(addslashes($_POST['sess']))."' LIMIT 1)
|
(SELECT * FROM jml_session where session_id='".trim(addslashes($_POST['sess']))."' LIMIT 1)
|
||||||
UNION
|
UNION
|
||||||
(SELECT * FROM eng_session where session_id='".trim(addslashes($_POST['sess']))."' LIMIT 1);");
|
(SELECT * FROM eng_session where session_id='".trim(addslashes($_POST['sess']))."' LIMIT 1);");
|
||||||
$sess=MySqlHelper::getInstance()->fetchAssoc();
|
$sess=MySqlHelper::getInstance()->fetchAssoc();
|
||||||
if (count($sess))
|
if (count($sess))
|
||||||
{
|
{
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM jml_user_usergroup_map where group_id IN (7,8) AND user_id=".$sess[0]['userid'].";");
|
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();
|
$admin=MySqlHelper::getInstance()->fetchAssoc();
|
||||||
return (count($admin) ? TRUE : FALSE);
|
return (count($admin) ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
if (!isset($this->lang)) { $this->lang=(strpos( $_SERVER['HTTP_HOST'], ".com") ? "eng" : "hun"); }
|
||||||
return $this->lang;
|
return $this->lang;
|
||||||
}
|
}
|
||||||
} // end of class
|
} // end of class
|
||||||
|
|
||||||
$controller=new Controller();
|
$controller=new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery("#refresh").attr('value','');
|
jQuery("#refresh").attr('value','');
|
||||||
jQuery("#string").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["string"]?>');
|
jQuery("#string").attr('value','<?=$_SESSION[$controller->pf]["_POST"]["string"]?>');
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,44 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Followedlinks</name>
|
<name>Followedlinks</name>
|
||||||
<!-- The following elements are optional and free of formatting constraints -->
|
<!-- The following elements are optional and free of formatting constraints -->
|
||||||
<creationDate>July 2015</creationDate>
|
<creationDate>July 2015</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<!-- The version string is recorded in the components table -->
|
<!-- The version string is recorded in the components table -->
|
||||||
<version>0.0.6</version>
|
<version>0.0.6</version>
|
||||||
<!-- The description is optional and defaults to the name -->
|
<!-- The description is optional and defaults to the name -->
|
||||||
<description>Description of the Followedlinks component ...</description>
|
<description>Description of the Followedlinks component ...</description>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
<!-- Administration Menu Section -->
|
<!-- Administration Menu Section -->
|
||||||
<menu>COM_FOLLOWEDLINKS_FOLLOWEDLINKS</menu>
|
<menu>COM_FOLLOWEDLINKS_FOLLOWEDLINKS</menu>
|
||||||
<submenu>
|
<submenu>
|
||||||
<menu link="option=com_followedlinks">COM_FOLLOWEDLINKS_CONTROL_PANEL</menu>
|
<menu link="option=com_followedlinks">COM_FOLLOWEDLINKS_CONTROL_PANEL</menu>
|
||||||
<menu link="option=com_followedlinks&view=links">COM_FOLLOWEDLINKS_FOLLOWEDLINKS</menu>
|
<menu link="option=com_followedlinks&view=links">COM_FOLLOWEDLINKS_FOLLOWEDLINKS</menu>
|
||||||
</submenu>
|
</submenu>
|
||||||
|
|
||||||
<!-- Administration Main File Copy Section -->
|
<!-- Administration Main File Copy Section -->
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /admin/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /admin/ in the package -->
|
||||||
<files folder="admin">
|
<files folder="admin">
|
||||||
<!-- Admin Main File Copy Section -->
|
<!-- Admin Main File Copy Section -->
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>followedlinks.php</filename>
|
<filename>followedlinks.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
<folder>helpers</folder>
|
<folder>helpers</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<languages folder="admin/language">
|
<languages folder="admin/language">
|
||||||
<language tag="hu-HU">hu-HU.com_followedlinks.ini</language>
|
<language tag="hu-HU">hu-HU.com_followedlinks.ini</language>
|
||||||
<language tag="hu-HU">hu-HU.com_followedlinks.sys.ini</language>
|
<language tag="hu-HU">hu-HU.com_followedlinks.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_followedlinks.ini</language>
|
<language tag="en-GB">en-GB.com_followedlinks.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_followedlinks.sys.ini</language>
|
<language tag="en-GB">en-GB.com_followedlinks.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,35 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Nonprofit</name>
|
<name>Nonprofit</name>
|
||||||
<!-- The following elements are optional and free of formatting constraints -->
|
<!-- The following elements are optional and free of formatting constraints -->
|
||||||
<creationDate>February 2015</creationDate>
|
<creationDate>February 2015</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<!-- The version string is recorded in the components table -->
|
<!-- The version string is recorded in the components table -->
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<!-- The description is optional and defaults to the name -->
|
<!-- The description is optional and defaults to the name -->
|
||||||
<description>Description of the nonprofit component ...</description>
|
<description>Description of the nonprofit component ...</description>
|
||||||
|
|
||||||
<languages folder="language">
|
<languages folder="language">
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.com_nonprofit.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.com_nonprofit.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.com_nonprofit.sys.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.com_nonprofit.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.com_nonprofit.ini</language>
|
<language tag="en-GB">en-GB/en-GB.com_nonprofit.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.com_nonprofit.sys.ini</language>
|
<language tag="en-GB">en-GB/en-GB.com_nonprofit.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
|
|
||||||
<!-- Site Main File Copy Section -->
|
<!-- Site Main File Copy Section -->
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
||||||
<files folder="site">
|
<files folder="site">
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>nonprofit.php</filename>
|
<filename>nonprofit.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,37 +1,37 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Presentation</name>
|
<name>Presentation</name>
|
||||||
<!-- The following elements are optional and free of formatting constraints -->
|
<!-- The following elements are optional and free of formatting constraints -->
|
||||||
<creationDate>September 2015</creationDate>
|
<creationDate>September 2015</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<!-- The version string is recorded in the components table -->
|
<!-- The version string is recorded in the components table -->
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<!-- The description is optional and defaults to the name -->
|
<!-- The description is optional and defaults to the name -->
|
||||||
<description>Description of the presentation component ...</description>
|
<description>Description of the presentation component ...</description>
|
||||||
|
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
||||||
<!-- Site Language File Copy Section -->
|
<!-- Site Language File Copy Section -->
|
||||||
<languages folder="language">
|
<languages folder="language">
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.com_presentation.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.com_presentation.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.com_presentation.sys.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.com_presentation.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.com_presentation.ini</language>
|
<language tag="en-GB">en-GB/en-GB.com_presentation.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.com_presentation.sys.ini</language>
|
<language tag="en-GB">en-GB/en-GB.com_presentation.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
|
|
||||||
<files folder="site">
|
<files folder="site">
|
||||||
<!-- Site Main File Copy Section -->
|
<!-- Site Main File Copy Section -->
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>presentation.php</filename>
|
<filename>presentation.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,62 +1,62 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Project</name>
|
<name>Project</name>
|
||||||
<creationDate>July 2015</creationDate>
|
<creationDate>July 2015</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<description>COM_PROJECT_DESCRIPTION</description>
|
<description>COM_PROJECT_DESCRIPTION</description>
|
||||||
|
|
||||||
<!-- Administration Section -->
|
<!-- Administration Section -->
|
||||||
<administration>
|
<administration>
|
||||||
<!-- Administration Language File Copy Section -->
|
<!-- Administration Language File Copy Section -->
|
||||||
<languages folder="admin/language">
|
<languages folder="admin/language">
|
||||||
<language tag="hu-HU">hu-HU.com_project.ini</language>
|
<language tag="hu-HU">hu-HU.com_project.ini</language>
|
||||||
<language tag="hu-HU">hu-HU.com_project.sys.ini</language>
|
<language tag="hu-HU">hu-HU.com_project.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_project.ini</language>
|
<language tag="en-GB">en-GB.com_project.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_project.sys.ini</language>
|
<language tag="en-GB">en-GB.com_project.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
|
|
||||||
<!-- Administration Menu Section -->
|
<!-- Administration Menu Section -->
|
||||||
<menu>COM_PROJECT_PROJECTS</menu>
|
<menu>COM_PROJECT_PROJECTS</menu>
|
||||||
<submenu>
|
<submenu>
|
||||||
<menu link="option=com_project">COM_PROJECT_CONTROL_PANEL</menu>
|
<menu link="option=com_project">COM_PROJECT_CONTROL_PANEL</menu>
|
||||||
<menu link="option=com_project&view=projects">COM_PROJECT_PROJECTS</menu>
|
<menu link="option=com_project&view=projects">COM_PROJECT_PROJECTS</menu>
|
||||||
<menu link="option=com_project&view=types">COM_PROJECT_TYPES</menu>
|
<menu link="option=com_project&view=types">COM_PROJECT_TYPES</menu>
|
||||||
</submenu>
|
</submenu>
|
||||||
|
|
||||||
<!-- Administration Main File Copy Section -->
|
<!-- Administration Main File Copy Section -->
|
||||||
<files folder="admin">
|
<files folder="admin">
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>project.php</filename>
|
<filename>project.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
<folder>helpers</folder>
|
<folder>helpers</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
</files>
|
</files>
|
||||||
</administration>
|
</administration>
|
||||||
|
|
||||||
<!-- Site Section -->
|
<!-- Site Section -->
|
||||||
<files folder="site">
|
<files folder="site">
|
||||||
<!-- Site Language File Copy Section -->
|
<!-- Site Language File Copy Section -->
|
||||||
<!--languages folder="site/language">
|
<!--languages folder="site/language">
|
||||||
<language tag="hu-HU">hu-HU.com_project.ini</language>
|
<language tag="hu-HU">hu-HU.com_project.ini</language>
|
||||||
<language tag="hu-HU">hu-HU.com_project.sys.ini</language>
|
<language tag="hu-HU">hu-HU.com_project.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_project.ini</language>
|
<language tag="en-GB">en-GB.com_project.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_project.sys.ini</language>
|
<language tag="en-GB">en-GB.com_project.sys.ini</language>
|
||||||
</languages-->
|
</languages-->
|
||||||
|
|
||||||
<!-- Site Main File Copy Section -->
|
<!-- Site Main File Copy Section -->
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>project.php</filename>
|
<filename>project.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,226 +1,226 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
class Controller extends BaseController
|
class Controller extends BaseController
|
||||||
{
|
{
|
||||||
public $pf = 'ProductsController';
|
public $pf = 'ProductsController';
|
||||||
public $logoPath = '/public/img/collection/REPLACE/zz_thumb.jpg';
|
public $logoPath = '/public/img/collection/REPLACE/zz_thumb.jpg';
|
||||||
public $filePath = '/public/collection/';
|
public $filePath = '/public/collection/';
|
||||||
|
|
||||||
public function procEvent()
|
public function procEvent()
|
||||||
{
|
{
|
||||||
$lang = $_SERVER['SERVER_NAME'] == 'www.archlinexp.com' ? 'eng' : 'hun';
|
$lang = $_SERVER['SERVER_NAME'] == 'www.archlinexp.com' ? 'eng' : 'hun';
|
||||||
if (!isset($_SESSION[$this->pf]["_POST"]) || trim($_POST["refresh"]) == "") $_SESSION[$this->pf]["_POST"] = $_POST;
|
if (!isset($_SESSION[$this->pf]["_POST"]) || trim($_POST["refresh"]) == "") $_SESSION[$this->pf]["_POST"] = $_POST;
|
||||||
if (isset($_POST['uploadForm']) && !isset($_SESSION[$this->pf]["_POST"][$this->pf . "_tableipp"])) $_SESSION[$this->pf]['_POST'][$this->pf . "_tableipp"] = 5;
|
if (isset($_POST['uploadForm']) && !isset($_SESSION[$this->pf]["_POST"][$this->pf . "_tableipp"])) $_SESSION[$this->pf]['_POST'][$this->pf . "_tableipp"] = 5;
|
||||||
if (isset($_POST['uploadForm']) && !isset($_SESSION[$this->pf]["tableipp"])) $_SESSION[$this->pf]["tableipp"] = 5;
|
if (isset($_POST['uploadForm']) && !isset($_SESSION[$this->pf]["tableipp"])) $_SESSION[$this->pf]["tableipp"] = 5;
|
||||||
$se = &$_SESSION[$this->pf]['_POST'];
|
$se = &$_SESSION[$this->pf]['_POST'];
|
||||||
$felt = "";
|
$felt = "";
|
||||||
$arrIcons = array(
|
$arrIcons = array(
|
||||||
'smallView' => array("href" => "REPLACE", "img" => IconHelper::getIcon("smallView"), "linkjoin" => "logo", "alttext" => "Preview"),
|
'smallView' => array("href" => "REPLACE", "img" => IconHelper::getIcon("smallView"), "linkjoin" => "logo", "alttext" => "Preview"),
|
||||||
'smallMissingView' => array("href" => "REPLACE", "img" => IconHelper::getIcon("smallMissingView"), "linkjoin" => "logo", "alttext" => "Preview"),
|
'smallMissingView' => array("href" => "REPLACE", "img" => IconHelper::getIcon("smallMissingView"), "linkjoin" => "logo", "alttext" => "Preview"),
|
||||||
'smallError' => array("href" => "REPLACE", "img" => IconHelper::getIcon("smallError"), "linkjoin" => "filedir", "alttext" => "Missing"),
|
'smallError' => array("href" => "REPLACE", "img" => IconHelper::getIcon("smallError"), "linkjoin" => "filedir", "alttext" => "Missing"),
|
||||||
'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")),
|
'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")),
|
'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")),
|
'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")),
|
||||||
'smallEdit' => array("href" => "index.php?option=com_showroom&view=productedit&id=REPLACE", "img" => IconHelper::getIcon("smallEdit"), "linkjoin" => "id", "alttext" => "Edit"),
|
'smallEdit' => array("href" => "index.php?option=com_showroom&view=productedit&id=REPLACE", "img" => IconHelper::getIcon("smallEdit"), "linkjoin" => "id", "alttext" => "Edit"),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->auth() == FALSE) die();
|
if ($this->auth() == FALSE) die();
|
||||||
|
|
||||||
// multi-edit
|
// multi-edit
|
||||||
if (isset($_POST['cb']) && is_array($_POST['cb']) && count($_POST['cb']) && (trim($_POST['me_tipus']) > '' || (int)$_POST['me_m_id'] > 0 || (int)$_POST['me_c_id'] > 0 || (int)$_POST['me_subcat'] > 0)) {
|
if (isset($_POST['cb']) && is_array($_POST['cb']) && count($_POST['cb']) && (trim($_POST['me_tipus']) > '' || (int)$_POST['me_m_id'] > 0 || (int)$_POST['me_c_id'] > 0 || (int)$_POST['me_subcat'] > 0)) {
|
||||||
foreach ($_POST['cb'] as $k => $v) {
|
foreach ($_POST['cb'] as $k => $v) {
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM collection2 WHERE o_id=" . (int)$v . " LIMIT 1;");
|
MySqlHelper::getInstance()->query("SELECT * FROM collection2 WHERE o_id=" . (int)$v . " LIMIT 1;");
|
||||||
$orig = MySqlHelper::getInstance()->fetchAssoc();
|
$orig = MySqlHelper::getInstance()->fetchAssoc();
|
||||||
$orig = $orig[0];
|
$orig = $orig[0];
|
||||||
|
|
||||||
$sql = "UPDATE collection2 SET ";
|
$sql = "UPDATE collection2 SET ";
|
||||||
if (trim($_POST['me_tipus']) > '') $sql .= " tipus='" . trim(addslashes($_POST['me_tipus'])) . "',";
|
if (trim($_POST['me_tipus']) > '') $sql .= " tipus='" . trim(addslashes($_POST['me_tipus'])) . "',";
|
||||||
if ((int)$_POST['me_m_id'] > 0) $sql .= " m_id='" . (int)$_POST['me_m_id'] . "',";
|
if ((int)$_POST['me_m_id'] > 0) $sql .= " m_id='" . (int)$_POST['me_m_id'] . "',";
|
||||||
if ((int)$_POST['me_c_id'] > 0) $sql .= " c_id='" . (int)$_POST['me_c_id'] . "',";
|
if ((int)$_POST['me_c_id'] > 0) $sql .= " c_id='" . (int)$_POST['me_c_id'] . "',";
|
||||||
if ((int)$_POST['me_subcat'] > 0) $sql .= " struct_id='" . (int)$_POST['me_subcat'] . "',";
|
if ((int)$_POST['me_subcat'] > 0) $sql .= " struct_id='" . (int)$_POST['me_subcat'] . "',";
|
||||||
MySqlHelper::getInstance()->query(substr($sql, 0, -1) . " WHERE o_id=" . (int)$v . " LIMIT 1;");
|
MySqlHelper::getInstance()->query(substr($sql, 0, -1) . " WHERE o_id=" . (int)$v . " LIMIT 1;");
|
||||||
|
|
||||||
if ((int)$_POST['me_m_id'] > 0 && $orig['m_id'] != (int)$_POST['me_m_id']) {
|
if ((int)$_POST['me_m_id'] > 0 && $orig['m_id'] != (int)$_POST['me_m_id']) {
|
||||||
MySqlHelper::getInstance()->query("SELECT dir FROM coll2_man WHERE id=" . (int)$orig['m_id'] . " LIMIT 1;");
|
MySqlHelper::getInstance()->query("SELECT dir FROM coll2_man WHERE id=" . (int)$orig['m_id'] . " LIMIT 1;");
|
||||||
$from = MySqlHelper::getInstance()->fetchAssoc();
|
$from = MySqlHelper::getInstance()->fetchAssoc();
|
||||||
$from = $_SERVER['DOCUMENT_ROOT'] . "/public/img/collection/" . $from[0]['dir'] . "/" . (int)$v;
|
$from = $_SERVER['DOCUMENT_ROOT'] . "/public/img/collection/" . $from[0]['dir'] . "/" . (int)$v;
|
||||||
|
|
||||||
MySqlHelper::getInstance()->query("SELECT dir FROM coll2_man WHERE id=" . (int)$_POST['me_m_id'] . " LIMIT 1;");
|
MySqlHelper::getInstance()->query("SELECT dir FROM coll2_man WHERE id=" . (int)$_POST['me_m_id'] . " LIMIT 1;");
|
||||||
$to = MySqlHelper::getInstance()->fetchAssoc();
|
$to = MySqlHelper::getInstance()->fetchAssoc();
|
||||||
$to = $_SERVER['DOCUMENT_ROOT'] . "/public/img/collection/" . $to[0]['dir'] . "/" . (int)$v;
|
$to = $_SERVER['DOCUMENT_ROOT'] . "/public/img/collection/" . $to[0]['dir'] . "/" . (int)$v;
|
||||||
|
|
||||||
if (is_dir($from) && !is_dir($to)) rename($from, $to);
|
if (is_dir($from) && !is_dir($to)) rename($from, $to);
|
||||||
|
|
||||||
$from = str_replace("img/", "", $from);
|
$from = str_replace("img/", "", $from);
|
||||||
$to = str_replace("img/", "", $to);
|
$to = str_replace("img/", "", $to);
|
||||||
|
|
||||||
if (is_dir($from) && !is_dir($to)) rename($from, $to);
|
if (is_dir($from) && !is_dir($to)) rename($from, $to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// click-edit (enable/disable)
|
// click-edit (enable/disable)
|
||||||
if (isset($_POST[$this->pf . '_event']) and trim($_POST[$this->pf . '_event']) > '') {
|
if (isset($_POST[$this->pf . '_event']) and trim($_POST[$this->pf . '_event']) > '') {
|
||||||
$event = trim(strtolower(addslashes((string)$_POST[$this->pf . '_event'])));
|
$event = trim(strtolower(addslashes((string)$_POST[$this->pf . '_event'])));
|
||||||
$value = trim(strtolower(addslashes((string)$_POST[$this->pf . '_value'])));
|
$value = trim(strtolower(addslashes((string)$_POST[$this->pf . '_value'])));
|
||||||
if ((int)$value > 0) {
|
if ((int)$value > 0) {
|
||||||
switch ($event) {
|
switch ($event) {
|
||||||
case 'enable': {
|
case 'enable': {
|
||||||
MySqlHelper::getInstance()->query("UPDATE collection2 SET deleted=0 WHERE o_id=" . $value);
|
MySqlHelper::getInstance()->query("UPDATE collection2 SET deleted=0 WHERE o_id=" . $value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'disable': {
|
case 'disable': {
|
||||||
MySqlHelper::getInstance()->query("UPDATE collection2 SET deleted=1 WHERE o_id=" . $value);
|
MySqlHelper::getInstance()->query("UPDATE collection2 SET deleted=1 WHERE o_id=" . $value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'delete': {
|
case 'delete': {
|
||||||
MySqlHelper::getInstance()->query("DELETE FROM collection2 WHERE o_id=" . $value . " LIMIT 1;");
|
MySqlHelper::getInstance()->query("DELETE FROM collection2 WHERE o_id=" . $value . " LIMIT 1;");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($se['oid']) && $se['oid'] > "") {
|
if (isset($se['oid']) && $se['oid'] > "") {
|
||||||
if (strpos($se['oid'], "-")) {
|
if (strpos($se['oid'], "-")) {
|
||||||
$reszek = explode("-", $se['oid']);
|
$reszek = explode("-", $se['oid']);
|
||||||
$felt .= ((int)$reszek[0] < (int)$reszek[1] ? " AND x.o_id>=" . (int)$reszek[0] . " AND x.o_id<=" . (int)$reszek[1] : " AND x.o_id>=" . (int)$reszek[1] . " AND x.o_id<=" . (int)$reszek[0]);
|
$felt .= ((int)$reszek[0] < (int)$reszek[1] ? " AND x.o_id>=" . (int)$reszek[0] . " AND x.o_id<=" . (int)$reszek[1] : " AND x.o_id>=" . (int)$reszek[1] . " AND x.o_id<=" . (int)$reszek[0]);
|
||||||
} else {
|
} else {
|
||||||
$felt .= " AND x.o_id=" . (int)$se['oid'];
|
$felt .= " AND x.o_id=" . (int)$se['oid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($se['name']) && $se['name'] > "") $felt .= " AND (x.title_" . $lang . " LIKE '%" . trim($se['name']) . "%')";
|
if (isset($se['name']) && $se['name'] > "") $felt .= " AND (x.title_" . $lang . " LIKE '%" . trim($se['name']) . "%')";
|
||||||
if (isset($se['tipus']) && trim($se['tipus']) > "") $felt .= " AND x.tipus='" . trim($se['tipus']) . "'";
|
if (isset($se['tipus']) && trim($se['tipus']) > "") $felt .= " AND x.tipus='" . trim($se['tipus']) . "'";
|
||||||
if (isset($se['m_id']) && (int)$se['m_id'] > 0) $felt .= " AND x.m_id=" . (int)$se['m_id'];
|
if (isset($se['m_id']) && (int)$se['m_id'] > 0) $felt .= " AND x.m_id=" . (int)$se['m_id'];
|
||||||
if (isset($se['c_id']) && (int)$se['c_id'] > 0) $felt .= " AND x.c_id=" . (int)$se['c_id'];
|
if (isset($se['c_id']) && (int)$se['c_id'] > 0) $felt .= " AND x.c_id=" . (int)$se['c_id'];
|
||||||
if (isset($se['parent']) && (int)$se['parent'] > 0) $felt .= " AND p.`id`=" . (int)$se['parent'];
|
if (isset($se['parent']) && (int)$se['parent'] > 0) $felt .= " AND p.`id`=" . (int)$se['parent'];
|
||||||
if (isset($se['subcat']) && (int)$se['subcat'] > 0) $felt .= " AND x.struct_id=" . (int)$se['subcat'];
|
if (isset($se['subcat']) && (int)$se['subcat'] > 0) $felt .= " AND x.struct_id=" . (int)$se['subcat'];
|
||||||
if (isset($se['deleted']) && (int)$se['deleted'] >= 0) $felt .= " AND x.deleted=" . (int)$se['deleted'];
|
if (isset($se['deleted']) && (int)$se['deleted'] >= 0) $felt .= " AND x.deleted=" . (int)$se['deleted'];
|
||||||
|
|
||||||
$objTabla = new TableHelper();
|
$objTabla = new TableHelper();
|
||||||
$objTabla->setParams(array('prefix' => $this->pf, 'csvExport' => TRUE, 'csvExportFilename' => 'showroom-products.csv', 'tablewidth' => '100%', 'imagePreview' => true, 'tablediv' => 'tablediv', 'footer' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'ipp' => (isset($_POST['uploadForm']) ? 5 : 500)));
|
$objTabla->setParams(array('prefix' => $this->pf, 'csvExport' => TRUE, 'csvExportFilename' => 'showroom-products.csv', 'tablewidth' => '100%', 'imagePreview' => true, 'tablediv' => 'tablediv', 'footer' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'ipp' => (isset($_POST['uploadForm']) ? 5 : 500)));
|
||||||
$v = $objTabla->setSession();
|
$v = $objTabla->setSession();
|
||||||
$objTabla->setColumn('checkbox', array('visible' => FALSE));
|
$objTabla->setColumn('checkbox', array('visible' => FALSE));
|
||||||
if (isset($_POST['uploadForm'])) {
|
if (isset($_POST['uploadForm'])) {
|
||||||
$objTabla->setColumn('id', array('header' => 'Id', 'width' => '40px', 'format' => 'onclick', 'onclick' => "setSelect('REPLACE');", 'linkjoin' => 'idcid'));
|
$objTabla->setColumn('id', array('header' => 'Id', 'width' => '40px', 'format' => 'onclick', 'onclick' => "setSelect('REPLACE');", 'linkjoin' => 'idcid'));
|
||||||
$objTabla->setColumn('title', array('header' => 'Név', 'align' => 'left', 'strlen' => 20, 'format' => 'onclick', 'onclick' => "setSelect('REPLACE');", 'width' => '140px', 'linkjoin' => 'idcid'));
|
$objTabla->setColumn('title', array('header' => 'Név', 'align' => 'left', 'strlen' => 20, 'format' => 'onclick', 'onclick' => "setSelect('REPLACE');", 'width' => '140px', 'linkjoin' => 'idcid'));
|
||||||
} else {
|
} else {
|
||||||
$objTabla->setColumn('id', array('header' => 'Id', 'width' => '40px', 'link' => 'index.php?option=com_showroom&view=productedit&id=REPLACE'));
|
$objTabla->setColumn('id', array('header' => 'Id', 'width' => '40px', 'link' => 'index.php?option=com_showroom&view=productedit&id=REPLACE'));
|
||||||
$objTabla->setColumn('title', array('header' => 'Név', 'format' => 'text', 'align' => 'left', 'strlen' => 20, 'width' => '140px', 'link' => 'index.php?option=com_showroom&view=productedit&id=REPLACE', 'linkjoin' => 'id'));
|
$objTabla->setColumn('title', array('header' => 'Név', 'format' => 'text', 'align' => 'left', 'strlen' => 20, 'width' => '140px', 'link' => 'index.php?option=com_showroom&view=productedit&id=REPLACE', 'linkjoin' => 'id'));
|
||||||
}
|
}
|
||||||
$objTabla->setColumn('idcid', array('visible' => false));
|
$objTabla->setColumn('idcid', array('visible' => false));
|
||||||
$objTabla->setColumn('desc', array('visible' => false/*'header'=>'Leírás','format'=>'text','align'=>'left'*/));
|
$objTabla->setColumn('desc', array('visible' => false/*'header'=>'Leírás','format'=>'text','align'=>'left'*/));
|
||||||
$objTabla->setColumn('filedir', array('visible' => false));
|
$objTabla->setColumn('filedir', array('visible' => false));
|
||||||
$objTabla->setColumn('cat', array('header' => 'Kategória', 'format' => 'text', 'align' => 'left'));
|
$objTabla->setColumn('cat', array('header' => 'Kategória', 'format' => 'text', 'align' => 'left'));
|
||||||
$objTabla->setColumn('subcat', array('header' => 'Alkategória', 'format' => 'text', 'align' => 'left'));
|
$objTabla->setColumn('subcat', array('header' => 'Alkategória', 'format' => 'text', 'align' => 'left'));
|
||||||
$objTabla->setColumn('tipus', array('header' => 'Tipus', 'format' => 'text', 'align' => 'left', 'strlen' => 14, 'width' => '100px'));
|
$objTabla->setColumn('tipus', array('header' => 'Tipus', 'format' => 'text', 'align' => 'left', 'strlen' => 14, 'width' => '100px'));
|
||||||
$objTabla->setColumn('manufacture', array('header' => 'Gyártó', 'format' => 'text', 'align' => 'left', 'strlen' => 14, 'width' => '80px'));
|
$objTabla->setColumn('manufacture', array('header' => 'Gyártó', 'format' => 'text', 'align' => 'left', 'strlen' => 14, 'width' => '80px'));
|
||||||
$objTabla->setColumn('family', array('header' => 'Termékcsalád', 'format' => 'text', 'align' => 'left', 'strlen' => 14, 'width' => '100px'));
|
$objTabla->setColumn('family', array('header' => 'Termékcsalád', 'format' => 'text', 'align' => 'left', 'strlen' => 14, 'width' => '100px'));
|
||||||
$objTabla->setColumn('datum', array('header' => 'Dátum', 'format' => 'text', 'align' => 'right', 'width' => '70px'));
|
$objTabla->setColumn('datum', array('header' => 'Dátum', 'format' => 'text', 'align' => 'right', 'width' => '70px'));
|
||||||
$objTabla->setColumn('rendelheto', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => 'Rend.', 'width' => '50px', 'format' => 'text', 'align' => 'center', 'replacevalues' => array(0 => 'Nem', 1 => 'Igen')));
|
$objTabla->setColumn('rendelheto', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => 'Rend.', 'width' => '50px', 'format' => 'text', 'align' => 'center', 'replacevalues' => array(0 => 'Nem', 1 => 'Igen')));
|
||||||
$objTabla->setColumn('show', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => 'Megj.', 'width' => '50px', 'format' => 'number', 'decimal' => 0));
|
$objTabla->setColumn('show', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => 'Megj.', 'width' => '50px', 'format' => 'number', 'decimal' => 0));
|
||||||
$objTabla->setColumn('down', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => 'Letölt', 'width' => '50px', 'format' => 'number', 'decimal' => 0));
|
$objTabla->setColumn('down', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => 'Letölt', 'width' => '50px', 'format' => 'number', 'decimal' => 0));
|
||||||
$objTabla->setColumn('deleted', array('header' => 'Aktív', 'width' => '50px', 'align' => 'center', 'replacevalues' => array(0 => 'Igen', 1 => 'Nem')));
|
$objTabla->setColumn('deleted', array('header' => 'Aktív', 'width' => '50px', 'align' => 'center', 'replacevalues' => array(0 => 'Igen', 1 => 'Nem')));
|
||||||
$objTabla->setColumn('logo', array('visible' => false));
|
$objTabla->setColumn('logo', array('visible' => false));
|
||||||
$objTabla->setColumn('options', array('header' => 'Műveletek', 'align' => 'right', 'width' => '120px', 'order' => false, 'addicons' => $arrIcons, 'linkjoin' => 'id'));
|
$objTabla->setColumn('options', array('header' => 'Műveletek', 'align' => 'right', 'width' => '120px', 'order' => false, 'addicons' => $arrIcons, 'linkjoin' => 'id'));
|
||||||
$objTabla->setQuery(array(
|
$objTabla->setQuery(array(
|
||||||
"
|
"
|
||||||
SELECT 'x' AS checkbox,x.`o_id` AS `id`,CONCAT(x.`o_id`,'-',c.`c_id`) AS `idcid`,x.`title_" . $lang . "` AS `title`,t.`name_" . $lang . "` AS `tipus`,p.`parent` AS `cat`,s.`struct_" . $lang . "` AS `subcat`,m.`name` AS `manufacture`,c.`nev_" . $lang . "` AS `family`,DATE(x.`datum`) AS datum,x.`rendelheto`,x.`show`,x.`down`,x.`deleted`,REPLACE('" . $this->logoPath . "','REPLACE',CONCAT(m.`dir`,'/',x.`o_id`)) AS `logo`,CONCAT('{$this->filePath}',m.dir,'/',x.o_id,'/') AS `filedir`,CONCAT('smallError|smallView'" . (isset($_POST['uploadForm']) ? "" : ",'|',IF(x.deleted=1,'smallDisable','smallEnable'),'|','smallEdit','|','smallDel'") . ") AS options
|
SELECT 'x' AS checkbox,x.`o_id` AS `id`,CONCAT(x.`o_id`,'-',c.`c_id`) AS `idcid`,x.`title_" . $lang . "` AS `title`,t.`name_" . $lang . "` AS `tipus`,p.`parent` AS `cat`,s.`struct_" . $lang . "` AS `subcat`,m.`name` AS `manufacture`,c.`nev_" . $lang . "` AS `family`,DATE(x.`datum`) AS datum,x.`rendelheto`,x.`show`,x.`down`,x.`deleted`,REPLACE('" . $this->logoPath . "','REPLACE',CONCAT(m.`dir`,'/',x.`o_id`)) AS `logo`,CONCAT('{$this->filePath}',m.dir,'/',x.o_id,'/') AS `filedir`,CONCAT('smallError|smallView'" . (isset($_POST['uploadForm']) ? "" : ",'|',IF(x.deleted=1,'smallDisable','smallEnable'),'|','smallEdit','|','smallDel'") . ") AS options
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_types t ON t.type=x.tipus
|
LEFT OUTER JOIN coll2_types t ON t.type=x.tipus
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
||||||
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
||||||
LEFT OUTER JOIN coll2_struct s ON s.id=x.struct_id
|
LEFT OUTER JOIN coll2_struct s ON s.id=x.struct_id
|
||||||
LEFT OUTER JOIN (SELECT id,struct_" . $lang . " AS `parent` FROM coll2_struct WHERE parent=id) p ON p.id=s.parent
|
LEFT OUTER JOIN (SELECT id,struct_" . $lang . " AS `parent` FROM coll2_struct WHERE parent=id) p ON p.id=s.parent
|
||||||
WHERE 1 " . $felt
|
WHERE 1 " . $felt
|
||||||
. ((isset($v['tableorder']) and $v['tableorder'] > '') ? ' ORDER BY ' . $v['tableorder'] : '')
|
. ((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'] : ''),
|
. ((isset($v['tableipp'])) ? ' LIMIT ' . ($v['tableipp'] > 0 ? ($v['tablepage'] - 1) * $v['tableipp'] : 0) . ',' . $v['tableipp'] : ''),
|
||||||
"
|
"
|
||||||
SELECT COUNT(*) AS recordCount,SUM(`show`) AS `show`,SUM(`down`) AS `down`
|
SELECT COUNT(*) AS recordCount,SUM(`show`) AS `show`,SUM(`down`) AS `down`
|
||||||
FROM (
|
FROM (
|
||||||
SELECT 'x' AS checkbox,x.`o_id` AS `id`,CONCAT(x.`o_id`,'-',c.`c_id`) AS `idcid`,x.`title_" . $lang . "` AS `title`,t.`name_" . $lang . "` AS `tipus`,p.`parent` AS cat,s.`struct_" . $lang . "` AS `subcat`,m.`name` AS `manufacture`,m.`dir` AS `folder`,c.`nev_" . $lang . "` AS `family`,DATE(x.`datum`) AS datum,x.`rendelheto`,x.`show`,x.`down`,x.`deleted`,REPLACE('" . $this->logoPath . "','REPLACE',CONCAT(m.`dir`,'/',x.`o_id`)) AS `logo`,CONCAT('smallView','|',IF(x.deleted=1,'smallDisable','smallEnable'),'|','smallEdit','|','smallDel') AS options
|
SELECT 'x' AS checkbox,x.`o_id` AS `id`,CONCAT(x.`o_id`,'-',c.`c_id`) AS `idcid`,x.`title_" . $lang . "` AS `title`,t.`name_" . $lang . "` AS `tipus`,p.`parent` AS cat,s.`struct_" . $lang . "` AS `subcat`,m.`name` AS `manufacture`,m.`dir` AS `folder`,c.`nev_" . $lang . "` AS `family`,DATE(x.`datum`) AS datum,x.`rendelheto`,x.`show`,x.`down`,x.`deleted`,REPLACE('" . $this->logoPath . "','REPLACE',CONCAT(m.`dir`,'/',x.`o_id`)) AS `logo`,CONCAT('smallView','|',IF(x.deleted=1,'smallDisable','smallEnable'),'|','smallEdit','|','smallDel') AS options
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_types t ON t.type=x.tipus
|
LEFT OUTER JOIN coll2_types t ON t.type=x.tipus
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
||||||
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
||||||
LEFT OUTER JOIN coll2_struct s ON s.id=x.struct_id
|
LEFT OUTER JOIN coll2_struct s ON s.id=x.struct_id
|
||||||
LEFT OUTER JOIN (SELECT id,struct_" . $lang . " AS `parent` FROM coll2_struct WHERE parent=id) p ON p.id=s.parent
|
LEFT OUTER JOIN (SELECT id,struct_" . $lang . " AS `parent` FROM coll2_struct WHERE parent=id) p ON p.id=s.parent
|
||||||
WHERE 1 " . $felt . "
|
WHERE 1 " . $felt . "
|
||||||
) x"
|
) x"
|
||||||
));
|
));
|
||||||
// print_r($_SERVER);
|
// print_r($_SERVER);
|
||||||
// print_r($objTabla->arrQuery);
|
// print_r($objTabla->arrQuery);
|
||||||
// $this->printSession($this->pf);
|
// $this->printSession($this->pf);
|
||||||
// print "<pre>".print_r($_POST,true)."</pre>";
|
// print "<pre>".print_r($_POST,true)."</pre>";
|
||||||
|
|
||||||
if ($objTabla->params['csvExport'] == TRUE) {
|
if ($objTabla->params['csvExport'] == TRUE) {
|
||||||
$csvContent = $objTabla->drawTable(FALSE);
|
$csvContent = $objTabla->drawTable(FALSE);
|
||||||
$objTabla->saveCSV($csvContent, $objTabla->params['csvExportFilename']);
|
$objTabla->saveCSV($csvContent, $objTabla->params['csvExportFilename']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$objTabla->setColumn('checkbox', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => '<a onclick="checkAll();">+</a><br /><a onclick="unCheckAll();">-</a>', 'width' => '20px', 'format' => 'checkbox', 'align' => 'center', 'linkjoin' => 'id', 'order' => false));
|
$objTabla->setColumn('checkbox', array('visible' => (isset($_POST['uploadForm']) ? FALSE : TRUE), 'header' => '<a onclick="checkAll();">+</a><br /><a onclick="unCheckAll();">-</a>', 'width' => '20px', 'format' => 'checkbox', 'align' => 'center', 'linkjoin' => 'id', 'order' => false));
|
||||||
$objTabla->setParams(array('csvExport' => FALSE));
|
$objTabla->setParams(array('csvExport' => FALSE));
|
||||||
$objTabla->drawTable();
|
$objTabla->drawTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auth()
|
public function auth()
|
||||||
{
|
{
|
||||||
MySqlHelper::getInstance()->query("
|
MySqlHelper::getInstance()->query("
|
||||||
(SELECT * FROM jml_session where session_id='" . trim(addslashes($_POST['sess'])) . "' LIMIT 1)
|
(SELECT * FROM jml_session where session_id='" . trim(addslashes($_POST['sess'])) . "' LIMIT 1)
|
||||||
UNION
|
UNION
|
||||||
(SELECT * FROM eng_session where session_id='" . trim(addslashes($_POST['sess'])) . "' LIMIT 1)");
|
(SELECT * FROM eng_session where session_id='" . trim(addslashes($_POST['sess'])) . "' LIMIT 1)");
|
||||||
$sess = MySqlHelper::getInstance()->fetchAssoc();
|
$sess = MySqlHelper::getInstance()->fetchAssoc();
|
||||||
if (count($sess)) {
|
if (count($sess)) {
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM jml_user_usergroup_map where group_id IN (7,8) AND user_id=" . $sess[0]['userid'] . ";");
|
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();
|
$admin = MySqlHelper::getInstance()->fetchAssoc();
|
||||||
return (count($admin) ? TRUE : FALSE);
|
return (count($admin) ? TRUE : FALSE);
|
||||||
} else {
|
} else {
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end of class
|
} // end of class
|
||||||
//print_r($_SESSION);
|
//print_r($_SESSION);
|
||||||
$controller = new Controller();
|
$controller = new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery("#refresh").attr('value', '');
|
jQuery("#refresh").attr('value', '');
|
||||||
jQuery("#name").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["name"] ?>');
|
jQuery("#name").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["name"] ?>');
|
||||||
jQuery("#oid").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["oid"] ?>');
|
jQuery("#oid").attr('value', '<?= $_SESSION[$controller->pf]["_POST"]["oid"] ?>');
|
||||||
jQuery("input[name=deleted]").each(function() {
|
jQuery("input[name=deleted]").each(function() {
|
||||||
if (jQuery(this).val() == <?= $_SESSION[$controller->pf]["_POST"]["deleted"] ?>) {
|
if (jQuery(this).val() == <?= $_SESSION[$controller->pf]["_POST"]["deleted"] ?>) {
|
||||||
jQuery(this).attr('checked', 'checked');
|
jQuery(this).attr('checked', 'checked');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
jQuery("#tipus option").each(function() {
|
jQuery("#tipus option").each(function() {
|
||||||
if (jQuery(this).val() == '<?= $_SESSION[$controller->pf]["_POST"]["tipus"] ?>') {
|
if (jQuery(this).val() == '<?= $_SESSION[$controller->pf]["_POST"]["tipus"] ?>') {
|
||||||
jQuery(this).attr('selected', 'selected');
|
jQuery(this).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery("#m_id option").each(function() {
|
jQuery("#m_id option").each(function() {
|
||||||
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["m_id"] ?>) {
|
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["m_id"] ?>) {
|
||||||
jQuery(this).attr('selected', 'selected');
|
jQuery(this).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery("#c_id option").each(function() {
|
jQuery("#c_id option").each(function() {
|
||||||
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["c_id"] ?>) {
|
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["c_id"] ?>) {
|
||||||
jQuery(this).attr('selected', 'selected');
|
jQuery(this).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery("#parent option").each(function() {
|
jQuery("#parent option").each(function() {
|
||||||
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["parent"] ?>) {
|
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["parent"] ?>) {
|
||||||
jQuery(this).attr('selected', 'selected');
|
jQuery(this).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery("#subcat option").each(function() {
|
jQuery("#subcat option").each(function() {
|
||||||
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["subcat"] ?>) {
|
if (jQuery(this).val() == <?= (int)$_SESSION[$controller->pf]["_POST"]["subcat"] ?>) {
|
||||||
jQuery(this).attr('selected', 'selected');
|
jQuery(this).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@ -1,97 +1,97 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
class Controller extends BaseController {
|
class Controller extends BaseController {
|
||||||
public $pf='TypesController';
|
public $pf='TypesController';
|
||||||
protected $typePath='/public/showroom/types/REPLACE.png';
|
protected $typePath='/public/showroom/types/REPLACE.png';
|
||||||
public $targetdiv='tablediv';
|
public $targetdiv='tablediv';
|
||||||
|
|
||||||
public function procEvent() {
|
public function procEvent() {
|
||||||
$lang='hun';
|
$lang='hun';
|
||||||
if (isset($_POST) && !empty($_POST)) $_SESSION[$this->pf]["_POST"]=$_POST;
|
if (isset($_POST) && !empty($_POST)) $_SESSION[$this->pf]["_POST"]=$_POST;
|
||||||
$se=&$_SESSION[$this->pf]['_POST'];
|
$se=&$_SESSION[$this->pf]['_POST'];
|
||||||
$felt="";
|
$felt="";
|
||||||
$arrIcons=array(
|
$arrIcons=array(
|
||||||
'smallView'=>array("href"=>"REPLACE","img"=>IconHelper::getIcon("smallView"),"linkjoin"=>"img","alttext"=>"View" ),
|
'smallView'=>array("href"=>"REPLACE","img"=>IconHelper::getIcon("smallView"),"linkjoin"=>"img","alttext"=>"View" ),
|
||||||
'smallMissingView'=>array("href"=>"REPLACE","img"=>IconHelper::getIcon("smallMissingView"),"linkjoin"=>"img","alttext"=>"Missing View" ),
|
'smallMissingView'=>array("href"=>"REPLACE","img"=>IconHelper::getIcon("smallMissingView"),"linkjoin"=>"img","alttext"=>"Missing View" ),
|
||||||
'smallEdit'=>array("href"=>"index.php?option=com_showroom&view=typeedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"type","alttext"=>"Edit" ),
|
'smallEdit'=>array("href"=>"index.php?option=com_showroom&view=typeedit&id=REPLACE", "img"=>IconHelper::getIcon("smallEdit"), "linkjoin"=>"type","alttext"=>"Edit" ),
|
||||||
'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") ),
|
'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") ),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
if (isset($_POST[$this->pf.'_event']) and trim($_POST[$this->pf.'_event'])>'')
|
||||||
{
|
{
|
||||||
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
$event=trim(strtolower(addslashes((string)$_POST[$this->pf.'_event'])));
|
||||||
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
$value=trim(strtolower(addslashes((string)$_POST[$this->pf.'_value'])));
|
||||||
switch ($event)
|
switch ($event)
|
||||||
{
|
{
|
||||||
|
|
||||||
case 'delete' : { MySqlHelper::getInstance()->query("DELETE FROM coll2_types WHERE type='".$value."' LIMIT 1;");break; }
|
case 'delete' : { MySqlHelper::getInstance()->query("DELETE FROM coll2_types WHERE type='".$value."' LIMIT 1;");break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$objTabla=New TableHelper();
|
$objTabla=New TableHelper();
|
||||||
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','imagePreview'=>true,'tablediv'=>$this->targetdiv));
|
$objTabla->setParams(array('prefix'=>$this->pf,'tablewidth'=>'100%','imagePreview'=>true,'tablediv'=>$this->targetdiv));
|
||||||
$v=$objTabla->setSession();
|
$v=$objTabla->setSession();
|
||||||
$objTabla->setColumn('img',array('visible'=>false));
|
$objTabla->setColumn('img',array('visible'=>false));
|
||||||
$objTabla->setColumn('type',array('header'=>'Típus','width'=>'100px','link'=>'index.php?option=com_showroom&view=typeedit&id=REPLACE'));
|
$objTabla->setColumn('type',array('header'=>'Típus','width'=>'100px','link'=>'index.php?option=com_showroom&view=typeedit&id=REPLACE'));
|
||||||
$objTabla->setColumn('type_download',array('header'=>'Letöltési<br />könyvtár','width'=>'100px'));
|
$objTabla->setColumn('type_download',array('header'=>'Letöltési<br />könyvtár','width'=>'100px'));
|
||||||
$objTabla->setColumn('name',array('header'=>'Név','width'=>'150px'));
|
$objTabla->setColumn('name',array('header'=>'Név','width'=>'150px'));
|
||||||
$objTabla->setColumn('desc',array('header'=>'Leírás','strlen'=>40));
|
$objTabla->setColumn('desc',array('header'=>'Leírás','strlen'=>40));
|
||||||
$objTabla->setColumn('filename',array('header'=>'File név','width'=>'100px'));
|
$objTabla->setColumn('filename',array('header'=>'File név','width'=>'100px'));
|
||||||
$objTabla->setColumn('all',array('header'=>'Összes<br />elem','width'=>'80px','format'=>'number','decimal'=>0));
|
$objTabla->setColumn('all',array('header'=>'Összes<br />elem','width'=>'80px','format'=>'number','decimal'=>0));
|
||||||
$objTabla->setColumn('active',array('header'=>'Aktiv<br />elem','width'=>'80px','format'=>'number','decimal'=>0));
|
$objTabla->setColumn('active',array('header'=>'Aktiv<br />elem','width'=>'80px','format'=>'number','decimal'=>0));
|
||||||
$objTabla->setColumn('megjelenes',array('header'=>'Megjelenés','width'=>'80px','format'=>'number','decimal'=>0));
|
$objTabla->setColumn('megjelenes',array('header'=>'Megjelenés','width'=>'80px','format'=>'number','decimal'=>0));
|
||||||
$objTabla->setColumn('letoltes',array('header'=>'Letöltés','width'=>'80px','format'=>'number','decimal'=>0));
|
$objTabla->setColumn('letoltes',array('header'=>'Letöltés','width'=>'80px','format'=>'number','decimal'=>0));
|
||||||
$objTabla->setColumn('options',array('header'=>'Műveletek','align'=>'right','width'=>'100px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'type'));
|
$objTabla->setColumn('options',array('header'=>'Műveletek','align'=>'right','width'=>'100px','order'=>false,'addicons'=>$arrIcons,'linkjoin'=>'type'));
|
||||||
$objTabla->setQuery(array("
|
$objTabla->setQuery(array("
|
||||||
SELECT c.`type`,c.`type_download`,c.`name_".$lang."` AS `name`,c.`desc_".$lang."` AS `desc`,REPLACE('".$this->typePath."','REPLACE',c.`type`) AS `img`,CONCAT(c.`type`,'.png') AS `filename`,IF(`all`.darab>0,`all`.darab,0) AS `all`,IF(`active`.darab>0,`active`.darab,0) AS `active`,`all`.`megjelenes`,`all`.`letoltes`,CONCAT('smallView','|','smallEdit','|','smallDel') AS options
|
SELECT c.`type`,c.`type_download`,c.`name_".$lang."` AS `name`,c.`desc_".$lang."` AS `desc`,REPLACE('".$this->typePath."','REPLACE',c.`type`) AS `img`,CONCAT(c.`type`,'.png') AS `filename`,IF(`all`.darab>0,`all`.darab,0) AS `all`,IF(`active`.darab>0,`active`.darab,0) AS `active`,`all`.`megjelenes`,`all`.`letoltes`,CONCAT('smallView','|','smallEdit','|','smallDel') AS options
|
||||||
FROM coll2_types c
|
FROM coll2_types c
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT x.tipus AS tipus,COUNT(*) AS darab,SUM(`show`) AS megjelenes,SUM(`down`) AS letoltes
|
SELECT x.tipus AS tipus,COUNT(*) AS darab,SUM(`show`) AS megjelenes,SUM(`down`) AS letoltes
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
GROUP BY x.tipus
|
GROUP BY x.tipus
|
||||||
) `all` ON `all`.tipus=c.type
|
) `all` ON `all`.tipus=c.type
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT x.tipus AS tipus,COUNT(*) AS darab
|
SELECT x.tipus AS tipus,COUNT(*) AS darab
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0
|
||||||
GROUP BY x.tipus
|
GROUP BY x.tipus
|
||||||
) `active` ON `active`.tipus=c.type
|
) `active` ON `active`.tipus=c.type
|
||||||
WHERE 1 ".$felt
|
WHERE 1 ".$felt
|
||||||
.((isset($v['tableorder']) and $v['tableorder']>'') ? ' ORDER BY '.$v['tableorder'] : '')
|
.((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'] : ''),"
|
.((isset($v['tableipp'])) ? ' LIMIT '.($v['tableipp']>0 ? ($v['tablepage']-1)*$v['tableipp'] : 0) .','.$v['tableipp'] : ''),"
|
||||||
SELECT COUNT(*) AS recordCount,SUM(`all`) AS `all`,SUM(`active`) AS `active`,SUM(`megjelenes`) AS `megjelenes`,SUM(`letoltes`) AS `letoltes`
|
SELECT COUNT(*) AS recordCount,SUM(`all`) AS `all`,SUM(`active`) AS `active`,SUM(`megjelenes`) AS `megjelenes`,SUM(`letoltes`) AS `letoltes`
|
||||||
FROM (
|
FROM (
|
||||||
SELECT c.`type`,c.`type_download`,c.`name_".$lang."` AS `name`,c.`desc_".$lang."` AS `desc`,REPLACE('".$this->typePath."','REPLACE',c.`type`) AS `img`,CONCAT(c.`type`,'.png') AS `filename`,IF(`all`.darab>0,`all`.darab,0) AS `all`,IF(`active`.darab>0,`active`.darab,0) AS `active`,`all`.`megjelenes`,`all`.`letoltes`,CONCAT('smallView','|','smallEdit','|','smallDel') AS options
|
SELECT c.`type`,c.`type_download`,c.`name_".$lang."` AS `name`,c.`desc_".$lang."` AS `desc`,REPLACE('".$this->typePath."','REPLACE',c.`type`) AS `img`,CONCAT(c.`type`,'.png') AS `filename`,IF(`all`.darab>0,`all`.darab,0) AS `all`,IF(`active`.darab>0,`active`.darab,0) AS `active`,`all`.`megjelenes`,`all`.`letoltes`,CONCAT('smallView','|','smallEdit','|','smallDel') AS options
|
||||||
FROM coll2_types c
|
FROM coll2_types c
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT x.tipus AS tipus,COUNT(*) AS darab,SUM(`show`) AS megjelenes,SUM(`down`) AS letoltes
|
SELECT x.tipus AS tipus,COUNT(*) AS darab,SUM(`show`) AS megjelenes,SUM(`down`) AS letoltes
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
GROUP BY x.tipus
|
GROUP BY x.tipus
|
||||||
) `all` ON `all`.tipus=c.type
|
) `all` ON `all`.tipus=c.type
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT x.tipus AS tipus,COUNT(*) AS darab
|
SELECT x.tipus AS tipus,COUNT(*) AS darab
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0
|
||||||
GROUP BY x.tipus
|
GROUP BY x.tipus
|
||||||
) `active` ON `active`.tipus=c.type
|
) `active` ON `active`.tipus=c.type
|
||||||
WHERE 1 ".$felt."
|
WHERE 1 ".$felt."
|
||||||
) z"
|
) z"
|
||||||
));
|
));
|
||||||
// $this->printSession($this->pf);
|
// $this->printSession($this->pf);
|
||||||
$objTabla->drawTable(TRUE);
|
$objTabla->drawTable(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$controller=new Controller();
|
$controller=new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
?>
|
?>
|
||||||
@ -1,49 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Showroom</name>
|
<name>Showroom</name>
|
||||||
<!-- The following elements are optional and free of formatting constraints -->
|
<!-- The following elements are optional and free of formatting constraints -->
|
||||||
<creationDate>April 2017</creationDate>
|
<creationDate>April 2017</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<!-- The version string is recorded in the components table -->
|
<!-- The version string is recorded in the components table -->
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
<!-- The description is optional and defaults to the name -->
|
<!-- The description is optional and defaults to the name -->
|
||||||
<description>Description of the Showroom component ...</description>
|
<description>Description of the Showroom component ...</description>
|
||||||
|
|
||||||
|
|
||||||
<!-- Site Main File Copy Section -->
|
<!-- Site Main File Copy Section -->
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
||||||
<files folder="site">
|
<files folder="site">
|
||||||
<language tag="hu-HU">language/hu-HU.com_showroom.ini</language>
|
<language tag="hu-HU">language/hu-HU.com_showroom.ini</language>
|
||||||
<language tag="en-GB">language/en-GB.com_showroom.ini</language>
|
<language tag="en-GB">language/en-GB.com_showroom.ini</language>
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>router.php</filename>
|
<filename>router.php</filename>
|
||||||
<filename>showroom.php</filename>
|
<filename>showroom.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
<!-- Administration Menu Section -->
|
<!-- Administration Menu Section -->
|
||||||
<menu>Showroom</menu>
|
<menu>Showroom</menu>
|
||||||
<!-- Administration Main File Copy Section -->
|
<!-- Administration Main File Copy Section -->
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /admin/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /admin/ in the package -->
|
||||||
<files folder="admin">
|
<files folder="admin">
|
||||||
<language tag="hu-HU">language/hu-HU.com_showroom.ini</language>
|
<language tag="hu-HU">language/hu-HU.com_showroom.ini</language>
|
||||||
<language tag="en-GB">language/en-GB.com_showroom.ini</language>
|
<language tag="en-GB">language/en-GB.com_showroom.ini</language>
|
||||||
<!-- Admin Main File Copy Section -->
|
<!-- Admin Main File Copy Section -->
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>showroom.php</filename>
|
<filename>showroom.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
<folder>helpers</folder>
|
<folder>helpers</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
</files>
|
</files>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,28 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Tcexam</name>
|
<name>Tcexam</name>
|
||||||
<!-- The following elements are optional and free of formatting constraints -->
|
<!-- The following elements are optional and free of formatting constraints -->
|
||||||
<creationDate>June 2015</creationDate>
|
<creationDate>June 2015</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<!-- The version string is recorded in the components table -->
|
<!-- The version string is recorded in the components table -->
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<!-- The description is optional and defaults to the name -->
|
<!-- The description is optional and defaults to the name -->
|
||||||
<description>Description of the Tcexam component ...</description>
|
<description>Description of the Tcexam component ...</description>
|
||||||
|
|
||||||
<!-- Site Main File Copy Section -->
|
<!-- Site Main File Copy Section -->
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package -->
|
||||||
<files folder="site">
|
<files folder="site">
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>tcexam.php</filename>
|
<filename>tcexam.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,44 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>Versions</name>
|
<name>Versions</name>
|
||||||
<!-- The following elements are optional and free of formatting constraints -->
|
<!-- The following elements are optional and free of formatting constraints -->
|
||||||
<creationDate>January 2016</creationDate>
|
<creationDate>January 2016</creationDate>
|
||||||
<author>Fekete Zsolt</author>
|
<author>Fekete Zsolt</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
<authorUrl>http://www.facebook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright Info</copyright>
|
<copyright>Copyright Info</copyright>
|
||||||
<license>License Info</license>
|
<license>License Info</license>
|
||||||
<!-- The version string is recorded in the components table -->
|
<!-- The version string is recorded in the components table -->
|
||||||
<version>0.0.6</version>
|
<version>0.0.6</version>
|
||||||
<!-- The description is optional and defaults to the name -->
|
<!-- The description is optional and defaults to the name -->
|
||||||
<description>Description of the Versions component ...</description>
|
<description>Description of the Versions component ...</description>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
<!-- Administration Menu Section -->
|
<!-- Administration Menu Section -->
|
||||||
<menu>COM_VERSIONS_VERSIONS</menu>
|
<menu>COM_VERSIONS_VERSIONS</menu>
|
||||||
<submenu>
|
<submenu>
|
||||||
<menu link="option=com_versions">COM_VERSIONS_CONTROL_PANEL</menu>
|
<menu link="option=com_versions">COM_VERSIONS_CONTROL_PANEL</menu>
|
||||||
<menu link="option=com_versions&view=list">COM_VERSIONS_VERSIONS</menu>
|
<menu link="option=com_versions&view=list">COM_VERSIONS_VERSIONS</menu>
|
||||||
</submenu>
|
</submenu>
|
||||||
|
|
||||||
<!-- Administration Main File Copy Section -->
|
<!-- Administration Main File Copy Section -->
|
||||||
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /admin/ in the package -->
|
<!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /admin/ in the package -->
|
||||||
<files folder="admin">
|
<files folder="admin">
|
||||||
<!-- Admin Main File Copy Section -->
|
<!-- Admin Main File Copy Section -->
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>versions.php</filename>
|
<filename>versions.php</filename>
|
||||||
<filename>controller.php</filename>
|
<filename>controller.php</filename>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
<folder>helpers</folder>
|
<folder>helpers</folder>
|
||||||
<folder>models</folder>
|
<folder>models</folder>
|
||||||
<folder>views</folder>
|
<folder>views</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<languages folder="admin/language">
|
<languages folder="admin/language">
|
||||||
<language tag="hu-HU">hu-HU.com_versions.ini</language>
|
<language tag="hu-HU">hu-HU.com_versions.ini</language>
|
||||||
<language tag="hu-HU">hu-HU.com_versions.sys.ini</language>
|
<language tag="hu-HU">hu-HU.com_versions.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_versions.ini</language>
|
<language tag="en-GB">en-GB.com_versions.ini</language>
|
||||||
<language tag="en-GB">en-GB.com_versions.sys.ini</language>
|
<language tag="en-GB">en-GB.com_versions.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,413 +1,413 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
||||||
|
|
||||||
class NonprofitModelNonprofit extends JModelItem
|
class NonprofitModelNonprofit extends JModelItem
|
||||||
{
|
{
|
||||||
public $npRangeMin=990001;
|
public $npRangeMin=990001;
|
||||||
public $npRangeMax=999999;
|
public $npRangeMax=999999;
|
||||||
|
|
||||||
protected $prefix;
|
protected $prefix;
|
||||||
protected $article;
|
protected $article;
|
||||||
public $hasNonprofitProgram;
|
public $hasNonprofitProgram;
|
||||||
public $hasCommercial;
|
public $hasCommercial;
|
||||||
public $isNonprofitConnectedToThisComputer;
|
public $isNonprofitConnectedToThisComputer;
|
||||||
public $isConnectedNonprofitExpired;
|
public $isConnectedNonprofitExpired;
|
||||||
protected $existKeys;
|
protected $existKeys;
|
||||||
protected $freeKeys;
|
protected $freeKeys;
|
||||||
protected $crmUser;
|
protected $crmUser;
|
||||||
protected $dbCRM;
|
protected $dbCRM;
|
||||||
public $newPass;
|
public $newPass;
|
||||||
public $newKey;
|
public $newKey;
|
||||||
public $sqlQuery; //debugra!
|
public $sqlQuery; //debugra!
|
||||||
|
|
||||||
public function getConfig()
|
public function getConfig()
|
||||||
{
|
{
|
||||||
if (empty($this->dbCRM))
|
if (empty($this->dbCRM))
|
||||||
{
|
{
|
||||||
require($_SERVER['DOCUMENT_ROOT'].'/maintenance/config.crm.php');
|
require($_SERVER['DOCUMENT_ROOT'].'/maintenance/config.crm.php');
|
||||||
$this->dbCRM=$dbCRM;
|
$this->dbCRM=$dbCRM;
|
||||||
}
|
}
|
||||||
return($this->dbCRM);
|
return($this->dbCRM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrefix($nUserID=0)
|
public function getPrefix($nUserID=0)
|
||||||
{
|
{
|
||||||
if ((int)$nUserID>0)
|
if ((int)$nUserID>0)
|
||||||
{
|
{
|
||||||
if (!isset($this->prefix))
|
if (!isset($this->prefix))
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT * FROM `users` WHERE nUserID=".$nUserID.";");
|
$crm->setQuery("SELECT * FROM `users` WHERE nUserID=".$nUserID.";");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
$this->prefix=($tmp[0]->old_db=='clusers' ? 'jml' : 'eng');
|
$this->prefix=($tmp[0]->old_db=='clusers' ? 'jml' : 'eng');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->prefix='eng';
|
$this->prefix='eng';
|
||||||
}
|
}
|
||||||
return $this->prefix;
|
return $this->prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentVersion($field='verID')
|
public function getCurrentVersion($field='verID')
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT ".$field." AS verID FROM `p_versions` WHERE verActual='Y' LIMIT 1;");
|
$crm->setQuery("SELECT ".$field." AS verID FROM `p_versions` WHERE verActual='Y' LIMIT 1;");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
return ($tmp[0]->verID);
|
return ($tmp[0]->verID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getArticle($product=1)
|
public function getArticle($product=1)
|
||||||
{
|
{
|
||||||
if (!isset($this->article))
|
if (!isset($this->article))
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
if($product == 1){
|
if($product == 1){
|
||||||
$db->setQuery("SELECT * FROM #__content WHERE alias='nonprofit' LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__content WHERE alias='nonprofit' LIMIT 1;");
|
||||||
} else {
|
} else {
|
||||||
$db->setQuery("SELECT * FROM #__content WHERE alias='nonprofitlive' LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__content WHERE alias='nonprofitlive' LIMIT 1;");
|
||||||
}
|
}
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->article=$tmp[0];
|
$this->article=$tmp[0];
|
||||||
}
|
}
|
||||||
return $this->article;
|
return $this->article;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function syncUser()
|
public function syncUser()
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$user=JFactory::getUser();
|
$user=JFactory::getUser();
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
|
|
||||||
file_get_contents("http://www.archline.hu/maintenance/sync_user.php");
|
file_get_contents("http://www.archline.hu/maintenance/sync_user.php");
|
||||||
file_get_contents("http://www.archline.hu/maintenance/sync_download.php?jmdb=jml");
|
file_get_contents("http://www.archline.hu/maintenance/sync_download.php?jmdb=jml");
|
||||||
file_get_contents("http://www.archline.hu/maintenance/sync_download.php?jmdb=eng");
|
file_get_contents("http://www.archline.hu/maintenance/sync_download.php?jmdb=eng");
|
||||||
|
|
||||||
$db->setQuery("SELECT * FROM #__users WHERE id=".$user->id." LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__users WHERE id=".$user->id." LIMIT 1;");
|
||||||
$curr=$db->loadObjectList();
|
$curr=$db->loadObjectList();
|
||||||
|
|
||||||
$tmpUser=$session->get('user');
|
$tmpUser=$session->get('user');
|
||||||
$tmpUser->nUserID=$curr[0]->nUserID;
|
$tmpUser->nUserID=$curr[0]->nUserID;
|
||||||
$session->set('user', $tmpUser);
|
$session->set('user', $tmpUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCRMUser($nUserID=0)
|
public function getCRMUser($nUserID=0)
|
||||||
{
|
{
|
||||||
if ($nUserID>0 && !isset($this->crmUser))
|
if ($nUserID>0 && !isset($this->crmUser))
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT * FROM `users` WHERE nUserID=".$nUserID." LIMIT 1;");
|
$crm->setQuery("SELECT * FROM `users` WHERE nUserID=".$nUserID." LIMIT 1;");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
if (!empty($tmp))
|
if (!empty($tmp))
|
||||||
{
|
{
|
||||||
$this->crmUser=$tmp[0];
|
$this->crmUser=$tmp[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->crmUser;
|
return $this->crmUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasRecord($nUserID=0, $product=1, $npid="")
|
public function hasRecord($nUserID=0, $product=1, $npid="")
|
||||||
{
|
{
|
||||||
if ($nUserID==0)
|
if ($nUserID==0)
|
||||||
{
|
{
|
||||||
$this->hasNonprofitProgram=FALSE;
|
$this->hasNonprofitProgram=FALSE;
|
||||||
$this->hasCommercial=FALSE;
|
$this->hasCommercial=FALSE;
|
||||||
$this->isNonprofitConnectedToThisComputer=FALSE;
|
$this->isNonprofitConnectedToThisComputer=FALSE;
|
||||||
$this->isConnectedNonprofitExpired=TRUE;
|
$this->isConnectedNonprofitExpired=TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$verid = /*$this->getCurrentVersion('verID')*/ 19; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
$verid = /*$this->getCurrentVersion('verID')*/ 19; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
||||||
if (!isset($this->hasNonprofitProgram))
|
if (!isset($this->hasNonprofitProgram))
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT * FROM hardlock h
|
$crm->setQuery("SELECT * FROM hardlock h
|
||||||
LEFT OUTER JOIN h_programs p ON h.hlNum = p.prHlNum
|
LEFT OUTER JOIN h_programs p ON h.hlNum = p.prHlNum
|
||||||
WHERE h.product_id=".$product." AND h.hlUser=".$nUserID." AND p.prVerID=".$verid." AND p.prHlNum LIKE '99%'");
|
WHERE h.product_id=".$product." AND h.hlUser=".$nUserID." AND p.prVerID=".$verid." AND p.prHlNum LIKE '99%'");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
if (count($tmp))
|
if (count($tmp))
|
||||||
{
|
{
|
||||||
$this->hasNonprofitProgram=TRUE;
|
$this->hasNonprofitProgram=TRUE;
|
||||||
$this->existKeys=$tmp;
|
$this->existKeys=$tmp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->hasNonprofitProgram=FALSE;
|
$this->hasNonprofitProgram=FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->hasCommercial))
|
if (!isset($this->hasCommercial))
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT * FROM hardlock h
|
$crm->setQuery("SELECT * FROM hardlock h
|
||||||
LEFT OUTER JOIN `h_programs` p ON h.hlNum=p.prHlNum
|
LEFT OUTER JOIN `h_programs` p ON h.hlNum=p.prHlNum
|
||||||
WHERE h.product_id=".$product." AND h.hlNum not like '99%' AND h.hlUser=".$nUserID." AND p.prVerID=".$verid);
|
WHERE h.product_id=".$product." AND h.hlNum not like '99%' AND h.hlUser=".$nUserID." AND p.prVerID=".$verid);
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
if (count($tmp))
|
if (count($tmp))
|
||||||
{
|
{
|
||||||
$this->hasCommercial=TRUE;
|
$this->hasCommercial=TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->hasCommercial=FALSE;
|
$this->hasCommercial=FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->isNonprofitConnectedToThisComputer) && $this->hasNonprofitProgram)
|
if (!isset($this->isNonprofitConnectedToThisComputer) && $this->hasNonprofitProgram)
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
||||||
$tmp2=$crm->loadObjectList();
|
$tmp2=$crm->loadObjectList();
|
||||||
|
|
||||||
if(empty($tmp2)) {
|
if(empty($tmp2)) {
|
||||||
$rec23=new stdClass();
|
$rec23=new stdClass();
|
||||||
$rec23->computer_id = $npid;
|
$rec23->computer_id = $npid;
|
||||||
$rec23->last_mod = date('Y-m-d',time());
|
$rec23->last_mod = date('Y-m-d',time());
|
||||||
$result23=$crm->insertObject("computers", $rec23);
|
$result23=$crm->insertObject("computers", $rec23);
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
||||||
$tmp2=$crm->loadObjectList();
|
$tmp2=$crm->loadObjectList();
|
||||||
}
|
}
|
||||||
$comp=$tmp2[0];
|
$comp=$tmp2[0];
|
||||||
$verPassword8and9 = /*$this->getCurrentVersion('verPassword8and9')*/ 36; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
$verPassword8and9 = /*$this->getCurrentVersion('verPassword8and9')*/ 36; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
||||||
|
|
||||||
$query = "SELECT h_programs.prFizetve AS expire_datetime
|
$query = "SELECT h_programs.prFizetve AS expire_datetime
|
||||||
FROM `nonprofit`
|
FROM `nonprofit`
|
||||||
LEFT OUTER JOIN hardlock ON hardlock.hlNum = nonprofit.hlID
|
LEFT OUTER JOIN hardlock ON hardlock.hlNum = nonprofit.hlID
|
||||||
LEFT OUTER JOIN h_programs ON h_programs.prHlNum = nonprofit.hlID
|
LEFT OUTER JOIN h_programs ON h_programs.prHlNum = nonprofit.hlID
|
||||||
WHERE nonprofit.computer_id='".$comp->id."' AND nonprofit.verid=".$verPassword8and9." AND h_programs.prVerID=".$verid." AND nonprofit.partnerID is null AND hardlock.product_id='".$product."';";
|
WHERE nonprofit.computer_id='".$comp->id."' AND nonprofit.verid=".$verPassword8and9." AND h_programs.prVerID=".$verid." AND nonprofit.partnerID is null AND hardlock.product_id='".$product."';";
|
||||||
$crm->setQuery($query);
|
$crm->setQuery($query);
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
$this->isNonprofitConnectedToThisComputer=(count($tmp) ? TRUE : FALSE);
|
$this->isNonprofitConnectedToThisComputer=(count($tmp) ? TRUE : FALSE);
|
||||||
|
|
||||||
if($this->isNonprofitConnectedToThisComputer) {
|
if($this->isNonprofitConnectedToThisComputer) {
|
||||||
$expireDateTime=$tmp[0]->expire_datetime;
|
$expireDateTime=$tmp[0]->expire_datetime;
|
||||||
|
|
||||||
$this->isConnectedNonprofitExpired = $expireDateTime < date("Y-m-d H:i:s", time());
|
$this->isConnectedNonprofitExpired = $expireDateTime < date("Y-m-d H:i:s", time());
|
||||||
} else {
|
} else {
|
||||||
$this->isConnectedNonprofitExpired=TRUE;
|
$this->isConnectedNonprofitExpired=TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->isNonprofitConnectedToThisComputer=FALSE;
|
$this->isNonprofitConnectedToThisComputer=FALSE;
|
||||||
$this->isConnectedNonprofitExpired=TRUE;
|
$this->isConnectedNonprofitExpired=TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->haveRightsToUseNonprofit = !$this->hasCommercial && (!$this->hasNonprofitProgram || !$this->isConnectedNonprofitExpired);
|
$this->haveRightsToUseNonprofit = !$this->hasCommercial && (!$this->hasNonprofitProgram || !$this->isConnectedNonprofitExpired);
|
||||||
$this->hasToGenerateNonprofit = $this->haveRightsToUseNonprofit && !$this->hasNonprofitProgram;
|
$this->hasToGenerateNonprofit = $this->haveRightsToUseNonprofit && !$this->hasNonprofitProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExistingKeyAndPass($nUserID=0,$npid="",$verid=0, $product=1) {
|
public function getExistingKeyAndPass($nUserID=0,$npid="",$verid=0, $product=1) {
|
||||||
if ((int)$verid==0) $verid = /*$this->getCurrentVersion('verID')*/ 19; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
if ((int)$verid==0) $verid = /*$this->getCurrentVersion('verID')*/ 19; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
||||||
|
|
||||||
if ($nUserID>0 && $npid>"") {
|
if ($nUserID>0 && $npid>"") {
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
$comp=$tmp[0];
|
$comp=$tmp[0];
|
||||||
|
|
||||||
$query="SELECT h_programs.prHlNum AS nonprofitKey, h_programs.prPass AS nonprofitPassword FROM nonprofit
|
$query="SELECT h_programs.prHlNum AS nonprofitKey, h_programs.prPass AS nonprofitPassword FROM nonprofit
|
||||||
LEFT OUTER JOIN hardlock ON hardlock.hlNum = nonprofit.hlID
|
LEFT OUTER JOIN hardlock ON hardlock.hlNum = nonprofit.hlID
|
||||||
LEFT OUTER JOIN h_programs ON h_programs.prHlNum = nonprofit.hlID
|
LEFT OUTER JOIN h_programs ON h_programs.prHlNum = nonprofit.hlID
|
||||||
WHERE nonprofit.computer_id='".$comp->id."' AND nonprofit.verid=".(int)$verid." AND nonprofit.nUserID='".$nUserID."' AND nonprofit.partnerID is null AND hardlock.product_id='".$product."';";
|
WHERE nonprofit.computer_id='".$comp->id."' AND nonprofit.verid=".(int)$verid." AND nonprofit.nUserID='".$nUserID."' AND nonprofit.partnerID is null AND hardlock.product_id='".$product."';";
|
||||||
$this->sqlQuery=$query;
|
$this->sqlQuery=$query;
|
||||||
$crm->setQuery($query);
|
$crm->setQuery($query);
|
||||||
$tmp2=$crm->loadObjectList();
|
$tmp2=$crm->loadObjectList();
|
||||||
$nonp=$tmp2[0];
|
$nonp=$tmp2[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->newKey=$nonp->nonprofitKey;
|
$this->newKey=$nonp->nonprofitKey;
|
||||||
$this->newPass=$nonp->nonprofitPassword;
|
$this->newPass=$nonp->nonprofitPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKey($nUserID=0,$npid="",$isid="",$verid=0, $product=1)
|
public function getKey($nUserID=0,$npid="",$isid="",$verid=0, $product=1)
|
||||||
{
|
{
|
||||||
$newKey=0;
|
$newKey=0;
|
||||||
if ((int)$verid==0) $verid = /*$this->getCurrentVersion('verID')*/ 19; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
if ((int)$verid==0) $verid = /*$this->getCurrentVersion('verID')*/ 19; // EZT KI KELL VENNI MARCIUSBAN!!!!
|
||||||
|
|
||||||
if ($nUserID>0 && $npid>"")
|
if ($nUserID>0 && $npid>"")
|
||||||
{
|
{
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
||||||
$tmp2=$crm->loadObjectList();
|
$tmp2=$crm->loadObjectList();
|
||||||
|
|
||||||
if(empty($tmp2)){
|
if(empty($tmp2)){
|
||||||
$rec23=new stdClass();
|
$rec23=new stdClass();
|
||||||
$rec23->computer_id = $npid;
|
$rec23->computer_id = $npid;
|
||||||
$rec23->last_mod = date('Y-m-d',time());
|
$rec23->last_mod = date('Y-m-d',time());
|
||||||
$result23=$crm->insertObject("computers", $rec23);
|
$result23=$crm->insertObject("computers", $rec23);
|
||||||
}
|
}
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
||||||
$tmp3=$crm->loadObjectList();
|
$tmp3=$crm->loadObjectList();
|
||||||
$comp=$tmp3[0];
|
$comp=$tmp3[0];
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `nonprofit`
|
$crm->setQuery("SELECT * FROM `nonprofit`
|
||||||
LEFT JOIN hardlock ON hardlock.hlNum = nonprofit.hlID
|
LEFT JOIN hardlock ON hardlock.hlNum = nonprofit.hlID
|
||||||
WHERE nonprofit.computer_id='".$comp->id."' AND nonprofit.verid='".$verid."' AND nonprofit.`partnerID` is null AND hardlock.product_id=".$product.";");
|
WHERE nonprofit.computer_id='".$comp->id."' AND nonprofit.verid='".$verid."' AND nonprofit.`partnerID` is null AND hardlock.product_id=".$product.";");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
|
|
||||||
if (empty($tmp))
|
if (empty($tmp))
|
||||||
{
|
{
|
||||||
$crm->setQuery("SELECT * FROM `users` WHERE nUserID=".$nUserID.";");
|
$crm->setQuery("SELECT * FROM `users` WHERE nUserID=".$nUserID.";");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
$user=$tmp[0];
|
$user=$tmp[0];
|
||||||
|
|
||||||
$newKey=(int)$this->tryToAlloc($this->npRangeMin,$this->npRangeMax);
|
$newKey=(int)$this->tryToAlloc($this->npRangeMin,$this->npRangeMax);
|
||||||
|
|
||||||
if ($newKey>0 && !empty($user))
|
if ($newKey>0 && !empty($user))
|
||||||
{
|
{
|
||||||
$rec=new stdClass();
|
$rec=new stdClass();
|
||||||
$rec->hlNum=$newKey;
|
$rec->hlNum=$newKey;
|
||||||
// $rec->hlCtrID=$user->nCtrID;
|
// $rec->hlCtrID=$user->nCtrID;
|
||||||
$rec->hlCtrID=($user->old_db=='clusers' ? 36 : 44);
|
$rec->hlCtrID=($user->old_db=='clusers' ? 36 : 44);
|
||||||
$rec->hlLan=0;
|
$rec->hlLan=0;
|
||||||
$rec->hlStat=1;
|
$rec->hlStat=1;
|
||||||
$rec->hlDateIssue=date('Y-m-d',time());
|
$rec->hlDateIssue=date('Y-m-d',time());
|
||||||
$rec->hlManID=36;
|
$rec->hlManID=36;
|
||||||
$rec->hlTime=date('Y-m-d H:i:s',time());
|
$rec->hlTime=date('Y-m-d H:i:s',time());
|
||||||
$rec->hlUser=$nUserID;
|
$rec->hlUser=$nUserID;
|
||||||
$rec->hlDealer=($user->old_db=='clusers' ? 51850 : 51851);
|
$rec->hlDealer=($user->old_db=='clusers' ? 51850 : 51851);
|
||||||
$rec->bUjithato=1;
|
$rec->bUjithato=1;
|
||||||
$rec->old_db=$user->old_db;
|
$rec->old_db=$user->old_db;
|
||||||
$rec->product_id=$product;
|
$rec->product_id=$product;
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `hardlock` WHERE hlNum=".$newKey." AND product_id=".$product." ORDER BY hlID DESC LIMIT 1;");
|
$crm->setQuery("SELECT * FROM `hardlock` WHERE hlNum=".$newKey." AND product_id=".$product." ORDER BY hlID DESC LIMIT 1;");
|
||||||
$tmp=$crm->loadObjectList();
|
$tmp=$crm->loadObjectList();
|
||||||
$exist=$tmp[0];
|
$exist=$tmp[0];
|
||||||
|
|
||||||
|
|
||||||
if ($exist)
|
if ($exist)
|
||||||
{
|
{
|
||||||
$values=array();
|
$values=array();
|
||||||
$query=$crm->getQuery(true);
|
$query=$crm->getQuery(true);
|
||||||
foreach ((array)$rec as $k=>$v) $values[]=$crm->quoteName($k)."=".$crm->quote($v);
|
foreach ((array)$rec as $k=>$v) $values[]=$crm->quoteName($k)."=".$crm->quote($v);
|
||||||
$query->update("hardlock")->set($values)->where(array('`hlID`='.(int)$exist->hlID));
|
$query->update("hardlock")->set($values)->where(array('`hlID`='.(int)$exist->hlID));
|
||||||
$crm->setQuery($query);
|
$crm->setQuery($query);
|
||||||
$result=$crm->execute();
|
$result=$crm->execute();
|
||||||
//if ($_SERVER['REMOTE_ADDR']=='46.139.14.111') {print_r($exist); print('<br />haha<br />'.$newKey); die();}
|
//if ($_SERVER['REMOTE_ADDR']=='46.139.14.111') {print_r($exist); print('<br />haha<br />'.$newKey); die();}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result=$crm->insertObject("hardlock", $rec);
|
$result=$crm->insertObject("hardlock", $rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
$crm->setQuery("SELECT * FROM `computers` WHERE computer_id='".$npid."';");
|
||||||
$tmp233=$crm->loadObjectList();
|
$tmp233=$crm->loadObjectList();
|
||||||
$comp2=$tmp233[0];
|
$comp2=$tmp233[0];
|
||||||
|
|
||||||
$rec2=new stdClass();
|
$rec2=new stdClass();
|
||||||
$rec2->computer_id=$comp2->id;
|
$rec2->computer_id=$comp2->id;
|
||||||
$rec2->isid=$isid;
|
$rec2->isid=$isid;
|
||||||
$rec2->verid=$verid;
|
$rec2->verid=$verid;
|
||||||
$rec2->hlID=$newKey;
|
$rec2->hlID=$newKey;
|
||||||
$rec2->nUserID=$nUserID;
|
$rec2->nUserID=$nUserID;
|
||||||
$rec2->add_datetime=date('Y-m-d H:i:s',time());
|
$rec2->add_datetime=date('Y-m-d H:i:s',time());
|
||||||
$rec2->expire_datetime=date('Y-m-d',time()+60*86400).' 23:59:59';
|
$rec2->expire_datetime=date('Y-m-d',time()+60*86400).' 23:59:59';
|
||||||
$rec2->old_db=$user->old_db;
|
$rec2->old_db=$user->old_db;
|
||||||
$result2=$crm->insertObject("nonprofit", $rec2);
|
$result2=$crm->insertObject("nonprofit", $rec2);
|
||||||
|
|
||||||
$rec=new stdClass();
|
$rec=new stdClass();
|
||||||
$rec->nUserID=$nUserID;
|
$rec->nUserID=$nUserID;
|
||||||
$rec->nTopicID=($user->old_db=='clusers' ? 300 : 302); //($this->getPrefix()=='jml' ? 300 : 302);
|
$rec->nTopicID=($user->old_db=='clusers' ? 300 : 302); //($this->getPrefix()=='jml' ? 300 : 302);
|
||||||
$rec->dateEvent=date('Y-m-d',time());
|
$rec->dateEvent=date('Y-m-d',time());
|
||||||
$rec->strPlace='web';
|
$rec->strPlace='web';
|
||||||
$rec->strInfo=JText::sprintf("COM_NONPROFIT_KEY_REQUEST_INFO",$newKey);
|
$rec->strInfo=JText::sprintf("COM_NONPROFIT_KEY_REQUEST_INFO",$newKey);
|
||||||
$rec->nManagerID=36;
|
$rec->nManagerID=36;
|
||||||
$rec->insertDate=date('Y-m-d H:i:s',time());
|
$rec->insertDate=date('Y-m-d H:i:s',time());
|
||||||
$result=$crm->insertObject("u_history", $rec);
|
$result=$crm->insertObject("u_history", $rec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ($newKey);
|
return ($newKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPass($nUserID=0,$npid="",$isid="",$verid=0, $product=1)
|
public function getPass($nUserID=0,$npid="",$isid="",$verid=0, $product=1)
|
||||||
{
|
{
|
||||||
$res="";
|
$res="";
|
||||||
if ($npid>"" && $isid>"" && (int)$verid>0)
|
if ($npid>"" && $isid>"" && (int)$verid>0)
|
||||||
{
|
{
|
||||||
$res=file_get_contents("https://www.archlinexp.com/maintenance/nonprofit.php?npid=".$npid."&isid=".$isid."&verid=".(int)$verid."&createProgram=true&product=".$product);
|
$res=file_get_contents("https://www.archlinexp.com/maintenance/nonprofit.php?npid=".$npid."&isid=".$isid."&verid=".(int)$verid."&createProgram=true&product=".$product);
|
||||||
}
|
}
|
||||||
return ($res);
|
return ($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Megpróbálja az adott kulcs tartományon belül a lehető legkissebb szabad
|
* Megpróbálja az adott kulcs tartományon belül a lehető legkissebb szabad
|
||||||
* kulcsot megtalálni, és visszaadja az számát
|
* kulcsot megtalálni, és visszaadja az számát
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
public function tryToAlloc($min=0,$max=0)
|
public function tryToAlloc($min=0,$max=0)
|
||||||
{
|
{
|
||||||
$ret=0;
|
$ret=0;
|
||||||
if ((int)$min==0 || (int)$max==0) return($ret);
|
if ((int)$min==0 || (int)$max==0) return($ret);
|
||||||
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
$crm=JDatabaseDriver::getInstance($this->getConfig());
|
||||||
$crm->setQuery("SELECT LEFT(hlNum,6) AS hlNum FROM hardlock WHERE hlStat!=0 AND hlNum>=".(int)$min." AND hlNum<".(int)$max." ORDER BY hlNum;");
|
$crm->setQuery("SELECT LEFT(hlNum,6) AS hlNum FROM hardlock WHERE hlStat!=0 AND hlNum>=".(int)$min." AND hlNum<".(int)$max." ORDER BY hlNum;");
|
||||||
$res=$crm->loadObjectList();
|
$res=$crm->loadObjectList();
|
||||||
|
|
||||||
if (count($res))
|
if (count($res))
|
||||||
{
|
{
|
||||||
$keszlet=range($min, $max);
|
$keszlet=range($min, $max);
|
||||||
foreach ($res as $r) { $kulcsok[]=$r->hlNum; }
|
foreach ($res as $r) { $kulcsok[]=$r->hlNum; }
|
||||||
$diff=array_diff($keszlet,$kulcsok);
|
$diff=array_diff($keszlet,$kulcsok);
|
||||||
reset($diff);
|
reset($diff);
|
||||||
$ret=current($diff);
|
$ret=current($diff);
|
||||||
if ((int)$ret>0)
|
if ((int)$ret>0)
|
||||||
{
|
{
|
||||||
$crm->setQuery("DELETE FROM `t_registeronce` WHERE arch_id=".(int)$ret);
|
$crm->setQuery("DELETE FROM `t_registeronce` WHERE arch_id=".(int)$ret);
|
||||||
$crm->execute();
|
$crm->execute();
|
||||||
}
|
}
|
||||||
$this->freeKeys=count($diff)-1;
|
$this->freeKeys=count($diff)-1;
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function countFreeKeys($min=0,$max=0)
|
public function countFreeKeys($min=0,$max=0)
|
||||||
{
|
{
|
||||||
$this->tryToAlloc($min,$max);
|
$this->tryToAlloc($min,$max);
|
||||||
return ((int)$this->freeKeys);
|
return ((int)$this->freeKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function sendWarningMail()
|
public function sendWarningMail()
|
||||||
{
|
{
|
||||||
$app=JFactory::getApplication();
|
$app=JFactory::getApplication();
|
||||||
$config=JFactory::getConfig();
|
$config=JFactory::getConfig();
|
||||||
$mailer=JFactory::getMailer();
|
$mailer=JFactory::getMailer();
|
||||||
$mailer->setSender(array('info@cadline.hu'));
|
$mailer->setSender(array('info@cadline.hu'));
|
||||||
$mailer->addRecipient(array('office@cadline.hu', 'marketing@cadline.hu'));
|
$mailer->addRecipient(array('office@cadline.hu', 'marketing@cadline.hu'));
|
||||||
$mailer->setSubject(JText::_(($this->freeKeys==0 ? 'COM_NONPROFIT_MAIL_NO_KEY_SUBJECT' : 'COM_NONPROFIT_MAIL_KEY_LOW_SUBJECT')));
|
$mailer->setSubject(JText::_(($this->freeKeys==0 ? 'COM_NONPROFIT_MAIL_NO_KEY_SUBJECT' : 'COM_NONPROFIT_MAIL_KEY_LOW_SUBJECT')));
|
||||||
$mailer->setBody(JText::sprintf(($this->freeKeys==0 ? 'COM_NONPROFIT_MAIL_NO_KEY_BODY' : 'COM_NONPROFIT_MAIL_KEY_LOW_BODY'),$this->freeKeys));
|
$mailer->setBody(JText::sprintf(($this->freeKeys==0 ? 'COM_NONPROFIT_MAIL_NO_KEY_BODY' : 'COM_NONPROFIT_MAIL_KEY_LOW_BODY'),$this->freeKeys));
|
||||||
$mailer->Send();
|
$mailer->Send();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendPasswordInEmail($to, $user, $password, $product)
|
public function sendPasswordInEmail($to, $user, $password, $product)
|
||||||
{
|
{
|
||||||
$app=JFactory::getApplication();
|
$app=JFactory::getApplication();
|
||||||
$config=JFactory::getConfig();
|
$config=JFactory::getConfig();
|
||||||
$mailer=JFactory::getMailer();
|
$mailer=JFactory::getMailer();
|
||||||
$mailer->isHTML(true);
|
$mailer->isHTML(true);
|
||||||
$mailer->setSender(array('info@cadline.hu'));
|
$mailer->setSender(array('info@cadline.hu'));
|
||||||
$mailer->addRecipient(array($to));
|
$mailer->addRecipient(array($to));
|
||||||
if($product == 2) {
|
if($product == 2) {
|
||||||
$mailer->setSubject("Non-Profit - ARCHLine.XP Live");
|
$mailer->setSubject("Non-Profit - ARCHLine.XP Live");
|
||||||
$mailer->setBody(JText::sprintf('COM_NONPROFIT_EMAIL_BODY_LIVE', $user, $password));
|
$mailer->setBody(JText::sprintf('COM_NONPROFIT_EMAIL_BODY_LIVE', $user, $password));
|
||||||
} else {
|
} else {
|
||||||
$mailer->setSubject("Non-Profit - ARCHLine.XP");
|
$mailer->setSubject("Non-Profit - ARCHLine.XP");
|
||||||
$mailer->setBody(JText::sprintf('COM_NONPROFIT_EMAIL_BODY', $user, $password));
|
$mailer->setBody(JText::sprintf('COM_NONPROFIT_EMAIL_BODY', $user, $password));
|
||||||
}
|
}
|
||||||
$mailer->Send();
|
$mailer->Send();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExistKeys() { return ($this->existKeys); }
|
public function getExistKeys() { return ($this->existKeys); }
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,167 +1,167 @@
|
|||||||
<?php defined('_JEXEC') or die; ?>
|
<?php defined('_JEXEC') or die; ?>
|
||||||
<?php
|
<?php
|
||||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||||
|
|
||||||
if (!class_exists('crm_hardlock')) require_once(JPATH_BASE."/common_cadline_libraries/crm_hardlock.class.php");
|
if (!class_exists('crm_hardlock')) require_once(JPATH_BASE."/common_cadline_libraries/crm_hardlock.class.php");
|
||||||
|
|
||||||
if(isset($_GET["webform"])) {
|
if(isset($_GET["webform"])) {
|
||||||
$encodedSession = $_GET["session"];
|
$encodedSession = $_GET["session"];
|
||||||
$param = $_GET["param"];
|
$param = $_GET["param"];
|
||||||
$session = base64_decode($encodedSession);
|
$session = base64_decode($encodedSession);
|
||||||
|
|
||||||
$privatekey = crm_hardlock::GetWebformPrivateKey();
|
$privatekey = crm_hardlock::GetWebformPrivateKey();
|
||||||
$param = crm_hardlock::decode($privatekey,$session,$param);
|
$param = crm_hardlock::decode($privatekey,$session,$param);
|
||||||
|
|
||||||
if(!empty($this->newPass)) {
|
if(!empty($this->newPass)) {
|
||||||
$result = "<NonProfit><Pass>".$this->newPass."</Pass></NonProfit>";
|
$result = "<NonProfit><Pass>".$this->newPass."</Pass></NonProfit>";
|
||||||
$encodedResult = crm_hardlock::encode($privatekey,$session,$result);
|
$encodedResult = crm_hardlock::encode($privatekey,$session,$result);
|
||||||
} elseif(!empty($this->regFinished)) {
|
} elseif(!empty($this->regFinished)) {
|
||||||
$result = "<NonProfit><Pass>".$this->regFinished."</Pass></NonProfit>";
|
$result = "<NonProfit><Pass>".$this->regFinished."</Pass></NonProfit>";
|
||||||
$encodedResult = crm_hardlock::encode($privatekey,$session,$result);
|
$encodedResult = crm_hardlock::encode($privatekey,$session,$result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||||
$link = crm_hardlock::encode($privatekey, $session, $actual_link);
|
$link = crm_hardlock::encode($privatekey, $session, $actual_link);
|
||||||
|
|
||||||
$linkParam = "?".$param;
|
$linkParam = "?".$param;
|
||||||
$npid = crm_hardlock::get_valueFromStringUrl($linkParam, "npid");
|
$npid = crm_hardlock::get_valueFromStringUrl($linkParam, "npid");
|
||||||
$isid = crm_hardlock::get_valueFromStringUrl($linkParam, "isid");
|
$isid = crm_hardlock::get_valueFromStringUrl($linkParam, "isid");
|
||||||
$product = crm_hardlock::get_valueFromStringUrl($linkParam, "product");
|
$product = crm_hardlock::get_valueFromStringUrl($linkParam, "product");
|
||||||
$verid = crm_hardlock::get_valueFromStringUrl($linkParam, "verid");
|
$verid = crm_hardlock::get_valueFromStringUrl($linkParam, "verid");
|
||||||
} else {
|
} else {
|
||||||
$verid = $_GET["verid"];
|
$verid = $_GET["verid"];
|
||||||
$npid = $_GET["npid"];
|
$npid = $_GET["npid"];
|
||||||
$isid = $_GET["isid"];
|
$isid = $_GET["isid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($product))
|
if(empty($product))
|
||||||
$product = 1;
|
$product = 1;
|
||||||
|
|
||||||
$user=JFactory::getUser();
|
$user=JFactory::getUser();
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php if ($this->redirect>'') : ?>
|
<?php if ($this->redirect>'') : ?>
|
||||||
jQuery(document).ready(function() { jQuery(location).attr('href','<?=$this->redirect?>'); });
|
jQuery(document).ready(function() { jQuery(location).attr('href','<?=$this->redirect?>'); });
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|
||||||
var clipboard = new Clipboard('.btn', { text: function() {
|
var clipboard = new Clipboard('.btn', { text: function() {
|
||||||
<?php
|
<?php
|
||||||
if(isset($_GET["webform"])) {
|
if(isset($_GET["webform"])) {
|
||||||
if(empty($this->newPass)) {
|
if(empty($this->newPass)) {
|
||||||
?>
|
?>
|
||||||
return '';
|
return '';
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
return '<'+'?xml version="1.0"?'+'><WebFormResult>?session=<?=$encodedSession?>&result_ok=<?=$encodedResult?></WebFormResult>';
|
return '<'+'?xml version="1.0"?'+'><WebFormResult>?session=<?=$encodedSession?>&result_ok=<?=$encodedResult?></WebFormResult>';
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
return 'ARCHline.XP_clpbrd_nnprft:<?=$this->newPass?>';
|
return 'ARCHline.XP_clpbrd_nnprft:<?=$this->newPass?>';
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
}});
|
}});
|
||||||
clipboard.on('success', function(e) { console.log(e); });
|
clipboard.on('success', function(e) { console.log(e); });
|
||||||
clipboard.on('error', function(e) { console.log(e); });
|
clipboard.on('error', function(e) { console.log(e); });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php if(/*!$this->hasCommercial || $this->isNpConToThisComp || !$this->isConnectedNonprofitExpired*/ false):?>
|
<?php if(/*!$this->hasCommercial || $this->isNpConToThisComp || !$this->isConnectedNonprofitExpired*/ false):?>
|
||||||
<div class="container" style="margin-top:10px;margin-bottom:10px;">
|
<div class="container" style="margin-top:10px;margin-bottom:10px;">
|
||||||
<div class="row form-group">
|
<div class="row form-group">
|
||||||
<h1 class="antracit"><?=$this->article->title?></h1>
|
<h1 class="antracit"><?=$this->article->title?></h1>
|
||||||
<?php
|
<?php
|
||||||
if($product == 2){
|
if($product == 2){
|
||||||
$restartButton = JText::_('COM_NONPROFIT_RESTART_LIVE');
|
$restartButton = JText::_('COM_NONPROFIT_RESTART_LIVE');
|
||||||
$nonpDesc = JText::_('COM_NONPROFIT_DESC_LIVE');
|
$nonpDesc = JText::_('COM_NONPROFIT_DESC_LIVE');
|
||||||
} else {
|
} else {
|
||||||
$restartButton = JText::_('COM_NONPROFIT_RESTART');
|
$restartButton = JText::_('COM_NONPROFIT_RESTART');
|
||||||
$nonpDesc = JText::_('COM_NONPROFIT_DESC');
|
$nonpDesc = JText::_('COM_NONPROFIT_DESC');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user=JFactory::getUser();
|
$user=JFactory::getUser();
|
||||||
|
|
||||||
if ((int)$user->id==0) : ?>
|
if ((int)$user->id==0) : ?>
|
||||||
<?=JModuleHelper::renderModule(JModuleHelper::getModule('mod_login','User login'), array())?>
|
<?=JModuleHelper::renderModule(JModuleHelper::getModule('mod_login','User login'), array())?>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php if(empty($_GET["restart"]) || !$_GET["restart"]) : ?>
|
<?php if(empty($_GET["restart"]) || !$_GET["restart"]) : ?>
|
||||||
<form name="nonprofit" id="nonprofit" action="<?=$_SERVER['SCRIPT_URL']?>" method="post">
|
<form name="nonprofit" id="nonprofit" action="<?=$_SERVER['SCRIPT_URL']?>" method="post">
|
||||||
<?php if ($this->newPass != '') : ?>
|
<?php if ($this->newPass != '') : ?>
|
||||||
<p><strong><?=JText::_('COM_NONPROFIT_SUCCESS')?></strong></p>
|
<p><strong><?=JText::_('COM_NONPROFIT_SUCCESS')?></strong></p>
|
||||||
<p><?=JText::_('COM_NONPROFIT_PASS')?>: <input type="text" name="newPass" id="newPass" value="<?=$this->newPass?>" readonly /></p>
|
<p><?=JText::_('COM_NONPROFIT_PASS')?>: <input type="text" name="newPass" id="newPass" value="<?=$this->newPass?>" readonly /></p>
|
||||||
<?php else :?>
|
<?php else :?>
|
||||||
<p><?=JText::_(COM_NONPROFIT_PRESS_BUTTON);?>:</p>
|
<p><?=JText::_(COM_NONPROFIT_PRESS_BUTTON);?>:</p>
|
||||||
<input type="<?=($this->haveRightsToUseNonprofit==FALSE ? "button" : "submit")?>" name="getid" id="getid" value="<?=JText::_(COM_NONPROFIT_BUTTON);?>" class="btn btn-lg btn-primary <?=($this->haveRightsToUseNonprofit==FALSE ? "disabled" : "")?>" /><br />
|
<input type="<?=($this->haveRightsToUseNonprofit==FALSE ? "button" : "submit")?>" name="getid" id="getid" value="<?=JText::_(COM_NONPROFIT_BUTTON);?>" class="btn btn-lg btn-primary <?=($this->haveRightsToUseNonprofit==FALSE ? "disabled" : "")?>" /><br />
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|
||||||
<?php if (in_array($_SERVER['REMOTE_ADDR'], array('188.6.239.155','46.139.109.235','46.139.14.111', '79.122.126.144'))) : ?>
|
<?php if (in_array($_SERVER['REMOTE_ADDR'], array('188.6.239.155','46.139.109.235','46.139.14.111', '79.122.126.144'))) : ?>
|
||||||
|
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</form>
|
</form>
|
||||||
<?php if ($this->newPass != '') : ?>
|
<?php if ($this->newPass != '') : ?>
|
||||||
<form method="GET" action="https://www.archlinexp.com/maintenance/webform/nonprofit.php">
|
<form method="GET" action="https://www.archlinexp.com/maintenance/webform/nonprofit.php">
|
||||||
<input type="hidden" name="session" value="<?=$encodedSession?>" />
|
<input type="hidden" name="session" value="<?=$encodedSession?>" />
|
||||||
<input type="hidden" name="result_ok" value="<?=$encodedResult?>" />
|
<input type="hidden" name="result_ok" value="<?=$encodedResult?>" />
|
||||||
<input type="hidden" name="param" value="<?=$link?>" />
|
<input type="hidden" name="param" value="<?=$link?>" />
|
||||||
<p><?=$nonpDesc?>:</p>
|
<p><?=$nonpDesc?>:</p>
|
||||||
<p><input type="submit" class="btn btn-lg btn-success" value="<?=$restartButton?>" /></p>
|
<p><input type="submit" class="btn btn-lg btn-success" value="<?=$restartButton?>" /></p>
|
||||||
</form>
|
</form>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<form name="nonprofit" id="nonprofit" action="<?=$_SERVER['SCRIPT_URL']?>" method="post">
|
<form name="nonprofit" id="nonprofit" action="<?=$_SERVER['SCRIPT_URL']?>" method="post">
|
||||||
<p><strong><?=JText::_('COM_NONPROFIT_SUCCESS')?></strong></p>
|
<p><strong><?=JText::_('COM_NONPROFIT_SUCCESS')?></strong></p>
|
||||||
<p><?=JText::_('COM_NONPROFIT_PASS')?>: <input type="text" name="regFinished" id="regFinished" value="<?=$this->regFinished?>" readonly /></p>
|
<p><?=JText::_('COM_NONPROFIT_PASS')?>: <input type="text" name="regFinished" id="regFinished" value="<?=$this->regFinished?>" readonly /></p>
|
||||||
</form>
|
</form>
|
||||||
<form method="GET" action="https://www.archlinexp.com/maintenance/webform/nonprofit.php">
|
<form method="GET" action="https://www.archlinexp.com/maintenance/webform/nonprofit.php">
|
||||||
<input type="hidden" name="session" value="<?=$encodedSession?>" />
|
<input type="hidden" name="session" value="<?=$encodedSession?>" />
|
||||||
<input type="hidden" name="result_ok" value="<?=$encodedResult?>" />
|
<input type="hidden" name="result_ok" value="<?=$encodedResult?>" />
|
||||||
<input type="hidden" name="param" value="<?=$link?>" />
|
<input type="hidden" name="param" value="<?=$link?>" />
|
||||||
<p><?=$nonpDesc?>:</p>
|
<p><?=$nonpDesc?>:</p>
|
||||||
<p><input type="submit" class="btn btn-lg btn-success" value="<?=$restartButton?>" /></p>
|
<p><input type="submit" class="btn btn-lg btn-success" value="<?=$restartButton?>" /></p>
|
||||||
</form>
|
</form>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
<?=$this->article->introtext?>
|
<?=$this->article->introtext?>
|
||||||
<?=$this->article->fulltext?>
|
<?=$this->article->fulltext?>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|
||||||
<?php if($_SERVER['REMOTE_ADDR'] == '79.122.126.144'): ?>
|
<?php if($_SERVER['REMOTE_ADDR'] == '79.122.126.144'): ?>
|
||||||
<style>
|
<style>
|
||||||
#text_div {
|
#text_div {
|
||||||
margin-top: -10px !important;
|
margin-top: -10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nonp_title {
|
#nonp_title {
|
||||||
margin-left: 25%;
|
margin-left: 25%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2 class="sppb-addon-title" id="nonp_title"><b>Non-profit licenc információ</b></h2>
|
<h2 class="sppb-addon-title" id="nonp_title"><b>Non-profit licenc információ</b></h2>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<img class="sppb-img-responsive" src="/images/2017/05/04/clients_image_photo.jpg" alt="clients_image_photo.jpg" />
|
<img class="sppb-img-responsive" src="/images/2017/05/04/clients_image_photo.jpg" alt="clients_image_photo.jpg" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" id="text_div">
|
<div class="col-md-6" id="text_div">
|
||||||
<h4><b>Szeretnél Non-Profit licencet?</b></h4>
|
<h4><b>Szeretnél Non-Profit licencet?</b></h4>
|
||||||
<p>Non-profit kód igénylését kifejezetten a szakmában dolgozóknak/tanulóknak javasoljuk.
|
<p>Non-profit kód igénylését kifejezetten a szakmában dolgozóknak/tanulóknak javasoljuk.
|
||||||
Ehhez létre kell hozni egy felhasználói fiókot, amelyben megadod a neved, elérhetőséged és e-mail címed. Ezt követően le kell töltened az ARCHLine.XP próbaváltozatát.
|
Ehhez létre kell hozni egy felhasználói fiókot, amelyben megadod a neved, elérhetőséged és e-mail címed. Ezt követően le kell töltened az ARCHLine.XP próbaváltozatát.
|
||||||
Az ARCHLine.XP Non-Profit kóddal a program két hónapig használható.</p>
|
Az ARCHLine.XP Non-Profit kóddal a program két hónapig használható.</p>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<h4><b>Hogyan kaphatok Non-Profit kódot?</b></h4>
|
<h4><b>Hogyan kaphatok Non-Profit kódot?</b></h4>
|
||||||
<p>Non-profit kód igényléshez kérjük, írj nekünk egy e-mailt az <a href="mailto:info@cadline.hu">info@cadline.hu</a> címre, melyben 1-2 mondatban indokold meg, hogy miért szeretnél kódot kérni.</p>
|
<p>Non-profit kód igényléshez kérjük, írj nekünk egy e-mailt az <a href="mailto:info@cadline.hu">info@cadline.hu</a> címre, melyben 1-2 mondatban indokold meg, hogy miért szeretnél kódot kérni.</p>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<h4><b>Igényelhetek terméktámogatást ha Non-Profit kóddal használom a programot?</b></h4>
|
<h4><b>Igényelhetek terméktámogatást ha Non-Profit kóddal használom a programot?</b></h4>
|
||||||
<p>Igen. E-mailben küldd el kérdésed az <a href="mailto:info@cadline.hu">info@cadline.hu-ra</a>! További segédanyagokat, oktatóvideókat honlapunkon találsz, az Oktatás menüpontban.</p>
|
<p>Igen. E-mailben küldd el kérdésed az <a href="mailto:info@cadline.hu">info@cadline.hu-ra</a>! További segédanyagokat, oktatóvideókat honlapunkon találsz, az Oktatás menüpontban.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|||||||
@ -1,148 +1,148 @@
|
|||||||
<?php
|
<?php
|
||||||
//https://www.archline.hu/index.php?option=com_nonprofit&view=nonprofit&npid=ff299d03-0d3e-4963-9335-ebfe3972eeb7&isid=aa11&verid=35
|
//https://www.archline.hu/index.php?option=com_nonprofit&view=nonprofit&npid=ff299d03-0d3e-4963-9335-ebfe3972eeb7&isid=aa11&verid=35
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
defined('_JEXEC') or die; // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
jimport('joomla.log.log');
|
jimport('joomla.log.log');
|
||||||
|
|
||||||
class NonprofitViewNonprofit extends JViewLegacy {
|
class NonprofitViewNonprofit extends JViewLegacy {
|
||||||
public function display($tpl = null) {
|
public function display($tpl = null) {
|
||||||
$app=JFactory::getApplication();
|
$app=JFactory::getApplication();
|
||||||
$user=JFactory::getUser();
|
$user=JFactory::getUser();
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
if(isset($_GET["webform"])) {
|
if(isset($_GET["webform"])) {
|
||||||
// ----------------------------------------------------------------------- Webform inicializálása -----------------------------------------------------------------------
|
// ----------------------------------------------------------------------- Webform inicializálása -----------------------------------------------------------------------
|
||||||
|
|
||||||
if (!class_exists('crm_hardlock')) require_once(JPATH_BASE."/common_cadline_libraries/crm_hardlock.class.php");
|
if (!class_exists('crm_hardlock')) require_once(JPATH_BASE."/common_cadline_libraries/crm_hardlock.class.php");
|
||||||
|
|
||||||
$encodedSession = $_GET["session"]; // Minden csatorna megnyíláskor egyedi kódot kap, ez a publikus kulcs is
|
$encodedSession = $_GET["session"]; // Minden csatorna megnyíláskor egyedi kódot kap, ez a publikus kulcs is
|
||||||
$session = base64_decode($encodedSession);
|
$session = base64_decode($encodedSession);
|
||||||
$param = $_GET["param"]; // Encode-olt adat
|
$param = $_GET["param"]; // Encode-olt adat
|
||||||
$privatekey = crm_hardlock::GetWebformPrivateKey(); // A privát kulcs lekérdezése
|
$privatekey = crm_hardlock::GetWebformPrivateKey(); // A privát kulcs lekérdezése
|
||||||
$param = crm_hardlock::decode($privatekey,$session,$param); // Adat decode-olása
|
$param = crm_hardlock::decode($privatekey,$session,$param); // Adat decode-olása
|
||||||
|
|
||||||
//crmHelper::SetWebformResource($session, "Ez lesz az üzenet a felhasználónak", "Kattints ide");
|
//crmHelper::SetWebformResource($session, "Ez lesz az üzenet a felhasználónak", "Kattints ide");
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- Webform inicializálása -----------------------------------------------------------------------
|
// ----------------------------------------------------------------------- Webform inicializálása -----------------------------------------------------------------------
|
||||||
|
|
||||||
$param = "?".$param;
|
$param = "?".$param;
|
||||||
$npid = crm_hardlock::get_valueFromStringUrl($param, "npid");
|
$npid = crm_hardlock::get_valueFromStringUrl($param, "npid");
|
||||||
$isid = crm_hardlock::get_valueFromStringUrl($param, "isid");
|
$isid = crm_hardlock::get_valueFromStringUrl($param, "isid");
|
||||||
$verid = crm_hardlock::get_valueFromStringUrl($param, "verid");
|
$verid = crm_hardlock::get_valueFromStringUrl($param, "verid");
|
||||||
$product = crm_hardlock::get_valueFromStringUrl($param, "product");
|
$product = crm_hardlock::get_valueFromStringUrl($param, "product");
|
||||||
$this->GET_VERSION= $verid;
|
$this->GET_VERSION= $verid;
|
||||||
} else { // Régi nonprofit ág
|
} else { // Régi nonprofit ág
|
||||||
$npid=trim(addslashes($_GET['npid']));
|
$npid=trim(addslashes($_GET['npid']));
|
||||||
$isid=trim(addslashes($_GET['isid']));
|
$isid=trim(addslashes($_GET['isid']));
|
||||||
$this->GET_VERSION=(isset($_GET['verid']) && (int)$_GET['verid']>0 ? (int)$_GET['verid'] : 0);
|
$this->GET_VERSION=(isset($_GET['verid']) && (int)$_GET['verid']>0 ? (int)$_GET['verid'] : 0);
|
||||||
$product = 1;
|
$product = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$verid = ($this->GET_VERSION==0 ? $this->CURRENT_VERSION : $this->GET_VERSION);
|
$verid = ($this->GET_VERSION==0 ? $this->CURRENT_VERSION : $this->GET_VERSION);
|
||||||
$this->CURRENT_VERSION=$model->getCurrentVersion('verPassword8and9');
|
$this->CURRENT_VERSION=$model->getCurrentVersion('verPassword8and9');
|
||||||
|
|
||||||
JFactory::getDocument()->addScript('/components/'.JFactory::getApplication()->input->get('option').'/assets/js/clipboard.min.js');
|
JFactory::getDocument()->addScript('/components/'.JFactory::getApplication()->input->get('option').'/assets/js/clipboard.min.js');
|
||||||
|
|
||||||
JLog::addLogger(array('text_file'=>'com_nonprofit.call.php','text_entry_format'=>'{DATE} {TIME} {CLIENTIP} {MESSAGE}'),JLog::ALL,array('com_nonprofit'));
|
JLog::addLogger(array('text_file'=>'com_nonprofit.call.php','text_entry_format'=>'{DATE} {TIME} {CLIENTIP} {MESSAGE}'),JLog::ALL,array('com_nonprofit'));
|
||||||
JLog::add("domain: ".JURI::base()." | npid: ".$npid." | isid: ".$isid, JLog::WARNING, 'com_nonprofit');
|
JLog::add("domain: ".JURI::base()." | npid: ".$npid." | isid: ".$isid, JLog::WARNING, 'com_nonprofit');
|
||||||
|
|
||||||
if (!$user->nUserID) {
|
if (!$user->nUserID) {
|
||||||
$model->syncUser();
|
$model->syncUser();
|
||||||
$user=JFactory::getUser();
|
$user=JFactory::getUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
$crmUser=$model->getCRMUser($user->nUserID);
|
$crmUser=$model->getCRMUser($user->nUserID);
|
||||||
|
|
||||||
// Redirect if curr lang != crm old_db
|
// Redirect if curr lang != crm old_db
|
||||||
if ($crmUser->old_db>'') {
|
if ($crmUser->old_db>'') {
|
||||||
$domain="";
|
$domain="";
|
||||||
$base=JURI::base();
|
$base=JURI::base();
|
||||||
$currLang=$model->getLang();
|
$currLang=$model->getLang();
|
||||||
if ($currLang=='hun' && $crmUser->old_db!='clusers') $domain='http://www.archlinexp.com';
|
if ($currLang=='hun' && $crmUser->old_db!='clusers') $domain='http://www.archlinexp.com';
|
||||||
if ($currLang=='eng' && $crmUser->old_db=='clusers') $domain='http://www.archline.hu';
|
if ($currLang=='eng' && $crmUser->old_db=='clusers') $domain='http://www.archline.hu';
|
||||||
//if ($domain>'') { $this->redirect=$domain."/index.php?option=com_nonprofit&view=nonprofit&npid=".$npid.($isid>''?"&isid=".$isid:'').($this->GET_VERSION>0?"&verid=".$this->GET_VERSION:''); }
|
//if ($domain>'') { $this->redirect=$domain."/index.php?option=com_nonprofit&view=nonprofit&npid=".$npid.($isid>''?"&isid=".$isid:'').($this->GET_VERSION>0?"&verid=".$this->GET_VERSION:''); }
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->article=$model->getArticle($product);
|
$this->article=$model->getArticle($product);
|
||||||
$model->hasRecord($user->nUserID, $product, $npid);
|
$model->hasRecord($user->nUserID, $product, $npid);
|
||||||
$this->hasNonprofitProgram=$model->hasNonprofitProgram;
|
$this->hasNonprofitProgram=$model->hasNonprofitProgram;
|
||||||
$this->hasCommercial=$model->hasCommercial;
|
$this->hasCommercial=$model->hasCommercial;
|
||||||
$this->isNpConToThisComp=$model->isNonprofitConnectedToThisComputer;
|
$this->isNpConToThisComp=$model->isNonprofitConnectedToThisComputer;
|
||||||
$this->isConnectedNonprofitExpired=$model->isConnectedNonprofitExpired;
|
$this->isConnectedNonprofitExpired=$model->isConnectedNonprofitExpired;
|
||||||
$this->haveRightsToUseNonprofit = $model->haveRightsToUseNonprofit;
|
$this->haveRightsToUseNonprofit = $model->haveRightsToUseNonprofit;
|
||||||
$this->hasToGenerateNonprofit = $model->hasToGenerateNonprofit;
|
$this->hasToGenerateNonprofit = $model->hasToGenerateNonprofit;
|
||||||
$this->sqlQuery=$model->sqlQuery;
|
$this->sqlQuery=$model->sqlQuery;
|
||||||
|
|
||||||
$this->freeKeys=$model->countFreeKeys($model->npRangeMin,$model->npRangeMax);
|
$this->freeKeys=$model->countFreeKeys($model->npRangeMin,$model->npRangeMax);
|
||||||
if (!$this->haveRightsToUseNonprofit || $this->freeKeys == 0) { // Ki kell írnia, hogy nincs joga használni a Nonprofitot
|
if (!$this->haveRightsToUseNonprofit || $this->freeKeys == 0) { // Ki kell írnia, hogy nincs joga használni a Nonprofitot
|
||||||
if($this->freeKeys == 0) {
|
if($this->freeKeys == 0) {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_NO_FREE_KEY).''.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_NO_FREE_KEY).''.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
} elseif($this->hasCommercial) {
|
} elseif($this->hasCommercial) {
|
||||||
// Mivel kereskedelmi licencel rendelkezik, ezért nem használhatja a nonprofit programot
|
// Mivel kereskedelmi licencel rendelkezik, ezért nem használhatja a nonprofit programot
|
||||||
|
|
||||||
if($product == 2) {
|
if($product == 2) {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXIST_ISID_LIVE).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXIST_ISID_LIVE).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
} else {
|
} else {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXIST_ISID).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXIST_ISID).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
}
|
}
|
||||||
} elseif(!$this->isNpConToThisComp) {
|
} elseif(!$this->isNpConToThisComp) {
|
||||||
// Másik gépen van regisztrálva
|
// Másik gépen van regisztrálva
|
||||||
|
|
||||||
if($product == 2) {
|
if($product == 2) {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_ANOTHER_MACHINE_REGISTERED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_ANOTHER_MACHINE_REGISTERED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
} else {
|
} else {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_ANOTHER_MACHINE_REGISTERED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_ANOTHER_MACHINE_REGISTERED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
}
|
}
|
||||||
} elseif($this->isConnectedNonprofitExpired) {
|
} elseif($this->isConnectedNonprofitExpired) {
|
||||||
// Lejárt a nonprofit
|
// Lejárt a nonprofit
|
||||||
|
|
||||||
if($product == 2) {
|
if($product == 2) {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXPIRED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXPIRED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
} else {
|
} else {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXPIRED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_EXPIRED).'<br/><br/>'.JText::_(COM_NONPROFIT_SUFFIX), 'notice');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->haveRightsToUseNonprofit) {
|
if($this->haveRightsToUseNonprofit) {
|
||||||
$model->getExistingKeyAndPass($user->nUserID,$npid,$verid, $product);
|
$model->getExistingKeyAndPass($user->nUserID,$npid,$verid, $product);
|
||||||
$this->regFinished=$model->newPass;
|
$this->regFinished=$model->newPass;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['getid']) && $this->haveRightsToUseNonprofit && (int)$user->nUserID>0 && (int)$this->freeKeys>0 && isset($npid) && $npid>'') {
|
if (isset($_POST['getid']) && $this->haveRightsToUseNonprofit && (int)$user->nUserID>0 && (int)$this->freeKeys>0 && isset($npid) && $npid>'') {
|
||||||
if($this->hasToGenerateNonprofit) {
|
if($this->hasToGenerateNonprofit) {
|
||||||
$this->newKey=$model->getKey($user->nUserID,$npid,$isid,$verid, $product);
|
$this->newKey=$model->getKey($user->nUserID,$npid,$isid,$verid, $product);
|
||||||
$this->newPass=$model->getPass($user->nUserID,$npid,$isid,$verid, $product);
|
$this->newPass=$model->getPass($user->nUserID,$npid,$isid,$verid, $product);
|
||||||
} else {
|
} else {
|
||||||
$model->getExistingKeyAndPass($user->nUserID,$npid,$verid, $product);
|
$model->getExistingKeyAndPass($user->nUserID,$npid,$verid, $product);
|
||||||
$this->newKey=$model->newKey;
|
$this->newKey=$model->newKey;
|
||||||
$this->newPass=$model->newPass;
|
$this->newPass=$model->newPass;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->newKey>0) {
|
if ($this->newKey>0) {
|
||||||
if($product == 2) {
|
if($product == 2) {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_RESTART_LIVE), 'message');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_RESTART_LIVE), 'message');
|
||||||
} else {
|
} else {
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_RESTART_SOFTWARE), 'message');
|
JFactory::getApplication()->enqueueMessage(JText::_(COM_NONPROFIT_RESTART_SOFTWARE), 'message');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET["webform"])) {
|
if(isset($_GET["webform"])) {
|
||||||
$privatekey = crm_hardlock::GetWebformPrivateKey();
|
$privatekey = crm_hardlock::GetWebformPrivateKey();
|
||||||
$result = "<NonProfit><Pass>".$this->newPass."</Pass></NonProfit>";
|
$result = "<NonProfit><Pass>".$this->newPass."</Pass></NonProfit>";
|
||||||
$encodedResult = crm_hardlock::encode($privatekey,$session,$result);
|
$encodedResult = crm_hardlock::encode($privatekey,$session,$result);
|
||||||
crm_hardlock::SetWebformResult($session, "result_ok", $encodedResult, "", "");
|
crm_hardlock::SetWebformResult($session, "result_ok", $encodedResult, "", "");
|
||||||
|
|
||||||
$model->sendPasswordInEmail($user->email, $user->name, $this->newPass, $product);
|
$model->sendPasswordInEmail($user->email, $user->name, $this->newPass, $product);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->freeKeys <= 25) $model->sendWarningMail(); // Email küldése Nonprofit aktiválásakor
|
if ($this->freeKeys <= 25) $model->sendWarningMail(); // Email küldése Nonprofit aktiválásakor
|
||||||
}
|
}
|
||||||
|
|
||||||
$app->getPathway()->addItem(JText::_(COM_NONPROFIT_NONPROFIT), '');
|
$app->getPathway()->addItem(JText::_(COM_NONPROFIT_NONPROFIT), '');
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,31 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('BaseController.class.php');
|
require_once('BaseController.class.php');
|
||||||
|
|
||||||
class Controller extends BaseController {
|
class Controller extends BaseController {
|
||||||
public $pf='DownloadController';
|
public $pf='DownloadController';
|
||||||
|
|
||||||
public function procEvent()
|
public function procEvent()
|
||||||
{
|
{
|
||||||
$product=(int)$_GET['o_id'];
|
$product=(int)$_GET['o_id'];
|
||||||
|
|
||||||
if ($product>0)
|
if ($product>0)
|
||||||
{
|
{
|
||||||
MySqlHelper::getInstance()->query("SELECT * FROM collection2 WHERE o_id=".$product);
|
MySqlHelper::getInstance()->query("SELECT * FROM collection2 WHERE o_id=".$product);
|
||||||
$res=MySqlHelper::getInstance()->fetchAssoc();
|
$res=MySqlHelper::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
if (!empty($res))
|
if (!empty($res))
|
||||||
{
|
{
|
||||||
$tomb = isset($_SESSION['sr_down']) ? $_SESSION['sr_down'] : '';
|
$tomb = isset($_SESSION['sr_down']) ? $_SESSION['sr_down'] : '';
|
||||||
if (!is_array($tomb) || empty($tomb) || !in_array($product,$tomb))
|
if (!is_array($tomb) || empty($tomb) || !in_array($product,$tomb))
|
||||||
{
|
{
|
||||||
$tomb=$product;
|
$tomb=$product;
|
||||||
$_SESSION['sr_down']=$tomb;
|
$_SESSION['sr_down']=$tomb;
|
||||||
MySqlHelper::getInstance()->query("UPDATE collection2 SET `down`=`down`+1 WHERE o_id=".$product);
|
MySqlHelper::getInstance()->query("UPDATE collection2 SET `down`=`down`+1 WHERE o_id=".$product);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$controller=new Controller();
|
$controller=new Controller();
|
||||||
$controller->run();
|
$controller->run();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,386 +1,386 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
||||||
|
|
||||||
class ShowroomModelFamily extends JModelItem
|
class ShowroomModelFamily extends JModelItem
|
||||||
{
|
{
|
||||||
protected $article;
|
protected $article;
|
||||||
protected $families;
|
protected $families;
|
||||||
protected $family;
|
protected $family;
|
||||||
protected $products;
|
protected $products;
|
||||||
protected $product;
|
protected $product;
|
||||||
protected $files;
|
protected $files;
|
||||||
protected $arrKnownFiles=array('oli','matdata','environment','pdf','ifc');
|
protected $arrKnownFiles=array('oli','matdata','environment','pdf','ifc');
|
||||||
protected $sess;
|
protected $sess;
|
||||||
protected $limit=50;
|
protected $limit=50;
|
||||||
protected $productThumb='public/img/collection';
|
protected $productThumb='public/img/collection';
|
||||||
protected $productDir='public/collection';
|
protected $productDir='public/collection';
|
||||||
protected $querystring;
|
protected $querystring;
|
||||||
protected $struct;
|
protected $struct;
|
||||||
|
|
||||||
public function getFamilies($family="",$m_id=0)
|
public function getFamilies($family="",$m_id=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');
|
$lang=$session->get('sr_lang');
|
||||||
if (!isset($this->families))
|
if (!isset($this->families))
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
|
|
||||||
if ($m_id==0)
|
if ($m_id==0)
|
||||||
{
|
{
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT c.c_id,c.nev_hun,c.nev_eng,c.m_id,m.`name` AS manufacture, m.dir,c.deleted AS c_deleted,m.deleted AS m_deleted
|
SELECT c.c_id,c.nev_hun,c.nev_eng,c.m_id,m.`name` AS manufacture, m.dir,c.deleted AS c_deleted,m.deleted AS m_deleted
|
||||||
FROM coll2_cat c
|
FROM coll2_cat c
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=c.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=c.m_id
|
||||||
WHERE c.c_id=".(int)$family." LIMIT 1;");
|
WHERE c.c_id=".(int)$family." LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
$manufacture=(int)$tmp[0]->m_id;
|
$manufacture=(int)$tmp[0]->m_id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$manufacture=$m_id;
|
$manufacture=$m_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT f.c_id,f.m_id,m.`name` AS manufacture,IF( LENGTH(f.nev_".$lang.")>20,CONCAT(SUBSTRING(f.nev_".$lang.",1,18),'...'),f.nev_".$lang.") AS family_short,f.nev_".$lang." AS family,cnt.darab
|
SELECT f.c_id,f.m_id,m.`name` AS manufacture,IF( LENGTH(f.nev_".$lang.")>20,CONCAT(SUBSTRING(f.nev_".$lang.",1,18),'...'),f.nev_".$lang.") AS family_short,f.nev_".$lang." AS family,cnt.darab
|
||||||
FROM coll2_cat f
|
FROM coll2_cat f
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT COUNT(*) AS darab,c_id,c_name FROM (
|
SELECT COUNT(*) AS darab,c_id,c_name FROM (
|
||||||
SELECT x.o_id,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.deleted AS c_deleted
|
SELECT x.o_id,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($manufacture>0 ? "AND x.m_id='".$manufacture."'" : "")."
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($manufacture>0 ? "AND x.m_id='".$manufacture."'" : "")."
|
||||||
) x GROUP BY c_id
|
) x GROUP BY c_id
|
||||||
) cnt ON cnt.c_id=f.c_id
|
) cnt ON cnt.c_id=f.c_id
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=f.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=f.m_id
|
||||||
WHERE f.deleted=0 AND m.deleted=0 AND cnt.darab>0
|
WHERE f.deleted=0 AND m.deleted=0 AND cnt.darab>0
|
||||||
ORDER BY f.nev_".$lang.";");
|
ORDER BY f.nev_".$lang.";");
|
||||||
$this->families = $db->loadObjectList();
|
$this->families = $db->loadObjectList();
|
||||||
}
|
}
|
||||||
return $this->families;
|
return $this->families;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFamily($id=0)
|
public function getFamily($id=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
$lang=$session->get('sr_lang');//'hun';
|
||||||
if ($id>0 && (!isset($this->family) or empty($this->family)))
|
if ($id>0 && (!isset($this->family) or empty($this->family)))
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT c_id,m_id,nev_".$lang." AS name,deleted FROM coll2_cat WHERE c_id=".$id." LIMIT 1;");
|
$db->setQuery("SELECT c_id,m_id,nev_".$lang." AS name,deleted FROM coll2_cat WHERE c_id=".$id." LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->family=$tmp[0];
|
$this->family=$tmp[0];
|
||||||
}
|
}
|
||||||
return $this->family;
|
return $this->family;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProducts($family="",$m_id=0)
|
public function getProducts($family="",$m_id=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');
|
$lang=$session->get('sr_lang');
|
||||||
if (!isset($this->products))
|
if (!isset($this->products))
|
||||||
{
|
{
|
||||||
$db = JFactory::getDBO();
|
$db = JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`,v.`version`,x.rendelheto,x.`show`,x.`down`,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted
|
SELECT x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`,v.`version`,x.rendelheto,x.`show`,x.`down`,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
||||||
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
||||||
) z GROUP BY o_id
|
) z GROUP BY o_id
|
||||||
) v ON x.o_id=v.o_id
|
) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($m_id>0 ? " AND x.m_id='".$m_id."'":"")." ".((int)$family>0 ? ' AND x.c_id='.(int)$family.' ORDER BY x.title_'.$lang : ' ORDER BY RAND() LIMIT 0,'.$this->limit).";");
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($m_id>0 ? " AND x.m_id='".$m_id."'":"")." ".((int)$family>0 ? ' AND x.c_id='.(int)$family.' ORDER BY x.title_'.$lang : ' ORDER BY RAND() LIMIT 0,'.$this->limit).";");
|
||||||
$this->products = $db->loadObjectList();
|
$this->products = $db->loadObjectList();
|
||||||
}
|
}
|
||||||
return $this->products;
|
return $this->products;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProduct($product=0)
|
public function getProduct($product=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');
|
$lang=$session->get('sr_lang');
|
||||||
if (!isset($this->product) && (int)$product>0)
|
if (!isset($this->product) && (int)$product>0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT
|
SELECT
|
||||||
x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,
|
x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,
|
||||||
x.desc_".$lang." AS `desc`,CONCAT('/".$this->getProductThumb()."/',m.dir,'/',x.o_id,'/zz_big.jpg') AS img,v.file,v.version,
|
x.desc_".$lang." AS `desc`,CONCAT('/".$this->getProductThumb()."/',m.dir,'/',x.o_id,'/zz_big.jpg') AS img,v.file,v.version,
|
||||||
x.rendelheto,x.`show`,x.`down`,x.tipus,t.name_".$lang." AS tipus_lang,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,
|
x.rendelheto,x.`show`,x.`down`,x.tipus,t.name_".$lang." AS tipus_lang,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,
|
||||||
x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,IF( LENGTH(c.nev_".$lang.")>15,CONCAT(SUBSTRING(c.nev_".$lang.",1,13),'...'),c.nev_".$lang.") AS `c_name_short`,c.deleted AS c_deleted
|
x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,IF( LENGTH(c.nev_".$lang.")>15,CONCAT(SUBSTRING(c.nev_".$lang.",1,13),'...'),c.nev_".$lang.") AS `c_name_short`,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN (SELECT ver_id,o_id,fajl AS file,version FROM coll2_ver WHERE o_id=".(int)$product." AND version<=".$this->getPrVersion()." ORDER BY version DESC LIMIT 1) v ON x.o_id=v.o_id
|
LEFT OUTER JOIN (SELECT ver_id,o_id,fajl AS file,version FROM coll2_ver WHERE o_id=".(int)$product." AND version<=".$this->getPrVersion()." ORDER BY version DESC LIMIT 1) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
||||||
$tmp = $db->loadObjectList();
|
$tmp = $db->loadObjectList();
|
||||||
$this->product = $tmp[0];
|
$this->product = $tmp[0];
|
||||||
}
|
}
|
||||||
return $this->product;
|
return $this->product;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrVersion()
|
public function getPrVersion()
|
||||||
{
|
{
|
||||||
$ret=2012;
|
$ret=2012;
|
||||||
|
|
||||||
if (!isset($this->prversion) || (int)$this->prversion==0)
|
if (!isset($this->prversion) || (int)$this->prversion==0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
|
|
||||||
$ver=(int)$session->get('sr_ver');
|
$ver=(int)$session->get('sr_ver');
|
||||||
|
|
||||||
if ($ver)
|
if ($ver)
|
||||||
{
|
{
|
||||||
$db->setQuery("SELECT * FROM coll2_prversion WHERE ver=".$ver);
|
$db->setQuery("SELECT * FROM coll2_prversion WHERE ver=".$ver);
|
||||||
$row=$db->loadObjectList();
|
$row=$db->loadObjectList();
|
||||||
if (!empty($row)) $ret=(int)$row[0]->prversion;
|
if (!empty($row)) $ret=(int)$row[0]->prversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->prversion=$ret;
|
$this->prversion=$ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ret=$this->prversion;
|
$ret=$this->prversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFiles($id=0)
|
public function getFiles($id=0)
|
||||||
{
|
{
|
||||||
if ((int)$id<=0) return(FALSE);
|
if ((int)$id<=0) return(FALSE);
|
||||||
|
|
||||||
$this->folder=$this->getFullPath($id);
|
$this->folder=$this->getFullPath($id);
|
||||||
if (is_dir($this->folder)) $this->files=$this->getFilteredFiles(scandir($this->folder),$id);
|
if (is_dir($this->folder)) $this->files=$this->getFilteredFiles(scandir($this->folder),$id);
|
||||||
return $this->files;
|
return $this->files;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilteredFiles($tomb=array(),$id)
|
public function getFilteredFiles($tomb=array(),$id)
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$this->filter=array('.','..','.quarantine');
|
$this->filter=array('.','..','.quarantine');
|
||||||
if (is_array($tomb) and count($tomb))
|
if (is_array($tomb) and count($tomb))
|
||||||
{
|
{
|
||||||
foreach ($tomb as $file)
|
foreach ($tomb as $file)
|
||||||
{
|
{
|
||||||
if (!in_array($file, $this->filter))
|
if (!in_array($file, $this->filter))
|
||||||
{
|
{
|
||||||
$parts=explode(".", $file);
|
$parts=explode(".", $file);
|
||||||
|
|
||||||
$obj=new stdClass;
|
$obj=new stdClass;
|
||||||
$obj->name=$file;
|
$obj->name=$file;
|
||||||
$obj->path=$this->getPath($id).$file;
|
$obj->path=$this->getPath($id).$file;
|
||||||
$obj->fullpath=$_SERVER['DOCUMENT_ROOT'].$obj->path;
|
$obj->fullpath=$_SERVER['DOCUMENT_ROOT'].$obj->path;
|
||||||
$obj->extension=(in_array(strtolower(end($parts)),$this->arrKnownFiles) ? strtolower(end($parts)) : 'unknown');
|
$obj->extension=(in_array(strtolower(end($parts)),$this->arrKnownFiles) ? strtolower(end($parts)) : 'unknown');
|
||||||
$obj->filesize=filesize($obj->fullpath);
|
$obj->filesize=filesize($obj->fullpath);
|
||||||
$obj->datetime=filemtime($obj->fullpath);
|
$obj->datetime=filemtime($obj->fullpath);
|
||||||
$obj->icon='/components/com_showroom/assets/images/'.$obj->extension.'.png';
|
$obj->icon='/components/com_showroom/assets/images/'.$obj->extension.'.png';
|
||||||
$obj->multidownloadlink=($obj->extension=='pdf' ? $obj->path : $this->getMultiDownloadLink($id,$obj->path));
|
$obj->multidownloadlink=($obj->extension=='pdf' ? $obj->path : $this->getMultiDownloadLink($id,$obj->path));
|
||||||
|
|
||||||
$ret[]=$obj;
|
$ret[]=$obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getPath($id=0)
|
public function getPath($id=0)
|
||||||
{
|
{
|
||||||
$path='';
|
$path='';
|
||||||
if ((int)$id>0)
|
if ((int)$id>0)
|
||||||
{
|
{
|
||||||
$itm=$this->getProduct($id);
|
$itm=$this->getProduct($id);
|
||||||
$path='/'.$this->productDir.'/'.$itm->dir.'/'.(int)$id.'/';
|
$path='/'.$this->productDir.'/'.$itm->dir.'/'.(int)$id.'/';
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFullPath($id=0)
|
public function getFullPath($id=0)
|
||||||
{
|
{
|
||||||
$path='';
|
$path='';
|
||||||
if ((int)$id>0) { $path=$_SERVER['DOCUMENT_ROOT'].$this->getPath($id); }
|
if ((int)$id>0) { $path=$_SERVER['DOCUMENT_ROOT'].$this->getPath($id); }
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getMultiDownloadLink($id,$path)
|
public function getMultiDownloadLink($id,$path)
|
||||||
{
|
{
|
||||||
$ret="";
|
$ret="";
|
||||||
|
|
||||||
$obj=$this->getProduct($id);
|
$obj=$this->getProduct($id);
|
||||||
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$fajlok=@scandir($this->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
$fajlok=@scandir($this->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
||||||
if(!isset($fajlok[2])) { $f=""; }
|
if(!isset($fajlok[2])) { $f=""; }
|
||||||
elseif(count($fajlok)>3) { $f=$obj->file; }
|
elseif(count($fajlok)>3) { $f=$obj->file; }
|
||||||
else { $f=$fajlok[2]; }
|
else { $f=$fajlok[2]; }
|
||||||
*/
|
*/
|
||||||
if ($path>"")
|
if ($path>"")
|
||||||
{
|
{
|
||||||
$ret=$path."?download=1&type=".$obj->type_download.
|
$ret=$path."?download=1&type=".$obj->type_download.
|
||||||
"&bigimage=".base64_encode($this->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
"&bigimage=".base64_encode($this->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
||||||
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
||||||
"&objectname=".base64_encode($obj->title).
|
"&objectname=".base64_encode($obj->title).
|
||||||
((int)$_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
((int)$_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
||||||
|
|
||||||
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
||||||
{
|
{
|
||||||
$struct=$this->getStruct($obj->id);
|
$struct=$this->getStruct($obj->id);
|
||||||
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
||||||
{
|
{
|
||||||
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getArticle($alias='showroom')
|
public function getArticle($alias='showroom')
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM #__content WHERE alias='".$alias."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__content WHERE alias='".$alias."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->article=$tmp[0];
|
$this->article=$tmp[0];
|
||||||
return $this->article;
|
return $this->article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getStruct($id=0)
|
public function getStruct($id=0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT s.`id`,s.`struct_eng` AS `subcategory`,s.`parent` AS `parent_id`,p.`struct_eng` AS `category`
|
SELECT s.`id`,s.`struct_eng` AS `subcategory`,s.`parent` AS `parent_id`,p.`struct_eng` AS `category`
|
||||||
FROM coll2_struct s
|
FROM coll2_struct s
|
||||||
LEFT OUTER JOIN (SELECT * FROM coll2_struct WHERE parent=id) p ON s.parent=p.id
|
LEFT OUTER JOIN (SELECT * FROM coll2_struct WHERE parent=id) p ON s.parent=p.id
|
||||||
WHERE s.id=(SELECT struct_id FROM collection2 WHERE o_id=".(int)$id.") LIMIT 1;");
|
WHERE s.id=(SELECT struct_id FROM collection2 WHERE o_id=".(int)$id.") LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->struct=$tmp[0];
|
$this->struct=$tmp[0];
|
||||||
return($this->struct);
|
return($this->struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProductThumb() { return $this->productThumb; }
|
public function getProductThumb() { return $this->productThumb; }
|
||||||
public function getProductDir() { return $this->productDir; }
|
public function getProductDir() { return $this->productDir; }
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getURL($url='')
|
public function getURL($url='')
|
||||||
{
|
{
|
||||||
$sefurl=$nonsefurl='';
|
$sefurl=$nonsefurl='';
|
||||||
|
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$url=trim($url);
|
$url=trim($url);
|
||||||
if (substr($url,0,1)=='/') $url=substr($url,1);
|
if (substr($url,0,1)=='/') $url=substr($url,1);
|
||||||
$lang=&JFactory::getSession()->get('sr_lang');
|
$lang=&JFactory::getSession()->get('sr_lang');
|
||||||
$table=($lang=='hun' ? 'jml_' : 'eng_')."sh404sef_urls";
|
$table=($lang=='hun' ? 'jml_' : 'eng_')."sh404sef_urls";
|
||||||
|
|
||||||
$db->setQuery("SELECT * FROM `".$table."` WHERE `".(substr($url, 0, 5)=='index' ? "newurl" : "oldurl" )."`='".$url."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM `".$table."` WHERE `".(substr($url, 0, 5)=='index' ? "newurl" : "oldurl" )."`='".$url."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
if (!empty($tmp))
|
if (!empty($tmp))
|
||||||
{
|
{
|
||||||
$sefurl=$tmp[0]->oldurl;
|
$sefurl=$tmp[0]->oldurl;
|
||||||
$nonsefurl=$tmp[0]->newurl;
|
$nonsefurl=$tmp[0]->newurl;
|
||||||
parse_str($nonsefurl, $output);
|
parse_str($nonsefurl, $output);
|
||||||
$id=(int)$output['product'];
|
$id=(int)$output['product'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$id=(int)$_GET['product'];
|
$id=(int)$_GET['product'];
|
||||||
$product=$this->getProduct($id);
|
$product=$this->getProduct($id);
|
||||||
$sefurl=$this->createSlug($lang=='hun' ? 'bemutatoterem' : 'showroom').'/'.$this->createSlug($product->tipus_lang).'/'.$this->createSlug($product->m_name).'/'.$this->createSlug($product->c_name).'/'.$this->createSlug($product->title);
|
$sefurl=$this->createSlug($lang=='hun' ? 'bemutatoterem' : 'showroom').'/'.$this->createSlug($product->tipus_lang).'/'.$this->createSlug($product->m_name).'/'.$this->createSlug($product->c_name).'/'.$this->createSlug($product->title);
|
||||||
$nonsefurl='index.php?option=com_showroom&view=product&product='.$id.'&lang='.$lang;
|
$nonsefurl='index.php?option=com_showroom&view=product&product='.$id.'&lang='.$lang;
|
||||||
|
|
||||||
$db->setQuery("SELECT * FROM ".$table." WHERE oldurl='".$sefurl."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM ".$table." WHERE oldurl='".$sefurl."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
if (empty($tmp) && $id>0)
|
if (empty($tmp) && $id>0)
|
||||||
{
|
{
|
||||||
$tomb=New stdClass();
|
$tomb=New stdClass();
|
||||||
$tomb->cpt=1;
|
$tomb->cpt=1;
|
||||||
$tomb->rank=0;
|
$tomb->rank=0;
|
||||||
$tomb->oldurl=$sefurl;
|
$tomb->oldurl=$sefurl;
|
||||||
$tomb->newurl=$nonsefurl;
|
$tomb->newurl=$nonsefurl;
|
||||||
$tomb->dateadd=date('Y-m-d',time());
|
$tomb->dateadd=date('Y-m-d',time());
|
||||||
$db->insertObject($table, $tomb);
|
$db->insertObject($table, $tomb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('sef'=>$sefurl,'nonsef'=>$nonsefurl,'lang'=>$lang,'id'=>$id);
|
return array('sef'=>$sefurl,'nonsef'=>$nonsefurl,'lang'=>$lang,'id'=>$id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getURLbyID($id=0)
|
public function getURLbyID($id=0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$sefurl=$nonsefurl='';
|
$sefurl=$nonsefurl='';
|
||||||
$lang=JFactory::getSession()->get('sr_lang');
|
$lang=JFactory::getSession()->get('sr_lang');
|
||||||
$table=($lang=='hun' ? 'jml_' : 'eng_')."sh404sef_urls";
|
$table=($lang=='hun' ? 'jml_' : 'eng_')."sh404sef_urls";
|
||||||
|
|
||||||
$sql="SELECT * FROM `".$table."` WHERE `newurl`='index.php?option=com_showroom&view=product&product=".$id."&lang=".$lang."' LIMIT 1;";
|
$sql="SELECT * FROM `".$table."` WHERE `newurl`='index.php?option=com_showroom&view=product&product=".$id."&lang=".$lang."' LIMIT 1;";
|
||||||
$db->setQuery($sql);
|
$db->setQuery($sql);
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
if (!empty($tmp))
|
if (!empty($tmp))
|
||||||
{
|
{
|
||||||
$sefurl=$tmp[0]->oldurl;
|
$sefurl=$tmp[0]->oldurl;
|
||||||
$nonsefurl=$tmp[0]->newurl;
|
$nonsefurl=$tmp[0]->newurl;
|
||||||
parse_str($nonsefurl, $output);
|
parse_str($nonsefurl, $output);
|
||||||
$id=(int)$output['product'];
|
$id=(int)$output['product'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($id>0)
|
if ($id>0)
|
||||||
{
|
{
|
||||||
$product=$this->getProduct($id);
|
$product=$this->getProduct($id);
|
||||||
$sefurl=$this->createSlug($lang=='hun' ? 'bemutatoterem' : 'showroom').'/'.$this->createSlug($product->tipus_lang).'/'.$this->createSlug($product->m_name).'/'.$this->createSlug($product->c_name).'/'.$this->createSlug($product->title);
|
$sefurl=$this->createSlug($lang=='hun' ? 'bemutatoterem' : 'showroom').'/'.$this->createSlug($product->tipus_lang).'/'.$this->createSlug($product->m_name).'/'.$this->createSlug($product->c_name).'/'.$this->createSlug($product->title);
|
||||||
$nonsefurl='index.php?option=com_showroom&view=product&product='.$id.'&lang='.$lang;
|
$nonsefurl='index.php?option=com_showroom&view=product&product='.$id.'&lang='.$lang;
|
||||||
|
|
||||||
$tomb=New stdClass();
|
$tomb=New stdClass();
|
||||||
$tomb->cpt=1;
|
$tomb->cpt=1;
|
||||||
$tomb->rank=0;
|
$tomb->rank=0;
|
||||||
$tomb->oldurl=$sefurl;
|
$tomb->oldurl=$sefurl;
|
||||||
$tomb->newurl=$nonsefurl;
|
$tomb->newurl=$nonsefurl;
|
||||||
$tomb->dateadd=date('Y-m-d',time());
|
$tomb->dateadd=date('Y-m-d',time());
|
||||||
$db->insertObject($table, $tomb);
|
$db->insertObject($table, $tomb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('sef'=>$sefurl,'nonsef'=>$nonsefurl,'lang'=>$lang,'id'=>$id);
|
return array('sef'=>$sefurl,'nonsef'=>$nonsefurl,'lang'=>$lang,'id'=>$id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function createSlug($string, $delimiter = '-') {
|
public function createSlug($string, $delimiter = '-') {
|
||||||
if (!extension_loaded('iconv')) { throw new Exception('iconv module not loaded'); }
|
if (!extension_loaded('iconv')) { throw new Exception('iconv module not loaded'); }
|
||||||
$oldLocale = setlocale(LC_ALL, '0'); // Save the old locale and set the new locale to UTF-8
|
$oldLocale = setlocale(LC_ALL, '0'); // Save the old locale and set the new locale to UTF-8
|
||||||
setlocale(LC_ALL, 'en_US.UTF-8');
|
setlocale(LC_ALL, 'en_US.UTF-8');
|
||||||
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
|
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
|
||||||
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
|
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
|
||||||
$clean = strtolower($clean);
|
$clean = strtolower($clean);
|
||||||
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
|
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
|
||||||
$clean = trim($clean, $delimiter);
|
$clean = trim($clean, $delimiter);
|
||||||
setlocale(LC_ALL, $oldLocale); // Revert back to the old locale
|
setlocale(LC_ALL, $oldLocale); // Revert back to the old locale
|
||||||
return $clean;
|
return $clean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,374 +1,374 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
||||||
|
|
||||||
class ShowroomModelProduct extends JModelItem
|
class ShowroomModelProduct extends JModelItem
|
||||||
{
|
{
|
||||||
protected $article;
|
protected $article;
|
||||||
protected $families=array();
|
protected $families=array();
|
||||||
protected $family;
|
protected $family;
|
||||||
protected $products=array();
|
protected $products=array();
|
||||||
protected $product;
|
protected $product;
|
||||||
protected $files;
|
protected $files;
|
||||||
protected $arrKnownFiles=array('oli','matdata','environment','pdf','ifc');
|
protected $arrKnownFiles=array('oli','matdata','environment','pdf','ifc');
|
||||||
protected $sess;
|
protected $sess;
|
||||||
protected $limit=50;
|
protected $limit=50;
|
||||||
protected $productThumb='public/img/collection';
|
protected $productThumb='public/img/collection';
|
||||||
protected $productDir='public/collection';
|
protected $productDir='public/collection';
|
||||||
protected $querystring;
|
protected $querystring;
|
||||||
protected $prversion;
|
protected $prversion;
|
||||||
protected $struct;
|
protected $struct;
|
||||||
|
|
||||||
public function getFamilies($product=0)
|
public function getFamilies($product=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
$lang=$session->get('sr_lang');//'hun';
|
||||||
if (!isset($this->families) or empty($this->families) )
|
if (!isset($this->families) or empty($this->families) )
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT x.*
|
SELECT x.*
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
||||||
WHERE x.deleted=0 AND c.deleted=0 AND m.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
WHERE x.deleted=0 AND c.deleted=0 AND m.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
$manufacture=(int)$tmp[0]->m_id;
|
$manufacture=(int)$tmp[0]->m_id;
|
||||||
|
|
||||||
if ($manufacture>0)
|
if ($manufacture>0)
|
||||||
{
|
{
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT f.c_id,f.m_id,m.`name` AS manufacture,IF( LENGTH(f.nev_".$lang.")>25,CONCAT(SUBSTRING(f.nev_".$lang.",1,23),'...'),f.nev_".$lang.") AS family_short,f.nev_".$lang." AS family,cnt.darab
|
SELECT f.c_id,f.m_id,m.`name` AS manufacture,IF( LENGTH(f.nev_".$lang.")>25,CONCAT(SUBSTRING(f.nev_".$lang.",1,23),'...'),f.nev_".$lang.") AS family_short,f.nev_".$lang." AS family,cnt.darab
|
||||||
FROM coll2_cat f
|
FROM coll2_cat f
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT COUNT(*) AS darab,c_id,c_name FROM (
|
SELECT COUNT(*) AS darab,c_id,c_name FROM (
|
||||||
SELECT x.o_id,x.tipus,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_hun AS c_name,c.deleted AS c_deleted
|
SELECT x.o_id,x.tipus,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_hun AS c_name,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($manufacture>0 ? "AND x.m_id='".$manufacture."'" : "")."
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($manufacture>0 ? "AND x.m_id='".$manufacture."'" : "")."
|
||||||
) x GROUP BY c_id
|
) x GROUP BY c_id
|
||||||
) cnt ON cnt.c_id=f.c_id
|
) cnt ON cnt.c_id=f.c_id
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=f.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=f.m_id
|
||||||
WHERE f.deleted=0 AND m.deleted=0 AND cnt.darab>0
|
WHERE f.deleted=0 AND m.deleted=0 AND cnt.darab>0
|
||||||
ORDER BY f.nev_".$lang.";");
|
ORDER BY f.nev_".$lang.";");
|
||||||
$this->families = $db->loadObjectList();
|
$this->families = $db->loadObjectList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->families;
|
return $this->families;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFamilyID($product=0)
|
public function getFamilyID($product=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get( 'sr_lang');//'hun';
|
$lang=$session->get( 'sr_lang');//'hun';
|
||||||
if ($product>0)
|
if ($product>0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$sql="
|
$sql="
|
||||||
SELECT x.c_id
|
SELECT x.c_id
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
LEFT OUTER JOIN coll2_cat c ON c.c_id=x.c_id
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
LEFT OUTER JOIN coll2_man m ON m.id=x.m_id
|
||||||
WHERE x.deleted=0 AND c.deleted=0 AND m.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;";
|
WHERE x.deleted=0 AND c.deleted=0 AND m.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;";
|
||||||
$db->setQuery($sql);
|
$db->setQuery($sql);
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
$this->family = (int)$tmp[0]->c_id;
|
$this->family = (int)$tmp[0]->c_id;
|
||||||
}
|
}
|
||||||
return $this->family;
|
return $this->family;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFamily($id=0)
|
public function getFamily($id=0)
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
$lang=$session->get('sr_lang');//'hun';
|
||||||
if ($id>0)
|
if ($id>0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT c_id,m_id,nev_".$lang." AS name,deleted FROM coll2_cat WHERE c_id=".$id." LIMIT 1;");
|
$db->setQuery("SELECT c_id,m_id,nev_".$lang." AS name,deleted FROM coll2_cat WHERE c_id=".$id." LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->family=$tmp[0];
|
$this->family=$tmp[0];
|
||||||
}
|
}
|
||||||
return $this->family;
|
return $this->family;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProducts($family="",$lang="hun")
|
public function getProducts($family="",$lang="hun")
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
// $lang=$session->get('sr_lang');//'hun';
|
// $lang=$session->get('sr_lang');//'hun';
|
||||||
|
|
||||||
if (!isset($this->products) or empty($this->products) )
|
if (!isset($this->products) or empty($this->products) )
|
||||||
{
|
{
|
||||||
$db = JFactory::getDBO();
|
$db = JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT x.o_id AS id,x.title_".$lang." AS `title`,IF(LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`,x.rendelheto,x.`show`,x.`down`,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted
|
SELECT x.o_id AS id,x.title_".$lang." AS `title`,IF(LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`,x.rendelheto,x.`show`,x.`down`,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
||||||
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
||||||
) z GROUP BY o_id
|
) z GROUP BY o_id
|
||||||
) v ON x.o_id=v.o_id
|
) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".((int)$family>0 ? ' AND x.c_id='.(int)$family.' ORDER BY x.title_'.$lang : ' ORDER BY RAND() LIMIT 0,'.$this->limit).";");
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".((int)$family>0 ? ' AND x.c_id='.(int)$family.' ORDER BY x.title_'.$lang : ' ORDER BY RAND() LIMIT 0,'.$this->limit).";");
|
||||||
$this->products = $db->loadObjectList();
|
$this->products = $db->loadObjectList();
|
||||||
}
|
}
|
||||||
return $this->products;
|
return $this->products;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProduct($product=0,$lang="hun")
|
public function getProduct($product=0,$lang="hun")
|
||||||
{
|
{
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$lang2=$session->get('sr_lang');
|
$lang2=$session->get('sr_lang');
|
||||||
if($lang2 == 'eng') {
|
if($lang2 == 'eng') {
|
||||||
$lang=$lang2;
|
$lang=$lang2;
|
||||||
}
|
}
|
||||||
if (!isset($this->product) && (int)$product>0)
|
if (!isset($this->product) && (int)$product>0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT
|
SELECT
|
||||||
x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,
|
x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,
|
||||||
x.desc_".$lang." AS `desc`,CONCAT('/".$this->getProductThumb()."/',m.dir,'/',x.o_id,'/zz_big.jpg') AS img,v.file,v.version,
|
x.desc_".$lang." AS `desc`,CONCAT('/".$this->getProductThumb()."/',m.dir,'/',x.o_id,'/zz_big.jpg') AS img,v.file,v.version,
|
||||||
x.rendelheto,x.`show`,x.`down`,x.tipus, t.name_".$lang." AS tipus_lang,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,
|
x.rendelheto,x.`show`,x.`down`,x.tipus, t.name_".$lang." AS tipus_lang,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,
|
||||||
x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,IF( LENGTH(c.nev_".$lang.")>15,CONCAT(SUBSTRING(c.nev_".$lang.",1,13),'...'),c.nev_".$lang.") AS `c_name_short`,c.deleted AS c_deleted
|
x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,IF( LENGTH(c.nev_".$lang.")>15,CONCAT(SUBSTRING(c.nev_".$lang.",1,13),'...'),c.nev_".$lang.") AS `c_name_short`,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN (SELECT ver_id,o_id,fajl AS file,version FROM coll2_ver WHERE o_id=".(int)$product." AND version<=".$this->getPrVersion()." ORDER BY version DESC LIMIT 1) v ON x.o_id=v.o_id
|
LEFT OUTER JOIN (SELECT ver_id,o_id,fajl AS file,version FROM coll2_ver WHERE o_id=".(int)$product." AND version<=".$this->getPrVersion()." ORDER BY version DESC LIMIT 1) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
||||||
$tmp = $db->loadObjectList();
|
$tmp = $db->loadObjectList();
|
||||||
$this->product = $tmp[0];
|
$this->product = $tmp[0];
|
||||||
}
|
}
|
||||||
return $this->product;
|
return $this->product;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrVersion()
|
public function getPrVersion()
|
||||||
{
|
{
|
||||||
$ret=2012;
|
$ret=2012;
|
||||||
|
|
||||||
if (!isset($this->prversion) || (int)$this->prversion==0)
|
if (!isset($this->prversion) || (int)$this->prversion==0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
|
|
||||||
$ver=(int)$session->get('sr_ver');
|
$ver=(int)$session->get('sr_ver');
|
||||||
|
|
||||||
if ($ver)
|
if ($ver)
|
||||||
{
|
{
|
||||||
$db->setQuery("SELECT * FROM coll2_prversion WHERE ver=".$ver);
|
$db->setQuery("SELECT * FROM coll2_prversion WHERE ver=".$ver);
|
||||||
$row=$db->loadObjectList();
|
$row=$db->loadObjectList();
|
||||||
if (!empty($row)) $ret=(int)$row[0]->prversion;
|
if (!empty($row)) $ret=(int)$row[0]->prversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->prversion=$ret;
|
$this->prversion=$ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ret=$this->prversion;
|
$ret=$this->prversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFiles($id=0)
|
public function getFiles($id=0)
|
||||||
{
|
{
|
||||||
if ((int)$id<=0) return(FALSE);
|
if ((int)$id<=0) return(FALSE);
|
||||||
|
|
||||||
$this->folder=$this->getFullPath($id);
|
$this->folder=$this->getFullPath($id);
|
||||||
if (is_dir($this->folder)) $this->files=$this->getFilteredFiles(scandir($this->folder),$id);
|
if (is_dir($this->folder)) $this->files=$this->getFilteredFiles(scandir($this->folder),$id);
|
||||||
return $this->files;
|
return $this->files;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilteredFiles($tomb=array(),$id)
|
public function getFilteredFiles($tomb=array(),$id)
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$this->filter=array('.','..','.quarantine');
|
$this->filter=array('.','..','.quarantine');
|
||||||
if (is_array($tomb) and count($tomb))
|
if (is_array($tomb) and count($tomb))
|
||||||
{
|
{
|
||||||
foreach ($tomb as $file)
|
foreach ($tomb as $file)
|
||||||
{
|
{
|
||||||
if (!in_array($file, $this->filter))
|
if (!in_array($file, $this->filter))
|
||||||
{
|
{
|
||||||
$parts=explode(".", $file);
|
$parts=explode(".", $file);
|
||||||
|
|
||||||
$obj=new stdClass;
|
$obj=new stdClass;
|
||||||
$obj->name=$file;
|
$obj->name=$file;
|
||||||
$obj->path=$this->getPath($id).$file;
|
$obj->path=$this->getPath($id).$file;
|
||||||
$obj->fullpath=$_SERVER['DOCUMENT_ROOT'].$obj->path;
|
$obj->fullpath=$_SERVER['DOCUMENT_ROOT'].$obj->path;
|
||||||
$obj->extension=(in_array(strtolower(end($parts)),$this->arrKnownFiles) ? strtolower(end($parts)) : 'unknown');
|
$obj->extension=(in_array(strtolower(end($parts)),$this->arrKnownFiles) ? strtolower(end($parts)) : 'unknown');
|
||||||
$obj->filesize=filesize($obj->fullpath);
|
$obj->filesize=filesize($obj->fullpath);
|
||||||
$obj->datetime=filemtime($obj->fullpath);
|
$obj->datetime=filemtime($obj->fullpath);
|
||||||
$obj->icon='/components/com_showroom/assets/images/'.$obj->extension.'.png';
|
$obj->icon='/components/com_showroom/assets/images/'.$obj->extension.'.png';
|
||||||
$obj->multidownloadlink=($obj->extension=='pdf' ? $obj->path : $this->getMultiDownloadLink($id,$obj->path));
|
$obj->multidownloadlink=($obj->extension=='pdf' ? $obj->path : $this->getMultiDownloadLink($id,$obj->path));
|
||||||
|
|
||||||
$ret[]=$obj;
|
$ret[]=$obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getPath($id=0)
|
public function getPath($id=0)
|
||||||
{
|
{
|
||||||
$path='';
|
$path='';
|
||||||
if ((int)$id>0)
|
if ((int)$id>0)
|
||||||
{
|
{
|
||||||
$itm=$this->getProduct($id);
|
$itm=$this->getProduct($id);
|
||||||
$path='/'.$this->productDir.'/'.$itm->dir.'/'.(int)$id.'/';
|
$path='/'.$this->productDir.'/'.$itm->dir.'/'.(int)$id.'/';
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFullPath($id=0)
|
public function getFullPath($id=0)
|
||||||
{
|
{
|
||||||
$path='';
|
$path='';
|
||||||
if ((int)$id>0) { $path=$_SERVER['DOCUMENT_ROOT'].$this->getPath($id); }
|
if ((int)$id>0) { $path=$_SERVER['DOCUMENT_ROOT'].$this->getPath($id); }
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getMultiDownloadLink($id,$path)
|
public function getMultiDownloadLink($id,$path)
|
||||||
{
|
{
|
||||||
$ret="";
|
$ret="";
|
||||||
|
|
||||||
$obj=$this->getProduct($id);
|
$obj=$this->getProduct($id);
|
||||||
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$fajlok=@scandir($this->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
$fajlok=@scandir($this->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
||||||
if(!isset($fajlok[2])) { $f=""; }
|
if(!isset($fajlok[2])) { $f=""; }
|
||||||
elseif(count($fajlok)>3) { $f=$obj->file; }
|
elseif(count($fajlok)>3) { $f=$obj->file; }
|
||||||
else { $f=$fajlok[2]; }
|
else { $f=$fajlok[2]; }
|
||||||
*/
|
*/
|
||||||
if ($path>"")
|
if ($path>"")
|
||||||
{
|
{
|
||||||
$ret=$path."?download=1&type=".$obj->type_download.
|
$ret=$path."?download=1&type=".$obj->type_download.
|
||||||
"&bigimage=".base64_encode($this->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
"&bigimage=".base64_encode($this->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
||||||
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
||||||
((int)$_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
((int)$_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
||||||
|
|
||||||
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
||||||
{
|
{
|
||||||
$struct=$this->getStruct($obj->id);
|
$struct=$this->getStruct($obj->id);
|
||||||
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
||||||
{
|
{
|
||||||
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getArticle($alias='showroom')
|
public function getArticle($alias='showroom')
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM #__content WHERE alias='".$alias."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__content WHERE alias='".$alias."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->article=$tmp[0];
|
$this->article=$tmp[0];
|
||||||
return $this->article;
|
return $this->article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getStruct($id=0)
|
public function getStruct($id=0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT s.`id`,s.`struct_eng` AS `subcategory`,s.`parent` AS `parent_id`,p.`struct_eng` AS `category`
|
SELECT s.`id`,s.`struct_eng` AS `subcategory`,s.`parent` AS `parent_id`,p.`struct_eng` AS `category`
|
||||||
FROM coll2_struct s
|
FROM coll2_struct s
|
||||||
LEFT OUTER JOIN (SELECT * FROM coll2_struct WHERE parent=id) p ON s.parent=p.id
|
LEFT OUTER JOIN (SELECT * FROM coll2_struct WHERE parent=id) p ON s.parent=p.id
|
||||||
WHERE s.id=(SELECT struct_id FROM collection2 WHERE o_id=".(int)$id.") LIMIT 1;");
|
WHERE s.id=(SELECT struct_id FROM collection2 WHERE o_id=".(int)$id.") LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->struct=$tmp[0];
|
$this->struct=$tmp[0];
|
||||||
return($this->struct);
|
return($this->struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function addShow($id=0)
|
public function addShow($id=0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("UPDATE collection2 SET `show`=`show`+1 WHERE o_id=".$id);
|
$db->setQuery("UPDATE collection2 SET `show`=`show`+1 WHERE o_id=".$id);
|
||||||
$db->query();
|
$db->query();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProductThumb() { return $this->productThumb; }
|
public function getProductThumb() { return $this->productThumb; }
|
||||||
public function getProductDir() { return $this->productDir; }
|
public function getProductDir() { return $this->productDir; }
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getURL($url='')
|
public function getURL($url='')
|
||||||
{
|
{
|
||||||
$sefurl=$nonsefurl='';
|
$sefurl=$nonsefurl='';
|
||||||
|
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$url=trim($url);
|
$url=trim($url);
|
||||||
if (substr($url,0,1)=='/') $url=substr($url,1);
|
if (substr($url,0,1)=='/') $url=substr($url,1);
|
||||||
$lang=JFactory::getSession()->get('sr_lang');
|
$lang=JFactory::getSession()->get('sr_lang');
|
||||||
$table=($lang=='hun' ? 'jml_' : 'eng_')."sh404sef_urls";
|
$table=($lang=='hun' ? 'jml_' : 'eng_')."sh404sef_urls";
|
||||||
|
|
||||||
$db->setQuery("SELECT * FROM `".$table."` WHERE `".(substr($url, 0, 5)=='index' ? "newurl" : "oldurl" )."`='".$url."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM `".$table."` WHERE `".(substr($url, 0, 5)=='index' ? "newurl" : "oldurl" )."`='".$url."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
if (!empty($tmp))
|
if (!empty($tmp))
|
||||||
{
|
{
|
||||||
$sefurl=$tmp[0]->oldurl;
|
$sefurl=$tmp[0]->oldurl;
|
||||||
$nonsefurl=$tmp[0]->newurl;
|
$nonsefurl=$tmp[0]->newurl;
|
||||||
parse_str($nonsefurl, $output);
|
parse_str($nonsefurl, $output);
|
||||||
$id=(int)$output['product'];
|
$id=(int)$output['product'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$id=(int)$_GET['product'];
|
$id=(int)$_GET['product'];
|
||||||
$product=$this->getProduct($id);
|
$product=$this->getProduct($id);
|
||||||
$sefurl=$this->createSlug($lang=='hun' ? 'bemutatoterem' : 'showroom').'/'.$this->createSlug($product->tipus_lang).'/'.$this->createSlug($product->m_name).'/'.$this->createSlug($product->c_name).'/'.$this->createSlug($product->title);
|
$sefurl=$this->createSlug($lang=='hun' ? 'bemutatoterem' : 'showroom').'/'.$this->createSlug($product->tipus_lang).'/'.$this->createSlug($product->m_name).'/'.$this->createSlug($product->c_name).'/'.$this->createSlug($product->title);
|
||||||
$nonsefurl='index.php?option=com_showroom&view=product&product='.$id.'&lang='.$lang;
|
$nonsefurl='index.php?option=com_showroom&view=product&product='.$id.'&lang='.$lang;
|
||||||
|
|
||||||
$db->setQuery("SELECT * FROM ".$table." WHERE oldurl='".$sefurl."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM ".$table." WHERE oldurl='".$sefurl."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
if (empty($tmp) && $id>0)
|
if (empty($tmp) && $id>0)
|
||||||
{
|
{
|
||||||
$tomb=New stdClass();
|
$tomb=New stdClass();
|
||||||
$tomb->cpt=1;
|
$tomb->cpt=1;
|
||||||
$tomb->rank=0;
|
$tomb->rank=0;
|
||||||
$tomb->oldurl=$sefurl;
|
$tomb->oldurl=$sefurl;
|
||||||
$tomb->newurl=$nonsefurl;
|
$tomb->newurl=$nonsefurl;
|
||||||
$tomb->dateadd=date('Y-m-d',time());
|
$tomb->dateadd=date('Y-m-d',time());
|
||||||
$db->insertObject($table, $tomb);
|
$db->insertObject($table, $tomb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('sef'=>$sefurl,'nonsef'=>$nonsefurl,'lang'=>$lang,'id'=>$id);
|
return array('sef'=>$sefurl,'nonsef'=>$nonsefurl,'lang'=>$lang,'id'=>$id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function createSlug($string, $delimiter = '-') {
|
public function createSlug($string, $delimiter = '-') {
|
||||||
if (!extension_loaded('iconv')) { throw new Exception('iconv module not loaded'); }
|
if (!extension_loaded('iconv')) { throw new Exception('iconv module not loaded'); }
|
||||||
$oldLocale = setlocale(LC_ALL, '0'); // Save the old locale and set the new locale to UTF-8
|
$oldLocale = setlocale(LC_ALL, '0'); // Save the old locale and set the new locale to UTF-8
|
||||||
setlocale(LC_ALL, 'en_US.UTF-8');
|
setlocale(LC_ALL, 'en_US.UTF-8');
|
||||||
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
|
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
|
||||||
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
|
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
|
||||||
$clean = strtolower($clean);
|
$clean = strtolower($clean);
|
||||||
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
|
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
|
||||||
$clean = trim($clean, $delimiter);
|
$clean = trim($clean, $delimiter);
|
||||||
setlocale(LC_ALL, $oldLocale); // Revert back to the old locale
|
setlocale(LC_ALL, $oldLocale); // Revert back to the old locale
|
||||||
return $clean;
|
return $clean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,395 +1,395 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
||||||
|
|
||||||
class ShowroomModelSearch extends JModelItem
|
class ShowroomModelSearch extends JModelItem
|
||||||
{
|
{
|
||||||
protected $article;
|
protected $article;
|
||||||
protected $products;
|
protected $products;
|
||||||
protected $product;
|
protected $product;
|
||||||
protected $files;
|
protected $files;
|
||||||
protected $arrKnownFiles=array('oli','matdata','environment','pdf','ifc');
|
protected $arrKnownFiles=array('oli','matdata','environment','pdf','ifc');
|
||||||
protected $sess;
|
protected $sess;
|
||||||
protected $ipp=48;
|
protected $ipp=48;
|
||||||
protected $all;
|
protected $all;
|
||||||
protected $page;
|
protected $page;
|
||||||
protected $last;
|
protected $last;
|
||||||
protected $first;
|
protected $first;
|
||||||
protected $visibleLast;
|
protected $visibleLast;
|
||||||
protected $visibleFirst;
|
protected $visibleFirst;
|
||||||
protected $pager=3;
|
protected $pager=3;
|
||||||
protected $productThumb='public/img/collection';
|
protected $productThumb='public/img/collection';
|
||||||
protected $productDir='public/collection';
|
protected $productDir='public/collection';
|
||||||
protected $placeholder;
|
protected $placeholder;
|
||||||
protected $querystring;
|
protected $querystring;
|
||||||
protected $struct;
|
protected $struct;
|
||||||
|
|
||||||
public function getResult($search="",$multiselect=array(),$page=1)
|
public function getResult($search="",$multiselect=array(),$page=1)
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');
|
$lang=$session->get('sr_lang');
|
||||||
$search=trim(addslashes($search));
|
$search=trim(addslashes($search));
|
||||||
|
|
||||||
$ms_type=((isset($multiselect['type']) && count($multiselect['type'])) ? " AND x.tipus IN ('".implode("','",$multiselect['type'])."')" : "");
|
$ms_type=((isset($multiselect['type']) && count($multiselect['type'])) ? " AND x.tipus IN ('".implode("','",$multiselect['type'])."')" : "");
|
||||||
$ms_brand=((isset($multiselect['brand']) && count($multiselect['brand'])) ? " AND x.m_id IN (".implode(',',$multiselect['brand']).")" : "");
|
$ms_brand=((isset($multiselect['brand']) && count($multiselect['brand'])) ? " AND x.m_id IN (".implode(',',$multiselect['brand']).")" : "");
|
||||||
$ms_category=((isset($multiselect['category']) && count($multiselect['category'])) ? " AND s.parent IN (".implode(',',$multiselect['category']).")" : "");
|
$ms_category=((isset($multiselect['category']) && count($multiselect['category'])) ? " AND s.parent IN (".implode(',',$multiselect['category']).")" : "");
|
||||||
$ms_subcategory=((isset($multiselect['subcategory']) && count($multiselect['subcategory'])) ? " AND s.id IN (".implode(',',$multiselect['subcategory']).")" : "");
|
$ms_subcategory=((isset($multiselect['subcategory']) && count($multiselect['subcategory'])) ? " AND s.id IN (".implode(',',$multiselect['subcategory']).")" : "");
|
||||||
|
|
||||||
$sql="
|
$sql="
|
||||||
SELECT COUNT(*) AS darab FROM (
|
SELECT COUNT(*) AS darab FROM (
|
||||||
SELECT x.o_id AS id,x.tipus,t.type_download,x.title_".$lang." AS `title`,IF(LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`
|
SELECT x.o_id AS id,x.tipus,t.type_download,x.title_".$lang." AS `title`,IF(LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN coll2_struct s ON x.struct_id=s.id
|
LEFT OUTER JOIN coll2_struct s ON x.struct_id=s.id
|
||||||
LEFT OUTER JOIN (SELECT id,struct_hun,struct_eng FROM coll2_struct WHERE id=parent) p ON s.parent=p.id
|
LEFT OUTER JOIN (SELECT id,struct_hun,struct_eng FROM coll2_struct WHERE id=parent) p ON s.parent=p.id
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
||||||
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
||||||
) z GROUP BY o_id
|
) z GROUP BY o_id
|
||||||
) v ON x.o_id=v.o_id
|
) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".$ms_type." ".$ms_brand." ".$ms_category." ".$ms_subcategory."
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".$ms_type." ".$ms_brand." ".$ms_category." ".$ms_subcategory."
|
||||||
AND (
|
AND (
|
||||||
x.title_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
x.title_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
x.desc_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
x.desc_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
m.`name` COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
m.`name` COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
c.nev_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
c.nev_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
s.struct_".$lang." LIKE '%".$search."%' OR
|
s.struct_".$lang." LIKE '%".$search."%' OR
|
||||||
p.struct_".$lang." LIKE '%".$search."%')
|
p.struct_".$lang." LIKE '%".$search."%')
|
||||||
) p;";
|
) p;";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery($sql);
|
$db->setQuery($sql);
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
|
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT x.o_id AS id,x.tipus,t.type_download,x.title_".$lang." AS `title`,IF(LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`
|
SELECT x.o_id AS id,x.tipus,t.type_download,x.title_".$lang." AS `title`,IF(LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,x.desc_".$lang." AS `desc`,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,c.deleted AS c_deleted,CONCAT('/','".$this->productThumb."','/',m.dir,'/',x.o_id,'/zz_thumb.jpg') AS img,v.`file`
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN coll2_struct s ON x.struct_id=s.id
|
LEFT OUTER JOIN coll2_struct s ON x.struct_id=s.id
|
||||||
LEFT OUTER JOIN (SELECT id,struct_hun,struct_eng FROM coll2_struct WHERE id=parent) p ON s.parent=p.id
|
LEFT OUTER JOIN (SELECT id,struct_hun,struct_eng FROM coll2_struct WHERE id=parent) p ON s.parent=p.id
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
SELECT ver_id,o_id,fajl AS `file`,version FROM (
|
||||||
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
SELECT * FROM coll2_ver WHERE version<=".$this->getPrVersion()." ORDER BY o_id ASC,version DESC
|
||||||
) z GROUP BY o_id
|
) z GROUP BY o_id
|
||||||
) v ON x.o_id=v.o_id
|
) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".$ms_type." ".$ms_brand." ".$ms_category." ".$ms_subcategory."
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".$ms_type." ".$ms_brand." ".$ms_category." ".$ms_subcategory."
|
||||||
AND (
|
AND (
|
||||||
x.title_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
x.title_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
x.desc_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
x.desc_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
m.`name` COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
m.`name` COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
c.nev_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
c.nev_".$lang." COLLATE utf8_general_ci LIKE '%".$search."%' OR
|
||||||
s.struct_".$lang." LIKE '%".$search."%' OR
|
s.struct_".$lang." LIKE '%".$search."%' OR
|
||||||
p.struct_".$lang." LIKE '%".$search."%')
|
p.struct_".$lang." LIKE '%".$search."%')
|
||||||
ORDER BY x.title_".$lang."
|
ORDER BY x.title_".$lang."
|
||||||
LIMIT ".($page>0 ? $page-1 : 0)*$this->ipp.", ".$this->ipp.";");
|
LIMIT ".($page>0 ? $page-1 : 0)*$this->ipp.", ".$this->ipp.";");
|
||||||
$this->products=$db->loadObjectList();
|
$this->products=$db->loadObjectList();
|
||||||
|
|
||||||
$this->page=((int)$page==0 ? 1 : $page);
|
$this->page=((int)$page==0 ? 1 : $page);
|
||||||
$this->all=$tmp[0]->darab;
|
$this->all=$tmp[0]->darab;
|
||||||
$this->last=(floor($this->all/$this->ipp)+($this->all%$this->ipp==0 ? 0 : 1));
|
$this->last=(floor($this->all/$this->ipp)+($this->all%$this->ipp==0 ? 0 : 1));
|
||||||
$this->first=1;
|
$this->first=1;
|
||||||
|
|
||||||
if ($this->last>$this->pager*2+1)
|
if ($this->last>$this->pager*2+1)
|
||||||
{
|
{
|
||||||
if ($this->page<$this->first+$this->pager) { $this->visibleFirst=$this->first;$this->visibleLast=$this->first+$this->pager*2; }
|
if ($this->page<$this->first+$this->pager) { $this->visibleFirst=$this->first;$this->visibleLast=$this->first+$this->pager*2; }
|
||||||
else if ($this->page>$this->last-$this->pager) { $this->visibleFirst=$this->last-$this->pager*2;$this->visibleLast=$this->last; }
|
else if ($this->page>$this->last-$this->pager) { $this->visibleFirst=$this->last-$this->pager*2;$this->visibleLast=$this->last; }
|
||||||
else { $this->visibleFirst=$this->page-$this->pager;$this->visibleLast=$this->page+$this->pager; }
|
else { $this->visibleFirst=$this->page-$this->pager;$this->visibleLast=$this->page+$this->pager; }
|
||||||
}
|
}
|
||||||
else { $this->visibleFirst=$this->first;$this->visibleLast=$this->last; }
|
else { $this->visibleFirst=$this->first;$this->visibleLast=$this->last; }
|
||||||
|
|
||||||
return $this->products;
|
return $this->products;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypes()
|
public function getTypes()
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
$lang=$session->get('sr_lang');//'hun';
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT `type`,`name_".$lang."` AS `name` FROM coll2_types t WHERE t.visible='Y' ORDER BY `name_".$lang."`;");
|
$db->setQuery("SELECT `type`,`name_".$lang."` AS `name` FROM coll2_types t WHERE t.visible='Y' ORDER BY `name_".$lang."`;");
|
||||||
$this->types=$db->loadObjectList();
|
$this->types=$db->loadObjectList();
|
||||||
return $this->types;
|
return $this->types;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBrands($types=array())
|
public function getBrands($types=array())
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
$lang=$session->get('sr_lang');//'hun';
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(m.`id`),m.`name`
|
SELECT DISTINCT(m.`id`),m.`name`
|
||||||
FROM collection2 c
|
FROM collection2 c
|
||||||
LEFT OUTER JOIN coll2_man m ON c.`m_id`=m.`id`
|
LEFT OUTER JOIN coll2_man m ON c.`m_id`=m.`id`
|
||||||
LEFT OUTER JOIN coll2_cat k ON c.`c_id`=k.`c_id`
|
LEFT OUTER JOIN coll2_cat k ON c.`c_id`=k.`c_id`
|
||||||
LEFT OUTER JOIN coll2_struct s ON c.`struct_id`=s.`id`
|
LEFT OUTER JOIN coll2_struct s ON c.`struct_id`=s.`id`
|
||||||
LEFT OUTER JOIN (SELECT id,struct_".$lang." FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
LEFT OUTER JOIN (SELECT id,struct_".$lang." FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
||||||
WHERE m.deleted=0 AND c.deleted=0 AND k.deleted=0 ".
|
WHERE m.deleted=0 AND c.deleted=0 AND k.deleted=0 ".
|
||||||
((is_array($types)&&count($types))?" AND c.tipus IN ('".implode("','",$types)."')":"")."
|
((is_array($types)&&count($types))?" AND c.tipus IN ('".implode("','",$types)."')":"")."
|
||||||
ORDER BY m.`name`;");
|
ORDER BY m.`name`;");
|
||||||
$this->brands=$db->loadObjectList();
|
$this->brands=$db->loadObjectList();
|
||||||
return $this->brands;
|
return $this->brands;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCategories($types=array(),$brands=array())
|
public function getCategories($types=array(),$brands=array())
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get( 'sr_lang');//'hun';
|
$lang=$session->get( 'sr_lang');//'hun';
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(p.`id`) AS `id`,p.`struct_".$lang."` AS `name`
|
SELECT DISTINCT(p.`id`) AS `id`,p.`struct_".$lang."` AS `name`
|
||||||
FROM collection2 c
|
FROM collection2 c
|
||||||
LEFT OUTER JOIN coll2_man m ON c.`m_id`=m.`id`
|
LEFT OUTER JOIN coll2_man m ON c.`m_id`=m.`id`
|
||||||
LEFT OUTER JOIN coll2_cat k ON c.`c_id`=k.`c_id`
|
LEFT OUTER JOIN coll2_cat k ON c.`c_id`=k.`c_id`
|
||||||
LEFT OUTER JOIN coll2_struct s ON c.`struct_id`=s.`id`
|
LEFT OUTER JOIN coll2_struct s ON c.`struct_id`=s.`id`
|
||||||
LEFT OUTER JOIN (SELECT id,struct_".$lang." FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
LEFT OUTER JOIN (SELECT id,struct_".$lang." FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
||||||
WHERE p.`id` IS NOT NULL AND m.deleted=0 AND c.deleted=0 AND k.deleted=0 ".
|
WHERE p.`id` IS NOT NULL AND m.deleted=0 AND c.deleted=0 AND k.deleted=0 ".
|
||||||
((is_array($types)&&count($types))?" AND c.tipus IN ('".implode("','",$types)."')":"").
|
((is_array($types)&&count($types))?" AND c.tipus IN ('".implode("','",$types)."')":"").
|
||||||
((is_array($brands)&&count($brands))?" AND c.m_id IN (".implode(",",$brands).")":"").
|
((is_array($brands)&&count($brands))?" AND c.m_id IN (".implode(",",$brands).")":"").
|
||||||
"
|
"
|
||||||
ORDER BY p.`struct_".$lang."`;");
|
ORDER BY p.`struct_".$lang."`;");
|
||||||
$this->categories=$db->loadObjectList();
|
$this->categories=$db->loadObjectList();
|
||||||
return $this->categories;
|
return $this->categories;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSubcategories($types=array(),$brands=array(),$categories=array())
|
public function getSubcategories($types=array(),$brands=array(),$categories=array())
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
$lang=$session->get('sr_lang');//'hun';
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT DISTINCT(s.`id`) AS `id`,s.`struct_".$lang."` AS `name`
|
SELECT DISTINCT(s.`id`) AS `id`,s.`struct_".$lang."` AS `name`
|
||||||
FROM collection2 c
|
FROM collection2 c
|
||||||
LEFT OUTER JOIN coll2_man m ON c.`m_id`=m.`id`
|
LEFT OUTER JOIN coll2_man m ON c.`m_id`=m.`id`
|
||||||
LEFT OUTER JOIN coll2_cat k ON c.`c_id`=k.`c_id`
|
LEFT OUTER JOIN coll2_cat k ON c.`c_id`=k.`c_id`
|
||||||
LEFT OUTER JOIN coll2_struct s ON c.`struct_id`=s.`id`
|
LEFT OUTER JOIN coll2_struct s ON c.`struct_id`=s.`id`
|
||||||
LEFT OUTER JOIN (SELECT id,struct_".$lang." FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
LEFT OUTER JOIN (SELECT id,struct_".$lang." FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
||||||
WHERE p.`id` IS NOT NULL AND m.deleted=0 AND c.deleted=0 AND k.deleted=0 ".
|
WHERE p.`id` IS NOT NULL AND m.deleted=0 AND c.deleted=0 AND k.deleted=0 ".
|
||||||
((is_array($types)&&count($types))?" AND c.tipus IN ('".implode("','",$types)."')":"").
|
((is_array($types)&&count($types))?" AND c.tipus IN ('".implode("','",$types)."')":"").
|
||||||
((is_array($brands)&&count($brands))?" AND c.m_id IN (".implode(",",$brands).")":"").
|
((is_array($brands)&&count($brands))?" AND c.m_id IN (".implode(",",$brands).")":"").
|
||||||
((is_array($categories)&&count($categories))?" AND s.parent IN (".implode(",",$categories).")":"").
|
((is_array($categories)&&count($categories))?" AND s.parent IN (".implode(",",$categories).")":"").
|
||||||
"
|
"
|
||||||
ORDER BY s.`struct_".$lang."`;");
|
ORDER BY s.`struct_".$lang."`;");
|
||||||
$this->subcategories=$db->loadObjectList();
|
$this->subcategories=$db->loadObjectList();
|
||||||
return $this->subcategories;
|
return $this->subcategories;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPlaceholder($type="sr_type",$value)
|
public function getPlaceholder($type="sr_type",$value)
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');
|
$lang=$session->get('sr_lang');
|
||||||
if (!isset($this->placeholder))
|
if (!isset($this->placeholder))
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
|
|
||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 'sr_type' :
|
case 'sr_type' :
|
||||||
{
|
{
|
||||||
$db->setQuery("SELECT `name_".$lang."` AS `name` FROM coll2_types WHERE `type`='".$value."' LIMIT 1;");
|
$db->setQuery("SELECT `name_".$lang."` AS `name` FROM coll2_types WHERE `type`='".$value."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'sr_manufacture' :
|
case 'sr_manufacture' :
|
||||||
{
|
{
|
||||||
$db->setQuery("SELECT `name` AS `name` FROM coll2_man WHERE `id`='".$value."' LIMIT 1;");
|
$db->setQuery("SELECT `name` AS `name` FROM coll2_man WHERE `id`='".$value."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->placeholder=(isset($tmp[0]->name) ? $tmp[0]->name : "");
|
$this->placeholder=(isset($tmp[0]->name) ? $tmp[0]->name : "");
|
||||||
}
|
}
|
||||||
return $this->placeholder;
|
return $this->placeholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrVersion()
|
public function getPrVersion()
|
||||||
{
|
{
|
||||||
$ret=2012;
|
$ret=2012;
|
||||||
|
|
||||||
if (!isset($this->prversion) || (int)$this->prversion==0)
|
if (!isset($this->prversion) || (int)$this->prversion==0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
|
|
||||||
$ver=(int)$session->get('sr_ver');
|
$ver=(int)$session->get('sr_ver');
|
||||||
|
|
||||||
if ($ver)
|
if ($ver)
|
||||||
{
|
{
|
||||||
$db->setQuery("SELECT * FROM coll2_prversion WHERE ver=".$ver);
|
$db->setQuery("SELECT * FROM coll2_prversion WHERE ver=".$ver);
|
||||||
$row=$db->loadObjectList();
|
$row=$db->loadObjectList();
|
||||||
if (!empty($row)) $ret=(int)$row[0]->prversion;
|
if (!empty($row)) $ret=(int)$row[0]->prversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->prversion=$ret;
|
$this->prversion=$ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ret=$this->prversion;
|
$ret=$this->prversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($ret);
|
return ($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getArticle($alias='showroom')
|
public function getArticle($alias='showroom')
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("SELECT * FROM #__content WHERE alias='".$alias."' LIMIT 1;");
|
$db->setQuery("SELECT * FROM #__content WHERE alias='".$alias."' LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->article=$tmp[0];
|
$this->article=$tmp[0];
|
||||||
return $this->article;
|
return $this->article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProduct($product=0)
|
public function getProduct($product=0)
|
||||||
{
|
{
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$lang=$session->get('sr_lang');
|
$lang=$session->get('sr_lang');
|
||||||
if (!isset($this->product) && (int)$product>0)
|
if (!isset($this->product) && (int)$product>0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT
|
SELECT
|
||||||
x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,
|
x.o_id AS id,x.title_".$lang." AS `title`,IF( LENGTH(x.title_".$lang.")>20,CONCAT(SUBSTRING(x.title_".$lang.",1,18),'...'),x.title_".$lang.") AS `title_short`,
|
||||||
x.desc_".$lang." AS `desc`,CONCAT('/".$this->getProductThumb()."/',m.dir,'/',x.o_id,'/zz_big.jpg') AS img,v.file,v.version,
|
x.desc_".$lang." AS `desc`,CONCAT('/".$this->getProductThumb()."/',m.dir,'/',x.o_id,'/zz_big.jpg') AS img,v.file,v.version,
|
||||||
x.rendelheto,x.`show`,x.`down`,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,
|
x.rendelheto,x.`show`,x.`down`,x.tipus,t.type_download,x.deleted,x.m_id,m.`name` AS m_name,m.dir,m.deleted AS m_deleted,
|
||||||
x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,IF( LENGTH(c.nev_".$lang.")>15,CONCAT(SUBSTRING(c.nev_".$lang.",1,13),'...'),c.nev_".$lang.") AS `c_name_short`,c.deleted AS c_deleted
|
x.c_id,c.nev_".$lang." AS c_name,c.nev_eng AS c_name_eng,IF( LENGTH(c.nev_".$lang.")>15,CONCAT(SUBSTRING(c.nev_".$lang.",1,13),'...'),c.nev_".$lang.") AS `c_name_short`,c.deleted AS c_deleted
|
||||||
FROM collection2 x
|
FROM collection2 x
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
||||||
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
LEFT OUTER JOIN coll2_types t ON x.tipus=t.type
|
||||||
LEFT OUTER JOIN (SELECT ver_id,o_id,fajl AS file,version FROM coll2_ver WHERE o_id=".(int)$product." AND version<=".$this->getPrVersion()." ORDER BY version DESC LIMIT 1) v ON x.o_id=v.o_id
|
LEFT OUTER JOIN (SELECT ver_id,o_id,fajl AS file,version FROM coll2_ver WHERE o_id=".(int)$product." AND version<=".$this->getPrVersion()." ORDER BY version DESC LIMIT 1) v ON x.o_id=v.o_id
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 AND x.o_id=".(int)$product." LIMIT 1;");
|
||||||
$tmp = $db->loadObjectList();
|
$tmp = $db->loadObjectList();
|
||||||
$this->product = $tmp[0];
|
$this->product = $tmp[0];
|
||||||
}
|
}
|
||||||
return $this->product;
|
return $this->product;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFiles($id=0)
|
public function getFiles($id=0)
|
||||||
{
|
{
|
||||||
if ((int)$id<=0) return(FALSE);
|
if ((int)$id<=0) return(FALSE);
|
||||||
|
|
||||||
$this->folder=$this->getFullPath($id);
|
$this->folder=$this->getFullPath($id);
|
||||||
if (is_dir($this->folder)) $this->files=$this->getFilteredFiles(scandir($this->folder),$id);
|
if (is_dir($this->folder)) $this->files=$this->getFilteredFiles(scandir($this->folder),$id);
|
||||||
return $this->files;
|
return $this->files;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilteredFiles($tomb=array(),$id)
|
public function getFilteredFiles($tomb=array(),$id)
|
||||||
{
|
{
|
||||||
$ret=array();
|
$ret=array();
|
||||||
$this->filter=array('.','..','.quarantine');
|
$this->filter=array('.','..','.quarantine');
|
||||||
if (is_array($tomb) and count($tomb))
|
if (is_array($tomb) and count($tomb))
|
||||||
{
|
{
|
||||||
foreach ($tomb as $file)
|
foreach ($tomb as $file)
|
||||||
{
|
{
|
||||||
if (!in_array($file, $this->filter))
|
if (!in_array($file, $this->filter))
|
||||||
{
|
{
|
||||||
$parts=explode(".", $file);
|
$parts=explode(".", $file);
|
||||||
|
|
||||||
$obj=new stdClass;
|
$obj=new stdClass;
|
||||||
$obj->name=$file;
|
$obj->name=$file;
|
||||||
$obj->path=$this->getPath($id).$file;
|
$obj->path=$this->getPath($id).$file;
|
||||||
$obj->fullpath=$_SERVER['DOCUMENT_ROOT'].$obj->path;
|
$obj->fullpath=$_SERVER['DOCUMENT_ROOT'].$obj->path;
|
||||||
$obj->extension=(in_array(strtolower(end($parts)),$this->arrKnownFiles) ? strtolower(end($parts)) : 'unknown');
|
$obj->extension=(in_array(strtolower(end($parts)),$this->arrKnownFiles) ? strtolower(end($parts)) : 'unknown');
|
||||||
$obj->filesize=filesize($obj->fullpath);
|
$obj->filesize=filesize($obj->fullpath);
|
||||||
$obj->datetime=filemtime($obj->fullpath);
|
$obj->datetime=filemtime($obj->fullpath);
|
||||||
$obj->icon='/components/com_showroom/assets/images/'.$obj->extension.'.png';
|
$obj->icon='/components/com_showroom/assets/images/'.$obj->extension.'.png';
|
||||||
$obj->multidownloadlink=($obj->extension=='pdf' ? $obj->path : $this->getMultiDownloadLink($id,$obj->path));
|
$obj->multidownloadlink=($obj->extension=='pdf' ? $obj->path : $this->getMultiDownloadLink($id,$obj->path));
|
||||||
|
|
||||||
$ret[]=$obj;
|
$ret[]=$obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getPath($id=0)
|
public function getPath($id=0)
|
||||||
{
|
{
|
||||||
$path='';
|
$path='';
|
||||||
if ((int)$id>0)
|
if ((int)$id>0)
|
||||||
{
|
{
|
||||||
$itm=$this->getProduct($id);
|
$itm=$this->getProduct($id);
|
||||||
$path='/'.$this->productDir.'/'.$itm->dir.'/'.(int)$id.'/';
|
$path='/'.$this->productDir.'/'.$itm->dir.'/'.(int)$id.'/';
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFullPath($id=0)
|
public function getFullPath($id=0)
|
||||||
{
|
{
|
||||||
$path='';
|
$path='';
|
||||||
if ((int)$id>0) { $path=$_SERVER['DOCUMENT_ROOT'].$this->getPath($id); }
|
if ((int)$id>0) { $path=$_SERVER['DOCUMENT_ROOT'].$this->getPath($id); }
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getMultiDownloadLink($id,$path)
|
public function getMultiDownloadLink($id,$path)
|
||||||
{
|
{
|
||||||
$ret="";
|
$ret="";
|
||||||
|
|
||||||
$obj=$this->getProduct($id);
|
$obj=$this->getProduct($id);
|
||||||
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$fajlok=@scandir($this->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
$fajlok=@scandir($this->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
||||||
if(!isset($fajlok[2])) { $f=""; }
|
if(!isset($fajlok[2])) { $f=""; }
|
||||||
elseif(count($fajlok)>3) { $f=$obj->file; }
|
elseif(count($fajlok)>3) { $f=$obj->file; }
|
||||||
else { $f=$fajlok[2]; }
|
else { $f=$fajlok[2]; }
|
||||||
*/
|
*/
|
||||||
if ($path>"")
|
if ($path>"")
|
||||||
{
|
{
|
||||||
$ret=$path."?download=1&type=".$obj->type_download.
|
$ret=$path."?download=1&type=".$obj->type_download.
|
||||||
"&bigimage=".base64_encode($this->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
"&bigimage=".base64_encode($this->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
||||||
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
||||||
"&objectname=".base64_encode($obj->title).
|
"&objectname=".base64_encode($obj->title).
|
||||||
((int)$_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
((int)$_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
||||||
|
|
||||||
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
||||||
{
|
{
|
||||||
$struct=$this->getStruct($obj->id);
|
$struct=$this->getStruct($obj->id);
|
||||||
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
||||||
{
|
{
|
||||||
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStruct($id=0)
|
public function getStruct($id=0)
|
||||||
{
|
{
|
||||||
$db=JFactory::getDBO();
|
$db=JFactory::getDBO();
|
||||||
$db->setQuery("
|
$db->setQuery("
|
||||||
SELECT s.`id`,s.`struct_eng` AS `subcategory`,s.`parent` AS `parent_id`,p.`struct_eng` AS `category`
|
SELECT s.`id`,s.`struct_eng` AS `subcategory`,s.`parent` AS `parent_id`,p.`struct_eng` AS `category`
|
||||||
FROM coll2_struct s
|
FROM coll2_struct s
|
||||||
LEFT OUTER JOIN (SELECT * FROM coll2_struct WHERE parent=id) p ON s.parent=p.id
|
LEFT OUTER JOIN (SELECT * FROM coll2_struct WHERE parent=id) p ON s.parent=p.id
|
||||||
WHERE s.id=(SELECT struct_id FROM collection2 WHERE o_id=".(int)$id.") LIMIT 1;");
|
WHERE s.id=(SELECT struct_id FROM collection2 WHERE o_id=".(int)$id.") LIMIT 1;");
|
||||||
$tmp=$db->loadObjectList();
|
$tmp=$db->loadObjectList();
|
||||||
$this->struct=$tmp[0];
|
$this->struct=$tmp[0];
|
||||||
return($this->struct);
|
return($this->struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProductThumb() { return $this->productThumb; }
|
public function getProductThumb() { return $this->productThumb; }
|
||||||
public function getProductDir() { return $this->productDir; }
|
public function getProductDir() { return $this->productDir; }
|
||||||
public function getAll() { return $this->all; }
|
public function getAll() { return $this->all; }
|
||||||
public function getIPP() { return $this->ipp; }
|
public function getIPP() { return $this->ipp; }
|
||||||
public function getPage() { return $this->page; }
|
public function getPage() { return $this->page; }
|
||||||
public function getLast() { return $this->last; }
|
public function getLast() { return $this->last; }
|
||||||
public function getFirst() { return $this->first; }
|
public function getFirst() { return $this->first; }
|
||||||
public function getPager() { return $this->pager; }
|
public function getPager() { return $this->pager; }
|
||||||
public function getVisibleLast() { return $this->visibleLast; }
|
public function getVisibleLast() { return $this->visibleLast; }
|
||||||
public function getVisibleFirst() { return $this->visibleFirst; }
|
public function getVisibleFirst() { return $this->visibleFirst; }
|
||||||
|
|
||||||
public function getLang()
|
public function getLang()
|
||||||
{
|
{
|
||||||
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
return (JFactory::getLanguage()->getTag()=='hu-HU' ? "hun" : "eng");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,252 +0,0 @@
|
|||||||
<?php
|
|
||||||
defined('_JEXEC') or die('Restricted access'); // No direct access to this file
|
|
||||||
|
|
||||||
jimport('joomla.application.component.modelitem'); // import Joomla modelitem library
|
|
||||||
|
|
||||||
class ShowroomModelUploadGroup extends JModelItem
|
|
||||||
{
|
|
||||||
protected $types;
|
|
||||||
protected $manufacture;
|
|
||||||
protected $manufactures;
|
|
||||||
protected $family;
|
|
||||||
protected $families;
|
|
||||||
protected $querystring;
|
|
||||||
protected $parents;
|
|
||||||
protected $parent;
|
|
||||||
protected $subcat;
|
|
||||||
protected $lang;
|
|
||||||
|
|
||||||
public function getTypes()
|
|
||||||
{
|
|
||||||
$session=&JFactory::getSession();
|
|
||||||
$lang=$session->get( 'sr_lang');//'hun';
|
|
||||||
if (!isset($this->types))
|
|
||||||
{
|
|
||||||
$db = JFactory::getDBO();
|
|
||||||
$db->setQuery("
|
|
||||||
SELECT `type`,`type_download`,`name_".$lang."` AS `name`,IF(LENGTH(name_".$lang.")>15,CONCAT(SUBSTRING(name_".$lang.",1,13),'...'),name_".$lang.") AS name_short, `desc_".$lang."` AS `desc`,REPLACE('".$this->typePath."','REPLACE',`type`) AS `img`,c.darab
|
|
||||||
FROM coll2_types t
|
|
||||||
LEFT OUTER JOIN (
|
|
||||||
SELECT COUNT(*) AS darab,x.tipus FROM (
|
|
||||||
SELECT x.o_id,x.tipus,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_hun AS c_name,c.deleted AS c_deleted
|
|
||||||
FROM collection2 x
|
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0
|
|
||||||
) x GROUP BY x.tipus
|
|
||||||
) c ON c.tipus=t.`type`
|
|
||||||
WHERE c.darab>0
|
|
||||||
ORDER BY `name_".$lang."`;");
|
|
||||||
$this->types = $db->loadObjectList();
|
|
||||||
}
|
|
||||||
return $this->types;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getManufactures($type="")
|
|
||||||
{
|
|
||||||
$session=&JFactory::getSession();
|
|
||||||
$lang=$session->get( 'sr_lang');//'hun';
|
|
||||||
if (!isset($this->manufactures))
|
|
||||||
{
|
|
||||||
$db = JFactory::getDBO();
|
|
||||||
$db->setQuery("
|
|
||||||
SELECT id,group_id,name,IF( LENGTH(name)>16,CONCAT(SUBSTRING(name,1,14),'...'),name) AS name_short,dir,deleted,REPLACE('".$this->logoPath."','REPLACE',`dir`) AS logo,cnt.darab
|
|
||||||
FROM coll2_man m
|
|
||||||
LEFT OUTER JOIN (
|
|
||||||
SELECT COUNT(*) AS darab,m_id,m_name FROM (
|
|
||||||
SELECT x.o_id,x.tipus,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_hun AS c_name,c.deleted AS c_deleted
|
|
||||||
FROM collection2 x
|
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($type>'' ? "AND tipus='".$type."'" : "")."
|
|
||||||
) x GROUP BY m_id
|
|
||||||
) cnt ON cnt.m_id=m.id
|
|
||||||
WHERE cnt.darab>0
|
|
||||||
ORDER BY name;");
|
|
||||||
$this->manufactures = $db->loadObjectList();
|
|
||||||
}
|
|
||||||
return $this->manufactures;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getManufacture($id=0)
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT * FROM coll2_man m WHERE id=".$id." LIMIT 1;");
|
|
||||||
$tmp=$db->loadObjectList();;
|
|
||||||
$this->manufacture=$tmp[0];
|
|
||||||
return $this->manufacture;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getManufactureByName($name="")
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT * FROM coll2_man m WHERE name='".$name."' LIMIT 1;");
|
|
||||||
$tmp=$db->loadObjectList();;
|
|
||||||
$this->manufacture=$tmp[0];
|
|
||||||
return $this->manufacture;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getFamilies($type="",$manufacture="")
|
|
||||||
{
|
|
||||||
$session=&JFactory::getSession();
|
|
||||||
$lang=$session->get( 'sr_lang');//'hun';
|
|
||||||
if (!isset($this->families))
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("
|
|
||||||
SELECT f.c_id,f.m_id,m.`name` AS manufacure,IF( LENGTH(f.nev_".$lang.")>15,CONCAT(SUBSTRING(f.nev_".$lang.",1,13),'...'),f.nev_".$lang.") AS family_short,f.nev_".$lang." AS family,cnt.darab
|
|
||||||
FROM coll2_cat f
|
|
||||||
LEFT OUTER JOIN (
|
|
||||||
SELECT COUNT(*) AS darab,c_id,c_name FROM (
|
|
||||||
SELECT x.o_id,x.tipus,x.deleted,x.m_id,m.`name` AS m_name,m.deleted AS m_deleted,x.c_id,c.nev_hun AS c_name,c.deleted AS c_deleted
|
|
||||||
FROM collection2 x
|
|
||||||
LEFT OUTER JOIN coll2_man m ON x.m_id=m.id
|
|
||||||
LEFT OUTER JOIN coll2_cat c ON x.c_id=c.c_id
|
|
||||||
WHERE x.deleted=0 AND m.deleted=0 AND c.deleted=0 ".($type>'' ? "AND tipus='".$type."'" : "")." ".((int)$manufacture>0 ? "AND x.m_id='".(int)$manufacture."'" : "")."
|
|
||||||
) x GROUP BY c_id
|
|
||||||
) cnt ON cnt.c_id=f.c_id
|
|
||||||
LEFT OUTER JOIN coll2_man m ON m.id=f.m_id
|
|
||||||
WHERE cnt.darab>0
|
|
||||||
ORDER BY f.nev_".$lang.";");
|
|
||||||
$this->families = $db->loadObjectList();
|
|
||||||
}
|
|
||||||
return $this->families;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFamily($id=0)
|
|
||||||
{
|
|
||||||
$session=&JFactory::getSession();
|
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT c_id,m_id,nev_".$lang." AS name,deleted FROM coll2_cat WHERE c_id=".$id." LIMIT 1;");
|
|
||||||
$tmp=$db->loadObjectList();
|
|
||||||
$this->family=$tmp[0];
|
|
||||||
return $this->family;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFamilyByName($name="",$m_id=0)
|
|
||||||
{
|
|
||||||
$session=&JFactory::getSession();
|
|
||||||
$lang=$session->get('sr_lang');//'hun';
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT c_id,m_id,nev_".$lang." AS name,deleted FROM coll2_cat WHERE ".((int)$m_id>0 ? 'm_id='.$m_id.' AND ' : '')." (nev_hun='".$name."' OR nev_eng='".$name."') LIMIT 1;");
|
|
||||||
$tmp=$db->loadObjectList();
|
|
||||||
$this->family=$tmp[0];
|
|
||||||
return $this->family;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function saveRecord($tomb=array())
|
|
||||||
{
|
|
||||||
$newID=0;
|
|
||||||
$collection2=new stdClass();
|
|
||||||
$collection2->m_id=$tomb['m_id'];
|
|
||||||
$collection2->desc_hun=$tomb['desc_hun'];
|
|
||||||
$collection2->desc_eng=$tomb['desc_eng'];
|
|
||||||
$collection2->c_id=$tomb['c_id'];
|
|
||||||
$collection2->struct_id=$tomb['struct_id'];
|
|
||||||
$collection2->datum=date("Y-m-d H:i:s",time());
|
|
||||||
$collection2->title_hun=$tomb['title_hun'];
|
|
||||||
$collection2->title_eng=$tomb['title_eng'];
|
|
||||||
$collection2->tipus=$tomb['tipus'];
|
|
||||||
$collection2->rendelheto=1;
|
|
||||||
$collection2->show=0;
|
|
||||||
$collection2->down=0;
|
|
||||||
$collection2->deleted=$tomb['deleted'];
|
|
||||||
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT * FROM collection2 WHERE tipus='".$collection2->tipus."' AND m_id=".$collection2->m_id." AND c_id=".$collection2->c_id." AND title_hun='".$collection2->title_hun."' LIMIT 1;");
|
|
||||||
$exist=$db->loadObjectList();
|
|
||||||
|
|
||||||
if (count($exist))
|
|
||||||
{
|
|
||||||
$newID=$exist[0]->o_id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (JFactory::getDbo()->insertObject('collection2', $collection2)==TRUE)
|
|
||||||
$newID=JFactory::getDbo()->insertid();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($newID)
|
|
||||||
{
|
|
||||||
$coll2_desc_eng=New stdClass();
|
|
||||||
$coll2_desc_eng->o_id=$newID;
|
|
||||||
$coll2_desc_eng->lang='eng';
|
|
||||||
$coll2_desc_eng->title=$tomb['title_eng'];
|
|
||||||
$coll2_desc_eng->desc=$tomb['desc_eng'];
|
|
||||||
JFactory::getDbo()->insertObject('coll2_desc', $coll2_desc_eng);
|
|
||||||
|
|
||||||
$coll2_desc_hun=New stdClass();
|
|
||||||
$coll2_desc_hun->o_id=$newID;
|
|
||||||
$coll2_desc_hun->lang='hun';
|
|
||||||
$coll2_desc_hun->title=$tomb['title_hun'];
|
|
||||||
$coll2_desc_hun->desc=$tomb['desc_hun'];
|
|
||||||
JFactory::getDbo()->insertObject('coll2_desc', $coll2_desc_hun);
|
|
||||||
|
|
||||||
$coll2_ver=New stdClass();
|
|
||||||
$coll2_ver->o_id=$newID;
|
|
||||||
$coll2_ver->fajl=$tomb['fajl'];
|
|
||||||
$coll2_ver->version=$tomb['version'];
|
|
||||||
$coll2_ver->down=0;
|
|
||||||
$coll2_ver->deleted=0;
|
|
||||||
JFactory::getDbo()->insertObject('coll2_ver', $coll2_ver);
|
|
||||||
}
|
|
||||||
return($newID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getParents()
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("
|
|
||||||
SELECT id,t.`name_".$this->getLang()."` AS `type`,struct_".$this->getLang()." AS `name`
|
|
||||||
FROM coll2_struct s
|
|
||||||
LEFT OUTER JOIN `coll2_types` t ON t.`type` COLLATE utf8_unicode_ci=s.`type`
|
|
||||||
WHERE parent=id
|
|
||||||
ORDER BY t.`name_".$this->getLang()."`,s.ord,s.`struct_".$this->getLang()."`;");
|
|
||||||
$this->parents=$db->loadObjectList();
|
|
||||||
return $this->parents;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getParentByName($tipus,$parent)
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT * FROM coll2_struct WHERE LOWER(type)='".strtolower($tipus)."' AND parent=id AND LOWER(struct_eng)='".strtolower($parent)."' LIMIT 1;");
|
|
||||||
$tmp=$db->loadObjectList();
|
|
||||||
$this->parent=$tmp[0];
|
|
||||||
return $this->parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSubcat($parent=-1)
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("
|
|
||||||
SELECT s.`id`,t.`name_".$this->getLang()."` AS `type`,p.`parent`,s.`struct_".$this->getLang()."` AS `name`
|
|
||||||
FROM `coll2_struct` s
|
|
||||||
LEFT OUTER JOIN `coll2_types` t ON t.`type` COLLATE utf8_unicode_ci=s.`type`
|
|
||||||
LEFT OUTER JOIN (SELECT id,struct_".$this->getLang()." AS `parent` FROM coll2_struct WHERE parent=id) p ON p.`id`=s.`parent`
|
|
||||||
WHERE s.`parent`!=s.`id` ".($parent==-1 ? "" : "AND s.`parent`=".(int)$parent)."
|
|
||||||
ORDER BY p.`parent`,s.ord,s.`struct_".$this->getLang()."`;");
|
|
||||||
$this->subcat=$db->loadObjectList();
|
|
||||||
return $this->subcat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSubcatByName($tipus,$parent_id,$subcat)
|
|
||||||
{
|
|
||||||
$db=JFactory::getDBO();
|
|
||||||
$db->setQuery("SELECT * FROM coll2_struct WHERE LOWER(type)='".strtolower($tipus)."' AND parent=".$parent_id." AND LOWER(struct_eng)='".strtolower($subcat)."';");
|
|
||||||
$tmp=$db->loadObjectList();
|
|
||||||
$this->subcat=$tmp[0];
|
|
||||||
return $this->subcat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLang()
|
|
||||||
{
|
|
||||||
if (!isset($this->lang)) { $this->lang=(strpos($_SERVER['HTTP_HOST'],".com") ? "eng" : "hun"); }
|
|
||||||
return $this->lang;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -1,131 +1,131 @@
|
|||||||
<?php defined('_JEXEC') or die; ?>
|
<?php defined('_JEXEC') or die; ?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php if (!isset($this->sess['sr_template'])) : ?>
|
<?php if (!isset($this->sess['sr_template'])) : ?>
|
||||||
<?= $this->article->introtext ?>
|
<?= $this->article->introtext ?>
|
||||||
<?= $this->article->fulltext ?>
|
<?= $this->article->fulltext ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="showroom_search">
|
<div class="showroom_search">
|
||||||
<div class="showroom_back">
|
<div class="showroom_back">
|
||||||
<a href="/index.php?option=com_showroom&view=showroom&family=none<?= ($this->sess['sr_type'] > '' ? '&type=' . $this->sess['sr_type'] : '') . ((int)$this->sess['sr_manufacture'] > 0 ? '&manufacture=' . $this->sess['sr_manufacture'] : '') . $this->querystring ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>">
|
<a href="/index.php?option=com_showroom&view=showroom&family=none<?= ($this->sess['sr_type'] > '' ? '&type=' . $this->sess['sr_type'] : '') . ((int)$this->sess['sr_manufacture'] > 0 ? '&manufacture=' . $this->sess['sr_manufacture'] : '') . $this->querystring ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>">
|
||||||
<img src="/components/com_showroom/assets/images/back_1.png" alt="<?= JText::_(COM_SHOWROOM_BACK); ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>" />
|
<img src="/components/com_showroom/assets/images/back_1.png" alt="<?= JText::_(COM_SHOWROOM_BACK); ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form name="showroom_search" id="showroom_search" method="post" action="index.php?option=com_showroom&view=search<?= $this->querystring ?>">
|
<form name="showroom_search" id="showroom_search" method="post" action="index.php?option=com_showroom&view=search<?= $this->querystring ?>">
|
||||||
<input type="text" name="showroom_keyword" id="showroom_keyword" placeholder="<?= JText::_(COM_SHOWROOM_SEARCH); ?>..." />
|
<input type="text" name="showroom_keyword" id="showroom_keyword" placeholder="<?= JText::_(COM_SHOWROOM_SEARCH); ?>..." />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php if ($this->sess['sr_ver'] >= 32 && $this->sess['sr_template'] == 'blankframe') : ?>
|
<?php if ($this->sess['sr_ver'] >= 32 && $this->sess['sr_template'] == 'blankframe') : ?>
|
||||||
<div class="showroom_multi">
|
<div class="showroom_multi">
|
||||||
<input type="checkbox" name="multi" id="multi" <?= ($this->sess['sr_multi'] == 'true' ? 'checked="checked"' : '') ?> />
|
<input type="checkbox" name="multi" id="multi" <?= ($this->sess['sr_multi'] == 'true' ? 'checked="checked"' : '') ?> />
|
||||||
<label for="multi"><span></span> <?= JText::_(COM_SHOWROOM_MULTI_DOWNLOAD); ?></label>
|
<label for="multi"><span></span> <?= JText::_(COM_SHOWROOM_MULTI_DOWNLOAD); ?></label>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="showroom_clear"></div>
|
<div class="showroom_clear"></div>
|
||||||
|
|
||||||
<div class="family_menu">
|
<div class="family_menu">
|
||||||
<h4><?= $this->families[0]->manufacture ?></h4>
|
<h4><?= $this->families[0]->manufacture ?></h4>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($this->families as $family) : ?>
|
<?php foreach ($this->families as $family) : ?>
|
||||||
<li>
|
<li>
|
||||||
<?php if ($family->c_id == $this->sess['sr_family']) : ?>
|
<?php if ($family->c_id == $this->sess['sr_family']) : ?>
|
||||||
<span class="active"><?= $family->family_short ?> (<?= $family->darab ?>)</span>
|
<span class="active"><?= $family->family_short ?> (<?= $family->darab ?>)</span>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<a href="index.php?option=com_showroom&view=family&family=<?= $family->c_id ?><?= $this->querystring ?>">
|
<a href="index.php?option=com_showroom&view=family&family=<?= $family->c_id ?><?= $this->querystring ?>">
|
||||||
<?= $family->family_short ?> (<?= $family->darab ?>)
|
<?= $family->family_short ?> (<?= $family->darab ?>)
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="family_container">
|
<div class="family_container">
|
||||||
<?php foreach ($this->products as $product) : ?>
|
<?php foreach ($this->products as $product) : ?>
|
||||||
<div class="paddingBottom10">
|
<div class="paddingBottom10">
|
||||||
<div id="product_<?= $product->id ?>" class="contentBox <?= ($this->sess['sr_product'] == $product->id ? "active" : "inactive") ?>">
|
<div id="product_<?= $product->id ?>" class="contentBox <?= ($this->sess['sr_product'] == $product->id ? "active" : "inactive") ?>">
|
||||||
<div class="image">
|
<div class="image">
|
||||||
<a href="/index.php?option=com_showroom&view=product&product=<?= $product->id ?><?= $this->querystring ?>">
|
<a href="/index.php?option=com_showroom&view=product&product=<?= $product->id ?><?= $this->querystring ?>">
|
||||||
<img src="<?= $product->img ?>" alt="<?= $product->title ?>" title="<?= $product->title ?>" />
|
<img src="<?= $product->img ?>" alt="<?= $product->title ?>" title="<?= $product->title ?>" />
|
||||||
<div class="description<?= ($this->sess['sr_product'] == $product->id ? "_active" : "") ?>"><span class="description_description"><?= $product->title_short ?></span></div>
|
<div class="description<?= ($this->sess['sr_product'] == $product->id ? "_active" : "") ?>"><span class="description_description"><?= $product->title_short ?></span></div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//$letoltlink=(isset($this->sess['sr_template']) ? $this->getDownloadLink($product) : '');
|
//$letoltlink=(isset($this->sess['sr_template']) ? $this->getDownloadLink($product) : '');
|
||||||
$letoltlink = $this->getDownloadLink($product);
|
$letoltlink = $this->getDownloadLink($product);
|
||||||
if ($letoltlink > "") : ?>
|
if ($letoltlink > "") : ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$letoltlink = (isset($this->sess['sr_template']) ? 'http://www.archline.hu/' . $letoltlink : $letoltlink);
|
$letoltlink = (isset($this->sess['sr_template']) ? 'http://www.archline.hu/' . $letoltlink : $letoltlink);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (count($this->files[$product->id]) > 1 && $this->sess['sr_ver'] >= 33) : ?>
|
<?php if (count($this->files[$product->id]) > 1 && $this->sess['sr_ver'] >= 33) : ?>
|
||||||
<div id="smallDownloadPanelContainer-<?= $product->id ?>" class="smallDownloadPanelContainer" style="display:none;">
|
<div id="smallDownloadPanelContainer-<?= $product->id ?>" class="smallDownloadPanelContainer" style="display:none;">
|
||||||
<table border="0" cellspacing="1" cellpadding="1">
|
<table border="0" cellspacing="1" cellpadding="1">
|
||||||
<?php foreach ($this->files[$product->id] as $file) : ?>
|
<?php foreach ($this->files[$product->id] as $file) : ?>
|
||||||
<?php if ($file->extension != 'unknown') : ?>
|
<?php if ($file->extension != 'unknown') : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="<?= $file->icon ?>" border="0" /></td>
|
<td><img src="<?= $file->icon ?>" border="0" /></td>
|
||||||
<td align="left"><a href="<?= $file->multidownloadlink ?>" class="letoltlink" rel="<?= $this->product->id ?>"><?= JText::_("COM_SHOWROOM_" . $file->extension); ?></a></td>
|
<td align="left"><a href="<?= $file->multidownloadlink ?>" class="letoltlink" rel="<?= $this->product->id ?>"><?= JText::_("COM_SHOWROOM_" . $file->extension); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<span class="description_download dd_pos1">
|
<span class="description_download dd_pos1">
|
||||||
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" onclick="javascript:clickSmallButton(<?= $product->id ?>);" />
|
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" onclick="javascript:clickSmallButton(<?= $product->id ?>);" />
|
||||||
</span>
|
</span>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<span class="description_download dd_pos1">
|
<span class="description_download dd_pos1">
|
||||||
<a href="<?= $letoltlink ?>" class="letoltlink" rel="<?= $product->id ?>">
|
<a href="<?= $letoltlink ?>" class="letoltlink" rel="<?= $product->id ?>">
|
||||||
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" />
|
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!isset($this->sess['sr_template'])) : ?>
|
<?php if (!isset($this->sess['sr_template'])) : ?>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row"> </div>
|
<div class="row"> </div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (isset($this->sess['sr_template'])) : ?>
|
<?php if (isset($this->sess['sr_template'])) : ?>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.letoltlink').click(function() {
|
jQuery('.letoltlink').click(function() {
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: '/components/com_showroom/assets/ajax/AjaxDownloadController.class.php',
|
url: '/components/com_showroom/assets/ajax/AjaxDownloadController.class.php',
|
||||||
data: 'o_id=' + jQuery(this).attr('rel'),
|
data: 'o_id=' + jQuery(this).attr('rel'),
|
||||||
success: function(html) {
|
success: function(html) {
|
||||||
jQuery('#result').html(html);
|
jQuery('#result').html(html);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('#multi').click(function() {
|
jQuery('#multi').click(function() {
|
||||||
jQuery(location).attr('href', '<?= (strpos(JFactory::getURI()->toString(), 'multi=') > 0 ? substr(JFactory::getURI()->toString(), 0, strpos(JFactory::getURI()->toString(), 'multi=') - 1) : JFactory::getURI()->toString()) ?>&multi=' + (jQuery('#multi').is(':checked') ? 'true' : 'false'));
|
jQuery(location).attr('href', '<?= (strpos(JFactory::getURI()->toString(), 'multi=') > 0 ? substr(JFactory::getURI()->toString(), 0, strpos(JFactory::getURI()->toString(), 'multi=') - 1) : JFactory::getURI()->toString()) ?>&multi=' + (jQuery('#multi').is(':checked') ? 'true' : 'false'));
|
||||||
});
|
});
|
||||||
|
|
||||||
function clickSmallButton(id) {
|
function clickSmallButton(id) {
|
||||||
var isVisible = jQuery("#smallDownloadPanelContainer-" + id).is(":visible");
|
var isVisible = jQuery("#smallDownloadPanelContainer-" + id).is(":visible");
|
||||||
jQuery(".smallDownloadPanelContainer").hide(200);
|
jQuery(".smallDownloadPanelContainer").hide(200);
|
||||||
if (isVisible == false) jQuery("#smallDownloadPanelContainer-" + id).show(200);
|
if (isVisible == false) jQuery("#smallDownloadPanelContainer-" + id).show(200);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -1,228 +1,228 @@
|
|||||||
<?php defined('_JEXEC') or die; ?>
|
<?php defined('_JEXEC') or die; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
$user=JFactory::getUser();
|
$user=JFactory::getUser();
|
||||||
if ($user->id==568)
|
if ($user->id==568)
|
||||||
{
|
{
|
||||||
print_r($this->url);
|
print_r($this->url);
|
||||||
print "<br />";
|
print "<br />";
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php if (!isset($this->sess['sr_template'])) : ?>
|
<?php if (!isset($this->sess['sr_template'])) : ?>
|
||||||
<?= $this->article->introtext ?>
|
<?= $this->article->introtext ?>
|
||||||
<?= $this->article->fulltext ?>
|
<?= $this->article->fulltext ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="showroom_search">
|
<div class="showroom_search">
|
||||||
<div class="showroom_back">
|
<div class="showroom_back">
|
||||||
<?php
|
<?php
|
||||||
$backlink = (isset($_GET['from']) && trim(strtolower($_GET['from'])) == 'search' ? 'search' : 'family&family=' . $this->sess['sr_family'] . $this->querystring);
|
$backlink = (isset($_GET['from']) && trim(strtolower($_GET['from'])) == 'search' ? 'search' : 'family&family=' . $this->sess['sr_family'] . $this->querystring);
|
||||||
?>
|
?>
|
||||||
<a href="/index.php?option=com_showroom&view=<?= $backlink ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>">
|
<a href="/index.php?option=com_showroom&view=<?= $backlink ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>">
|
||||||
<img src="/components/com_showroom/assets/images/back_2.png" alt="<?= JText::_(COM_SHOWROOM_BACK); ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>" />
|
<img src="/components/com_showroom/assets/images/back_2.png" alt="<?= JText::_(COM_SHOWROOM_BACK); ?>" title="<?= JText::_(COM_SHOWROOM_BACK); ?>" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form name="showroom_search" id="showroom_search" method="post" action="index.php?option=com_showroom&view=search<?= $this->querystring ?>">
|
<form name="showroom_search" id="showroom_search" method="post" action="index.php?option=com_showroom&view=search<?= $this->querystring ?>">
|
||||||
<input type="text" name="showroom_keyword" id="showroom_keyword" placeholder="<?= JText::_(COM_SHOWROOM_SEARCH); ?>..." />
|
<input type="text" name="showroom_keyword" id="showroom_keyword" placeholder="<?= JText::_(COM_SHOWROOM_SEARCH); ?>..." />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php if ($this->sess['sr_ver'] >= 32 && $this->sess['sr_template'] == 'blankframe') : ?>
|
<?php if ($this->sess['sr_ver'] >= 32 && $this->sess['sr_template'] == 'blankframe') : ?>
|
||||||
<div class="showroom_multi">
|
<div class="showroom_multi">
|
||||||
<input type="checkbox" name="multi" id="multi" <?= ($this->sess['sr_multi'] == 'true' ? 'checked="checked"' : '') ?> />
|
<input type="checkbox" name="multi" id="multi" <?= ($this->sess['sr_multi'] == 'true' ? 'checked="checked"' : '') ?> />
|
||||||
<label for="multi"><span></span> <?= JText::_(COM_SHOWROOM_MULTI_DOWNLOAD); ?></label>
|
<label for="multi"><span></span> <?= JText::_(COM_SHOWROOM_MULTI_DOWNLOAD); ?></label>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="showroom_clear"></div>
|
<div class="showroom_clear"></div>
|
||||||
|
|
||||||
<div class="family_menu">
|
<div class="family_menu">
|
||||||
<h4><?= $this->families[0]->manufacture ?></h4>
|
<h4><?= $this->families[0]->manufacture ?></h4>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($this->families as $family) : ?>
|
<?php foreach ($this->families as $family) : ?>
|
||||||
<li>
|
<li>
|
||||||
<?php if ($family->c_id == $this->sess['sr_family']) : ?>
|
<?php if ($family->c_id == $this->sess['sr_family']) : ?>
|
||||||
<span class="active"><?= $family->family ?> (<?= $family->darab ?>)</span>
|
<span class="active"><?= $family->family ?> (<?= $family->darab ?>)</span>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<a href="index.php?option=com_showroom&view=family&family=<?= $family->c_id ?>&product=none<?= $this->querystring ?>">
|
<a href="index.php?option=com_showroom&view=family&family=<?= $family->c_id ?>&product=none<?= $this->querystring ?>">
|
||||||
<?= $family->family_short ?> (<?= $family->darab ?>)
|
<?= $family->family_short ?> (<?= $family->darab ?>)
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="product_container">
|
<div class="product_container">
|
||||||
<div class="product_image_<?= (isset($this->sess['sr_template']) ? 'narrow' : 'full') ?>">
|
<div class="product_image_<?= (isset($this->sess['sr_template']) ? 'narrow' : 'full') ?>">
|
||||||
<img src="<?= $this->product->img ?>" id="img_<?= $this->product->id ?>" alt="<?= $this->product->title ?>" title="<?= $this->product->title ?>" border="0" />
|
<img src="<?= $this->product->img ?>" id="img_<?= $this->product->id ?>" alt="<?= $this->product->title ?>" title="<?= $this->product->title ?>" border="0" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="product_description <?= (isset($this->sess['sr_template']) ? 'narrow' : 'full') ?>">
|
<div class="product_description <?= (isset($this->sess['sr_template']) ? 'narrow' : 'full') ?>">
|
||||||
<h5><?= $this->product->c_name ?></h5>
|
<h5><?= $this->product->c_name ?></h5>
|
||||||
<h6><?= $this->product->title ?></h6>
|
<h6><?= $this->product->title ?></h6>
|
||||||
<div style="width:420px;height:245px;overflow:auto;">
|
<div style="width:420px;height:245px;overflow:auto;">
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if (strpos($this->product->desc, "#") !== FALSE) {
|
if (strpos($this->product->desc, "#") !== FALSE) {
|
||||||
$miket = array('#kep_moshato#', '#kep_nem_moshato2#', '#kep_nem_moshato#', '#kep_moshato2#');
|
$miket = array('#kep_moshato#', '#kep_nem_moshato2#', '#kep_nem_moshato#', '#kep_moshato2#');
|
||||||
$mikre = array(
|
$mikre = array(
|
||||||
'<img src="/public/img/collection/kep_moshato.png" />',
|
'<img src="/public/img/collection/kep_moshato.png" />',
|
||||||
'<img src="/public/img/collection/kep_nem_moshato.png" />',
|
'<img src="/public/img/collection/kep_nem_moshato.png" />',
|
||||||
'<img src="/public/img/collection/kep_nem_moshato_alap.png" />',
|
'<img src="/public/img/collection/kep_nem_moshato_alap.png" />',
|
||||||
'<img src="/public/img/collection/kep_moshato2.png" />'
|
'<img src="/public/img/collection/kep_moshato2.png" />'
|
||||||
);
|
);
|
||||||
$this->product->desc = str_replace($miket, $mikre, $this->product->desc);
|
$this->product->desc = str_replace($miket, $mikre, $this->product->desc);
|
||||||
}
|
}
|
||||||
echo nl2br($this->product->desc);
|
echo nl2br($this->product->desc);
|
||||||
?></p>
|
?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><i><?= JText::_(COM_SHOWROOM_DOWNLOADS); ?>: <strong><?= $this->product->down ?></strong> <?= JText::_(COM_SHOWROOM_VIEWS); ?>: <strong><?= $this->product->show ?></strong></i></p>
|
<p><i><?= JText::_(COM_SHOWROOM_DOWNLOADS); ?>: <strong><?= $this->product->down ?></strong> <?= JText::_(COM_SHOWROOM_VIEWS); ?>: <strong><?= $this->product->show ?></strong></i></p>
|
||||||
<?php
|
<?php
|
||||||
//$letoltlink=(isset($this->sess['sr_template']) ? $this->getDownloadLink($this->product) : '');
|
//$letoltlink=(isset($this->sess['sr_template']) ? $this->getDownloadLink($this->product) : '');
|
||||||
$letoltlink = $this->getDownloadLink($this->product);
|
$letoltlink = $this->getDownloadLink($this->product);
|
||||||
|
|
||||||
if ($letoltlink > "") : ?>
|
if ($letoltlink > "") : ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$letoltlink = (isset($this->sess['sr_template']) ? 'http://www.archline.hu/' . $letoltlink : $letoltlink);
|
$letoltlink = (isset($this->sess['sr_template']) ? 'http://www.archline.hu/' . $letoltlink : $letoltlink);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (count($this->files[$this->product->id]) > 1 && $this->sess['sr_ver'] >= 33) : ?>
|
<?php if (count($this->files[$this->product->id]) > 1 && $this->sess['sr_ver'] >= 33) : ?>
|
||||||
<div id="downloadButton" class="product_download"><?= JText::_(COM_SHOWROOM_DOWNLOAD); ?></div>
|
<div id="downloadButton" class="product_download"><?= JText::_(COM_SHOWROOM_DOWNLOAD); ?></div>
|
||||||
<div id="downloadPanelContainer" style="display:none;">
|
<div id="downloadPanelContainer" style="display:none;">
|
||||||
<table border="0" cellspacing="1" cellpadding="1">
|
<table border="0" cellspacing="1" cellpadding="1">
|
||||||
<?php foreach ($this->files[$this->product->id] as $file) : ?>
|
<?php foreach ($this->files[$this->product->id] as $file) : ?>
|
||||||
<?php if ($file->extension != 'unknown') : ?>
|
<?php if ($file->extension != 'unknown') : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="<?= $file->icon ?>" border="0" /></td>
|
<td><img src="<?= $file->icon ?>" border="0" /></td>
|
||||||
<td align="left"><a href="<?= $file->multidownloadlink ?>" class="letoltlink" rel="<?= $this->product->id ?>"><?= JText::_("COM_SHOWROOM_" . $file->extension); ?></a></td>
|
<td align="left"><a href="<?= $file->multidownloadlink ?>" class="letoltlink" rel="<?= $this->product->id ?>"><?= JText::_("COM_SHOWROOM_" . $file->extension); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<a href="<?= $letoltlink ?>" class="letoltlink" rel="<?= $this->product->id ?>">
|
<a href="<?= $letoltlink ?>" class="letoltlink" rel="<?= $this->product->id ?>">
|
||||||
<div class="product_download"><?= JText::_(COM_SHOWROOM_DOWNLOAD); ?></div>
|
<div class="product_download"><?= JText::_(COM_SHOWROOM_DOWNLOAD); ?></div>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="showroom_clear"></div>
|
<div class="showroom_clear"></div>
|
||||||
|
|
||||||
<div class="product_scroller" style="padding-top:6px;">
|
<div class="product_scroller" style="padding-top:6px;">
|
||||||
<div class="showroom_container">
|
<div class="showroom_container">
|
||||||
<div class="showroom_title showroom_title_level1"><span class="showroom_title_description" style="padding-left:5px;"><?= $this->product->c_name_short ?> (<?= count($this->products) ?>)</span></div>
|
<div class="showroom_title showroom_title_level1"><span class="showroom_title_description" style="padding-left:5px;"><?= $this->product->c_name_short ?> (<?= count($this->products) ?>)</span></div>
|
||||||
<div id="makeMeScrollable_1" class="makeMeScrollable">
|
<div id="makeMeScrollable_1" class="makeMeScrollable">
|
||||||
<?php foreach ($this->products as $product) : ?>
|
<?php foreach ($this->products as $product) : ?>
|
||||||
<div id="product_<?= $product->id ?>" class="contentBox <?= ($this->sess['sr_product'] == $product->id ? "active" : "inactive") ?>">
|
<div id="product_<?= $product->id ?>" class="contentBox <?= ($this->sess['sr_product'] == $product->id ? "active" : "inactive") ?>">
|
||||||
<div class="image">
|
<div class="image">
|
||||||
<?php
|
<?php
|
||||||
$backlink = (isset($_GET['from']) && trim(strtolower($_GET['from'])) == 'search' ? '&from=search' : '');
|
$backlink = (isset($_GET['from']) && trim(strtolower($_GET['from'])) == 'search' ? '&from=search' : '');
|
||||||
?>
|
?>
|
||||||
<a href="/index.php?option=com_showroom&view=product&product=<?= $product->id ?><?= $backlink ?><?= $this->querystring ?>">
|
<a href="/index.php?option=com_showroom&view=product&product=<?= $product->id ?><?= $backlink ?><?= $this->querystring ?>">
|
||||||
<img src="<?= $product->img ?>" alt="<?= $product->title ?>" title="<?= $product->title ?>" />
|
<img src="<?= $product->img ?>" alt="<?= $product->title ?>" title="<?= $product->title ?>" />
|
||||||
<div class="description<?= ($this->sess['sr_product'] == $product->id ? "_active" : "") ?>"><span class="description_description"><?= $product->title_short ?></span></div>
|
<div class="description<?= ($this->sess['sr_product'] == $product->id ? "_active" : "") ?>"><span class="description_description"><?= $product->title_short ?></span></div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$letoltlink = (isset($this->sess['sr_template']) ? $this->getDownloadLink($product) : '');
|
$letoltlink = (isset($this->sess['sr_template']) ? $this->getDownloadLink($product) : '');
|
||||||
if ($letoltlink > "") : ?>
|
if ($letoltlink > "") : ?>
|
||||||
|
|
||||||
<?php if (count($this->files[$product->id]) > 1 && $this->sess['sr_ver'] >= 33) : ?>
|
<?php if (count($this->files[$product->id]) > 1 && $this->sess['sr_ver'] >= 33) : ?>
|
||||||
<div id="smallDownloadPanelContainer-<?= $product->id ?>" class="smallDownloadPanelContainer" style="display:none;">
|
<div id="smallDownloadPanelContainer-<?= $product->id ?>" class="smallDownloadPanelContainer" style="display:none;">
|
||||||
<table border="0" cellspacing="1" cellpadding="1">
|
<table border="0" cellspacing="1" cellpadding="1">
|
||||||
<?php foreach ($this->files[$product->id] as $file) : ?>
|
<?php foreach ($this->files[$product->id] as $file) : ?>
|
||||||
<?php if ($file->extension != 'unknown') : ?>
|
<?php if ($file->extension != 'unknown') : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="<?= $file->icon ?>" border="0" /></td>
|
<td><img src="<?= $file->icon ?>" border="0" /></td>
|
||||||
<td align="left"><a href="<?= $file->multidownloadlink ?>" class="letoltlink" rel="<?= $this->product->id ?>"><?= JText::_("COM_SHOWROOM_" . $file->extension); ?></a></td>
|
<td align="left"><a href="<?= $file->multidownloadlink ?>" class="letoltlink" rel="<?= $this->product->id ?>"><?= JText::_("COM_SHOWROOM_" . $file->extension); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<span class="description_download dd_pos1">
|
<span class="description_download dd_pos1">
|
||||||
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" onclick="javascript:clickSmallButton(<?= $product->id ?>);" />
|
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" onclick="javascript:clickSmallButton(<?= $product->id ?>);" />
|
||||||
</span>
|
</span>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<span class="description_download dd_pos1">
|
<span class="description_download dd_pos1">
|
||||||
<a href="<?= $letoltlink ?>" class="letoltlink" rel="<?= $product->id ?>">
|
<a href="<?= $letoltlink ?>" class="letoltlink" rel="<?= $product->id ?>">
|
||||||
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" />
|
<img src="/components/com_showroom/assets/images/icon-download.png" alt="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" title="<?= JText::_(COM_SHOWROOM_DOWNLOAD); ?>" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php if (!isset($this->sess['sr_template'])) : ?>
|
<?php if (!isset($this->sess['sr_template'])) : ?>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row"> </div>
|
<div class="row"> </div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (isset($this->sess['sr_template'])) : ?>
|
<?php if (isset($this->sess['sr_template'])) : ?>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.letoltlink').click(function() {
|
jQuery('.letoltlink').click(function() {
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: '/components/com_showroom/assets/ajax/AjaxDownloadController.class.php',
|
url: '/components/com_showroom/assets/ajax/AjaxDownloadController.class.php',
|
||||||
data: 'o_id=' + jQuery(this).attr('rel'),
|
data: 'o_id=' + jQuery(this).attr('rel'),
|
||||||
success: function(html) {
|
success: function(html) {
|
||||||
jQuery('#result').html(html);
|
jQuery('#result').html(html);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
|
|
||||||
function() {
|
function() {
|
||||||
jQuery("#makeMeScrollable_1").smoothDivScroll({
|
jQuery("#makeMeScrollable_1").smoothDivScroll({
|
||||||
mousewheelScrolling: "allDirections",
|
mousewheelScrolling: "allDirections",
|
||||||
manualContinuousScrolling: true,
|
manualContinuousScrolling: true,
|
||||||
autoScrollingMode: "onStart"
|
autoScrollingMode: "onStart"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('#multi').click(function() {
|
jQuery('#multi').click(function() {
|
||||||
jQuery(location).attr('href', '<?= (strpos(JFactory::getURI()->toString(), 'multi=') > 0 ? substr(JFactory::getURI()->toString(), 0, strpos(JFactory::getURI()->toString(), 'multi=') - 1) : JFactory::getURI()->toString()) ?>&multi=' + (jQuery('#multi').is(':checked') ? 'true' : 'false'));
|
jQuery(location).attr('href', '<?= (strpos(JFactory::getURI()->toString(), 'multi=') > 0 ? substr(JFactory::getURI()->toString(), 0, strpos(JFactory::getURI()->toString(), 'multi=') - 1) : JFactory::getURI()->toString()) ?>&multi=' + (jQuery('#multi').is(':checked') ? 'true' : 'false'));
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery("#downloadButton").click(function() {
|
jQuery("#downloadButton").click(function() {
|
||||||
jQuery(".smallDownloadPanelContainer").hide(200);
|
jQuery(".smallDownloadPanelContainer").hide(200);
|
||||||
jQuery("#downloadPanelContainer").toggle(200);
|
jQuery("#downloadPanelContainer").toggle(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
function clickSmallButton(id) {
|
function clickSmallButton(id) {
|
||||||
var isVisible = jQuery("#smallDownloadPanelContainer-" + id).is(":visible");
|
var isVisible = jQuery("#smallDownloadPanelContainer-" + id).is(":visible");
|
||||||
jQuery("#downloadPanelContainer").hide(200);
|
jQuery("#downloadPanelContainer").hide(200);
|
||||||
jQuery(".smallDownloadPanelContainer").hide(200);
|
jQuery(".smallDownloadPanelContainer").hide(200);
|
||||||
if (isVisible == false) jQuery("#smallDownloadPanelContainer-" + id).show(200);
|
if (isVisible == false) jQuery("#smallDownloadPanelContainer-" + id).show(200);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -1,147 +1,147 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
defined('_JEXEC') or die; // No direct access to this file
|
||||||
|
|
||||||
require_once ( JPATH_BASE.'/includes/defines.php' );
|
require_once ( JPATH_BASE.'/includes/defines.php' );
|
||||||
require_once ( JPATH_BASE.'/includes/framework.php' );
|
require_once ( JPATH_BASE.'/includes/framework.php' );
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
jimport('joomla.session.session');
|
jimport('joomla.session.session');
|
||||||
|
|
||||||
class ShowroomViewProduct extends JViewLegacy
|
class ShowroomViewProduct extends JViewLegacy
|
||||||
{
|
{
|
||||||
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
||||||
protected $defLang='eng';
|
protected $defLang='eng';
|
||||||
|
|
||||||
public $sess=array();
|
public $sess=array();
|
||||||
public $url=array();
|
public $url=array();
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$app=JFactory::getApplication();
|
$app=JFactory::getApplication();
|
||||||
$session=JFactory::getSession();
|
$session=JFactory::getSession();
|
||||||
$document=JFactory::getDocument();
|
$document=JFactory::getDocument();
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
$mainframe = JFactory::getApplication('site');
|
$mainframe = JFactory::getApplication('site');
|
||||||
$mainframe->initialise();
|
$mainframe->initialise();
|
||||||
|
|
||||||
$document->addStyleSheet('/components/com_showroom/assets/css/smoothTouchScroll.css');
|
$document->addStyleSheet('/components/com_showroom/assets/css/smoothTouchScroll.css');
|
||||||
$document->addStyleSheet('/components/com_showroom/assets/css/showroom.css');
|
$document->addStyleSheet('/components/com_showroom/assets/css/showroom.css');
|
||||||
$document->addScript('/components/com_showroom/assets/js/jquery-ui-1.11.2.custom.min.js');
|
$document->addScript('/components/com_showroom/assets/js/jquery-ui-1.11.2.custom.min.js');
|
||||||
$document->addScript('/components/com_showroom/assets/js/jquery.kinetic-2.0.4.min.js');
|
$document->addScript('/components/com_showroom/assets/js/jquery.kinetic-2.0.4.min.js');
|
||||||
$document->addScript('/components/com_showroom/assets/js/jquery.smoothDivScroll-1.3.min.js');
|
$document->addScript('/components/com_showroom/assets/js/jquery.smoothDivScroll-1.3.min.js');
|
||||||
|
|
||||||
$this->url=$model->getURL($_SERVER['REQUEST_URI']);
|
$this->url=$model->getURL($_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
// SEF URL
|
// SEF URL
|
||||||
$this->url=$model->getURL($_SERVER['REQUEST_URI']);
|
$this->url=$model->getURL($_SERVER['REQUEST_URI']);
|
||||||
if (!isset($_GET['product']) && $this->url['id']>0) $_GET['product']=$this->url['id'];
|
if (!isset($_GET['product']) && $this->url['id']>0) $_GET['product']=$this->url['id'];
|
||||||
if (!isset($_GET['lang']) && $this->url['lang']>'') $_GET['lang']=$this->url['lang'];
|
if (!isset($_GET['lang']) && $this->url['lang']>'') $_GET['lang']=$this->url['lang'];
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['lang'])) $session->set('sr_lang',(array_key_exists(trim($_GET['lang']),$this->acceptLang) ? trim($_GET['lang']) : $this->defLang));
|
if (isset($_GET['lang'])) $session->set('sr_lang',(array_key_exists(trim($_GET['lang']),$this->acceptLang) ? trim($_GET['lang']) : $this->defLang));
|
||||||
if (isset($_GET['product']))
|
if (isset($_GET['product']))
|
||||||
{
|
{
|
||||||
$product=(trim(addslashes($_GET['product']))=='none' ? '' : (int)$_GET['product']);
|
$product=(trim(addslashes($_GET['product']))=='none' ? '' : (int)$_GET['product']);
|
||||||
$tomb=$session->get('sr_show');
|
$tomb=$session->get('sr_show');
|
||||||
if (!is_array($tomb) || !in_array($product,$tomb))
|
if (!is_array($tomb) || !in_array($product,$tomb))
|
||||||
{
|
{
|
||||||
$tomb[]=$product;
|
$tomb[]=$product;
|
||||||
$session->set('sr_show',$tomb);
|
$session->set('sr_show',$tomb);
|
||||||
$model->addShow($product);
|
$model->addShow($product);
|
||||||
}
|
}
|
||||||
$session->set('sr_product',$product);
|
$session->set('sr_product',$product);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['family'])) $session->set('sr_family',(trim(addslashes($_GET['family']))=='none' ? '' : trim(addslashes($_GET['family']))));
|
if (isset($_GET['family'])) $session->set('sr_family',(trim(addslashes($_GET['family']))=='none' ? '' : trim(addslashes($_GET['family']))));
|
||||||
if (isset($_GET['template']) && trim(addslashes($_GET['template']))=='blankframe') $session->set('sr_template','blankframe');
|
if (isset($_GET['template']) && trim(addslashes($_GET['template']))=='blankframe') $session->set('sr_template','blankframe');
|
||||||
if (isset($_GET['ver'])) $session->set('sr_ver',(int)$_GET['ver']);
|
if (isset($_GET['ver'])) $session->set('sr_ver',(int)$_GET['ver']);
|
||||||
if (isset($_GET['multi'])) $session->set('sr_multi', ($_GET['multi']=='true' ? 'true' : 'false'));
|
if (isset($_GET['multi'])) $session->set('sr_multi', ($_GET['multi']=='true' ? 'true' : 'false'));
|
||||||
|
|
||||||
if (!$session->get('sr_lang')) $session->set('sr_lang',$this->defLang);
|
if (!$session->get('sr_lang')) $session->set('sr_lang',$this->defLang);
|
||||||
|
|
||||||
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
||||||
|
|
||||||
$session->set('sr_family',$model->getFamilyID($session->get('sr_product')));
|
$session->set('sr_family',$model->getFamilyID($session->get('sr_product')));
|
||||||
|
|
||||||
$this->getSession();
|
$this->getSession();
|
||||||
$this->article=$model->getArticle();
|
$this->article=$model->getArticle();
|
||||||
$this->families=$model->getFamilies($this->sess['sr_product']);
|
$this->families=$model->getFamilies($this->sess['sr_product']);
|
||||||
$this->family=$model->getFamily(((int)$this->sess["sr_family"]>0 ? $this->sess['sr_family'] : 0));
|
$this->family=$model->getFamily(((int)$this->sess["sr_family"]>0 ? $this->sess['sr_family'] : 0));
|
||||||
$this->products=$model->getProducts($this->sess['sr_family'],$session->get('sr_lang'));
|
$this->products=$model->getProducts($this->sess['sr_family'],$session->get('sr_lang'));
|
||||||
$this->product=$model->getProduct($this->sess['sr_product'],$session->get('sr_lang'));
|
$this->product=$model->getProduct($this->sess['sr_product'],$session->get('sr_lang'));
|
||||||
$this->querystring=($this->sess['sr_template']>'' ? '&template='.$this->sess['sr_template'] : '').($this->sess['sr_ver']>'' ? '&ver='.$this->sess['sr_ver'] : '').'&lang='.$this->sess['sr_lang'];
|
$this->querystring=($this->sess['sr_template']>'' ? '&template='.$this->sess['sr_template'] : '').($this->sess['sr_ver']>'' ? '&ver='.$this->sess['sr_ver'] : '').'&lang='.$this->sess['sr_lang'];
|
||||||
$this->productThumb=$model->getProductThumb();
|
$this->productThumb=$model->getProductThumb();
|
||||||
foreach ($this->products as $product) { $this->files[$product->id]=$model->getFiles($product->id); }
|
foreach ($this->products as $product) { $this->files[$product->id]=$model->getFiles($product->id); }
|
||||||
|
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option=com_showroom&view=showroom&type=none&manufacture=none&family=none'.$this->querystring);
|
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option=com_showroom&view=showroom&type=none&manufacture=none&family=none'.$this->querystring);
|
||||||
if ((int)$this->families[0]->m_id>0) $app->getPathway()->addItem($this->families[0]->manufacture, '/index.php?option=com_showroom&view=showroom&family=none'.($this->sess["sr_type"]>'' ? '&type='.$this->sess["sr_type"] : '').((int)$this->family->m_id>0 ? '&manufacture='.(int)$this->family->m_id : '').$this->querystring);
|
if ((int)$this->families[0]->m_id>0) $app->getPathway()->addItem($this->families[0]->manufacture, '/index.php?option=com_showroom&view=showroom&family=none'.($this->sess["sr_type"]>'' ? '&type='.$this->sess["sr_type"] : '').((int)$this->family->m_id>0 ? '&manufacture='.(int)$this->family->m_id : '').$this->querystring);
|
||||||
if ((int)$this->family->m_id>0) $app->getPathway()->addItem($this->family->name, '/index.php?option=com_showroom&view=family&family='.(int)$this->family->c_id.($this->sess["sr_type"]>'' ? '&type='.$this->sess["sr_type"] : '').((int)$this->family->m_id>0 ? '&manufacture='.(int)$this->family->m_id : '').$this->querystring);
|
if ((int)$this->family->m_id>0) $app->getPathway()->addItem($this->family->name, '/index.php?option=com_showroom&view=family&family='.(int)$this->family->c_id.($this->sess["sr_type"]>'' ? '&type='.$this->sess["sr_type"] : '').((int)$this->family->m_id>0 ? '&manufacture='.(int)$this->family->m_id : '').$this->querystring);
|
||||||
if ((int)$this->product->id>0) $app->getPathway()->addItem($this->product->title);
|
if ((int)$this->product->id>0) $app->getPathway()->addItem($this->product->title);
|
||||||
|
|
||||||
$document->setTitle($this->product->title.' | '.$this->product->c_name.' | '.$this->product->m_name.' | '.JText::_(COM_SHOWROOM_SHOWROOM).' | ARCHLine.XP');
|
$document->setTitle($this->product->title.' | '.$this->product->c_name.' | '.$this->product->m_name.' | '.JText::_(COM_SHOWROOM_SHOWROOM).' | ARCHLine.XP');
|
||||||
$document->setDescription(substr(strip_tags(str_replace(array("\n","\r"), " ", ($this->product->desc))), 0, 160) );
|
$document->setDescription(substr(strip_tags(str_replace(array("\n","\r"), " ", ($this->product->desc))), 0, 160) );
|
||||||
/*
|
/*
|
||||||
$document->addCustomTag('<meta property="og:title" content="'.$this->escape($this->product->title).'"/>
|
$document->addCustomTag('<meta property="og:title" content="'.$this->escape($this->product->title).'"/>
|
||||||
<meta property="og:url" content="'.JFactory::getURI()->toString().'"/>
|
<meta property="og:url" content="'.JFactory::getURI()->toString().'"/>
|
||||||
<meta property="og:image" content="'.trim(JURI::base(),'/').'/'.trim($this->product->img,'/').'"/>
|
<meta property="og:image" content="'.trim(JURI::base(),'/').'/'.trim($this->product->img,'/').'"/>
|
||||||
<meta property="og:site_name" content="'.JURI::base().'"/>
|
<meta property="og:site_name" content="'.JURI::base().'"/>
|
||||||
<meta property="og:description" content="'.$this->escape(substr(strip_tags(str_replace(array("\n","\r"), " ", ($this->product->desc))),0,160) ).'"/>');
|
<meta property="og:description" content="'.$this->escape(substr(strip_tags(str_replace(array("\n","\r"), " ", ($this->product->desc))),0,160) ).'"/>');
|
||||||
*/
|
*/
|
||||||
if (isset($_GET['desc'])) { print($this->product->desc); die(); }
|
if (isset($_GET['desc'])) { print($this->product->desc); die(); }
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDownloadLink($obj)
|
public function getDownloadLink($obj)
|
||||||
{
|
{
|
||||||
$ret="";
|
$ret="";
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
$fajlok=@scandir($model->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
$fajlok=@scandir($model->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
||||||
|
|
||||||
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
||||||
|
|
||||||
if(!isset($fajlok[2])) { $f=""; }
|
if(!isset($fajlok[2])) { $f=""; }
|
||||||
elseif(count($fajlok)>3) { $f=(trim($obj->file)>'' ? $obj->file : $fajlok[2]); }
|
elseif(count($fajlok)>3) { $f=(trim($obj->file)>'' ? $obj->file : $fajlok[2]); }
|
||||||
else { $f=$fajlok[2]; }
|
else { $f=$fajlok[2]; }
|
||||||
|
|
||||||
if ($f>"")
|
if ($f>"")
|
||||||
{
|
{
|
||||||
$ret=$model->getProductDir()."/".$obj->dir."/".$obj->id."/".$f."?download=1&type=".$obj->type_download.
|
$ret=$model->getProductDir()."/".$obj->dir."/".$obj->id."/".$f."?download=1&type=".$obj->type_download.
|
||||||
"&bigimage=".base64_encode($model->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
"&bigimage=".base64_encode($model->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
||||||
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
||||||
"&objectname=".base64_encode($obj->title).
|
"&objectname=".base64_encode($obj->title).
|
||||||
($this->sess['sr_ver']>=32 ? '&multi='.($this->sess['sr_multi']>'' ? $this->sess['sr_multi'] : 'false') : '');
|
($this->sess['sr_ver']>=32 ? '&multi='.($this->sess['sr_multi']>'' ? $this->sess['sr_multi'] : 'false') : '');
|
||||||
|
|
||||||
if ((int)$this->sess['sr_ver']>=33)
|
if ((int)$this->sess['sr_ver']>=33)
|
||||||
{
|
{
|
||||||
$struct=$model->getStruct($obj->id);
|
$struct=$model->getStruct($obj->id);
|
||||||
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
||||||
{
|
{
|
||||||
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSession()
|
public function getSession()
|
||||||
{
|
{
|
||||||
$this->sess['sr_template']=JFactory::getSession()->get('sr_template');
|
$this->sess['sr_template']=JFactory::getSession()->get('sr_template');
|
||||||
$this->sess['sr_type']=JFactory::getSession()->get('sr_type');
|
$this->sess['sr_type']=JFactory::getSession()->get('sr_type');
|
||||||
$this->sess['sr_manufacture']=JFactory::getSession()->get('sr_manufacture');
|
$this->sess['sr_manufacture']=JFactory::getSession()->get('sr_manufacture');
|
||||||
$this->sess['sr_family']=JFactory::getSession()->get('sr_family');
|
$this->sess['sr_family']=JFactory::getSession()->get('sr_family');
|
||||||
$this->sess['sr_product']=JFactory::getSession()->get('sr_product');
|
$this->sess['sr_product']=JFactory::getSession()->get('sr_product');
|
||||||
$this->sess['sr_search']=JFactory::getSession()->get('sr_search');
|
$this->sess['sr_search']=JFactory::getSession()->get('sr_search');
|
||||||
$this->sess['sr_page']=JFactory::getSession()->get('sr_page');
|
$this->sess['sr_page']=JFactory::getSession()->get('sr_page');
|
||||||
$this->sess['sr_filter_type']=JFactory::getSession()->get('sr_filter_type');
|
$this->sess['sr_filter_type']=JFactory::getSession()->get('sr_filter_type');
|
||||||
$this->sess['sr_filter']=JFactory::getSession()->get('sr_filter');
|
$this->sess['sr_filter']=JFactory::getSession()->get('sr_filter');
|
||||||
$this->sess['sr_lang']=JFactory::getSession()->get('sr_lang');
|
$this->sess['sr_lang']=JFactory::getSession()->get('sr_lang');
|
||||||
$this->sess['sr_ver']=JFactory::getSession()->get('sr_ver');
|
$this->sess['sr_ver']=JFactory::getSession()->get('sr_ver');
|
||||||
$this->sess['sr_multi']=JFactory::getSession()->get('sr_multi');
|
$this->sess['sr_multi']=JFactory::getSession()->get('sr_multi');
|
||||||
$this->sess['sr_multiselect']=JFactory::getSession()->get('sr_multiselect');
|
$this->sess['sr_multiselect']=JFactory::getSession()->get('sr_multiselect');
|
||||||
$this->sess['sr_show']=JFactory::getSession()->get('sr_show');
|
$this->sess['sr_show']=JFactory::getSession()->get('sr_show');
|
||||||
$this->sess['sr_down']=JFactory::getSession()->get('sr_down');
|
$this->sess['sr_down']=JFactory::getSession()->get('sr_down');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,124 +1,124 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
defined('_JEXEC') or die; // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
jimport('joomla.session.session');
|
jimport('joomla.session.session');
|
||||||
|
|
||||||
class ShowroomViewSearch extends JViewLegacy
|
class ShowroomViewSearch extends JViewLegacy
|
||||||
{
|
{
|
||||||
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
||||||
protected $defLang='eng';
|
protected $defLang='eng';
|
||||||
protected $types;
|
protected $types;
|
||||||
protected $brands;
|
protected $brands;
|
||||||
protected $categories;
|
protected $categories;
|
||||||
protected $subcategories;
|
protected $subcategories;
|
||||||
|
|
||||||
public $sess=array();
|
public $sess=array();
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$app=&JFactory::getApplication();
|
$app=&JFactory::getApplication();
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
$document=&JFactory::getDocument();
|
$document=&JFactory::getDocument();
|
||||||
$document->addStyleSheet('/components/'.$app->input->get('option').'/assets/css/showroom.css');
|
$document->addStyleSheet('/components/'.$app->input->get('option').'/assets/css/showroom.css');
|
||||||
|
|
||||||
if (isset($_GET['lang'])) $session->set('sr_lang',(array_key_exists(trim($_GET['lang']),$this->acceptLang) ? trim($_GET['lang']) : $this->defLang) );
|
if (isset($_GET['lang'])) $session->set('sr_lang',(array_key_exists(trim($_GET['lang']),$this->acceptLang) ? trim($_GET['lang']) : $this->defLang) );
|
||||||
|
|
||||||
if (isset($_POST['showroom_keyword']))
|
if (isset($_POST['showroom_keyword']))
|
||||||
{
|
{
|
||||||
$multiselect=array('type'=>$_POST['type'],'brand'=>$_POST['brand'],'category'=>$_POST['category'],'subcategory'=>$_POST['subcategory']);
|
$multiselect=array('type'=>$_POST['type'],'brand'=>$_POST['brand'],'category'=>$_POST['category'],'subcategory'=>$_POST['subcategory']);
|
||||||
|
|
||||||
$session->set('sr_search',$_POST['showroom_keyword']);
|
$session->set('sr_search',$_POST['showroom_keyword']);
|
||||||
$session->set('sr_multiselect',$multiselect);
|
$session->set('sr_multiselect',$multiselect);
|
||||||
$session->set('sr_page',1);
|
$session->set('sr_page',1);
|
||||||
}
|
}
|
||||||
if (isset($_GET['page']) && (int)$_GET['page']>0) $session->set('sr_page',(int)$_GET['page']);
|
if (isset($_GET['page']) && (int)$_GET['page']>0) $session->set('sr_page',(int)$_GET['page']);
|
||||||
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
||||||
if (isset($_GET['ver'])) $session->set('sr_ver',(int)$_GET['ver']);
|
if (isset($_GET['ver'])) $session->set('sr_ver',(int)$_GET['ver']);
|
||||||
if (isset($_GET['multi'])) $session->set('sr_multi', ($_GET['multi']=='true' ? 'true' : 'false'));
|
if (isset($_GET['multi'])) $session->set('sr_multi', ($_GET['multi']=='true' ? 'true' : 'false'));
|
||||||
if (!$session->get('sr_lang')) $session->set('sr_lang',$this->defLang);
|
if (!$session->get('sr_lang')) $session->set('sr_lang',$this->defLang);
|
||||||
|
|
||||||
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
||||||
|
|
||||||
$this->getSession();
|
$this->getSession();
|
||||||
$this->article=$model->getArticle();
|
$this->article=$model->getArticle();
|
||||||
$this->products=$model->getResult($this->sess['sr_search'],$this->sess['sr_multiselect'],$this->sess['sr_page']);
|
$this->products=$model->getResult($this->sess['sr_search'],$this->sess['sr_multiselect'],$this->sess['sr_page']);
|
||||||
$this->all=$model->getAll();
|
$this->all=$model->getAll();
|
||||||
$this->ipp=$model->getIPP();
|
$this->ipp=$model->getIPP();
|
||||||
$this->page=$model->getPage();
|
$this->page=$model->getPage();
|
||||||
$this->last=$model->getLast();
|
$this->last=$model->getLast();
|
||||||
$this->first=$model->getFirst();
|
$this->first=$model->getFirst();
|
||||||
$this->pager=$model->getPager();
|
$this->pager=$model->getPager();
|
||||||
$this->placeholder=$this->sess['sr_search'];
|
$this->placeholder=$this->sess['sr_search'];
|
||||||
$this->visibleLast=$model->getVisibleLast();
|
$this->visibleLast=$model->getVisibleLast();
|
||||||
$this->visibleFirst=$model->getVisibleFirst();
|
$this->visibleFirst=$model->getVisibleFirst();
|
||||||
$this->querystring=($this->sess['sr_template']>'' ? '&template='.$this->sess['sr_template'] : '').($this->sess['sr_ver']>'' ? '&ver='.$this->sess['sr_ver'] : '').'&lang='.$this->sess['sr_lang'];
|
$this->querystring=($this->sess['sr_template']>'' ? '&template='.$this->sess['sr_template'] : '').($this->sess['sr_ver']>'' ? '&ver='.$this->sess['sr_ver'] : '').'&lang='.$this->sess['sr_lang'];
|
||||||
$this->productThumb=$model->getProductThumb();
|
$this->productThumb=$model->getProductThumb();
|
||||||
$this->types=$model->getTypes();
|
$this->types=$model->getTypes();
|
||||||
$this->brands=$model->getBrands($this->sess['sr_multiselect']['type']);
|
$this->brands=$model->getBrands($this->sess['sr_multiselect']['type']);
|
||||||
$this->categories=$model->getCategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand']);
|
$this->categories=$model->getCategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand']);
|
||||||
$this->subcategories=$model->getSubcategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand'],$this->sess['sr_multiselect']['category']);
|
$this->subcategories=$model->getSubcategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand'],$this->sess['sr_multiselect']['category']);
|
||||||
foreach ($this->products as $product) { $this->files[$product->id]=$model->getFiles($product->id); }
|
foreach ($this->products as $product) { $this->files[$product->id]=$model->getFiles($product->id); }
|
||||||
|
|
||||||
|
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option='.$app->input->get('option').'&view=showroom&type=none&manufacture=none&family=none'.$this->querystring);
|
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option='.$app->input->get('option').'&view=showroom&type=none&manufacture=none&family=none'.$this->querystring);
|
||||||
$app->getPathway()->addItem( ($this->sess['sr_search']>'' ? ($this->placeholder>'' ? $this->placeholder.": " : "").$this->sess['sr_search'] : JText::_(COM_SHOWROOM_SEARCH)));
|
$app->getPathway()->addItem( ($this->sess['sr_search']>'' ? ($this->placeholder>'' ? $this->placeholder.": " : "").$this->sess['sr_search'] : JText::_(COM_SHOWROOM_SEARCH)));
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDownloadLink($obj)
|
public function getDownloadLink($obj)
|
||||||
{
|
{
|
||||||
$ret="";
|
$ret="";
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
$fajlok=@scandir($model->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
$fajlok=@scandir($model->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
||||||
|
|
||||||
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
||||||
|
|
||||||
if(!isset($fajlok[2])) { $f=""; }
|
if(!isset($fajlok[2])) { $f=""; }
|
||||||
elseif(count($fajlok)>3) { $f=(trim($obj->file)>'' ? $obj->file : $fajlok[2]); }
|
elseif(count($fajlok)>3) { $f=(trim($obj->file)>'' ? $obj->file : $fajlok[2]); }
|
||||||
else { $f=$fajlok[2]; }
|
else { $f=$fajlok[2]; }
|
||||||
|
|
||||||
if ($f>"")
|
if ($f>"")
|
||||||
{
|
{
|
||||||
$ret=$model->getProductDir()."/".$obj->dir."/".$obj->id."/".$f."?download=1&type=".$obj->type_download.
|
$ret=$model->getProductDir()."/".$obj->dir."/".$obj->id."/".$f."?download=1&type=".$obj->type_download.
|
||||||
"&bigimage=".base64_encode($model->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
"&bigimage=".base64_encode($model->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
||||||
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
||||||
"&objectname=".base64_encode($obj->title).
|
"&objectname=".base64_encode($obj->title).
|
||||||
($this->sess['sr_ver']>=32 ? '&multi='.($this->sess['sr_multi']>'' ? $this->sess['sr_multi'] : 'false') : '');
|
($this->sess['sr_ver']>=32 ? '&multi='.($this->sess['sr_multi']>'' ? $this->sess['sr_multi'] : 'false') : '');
|
||||||
|
|
||||||
if ((int)$this->sess['sr_ver']>=33)
|
if ((int)$this->sess['sr_ver']>=33)
|
||||||
{
|
{
|
||||||
$struct=$model->getStruct($obj->id);
|
$struct=$model->getStruct($obj->id);
|
||||||
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
||||||
{
|
{
|
||||||
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSession()
|
public function getSession()
|
||||||
{
|
{
|
||||||
$this->sess['sr_template']=JFactory::getSession()->get('sr_template');
|
$this->sess['sr_template']=JFactory::getSession()->get('sr_template');
|
||||||
$this->sess['sr_type']=JFactory::getSession()->get('sr_type');
|
$this->sess['sr_type']=JFactory::getSession()->get('sr_type');
|
||||||
$this->sess['sr_manufacture']=JFactory::getSession()->get('sr_manufacture');
|
$this->sess['sr_manufacture']=JFactory::getSession()->get('sr_manufacture');
|
||||||
$this->sess['sr_family']=JFactory::getSession()->get('sr_family');
|
$this->sess['sr_family']=JFactory::getSession()->get('sr_family');
|
||||||
$this->sess['sr_product']=JFactory::getSession()->get('sr_product');
|
$this->sess['sr_product']=JFactory::getSession()->get('sr_product');
|
||||||
$this->sess['sr_search']=JFactory::getSession()->get('sr_search');
|
$this->sess['sr_search']=JFactory::getSession()->get('sr_search');
|
||||||
$this->sess['sr_page']=JFactory::getSession()->get('sr_page');
|
$this->sess['sr_page']=JFactory::getSession()->get('sr_page');
|
||||||
$this->sess['sr_filter_type']=JFactory::getSession()->get('sr_filter_type');
|
$this->sess['sr_filter_type']=JFactory::getSession()->get('sr_filter_type');
|
||||||
$this->sess['sr_filter']=JFactory::getSession()->get('sr_filter');
|
$this->sess['sr_filter']=JFactory::getSession()->get('sr_filter');
|
||||||
$this->sess['sr_lang']=JFactory::getSession()->get('sr_lang');
|
$this->sess['sr_lang']=JFactory::getSession()->get('sr_lang');
|
||||||
$this->sess['sr_ver']=JFactory::getSession()->get('sr_ver');
|
$this->sess['sr_ver']=JFactory::getSession()->get('sr_ver');
|
||||||
$this->sess['sr_multi']=JFactory::getSession()->get('sr_multi');
|
$this->sess['sr_multi']=JFactory::getSession()->get('sr_multi');
|
||||||
$this->sess['sr_multiselect']=JFactory::getSession()->get('sr_multiselect');
|
$this->sess['sr_multiselect']=JFactory::getSession()->get('sr_multiselect');
|
||||||
$this->sess['sr_show']=JFactory::getSession()->get('sr_show');
|
$this->sess['sr_show']=JFactory::getSession()->get('sr_show');
|
||||||
$this->sess['sr_down']=JFactory::getSession()->get('sr_down');
|
$this->sess['sr_down']=JFactory::getSession()->get('sr_down');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,106 +1,106 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
defined('_JEXEC') or die; // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
jimport('joomla.session.session');
|
jimport('joomla.session.session');
|
||||||
|
|
||||||
class ShowroomViewSearch2 extends JViewLegacy
|
class ShowroomViewSearch2 extends JViewLegacy
|
||||||
{
|
{
|
||||||
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
||||||
protected $defLang='eng';
|
protected $defLang='eng';
|
||||||
protected $types;
|
protected $types;
|
||||||
protected $brands;
|
protected $brands;
|
||||||
protected $categories;
|
protected $categories;
|
||||||
protected $subcategories;
|
protected $subcategories;
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$app=&JFactory::getApplication();
|
$app=&JFactory::getApplication();
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
$document=&JFactory::getDocument();
|
$document=&JFactory::getDocument();
|
||||||
$document->addStyleSheet('/components/'.$app->input->get('option').'/assets/css/showroom.css');
|
$document->addStyleSheet('/components/'.$app->input->get('option').'/assets/css/showroom.css');
|
||||||
|
|
||||||
if (isset($_GET['lang'])) $session->set('sr_lang',(array_key_exists(trim($_GET['lang']),$this->acceptLang) ? trim($_GET['lang']) : $this->defLang) );
|
if (isset($_GET['lang'])) $session->set('sr_lang',(array_key_exists(trim($_GET['lang']),$this->acceptLang) ? trim($_GET['lang']) : $this->defLang) );
|
||||||
|
|
||||||
if (isset($_POST['showroom_keyword']))
|
if (isset($_POST['showroom_keyword']))
|
||||||
{
|
{
|
||||||
$multiselect=array('type'=>$_POST['type'],'brand'=>$_POST['brand'],'category'=>$_POST['category'],'subcategory'=>$_POST['subcategory']);
|
$multiselect=array('type'=>$_POST['type'],'brand'=>$_POST['brand'],'category'=>$_POST['category'],'subcategory'=>$_POST['subcategory']);
|
||||||
|
|
||||||
$session->set('sr_search',$_POST['showroom_keyword']);
|
$session->set('sr_search',$_POST['showroom_keyword']);
|
||||||
$session->set('sr_multiselect',$multiselect);
|
$session->set('sr_multiselect',$multiselect);
|
||||||
$session->set('sr_page',1);
|
$session->set('sr_page',1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//print_r($_POST);
|
//print_r($_POST);
|
||||||
//print_r($_SESSION['__default']['sr_multiselect']);
|
//print_r($_SESSION['__default']['sr_multiselect']);
|
||||||
|
|
||||||
if (isset($_GET['page']) && (int)$_GET['page']>0) $session->set('sr_page',(int)$_GET['page']);
|
if (isset($_GET['page']) && (int)$_GET['page']>0) $session->set('sr_page',(int)$_GET['page']);
|
||||||
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
||||||
if (isset($_GET['ver'])) $session->set('sr_ver',(int)$_GET['ver']);
|
if (isset($_GET['ver'])) $session->set('sr_ver',(int)$_GET['ver']);
|
||||||
if (isset($_GET['multi'])) $session->set('sr_multi', ($_GET['multi']=='true' ? 'true' : 'false'));
|
if (isset($_GET['multi'])) $session->set('sr_multi', ($_GET['multi']=='true' ? 'true' : 'false'));
|
||||||
|
|
||||||
if (!isset($_SESSION['__default']['sr_lang'])) $session->set('sr_lang',$this->defLang);
|
if (!isset($_SESSION['__default']['sr_lang'])) $session->set('sr_lang',$this->defLang);
|
||||||
|
|
||||||
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
||||||
|
|
||||||
$this->sess=$_SESSION['__default'];
|
$this->sess=$_SESSION['__default'];
|
||||||
$this->article=$model->getArticle();
|
$this->article=$model->getArticle();
|
||||||
$this->products=$model->getResult($this->sess['sr_search'],$this->sess['sr_multiselect'],$this->sess['sr_page']);
|
$this->products=$model->getResult($this->sess['sr_search'],$this->sess['sr_multiselect'],$this->sess['sr_page']);
|
||||||
$this->all=$model->getAll();
|
$this->all=$model->getAll();
|
||||||
$this->ipp=$model->getIPP();
|
$this->ipp=$model->getIPP();
|
||||||
$this->page=$model->getPage();
|
$this->page=$model->getPage();
|
||||||
$this->last=$model->getLast();
|
$this->last=$model->getLast();
|
||||||
$this->first=$model->getFirst();
|
$this->first=$model->getFirst();
|
||||||
$this->pager=$model->getPager();
|
$this->pager=$model->getPager();
|
||||||
$this->placeholder=$session->get('sr_search'); //$model->getPlaceholder();
|
$this->placeholder=$session->get('sr_search'); //$model->getPlaceholder();
|
||||||
$this->visibleLast=$model->getVisibleLast();
|
$this->visibleLast=$model->getVisibleLast();
|
||||||
$this->visibleFirst=$model->getVisibleFirst();
|
$this->visibleFirst=$model->getVisibleFirst();
|
||||||
$this->querystring=($session->get('sr_template')>'' ? '&template='.$session->get('sr_template') : '').($session->get('sr_ver')>'' ? '&ver='.$session->get('sr_ver') : '').'&lang='.$session->get('sr_lang');
|
$this->querystring=($session->get('sr_template')>'' ? '&template='.$session->get('sr_template') : '').($session->get('sr_ver')>'' ? '&ver='.$session->get('sr_ver') : '').'&lang='.$session->get('sr_lang');
|
||||||
$this->productThumb=$model->getProductThumb();
|
$this->productThumb=$model->getProductThumb();
|
||||||
$this->types=$model->getTypes();
|
$this->types=$model->getTypes();
|
||||||
$this->brands=$model->getBrands($this->sess['sr_multiselect']['type']);
|
$this->brands=$model->getBrands($this->sess['sr_multiselect']['type']);
|
||||||
$this->categories=$model->getCategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand']);
|
$this->categories=$model->getCategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand']);
|
||||||
$this->subcategories=$model->getSubcategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand'],$this->sess['sr_multiselect']['category']);
|
$this->subcategories=$model->getSubcategories($this->sess['sr_multiselect']['type'],$this->sess['sr_multiselect']['brand'],$this->sess['sr_multiselect']['category']);
|
||||||
|
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option='.$app->input->get('option').'&view=showroom&type=none&manufacture=none&family=none'.$this->querystring);
|
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option='.$app->input->get('option').'&view=showroom&type=none&manufacture=none&family=none'.$this->querystring);
|
||||||
$app->getPathway()->addItem( ($this->sess['sr_search']>'' ? ($this->placeholder>'' ? $this->placeholder.": " : "").$this->sess['sr_search'] : JText::_(COM_SHOWROOM_SEARCH)));
|
$app->getPathway()->addItem( ($this->sess['sr_search']>'' ? ($this->placeholder>'' ? $this->placeholder.": " : "").$this->sess['sr_search'] : JText::_(COM_SHOWROOM_SEARCH)));
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDownloadLink($obj)
|
public function getDownloadLink($obj)
|
||||||
{
|
{
|
||||||
$ret="";
|
$ret="";
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
$fajlok=@scandir($model->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
$fajlok=@scandir($model->getProductDir().'/'.$obj->dir.'/'.$obj->id);
|
||||||
|
|
||||||
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
if ($obj->prver=="2013" && $obj->tipus=="object") { $obj->type_download="accessory"; }
|
||||||
|
|
||||||
if(!isset($fajlok[2])) { $f=""; }
|
if(!isset($fajlok[2])) { $f=""; }
|
||||||
elseif(count($fajlok)>3) { $f=(trim($obj->file)>'' ? $obj->file : $fajlok[2]); }
|
elseif(count($fajlok)>3) { $f=(trim($obj->file)>'' ? $obj->file : $fajlok[2]); }
|
||||||
else { $f=$fajlok[2]; }
|
else { $f=$fajlok[2]; }
|
||||||
|
|
||||||
if ($f>"")
|
if ($f>"")
|
||||||
{
|
{
|
||||||
$ret=$model->getProductDir()."/".$obj->dir."/".$obj->id."/".$f."?download=1&type=".$obj->type_download.
|
$ret=$model->getProductDir()."/".$obj->dir."/".$obj->id."/".$f."?download=1&type=".$obj->type_download.
|
||||||
"&bigimage=".base64_encode($model->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
"&bigimage=".base64_encode($model->getProductThumb()."/".$obj->dir."/".$obj->id."/zz_big.jpg").
|
||||||
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
"&brandcategory=".base64_encode($obj->m_name.'\\'.$obj->c_name_eng).
|
||||||
"&objectname=".base64_encode($obj->title).
|
"&objectname=".base64_encode($obj->title).
|
||||||
($_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
($_SESSION['__default']['sr_ver']>=32 ? '&multi='.($_SESSION['__default']['sr_multi']>'' ? $_SESSION['__default']['sr_multi'] : 'false') : '');
|
||||||
|
|
||||||
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
if ((int)$_SESSION['__default']['sr_ver']>=33)
|
||||||
{
|
{
|
||||||
$struct=$model->getStruct($obj->id);
|
$struct=$model->getStruct($obj->id);
|
||||||
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
if (trim($struct->category)>"" && trim($struct->subcategory)>"")
|
||||||
{
|
{
|
||||||
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
$ret.="&category=".base64_encode($struct->category)."&subcategory=".base64_encode($struct->subcategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,255 +1,255 @@
|
|||||||
<?php
|
<?php
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Az eredti descriptor file felépítése:
|
Az eredti descriptor file felépítése:
|
||||||
=====================================
|
=====================================
|
||||||
$data["file"] = $adatok[0];
|
$data["file"] = $adatok[0];
|
||||||
$data["eredeti"] = $adatok[1];
|
$data["eredeti"] = $adatok[1];
|
||||||
$data["vendegkep"] = $adatok[2];
|
$data["vendegkep"] = $adatok[2];
|
||||||
$data["kepalap"] = $adatok[3];
|
$data["kepalap"] = $adatok[3];
|
||||||
$data["cim"] = $adatok[4];
|
$data["cim"] = $adatok[4];
|
||||||
$data["cimhun"] = $adatok[5] ? $adatok[5] : $adatok[4];
|
$data["cimhun"] = $adatok[5] ? $adatok[5] : $adatok[4];
|
||||||
$data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6];
|
$data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6];
|
||||||
|
|
||||||
Pl. (valójában sortörés nélkül van):
|
Pl. (valójában sortörés nélkül van):
|
||||||
------------------------------------
|
------------------------------------
|
||||||
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
||||||
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
||||||
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
||||||
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
||||||
Logus_90_Arbore_NA_single (smartshapes(3).oli)#
|
Logus_90_Arbore_NA_single (smartshapes(3).oli)#
|
||||||
#
|
#
|
||||||
2011
|
2011
|
||||||
|
|
||||||
Az új descriptor file felépítése:
|
Az új descriptor file felépítése:
|
||||||
=====================================
|
=====================================
|
||||||
$data["file"]=$adatok[0],
|
$data["file"]=$adatok[0],
|
||||||
$data["vendegkep"]=$adatok[1],
|
$data["vendegkep"]=$adatok[1],
|
||||||
$data["nev_eng"]=$adatok[2],
|
$data["nev_eng"]=$adatok[2],
|
||||||
$data["nev_hun"]=$adatok[3],
|
$data["nev_hun"]=$adatok[3],
|
||||||
$data["tipus"]=$adatok[4],
|
$data["tipus"]=$adatok[4],
|
||||||
$data["kategoria"]=$adatok[5],
|
$data["kategoria"]=$adatok[5],
|
||||||
$data["alkategoria"]=$adatok[6],
|
$data["alkategoria"]=$adatok[6],
|
||||||
$data["gyarto"]=$adatok[7],
|
$data["gyarto"]=$adatok[7],
|
||||||
$data["prver"]=($adatok[8]=="-1" ? "2012" : $adatok[8]),
|
$data["prver"]=($adatok[8]=="-1" ? "2012" : $adatok[8]),
|
||||||
|
|
||||||
Pl. (valójában sortörés nélkül van):
|
Pl. (valójában sortörés nélkül van):
|
||||||
------------------------------------
|
------------------------------------
|
||||||
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
||||||
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
||||||
brown chair#
|
brown chair#
|
||||||
barna szék#
|
barna szék#
|
||||||
material#
|
material#
|
||||||
Wood#
|
Wood#
|
||||||
Oak#
|
Oak#
|
||||||
Marrakesh#
|
Marrakesh#
|
||||||
-1
|
-1
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
defined('_JEXEC') or die; // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
jimport('joomla.application.module.helper');
|
jimport('joomla.application.module.helper');
|
||||||
jimport('joomla.session.session');
|
jimport('joomla.session.session');
|
||||||
|
|
||||||
class ShowroomViewUpload extends JViewLegacy
|
class ShowroomViewUpload extends JViewLegacy
|
||||||
{
|
{
|
||||||
protected $arrAllowedGroups=array(7,8);
|
protected $arrAllowedGroups=array(7,8);
|
||||||
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
||||||
protected $defLang='eng';
|
protected $defLang='eng';
|
||||||
protected $desc=array();
|
protected $desc=array();
|
||||||
protected $data=array();
|
protected $data=array();
|
||||||
protected $selected_type;
|
protected $selected_type;
|
||||||
protected $selected_manufacture;
|
protected $selected_manufacture;
|
||||||
protected $selected_family;
|
protected $selected_family;
|
||||||
protected $selected_category;
|
protected $selected_category;
|
||||||
protected $selected_subcategory;
|
protected $selected_subcategory;
|
||||||
|
|
||||||
public $pf='ProductsController';
|
public $pf='ProductsController';
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$app=&JFactory::getApplication();
|
$app=&JFactory::getApplication();
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$document=&JFactory::getDocument();
|
$document=&JFactory::getDocument();
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
if (isset($_GET['lang']))
|
if (isset($_GET['lang']))
|
||||||
{
|
{
|
||||||
if (array_key_exists(trim($_GET['lang']), $this->acceptLang)) { $session->set('sr_lang',trim($_GET['lang'])); }
|
if (array_key_exists(trim($_GET['lang']), $this->acceptLang)) { $session->set('sr_lang',trim($_GET['lang'])); }
|
||||||
else { $session->set('sr_lang',$this->defLang); }
|
else { $session->set('sr_lang',$this->defLang); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['file'])) $session->set('sr_file',(trim(addslashes($_GET['file']))=='none' ? '' : trim(addslashes($_GET['file']))));
|
if (isset($_GET['file'])) $session->set('sr_file',(trim(addslashes($_GET['file']))=='none' ? '' : trim(addslashes($_GET['file']))));
|
||||||
if (isset($_GET['type'])) $session->set('sr_type',(trim(addslashes($_GET['type']))=='none' ? '' : trim(addslashes($_GET['type']))));
|
if (isset($_GET['type'])) $session->set('sr_type',(trim(addslashes($_GET['type']))=='none' ? '' : trim(addslashes($_GET['type']))));
|
||||||
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
||||||
if (!isset($_SESSION['__default']['sr_lang'])) $session->set('sr_lang',$this->defLang);
|
if (!isset($_SESSION['__default']['sr_lang'])) $session->set('sr_lang',$this->defLang);
|
||||||
|
|
||||||
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
||||||
|
|
||||||
$this->sess=$_SESSION['__default'];
|
$this->sess=$_SESSION['__default'];
|
||||||
$this->types=$this->get('Types');
|
$this->types=$this->get('Types');
|
||||||
$this->manufactures=$model->getManufactures($this->sess['sr_type']);
|
$this->manufactures=$model->getManufactures($this->sess['sr_type']);
|
||||||
$this->families=$model->getFamilies($this->sess['sr_type'],$this->sess['sr_manufacture']);
|
$this->families=$model->getFamilies($this->sess['sr_type'],$this->sess['sr_manufacture']);
|
||||||
$this->family=$model->getFamily(((int)$this->sess["sr_family"]>0 ? $this->sess['sr_family'] : 0));
|
$this->family=$model->getFamily(((int)$this->sess["sr_family"]>0 ? $this->sess['sr_family'] : 0));
|
||||||
$this->querystring='&lang='.$session->get('sr_lang')
|
$this->querystring='&lang='.$session->get('sr_lang')
|
||||||
.($session->get('sr_template')>'' ? '&template='.$session->get('sr_template') : '')
|
.($session->get('sr_template')>'' ? '&template='.$session->get('sr_template') : '')
|
||||||
.($session->get('sr_file')>'' ? '&file='.$session->get('sr_file') : '')
|
.($session->get('sr_file')>'' ? '&file='.$session->get('sr_file') : '')
|
||||||
.($session->get('sr_type')>'' ? '&type='.$session->get('sr_type') : '');
|
.($session->get('sr_type')>'' ? '&type='.$session->get('sr_type') : '');
|
||||||
|
|
||||||
if ($session->get('sr_file')>"") {
|
if ($session->get('sr_file')>"") {
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$descriptor = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$session->get('sr_file');
|
$descriptor = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$session->get('sr_file');
|
||||||
} else {
|
} else {
|
||||||
$descriptor = '/home/vendeg/'.$session->get('sr_file');
|
$descriptor = '/home/vendeg/'.$session->get('sr_file');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_file($descriptor))
|
if (is_file($descriptor))
|
||||||
{
|
{
|
||||||
$this->desc=explode("#",file_get_contents($descriptor));
|
$this->desc=explode("#",file_get_contents($descriptor));
|
||||||
|
|
||||||
if (is_array($this->desc) && count($this->desc)) { foreach ($this->desc as $k=>$v) $this->desc[$k]=trim($v); }
|
if (is_array($this->desc) && count($this->desc)) { foreach ($this->desc as $k=>$v) $this->desc[$k]=trim($v); }
|
||||||
|
|
||||||
if ($this->desc[0]==$this->desc[1]) // regi struktura
|
if ($this->desc[0]==$this->desc[1]) // regi struktura
|
||||||
{
|
{
|
||||||
$this->data=array(
|
$this->data=array(
|
||||||
"file"=>$this->desc[0],
|
"file"=>$this->desc[0],
|
||||||
"vendegkep"=>$this->desc[2],
|
"vendegkep"=>$this->desc[2],
|
||||||
"nev_eng"=>$this->desc[4],
|
"nev_eng"=>$this->desc[4],
|
||||||
"nev_hun"=>($this->desc[5] ? $this->desc[5] : $this->desc[4]),
|
"nev_hun"=>($this->desc[5] ? $this->desc[5] : $this->desc[4]),
|
||||||
"tipus"=>$this->sess['sr_type'],
|
"tipus"=>$this->sess['sr_type'],
|
||||||
"kategoria"=>"",
|
"kategoria"=>"",
|
||||||
"alkategoria"=>"",
|
"alkategoria"=>"",
|
||||||
"gyarto"=>"",
|
"gyarto"=>"",
|
||||||
"prver"=>($this->desc[6]=="-1" ? "2012" : $this->desc[6]),
|
"prver"=>($this->desc[6]=="-1" ? "2012" : $this->desc[6]),
|
||||||
"ifc"=>false
|
"ifc"=>false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else // uj struktura
|
else // uj struktura
|
||||||
{
|
{
|
||||||
$this->data=array(
|
$this->data=array(
|
||||||
"file"=>$this->desc[0],
|
"file"=>$this->desc[0],
|
||||||
"vendegkep"=>$this->desc[1],
|
"vendegkep"=>$this->desc[1],
|
||||||
"nev_eng"=>$this->desc[2],
|
"nev_eng"=>$this->desc[2],
|
||||||
"nev_hun"=>$this->desc[3],
|
"nev_hun"=>$this->desc[3],
|
||||||
"tipus"=>$this->desc[4],
|
"tipus"=>$this->desc[4],
|
||||||
"kategoria"=>$this->desc[5],
|
"kategoria"=>$this->desc[5],
|
||||||
"alkategoria"=>$this->desc[6],
|
"alkategoria"=>$this->desc[6],
|
||||||
"gyarto"=>$this->desc[7],
|
"gyarto"=>$this->desc[7],
|
||||||
"prver"=>($this->desc[8]=="-1" ? "2012" : $this->desc[8]),
|
"prver"=>($this->desc[8]=="-1" ? "2012" : $this->desc[8]),
|
||||||
"ifc"=>(substr($this->desc[0],-4)==".ifc"?TRUE:FALSE)
|
"ifc"=>(substr($this->desc[0],-4)==".ifc"?TRUE:FALSE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->data['gyarto']>"") { $manufacure=$model->getManufactureByName($this->data['gyarto']); }
|
if ($this->data['gyarto']>"") { $manufacure=$model->getManufactureByName($this->data['gyarto']); }
|
||||||
if ($this->data['kategoria']>"") { $kategoria=$model->getParentByName($this->data['tipus'],$this->data['kategoria']); }
|
if ($this->data['kategoria']>"") { $kategoria=$model->getParentByName($this->data['tipus'],$this->data['kategoria']); }
|
||||||
if ($this->data['alkategoria']>"" && $kategoria->id>0) { $alkategoria=$model->getSubcatByName($this->data['tipus'],$kategoria->id,$this->data['alkategoria']); }
|
if ($this->data['alkategoria']>"" && $kategoria->id>0) { $alkategoria=$model->getSubcatByName($this->data['tipus'],$kategoria->id,$this->data['alkategoria']); }
|
||||||
|
|
||||||
$this->selected_type=$this->data['tipus'];
|
$this->selected_type=$this->data['tipus'];
|
||||||
$this->selected_manufacture=((int)$manufacure->id>0 ? (int)$manufacure->id : 0);
|
$this->selected_manufacture=((int)$manufacure->id>0 ? (int)$manufacure->id : 0);
|
||||||
$this->selected_family=$this->sess['sr_family'];
|
$this->selected_family=$this->sess['sr_family'];
|
||||||
$this->selected_category=((int)$kategoria->id>0 ? (int)$kategoria->id : 0);
|
$this->selected_category=((int)$kategoria->id>0 ? (int)$kategoria->id : 0);
|
||||||
$this->selected_subcategory=((int)$alkategoria->id>0 ? (int)$alkategoria->id : 0);
|
$this->selected_subcategory=((int)$alkategoria->id>0 ? (int)$alkategoria->id : 0);
|
||||||
|
|
||||||
// kis kép elhelyezése a végleges helyére
|
// kis kép elhelyezése a végleges helyére
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['vendegkep'];
|
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['vendegkep'];
|
||||||
} else {
|
} else {
|
||||||
$honnan = '/home/vendeg/'.$this->data['vendegkep'];
|
$honnan = '/home/vendeg/'.$this->data['vendegkep'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/img/collection/'.$this->data['tipus'];
|
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/img/collection/'.$this->data['tipus'];
|
||||||
if (!is_dir($hova)) mkdir($hova, 0777);
|
if (!is_dir($hova)) mkdir($hova, 0777);
|
||||||
$hova.='/'.$this->data['vendegkep'];
|
$hova.='/'.$this->data['vendegkep'];
|
||||||
if (is_file($honnan) && !is_file($hova)) { copy($honnan,$hova); }
|
if (is_file($honnan) && !is_file($hova)) { copy($honnan,$hova); }
|
||||||
|
|
||||||
if (isset($_POST['save']))
|
if (isset($_POST['save']))
|
||||||
{
|
{
|
||||||
$tomb=array(
|
$tomb=array(
|
||||||
'm_id'=>(int)$_POST['m_id'],
|
'm_id'=>(int)$_POST['m_id'],
|
||||||
'c_id'=>(int)$_POST['c_id'],
|
'c_id'=>(int)$_POST['c_id'],
|
||||||
'struct_id'=>(int)$_POST['subcat'],
|
'struct_id'=>(int)$_POST['subcat'],
|
||||||
'title_hun'=>trim(addslashes($_POST['title_hun'])),
|
'title_hun'=>trim(addslashes($_POST['title_hun'])),
|
||||||
'title_eng'=>trim(addslashes($_POST['title_eng'])),
|
'title_eng'=>trim(addslashes($_POST['title_eng'])),
|
||||||
'desc_hun'=>trim(addslashes($_POST['desc_hun'])),
|
'desc_hun'=>trim(addslashes($_POST['desc_hun'])),
|
||||||
'desc_eng'=>trim(addslashes($_POST['desc_eng'])),
|
'desc_eng'=>trim(addslashes($_POST['desc_eng'])),
|
||||||
'tipus'=>$_POST['tipus'],
|
'tipus'=>$_POST['tipus'],
|
||||||
'fajl'=>$this->data['file'],
|
'fajl'=>$this->data['file'],
|
||||||
'version'=>$this->data['prver'],
|
'version'=>$this->data['prver'],
|
||||||
'deleted'=>(isset($_POST['deleted']) ? 0 : 1),
|
'deleted'=>(isset($_POST['deleted']) ? 0 : 1),
|
||||||
);
|
);
|
||||||
|
|
||||||
// $newID=($this->data['ifc']==FALSE ? $model->saveRecord($tomb) : (int)$_POST['joinID']);
|
// $newID=($this->data['ifc']==FALSE ? $model->saveRecord($tomb) : (int)$_POST['joinID']);
|
||||||
$newID=$model->saveRecord($tomb);
|
$newID=$model->saveRecord($tomb);
|
||||||
|
|
||||||
if ((int)$newID>0)
|
if ((int)$newID>0)
|
||||||
{
|
{
|
||||||
$man=$model->getManufacture($tomb['m_id']);
|
$man=$model->getManufacture($tomb['m_id']);
|
||||||
|
|
||||||
// objektum file(ok) elhelyezése a végleges helyére
|
// objektum file(ok) elhelyezése a végleges helyére
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['file'];
|
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['file'];
|
||||||
} else {
|
} else {
|
||||||
$honnan = '/home/vendeg/'.$this->data['file'];
|
$honnan = '/home/vendeg/'.$this->data['file'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir;
|
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir;
|
||||||
if (!is_dir($hova)) mkdir($hova, 0777);
|
if (!is_dir($hova)) mkdir($hova, 0777);
|
||||||
$hova.='/'.$newID;
|
$hova.='/'.$newID;
|
||||||
if (!is_dir($hova)) mkdir($hova, 0777);
|
if (!is_dir($hova)) mkdir($hova, 0777);
|
||||||
$hova.='/'.$this->data['file'];
|
$hova.='/'.$this->data['file'];
|
||||||
if (is_file($honnan)) copy($honnan,$hova);
|
if (is_file($honnan)) copy($honnan,$hova);
|
||||||
|
|
||||||
if ($this->data['ifc']==TRUE)
|
if ($this->data['ifc']==TRUE)
|
||||||
{
|
{
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.str_replace(".ifc",".oli",$this->data['file']);
|
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.str_replace(".ifc",".oli",$this->data['file']);
|
||||||
} else {
|
} else {
|
||||||
$honnan = '/home/vendeg/'.str_replace(".ifc",".oli",$this->data['file']);
|
$honnan = '/home/vendeg/'.str_replace(".ifc",".oli",$this->data['file']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir.'/'.$newID.'/'.str_replace(".ifc",".oli",$this->data['file']);
|
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir.'/'.$newID.'/'.str_replace(".ifc",".oli",$this->data['file']);
|
||||||
if (is_file($honnan)) copy($honnan,$hova);
|
if (is_file($honnan)) copy($honnan,$hova);
|
||||||
}
|
}
|
||||||
|
|
||||||
// feltöltött kép elhelyezése a végleges helyére
|
// feltöltött kép elhelyezése a végleges helyére
|
||||||
if (is_array($_FILES['fileupload']) && !empty($_FILES['fileupload']) && /*$this->data['ifc']==FALSE &&*/ in_array($_FILES['fileupload']['type'],array('image/jpeg','image/jpg')))
|
if (is_array($_FILES['fileupload']) && !empty($_FILES['fileupload']) && /*$this->data['ifc']==FALSE &&*/ in_array($_FILES['fileupload']['type'],array('image/jpeg','image/jpg')))
|
||||||
{
|
{
|
||||||
$origSize=getimagesize($_FILES['fileupload']['tmp_name']);
|
$origSize=getimagesize($_FILES['fileupload']['tmp_name']);
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT']."/public/img/collection/".$man->dir;
|
$hova=$_SERVER['DOCUMENT_ROOT']."/public/img/collection/".$man->dir;
|
||||||
if (!is_dir($hova)) mkdir($hova,0777);
|
if (!is_dir($hova)) mkdir($hova,0777);
|
||||||
$hova.="/".$newID;
|
$hova.="/".$newID;
|
||||||
if (!is_dir($hova)) mkdir($hova,0777);
|
if (!is_dir($hova)) mkdir($hova,0777);
|
||||||
if (!is_dir($hova."/orig")) mkdir($hova."/orig",0777);
|
if (!is_dir($hova."/orig")) mkdir($hova."/orig",0777);
|
||||||
|
|
||||||
$this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_big.jpg', (int)round(($origSize[0]/$origSize[1])*400),400);
|
$this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_big.jpg', (int)round(($origSize[0]/$origSize[1])*400),400);
|
||||||
$this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_thumb.jpg', (int)round(($origSize[0]/$origSize[1])*120),120);
|
$this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_thumb.jpg', (int)round(($origSize[0]/$origSize[1])*120),120);
|
||||||
$this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_small.jpg', (int)round(($origSize[0]/$origSize[1])*66),66);
|
$this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_small.jpg', (int)round(($origSize[0]/$origSize[1])*66),66);
|
||||||
|
|
||||||
move_uploaded_file($_FILES['fileupload']['tmp_name'], $hova.'/orig/'.$_FILES['fileupload']['name']);
|
move_uploaded_file($_FILES['fileupload']['tmp_name'], $hova.'/orig/'.$_FILES['fileupload']['name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { print ("descriptor file nem elérhető"); }
|
else { print ("descriptor file nem elérhető"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->parents=$model->getParents();
|
$this->parents=$model->getParents();
|
||||||
$this->subcat=$model->getSubcat($this->selected_category);
|
$this->subcat=$model->getSubcat($this->selected_category);
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option=com_showroom&view=showroom');
|
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option=com_showroom&view=showroom');
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_UPLOAD));
|
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_UPLOAD));
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function make_thumb($src, $dest, $desired_width,$desired_h)
|
protected function make_thumb($src, $dest, $desired_width,$desired_h)
|
||||||
{
|
{
|
||||||
$source_image=imagecreatefromjpeg($src);
|
$source_image=imagecreatefromjpeg($src);
|
||||||
$width=imagesx($source_image);
|
$width=imagesx($source_image);
|
||||||
$height=imagesy($source_image);
|
$height=imagesy($source_image);
|
||||||
$desired_height=$desired_h;
|
$desired_height=$desired_h;
|
||||||
$virtual_image=imagecreatetruecolor($desired_width, $desired_height);
|
$virtual_image=imagecreatetruecolor($desired_width, $desired_height);
|
||||||
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
||||||
imagejpeg($virtual_image, $dest);
|
imagejpeg($virtual_image, $dest);
|
||||||
}
|
}
|
||||||
} // end of class
|
} // end of class
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,154 +0,0 @@
|
|||||||
<?php defined('_JEXEC') or die; ?>
|
|
||||||
|
|
||||||
<?php if (!isset($this->sess['sr_template'])):?>
|
|
||||||
<h3 style="margin-bottom:10px;"><?=JText::_(COM_SHOWROOM_SHOWROOM);?></h3>
|
|
||||||
<?php endif;?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$user=JFactory::getUser();
|
|
||||||
$groups=$user->get('groups');
|
|
||||||
|
|
||||||
if ((int)$user->id>0 && is_array($groups)) : ?>
|
|
||||||
<?php
|
|
||||||
$admin=FALSE;
|
|
||||||
foreach ($groups as $k=>$v) { if (in_array($v,$this->arrAllowedGroups)) $admin=TRUE; }
|
|
||||||
if ($admin==FALSE) { JFactory::getApplication()->redirect("/index.php?option=com_showroom&view=showroom"); die(); }
|
|
||||||
?>
|
|
||||||
<div id="j-main-container">
|
|
||||||
<form name="showroom_upload" id="showroom_upload" method="post" enctype="multipart/form-data" action="index.php?option=com_showroom&view=uploadgroup<?=$this->querystring?>">
|
|
||||||
<div class="hasab">
|
|
||||||
<div class="inputholder" style="height:200px;">
|
|
||||||
<label for="desc_hun"><?=JText::_('COM_SHOWROOM_DESC_HUN')?>:</label><br />
|
|
||||||
<textarea name="desc_hun" id="desc_hun"><?=(isset($_POST['desc_hun']) ? $_POST['desc_hun'] : '')?></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hasab">
|
|
||||||
<div class="inputholder" style="height:200px;">
|
|
||||||
<label for="desc_eng"><?=JText::_('COM_SHOWROOM_DESC_ENG')?>:</label><br />
|
|
||||||
<textarea name="desc_eng" id="desc_eng"><?=(isset($_POST['desc_eng']) ? $_POST['desc_eng'] : '')?></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hasab">
|
|
||||||
<div class="inputholder">
|
|
||||||
<label for="tipus"><?=JText::_('COM_SHOWROOM_TYPE')?>:</label>
|
|
||||||
<select name="tipus" id="tipus" onchange="javascript:changeTipus();">
|
|
||||||
<option value=""><?=JText::_('COM_SHOWROOM_ALL')?></option>
|
|
||||||
<option disabled="disabled">-----</option>
|
|
||||||
<?php foreach ($this->types as $type):?>
|
|
||||||
<option value="<?=$type->type?>"<?=($type->type==$this->selected_type ? ' selected="selected"' : '')?>><?=$type->name?></option>
|
|
||||||
<?php endforeach;?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="inputholder">
|
|
||||||
<label for="m_id"><?=JText::_('COM_SHOWROOM_MANUFACTURE')?>:</label>
|
|
||||||
<div id="m_id_container" style="display:inline-block;">
|
|
||||||
<select name="m_id" id="m_id" onchange="javascript:changeGyarto();">
|
|
||||||
<option value=""><?=JText::_('COM_SHOWROOM_ALL')?></option>
|
|
||||||
<option disabled="disabled">-----</option>
|
|
||||||
<?php foreach ($this->manufactures as $manufacture):?>
|
|
||||||
<option value="<?=$manufacture->id?>"<?=($manufacture->id==$this->selected_manufacture ? ' selected="selected"' : '')?> ><?=$manufacture->name?></option>
|
|
||||||
<?php endforeach;?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="inputholder">
|
|
||||||
<label for="c_id"><?=JText::_('COM_SHOWROOM_FAMILY')?>:</label>
|
|
||||||
<div id="c_id_container" style="display:inline-block;">
|
|
||||||
<select name="c_id" id="c_id" onchange="">
|
|
||||||
<option value=""><?=JText::_('COM_SHOWROOM_ALL')?></option>
|
|
||||||
<option disabled="disabled">-----</option>
|
|
||||||
<?php foreach ($this->families as $family):?>
|
|
||||||
<option value="<?=$family->c_id?>"<?=((int)$family->c_id==(int)$this->selected_family ? ' selected="selected"' : '')?>><?=$family->name?></option>
|
|
||||||
<?php endforeach;?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="inputholder">
|
|
||||||
<label for="parent" class="szeleslabel"><?=JText::_('COM_SHOWROOM_CAT')?>:</label>
|
|
||||||
<select name="parent" id="parent" onchange="javascript:changeParent();">
|
|
||||||
<option value=""><?=JText::_('COM_SHOWROOM_ALL')?></option>
|
|
||||||
<option disabled="disabled">-----</option>
|
|
||||||
<?php $lastParentType="";?>
|
|
||||||
<?php foreach ($this->parents as $parent):?>
|
|
||||||
<?php if ($lastParentType!=$parent->type) { echo '<option disabled="disabled">'.$parent->type.'</option>'; $lastParentType=$parent->type; } ?>
|
|
||||||
<option value="<?=$parent->id?>"<?=($parent->id==$this->selected_category ? ' selected="selected"' : '')?>> <?=$parent->name?></option>
|
|
||||||
<?php endforeach;?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="inputholder">
|
|
||||||
<label for="subcat" class="szeleslabel"><?=JText::_('COM_SHOWROOM_SUBCAT')?>:</label>
|
|
||||||
<div id="subcat_container" style="display:inline-block;">
|
|
||||||
<select name="subcat" id="subcat">
|
|
||||||
<option value=""><?=JText::_('COM_SHOWROOM_ALL')?></option>
|
|
||||||
<option disabled="disabled">-----</option>
|
|
||||||
<?php $lastCategoryType="";?>
|
|
||||||
<?php foreach ($this->subcat as $subcat):?>
|
|
||||||
<?php if ($lastCategoryType!=$subcat->parent) { echo '<option disabled="disabled">'.$subcat->parent.'</option>'; $lastCategoryType=$subcat->parent; } ?>
|
|
||||||
<option value="<?=$subcat->id?>"<?=($subcat->id==$this->selected_subcategory ? ' selected="selected"' : '')?>> <?=$subcat->name?></option>
|
|
||||||
<?php endforeach;?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="inputholder">
|
|
||||||
<label for="deleted_y"><?=JText::_('COM_SHOWROOM_ACTIVE')?>:</label>
|
|
||||||
<fieldset>
|
|
||||||
<input type="radio" name="deleted" id="deleted_y" value="0" disabled="disabled" /><label for="deleted_y"><?=JText::_('COM_SHOWROOM_YES')?></label>
|
|
||||||
<input type="radio" name="deleted" id="deleted_n" value="1" checked="checked" /><label for="deleted_n"><?=JText::_('COM_SHOWROOM_NO')?></label>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="inputholder">
|
|
||||||
<input type="submit" name="save" id="save" value="<?=JText::_('COM_SHOWROOM_SAVE')?>" <?=(count($_POST) ? 'disabled="disabled"' : '')?> onclick="javascript:return ellenoriz();" /><br />
|
|
||||||
<strong><?=(count($_POST) ? JText::_('COM_SHOWROOM_SAVE_SUCCESSFUL') : '')?></strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hasab" style="display:inline-block;width:600px;">
|
|
||||||
<?php foreach ($this->arrKiskep as $kiskep) : ?>
|
|
||||||
<?php if (is_file($_SERVER['DOCUMENT_ROOT'].$kiskep)) : ?>
|
|
||||||
<img src="<?=$kiskep?>" style="max-width:60px;max-height:60px;" border="0" />
|
|
||||||
<?php endif;?>
|
|
||||||
<?php endforeach;?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(document).ready(function() { changeTipus(); });
|
|
||||||
|
|
||||||
function changeTipus() {
|
|
||||||
jQuery.get('/administrator/components/com_showroom/assets/ajax/AjaxSelectController.class.php?lang=<?=$this->sess['sr_lang']?>&type=manufacture&tipus='+jQuery('#tipus').val()+'&selected=<?=$this->selected_manufacture?>', function( data ) { jQuery("#m_id_container").html( data ); });
|
|
||||||
changeGyarto();
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeGyarto() {
|
|
||||||
jQuery.get('/administrator/components/com_showroom/assets/ajax/AjaxSelectController.class.php?lang=<?=$this->sess['sr_lang']?>&type=family&tipus='+jQuery('#tipus').val()+'&gyarto='+jQuery('#m_id').val()+'&selected=<?=$this->selected_family?>', function( data ) { jQuery("#c_id_container").html( data ); });
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeParent() {
|
|
||||||
jQuery.get('/administrator/components/com_showroom/assets/ajax/AjaxSelectController.class.php?lang=<?=$this->sess['sr_lang']?>&type=parent&id='+jQuery('#parent').val(), function( data ) { jQuery("#subcat_container").html( data ); });
|
|
||||||
}
|
|
||||||
|
|
||||||
function ellenoriz() {
|
|
||||||
if (jQuery('#tipus').val()=="") {alert('<?=JText::_('COM_SHOWROOM_MISSING_TYPE')?>!'); return false;}
|
|
||||||
if (jQuery('#m_id').val()=="") {alert('<?=JText::_('COM_SHOWROOM_MISSING_MANUFACTURE')?>!'); return false;}
|
|
||||||
if (jQuery('#c_id').val()=="") {alert('<?=JText::_('COM_SHOWROOM_MISSING_FAMILY')?>!'); return false;}
|
|
||||||
if (jQuery('#parent').val()=="") {alert('<?=JText::_('COM_SHOWROOM_MISSING_PARENT')?>!'); return false;}
|
|
||||||
if (jQuery('#subcat').val()=="") {alert('<?=JText::_('COM_SHOWROOM_MISSING_SUBCAT')?>!'); return false;}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<?php else : ?>
|
|
||||||
<?=JModuleHelper::renderModule(JModuleHelper::getModule('login'),array());?>
|
|
||||||
<? endif; ?>
|
|
||||||
@ -1,272 +1,272 @@
|
|||||||
<?php
|
<?php
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Az eredti descriptor file felépítése:
|
Az eredti descriptor file felépítése:
|
||||||
=====================================
|
=====================================
|
||||||
$data["fajl"] = $adatok[0];
|
$data["fajl"] = $adatok[0];
|
||||||
$data["eredeti"] = $adatok[1];
|
$data["eredeti"] = $adatok[1];
|
||||||
$data["vendegkep"] = $adatok[2];
|
$data["vendegkep"] = $adatok[2];
|
||||||
$data["kepalap"] = $adatok[3];
|
$data["kepalap"] = $adatok[3];
|
||||||
$data["cim"] = $adatok[4];
|
$data["cim"] = $adatok[4];
|
||||||
$data["cimhun"] = $adatok[5] ? $adatok[5] : $adatok[4];
|
$data["cimhun"] = $adatok[5] ? $adatok[5] : $adatok[4];
|
||||||
$data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6];
|
$data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6];
|
||||||
$data["man"] = $adatok[7];
|
$data["man"] = $adatok[7];
|
||||||
$data["fam"] = $adatok[8];
|
$data["fam"] = $adatok[8];
|
||||||
|
|
||||||
|
|
||||||
Az új descriptor file felépítése:
|
Az új descriptor file felépítése:
|
||||||
=====================================
|
=====================================
|
||||||
$data["file"]=$adatok[0],
|
$data["file"]=$adatok[0],
|
||||||
$data["vendegkep"]=$adatok[1],
|
$data["vendegkep"]=$adatok[1],
|
||||||
$data["nev_eng"]=$adatok[2],
|
$data["nev_eng"]=$adatok[2],
|
||||||
$data["nev_hun"]=$adatok[3],
|
$data["nev_hun"]=$adatok[3],
|
||||||
$data["tipus"]=$adatok[4],
|
$data["tipus"]=$adatok[4],
|
||||||
$data["kategoria"]=$adatok[5],
|
$data["kategoria"]=$adatok[5],
|
||||||
$data["alkategoria"]=$adatok[6],
|
$data["alkategoria"]=$adatok[6],
|
||||||
$data["gyarto"]=$adatok[7],
|
$data["gyarto"]=$adatok[7],
|
||||||
$data["termekcsalad"]=>$this->desc[8],
|
$data["termekcsalad"]=>$this->desc[8],
|
||||||
$data["prver"]=($adatok[9]=="-1" ? "2012" : $adatok[8]),
|
$data["prver"]=($adatok[9]=="-1" ? "2012" : $adatok[8]),
|
||||||
$data["desc_eng"]=>$this->desc[10],
|
$data["desc_eng"]=>$this->desc[10],
|
||||||
$data["desc_hun"]=>$this->desc[11],
|
$data["desc_hun"]=>$this->desc[11],
|
||||||
$data["serial"]=>$this->desc[12],
|
$data["serial"]=>$this->desc[12],
|
||||||
|
|
||||||
Pl. (valójában sortörés nélkül van):
|
Pl. (valójában sortörés nélkül van):
|
||||||
------------------------------------
|
------------------------------------
|
||||||
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
||||||
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
||||||
brown chair#
|
brown chair#
|
||||||
barna szék#
|
barna szék#
|
||||||
material#
|
material#
|
||||||
Wood#
|
Wood#
|
||||||
Oak#
|
Oak#
|
||||||
Marrakesh#
|
Marrakesh#
|
||||||
-1
|
-1
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
defined('_JEXEC') or die; // No direct access to this file
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
jimport('joomla.application.component.view'); // import Joomla view library
|
||||||
jimport('joomla.application.module.helper');
|
jimport('joomla.application.module.helper');
|
||||||
jimport('joomla.session.session');
|
jimport('joomla.session.session');
|
||||||
|
|
||||||
class ShowroomViewUploadGroup extends JViewLegacy
|
class ShowroomViewUploadGroup extends JViewLegacy
|
||||||
{
|
{
|
||||||
protected $arrAllowedGroups=array(7,8);
|
protected $arrAllowedGroups=array(7,8);
|
||||||
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
||||||
protected $desc=array();
|
protected $desc=array();
|
||||||
protected $data=array();
|
protected $data=array();
|
||||||
protected $hiba;
|
protected $hiba;
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$app=&JFactory::getApplication();
|
$app=&JFactory::getApplication();
|
||||||
$lang=&JFactory::getLanguage();
|
$lang=&JFactory::getLanguage();
|
||||||
$session=&JFactory::getSession();
|
$session=&JFactory::getSession();
|
||||||
$document=&JFactory::getDocument();
|
$document=&JFactory::getDocument();
|
||||||
$model=$this->getModel();
|
$model=$this->getModel();
|
||||||
|
|
||||||
$document->addStyleSheet('/components/com_showroom/assets/css/showroom.css');
|
$document->addStyleSheet('/components/com_showroom/assets/css/showroom.css');
|
||||||
$session->set('sr_template','blankframe');
|
$session->set('sr_template','blankframe');
|
||||||
$session->set('sr_lang','eng');
|
$session->set('sr_lang','eng');
|
||||||
$lang->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
$lang->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
||||||
$session->set('sr_file',(trim(addslashes($_GET['file']))=='none' ? '' : trim(addslashes($_GET['file']))));
|
$session->set('sr_file',(trim(addslashes($_GET['file']))=='none' ? '' : trim(addslashes($_GET['file']))));
|
||||||
// $this->sess=$_SESSION['__default'];
|
// $this->sess=$_SESSION['__default'];
|
||||||
$this->out=array();
|
$this->out=array();
|
||||||
|
|
||||||
if (trim($session->get('sr_file'))>"" && trim($session->get('sr_file'))!='none')
|
if (trim($session->get('sr_file'))>"" && trim($session->get('sr_file'))!='none')
|
||||||
{
|
{
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$grouplist = trim($_SERVER['DOCUMENT_ROOT'].'/webdav/'.$session->get('sr_file'));
|
$grouplist = trim($_SERVER['DOCUMENT_ROOT'].'/webdav/'.$session->get('sr_file'));
|
||||||
} else {
|
} else {
|
||||||
$grouplist = trim('/home/vendeg/'.$session->get('sr_file'));
|
$grouplist = trim('/home/vendeg/'.$session->get('sr_file'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ($_SERVER['REMOTE_ADDR'] == '213.197.95.246') {
|
/*if ($_SERVER['REMOTE_ADDR'] == '213.197.95.246') {
|
||||||
if (file_exists($_SERVER['DOCUMENT_ROOT'].'/webdav/3979EAED-035E-4367-B8C2-52277989A480.oli')) {
|
if (file_exists($_SERVER['DOCUMENT_ROOT'].'/webdav/3979EAED-035E-4367-B8C2-52277989A480.oli')) {
|
||||||
echo $grouplist;
|
echo $grouplist;
|
||||||
echo '<br/>';
|
echo '<br/>';
|
||||||
echo $_SERVER['DOCUMENT_ROOT'].'/webdav/3979EAED-035E-4367-B8C2-52277989A480.oli';
|
echo $_SERVER['DOCUMENT_ROOT'].'/webdav/3979EAED-035E-4367-B8C2-52277989A480.oli';
|
||||||
|
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
$this->out['grouplist']=$session->get('sr_file');
|
$this->out['grouplist']=$session->get('sr_file');
|
||||||
$this->out['sorok']=array();
|
$this->out['sorok']=array();
|
||||||
|
|
||||||
if (is_file($grouplist))
|
if (is_file($grouplist))
|
||||||
{
|
{
|
||||||
$lines=file($grouplist);
|
$lines=file($grouplist);
|
||||||
|
|
||||||
if (is_array($lines) && count($lines))
|
if (is_array($lines) && count($lines))
|
||||||
{
|
{
|
||||||
foreach ($lines as $idx=>$line)
|
foreach ($lines as $idx=>$line)
|
||||||
{
|
{
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$descriptor = trim($_SERVER['DOCUMENT_ROOT'].'/webdav/'.$line);
|
$descriptor = trim($_SERVER['DOCUMENT_ROOT'].'/webdav/'.$line);
|
||||||
} else {
|
} else {
|
||||||
$descriptor = trim('/home/vendeg/'.$line);
|
$descriptor = trim('/home/vendeg/'.$line);
|
||||||
}
|
}
|
||||||
$this->out['sorok'][$idx]['descriptor']=$line;
|
$this->out['sorok'][$idx]['descriptor']=$line;
|
||||||
|
|
||||||
if (is_file($descriptor))
|
if (is_file($descriptor))
|
||||||
{
|
{
|
||||||
$this->desc=explode("#",file_get_contents($descriptor));
|
$this->desc=explode("#",file_get_contents($descriptor));
|
||||||
|
|
||||||
if (is_array($this->desc) && count($this->desc)) { foreach ($this->desc as $k=>$v) $this->desc[$k]=trim($v); }
|
if (is_array($this->desc) && count($this->desc)) { foreach ($this->desc as $k=>$v) $this->desc[$k]=trim($v); }
|
||||||
|
|
||||||
$this->data=array(
|
$this->data=array(
|
||||||
"file"=>$this->desc[0],
|
"file"=>$this->desc[0],
|
||||||
"nagykep"=>$this->desc[1],
|
"nagykep"=>$this->desc[1],
|
||||||
"nev_eng"=>$this->desc[2],
|
"nev_eng"=>$this->desc[2],
|
||||||
"nev_hun"=>$this->desc[3],
|
"nev_hun"=>$this->desc[3],
|
||||||
"tipus"=>$this->desc[4],
|
"tipus"=>$this->desc[4],
|
||||||
"kategoria"=>$this->desc[5],
|
"kategoria"=>$this->desc[5],
|
||||||
"alkategoria"=>$this->desc[6],
|
"alkategoria"=>$this->desc[6],
|
||||||
"gyarto"=>$this->desc[7],
|
"gyarto"=>$this->desc[7],
|
||||||
"termekcsalad"=>$this->desc[8],
|
"termekcsalad"=>$this->desc[8],
|
||||||
"prver"=>($this->desc[9]=="-1" ? "2012" : $this->desc[9]),
|
"prver"=>($this->desc[9]=="-1" ? "2012" : $this->desc[9]),
|
||||||
"desc_eng"=>$this->desc[10],
|
"desc_eng"=>$this->desc[10],
|
||||||
"desc_hun"=>$this->desc[11],
|
"desc_hun"=>$this->desc[11],
|
||||||
"serial"=>(isset($this->desc[12]) ? trim($this->desc[12]) : ""),
|
"serial"=>(isset($this->desc[12]) ? trim($this->desc[12]) : ""),
|
||||||
);
|
);
|
||||||
$this->out['sorok'][$idx]['data']=$this->data;
|
$this->out['sorok'][$idx]['data']=$this->data;
|
||||||
|
|
||||||
if ($this->data['tipus']>"") { $this->tipus=$model->getType($this->data['tipus']); }
|
if ($this->data['tipus']>"") { $this->tipus=$model->getType($this->data['tipus']); }
|
||||||
if ($this->data['gyarto']>"") { $this->manufacture=$model->getManufactureByName($this->data['gyarto']); }
|
if ($this->data['gyarto']>"") { $this->manufacture=$model->getManufactureByName($this->data['gyarto']); }
|
||||||
if ($this->data['termekcsalad']>"" && (int)$this->manufacture->id>0) { $this->termekcsalad=$model->getFamilyByName($this->data['termekcsalad'],$this->manufacture->id); }
|
if ($this->data['termekcsalad']>"" && (int)$this->manufacture->id>0) { $this->termekcsalad=$model->getFamilyByName($this->data['termekcsalad'],$this->manufacture->id); }
|
||||||
if ($this->data['kategoria']>"") { $this->kategoria=$model->getParentByName($this->data['tipus'],$this->data['kategoria']); }
|
if ($this->data['kategoria']>"") { $this->kategoria=$model->getParentByName($this->data['tipus'],$this->data['kategoria']); }
|
||||||
if ($this->data['alkategoria']>"" && (int)$this->kategoria->id>0) { $this->alkategoria=$model->getSubcatByName($this->data['tipus'],$this->kategoria->id,$this->data['alkategoria']); }
|
if ($this->data['alkategoria']>"" && (int)$this->kategoria->id>0) { $this->alkategoria=$model->getSubcatByName($this->data['tipus'],$this->kategoria->id,$this->data['alkategoria']); }
|
||||||
|
|
||||||
$tomb=array(
|
$tomb=array(
|
||||||
'kategoria'=>(int)$this->kategoria->id,
|
'kategoria'=>(int)$this->kategoria->id,
|
||||||
't_id'=>$this->tipus->type_download,
|
't_id'=>$this->tipus->type_download,
|
||||||
'm_id'=>(int)$this->manufacture->id,
|
'm_id'=>(int)$this->manufacture->id,
|
||||||
'c_id'=>(int)$this->termekcsalad->c_id,
|
'c_id'=>(int)$this->termekcsalad->c_id,
|
||||||
'struct_id'=>(int)$this->alkategoria->id,
|
'struct_id'=>(int)$this->alkategoria->id,
|
||||||
'title_hun'=>$this->data['nev_hun'],
|
'title_hun'=>$this->data['nev_hun'],
|
||||||
'title_eng'=>$this->data['nev_eng'],
|
'title_eng'=>$this->data['nev_eng'],
|
||||||
'desc_hun'=>$this->data['desc_hun'],
|
'desc_hun'=>$this->data['desc_hun'],
|
||||||
'desc_eng'=>$this->data['desc_eng'],
|
'desc_eng'=>$this->data['desc_eng'],
|
||||||
'tipus'=>$this->data['tipus'],
|
'tipus'=>$this->data['tipus'],
|
||||||
'fajl'=>$this->data['file'],
|
'fajl'=>$this->data['file'],
|
||||||
'version'=>$this->data['prver'],
|
'version'=>$this->data['prver'],
|
||||||
'deleted'=>($this->data['gyarto']=='User' ? 1 : 0),
|
'deleted'=>($this->data['gyarto']=='User' ? 1 : 0),
|
||||||
'nUserID'=>$model->getUserBySerial($this->data['serial']),
|
'nUserID'=>$model->getUserBySerial($this->data['serial']),
|
||||||
);
|
);
|
||||||
$this->out['sorok'][$idx]['tomb']=$tomb;
|
$this->out['sorok'][$idx]['tomb']=$tomb;
|
||||||
$newID=$model->saveRecord($tomb);
|
$newID=$model->saveRecord($tomb);
|
||||||
$this->out['sorok'][$idx]['newID']=$newID;
|
$this->out['sorok'][$idx]['newID']=$newID;
|
||||||
|
|
||||||
if ((int)$newID>0)
|
if ((int)$newID>0)
|
||||||
{
|
{
|
||||||
// objektum file elhelyezése a végleges helyére
|
// objektum file elhelyezése a végleges helyére
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['file'];
|
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['file'];
|
||||||
} else {
|
} else {
|
||||||
$honnan = '/home/vendeg/'.$this->data['file'];
|
$honnan = '/home/vendeg/'.$this->data['file'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$this->manufacture->dir;
|
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$this->manufacture->dir;
|
||||||
if (!is_dir($hova))
|
if (!is_dir($hova))
|
||||||
{
|
{
|
||||||
$ret=mkdir($hova, 0777);
|
$ret=mkdir($hova, 0777);
|
||||||
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova.='/'.$newID;
|
$hova.='/'.$newID;
|
||||||
if (!is_dir($hova))
|
if (!is_dir($hova))
|
||||||
{
|
{
|
||||||
$ret=mkdir($hova, 0777);
|
$ret=mkdir($hova, 0777);
|
||||||
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
||||||
}
|
}
|
||||||
|
|
||||||
$files=scandir($hova);
|
$files=scandir($hova);
|
||||||
$filter=array('.','..','.quarantine');
|
$filter=array('.','..','.quarantine');
|
||||||
$parts=explode(".", $this->data['file']);
|
$parts=explode(".", $this->data['file']);
|
||||||
$upload_ext=strtolower(end($parts));
|
$upload_ext=strtolower(end($parts));
|
||||||
|
|
||||||
if (is_array($files) and count($files))
|
if (is_array($files) and count($files))
|
||||||
{
|
{
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
if (!in_array($file, $filter))
|
if (!in_array($file, $filter))
|
||||||
{
|
{
|
||||||
$parts=explode(".", $file);
|
$parts=explode(".", $file);
|
||||||
$exist_ext=strtolower(end($parts));
|
$exist_ext=strtolower(end($parts));
|
||||||
if ($exist_ext==$upload_ext) { unlink($hova.'/'.$file); }
|
if ($exist_ext==$upload_ext) { unlink($hova.'/'.$file); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova.='/'.$this->data['file'];
|
$hova.='/'.$this->data['file'];
|
||||||
if (is_file($honnan)) copy($honnan,$hova);
|
if (is_file($honnan)) copy($honnan,$hova);
|
||||||
if (is_file($honnan)) unlink($honnan);
|
if (is_file($honnan)) unlink($honnan);
|
||||||
|
|
||||||
// képek legyártása
|
// képek legyártása
|
||||||
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
if (isset($_GET['ver']) && $_GET['ver'] >= 39) {
|
||||||
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['nagykep'];
|
$honnan = $_SERVER['DOCUMENT_ROOT'].'/webdav/'.$this->data['nagykep'];
|
||||||
} else {
|
} else {
|
||||||
$honnan = '/home/vendeg/'.$this->data['nagykep'];
|
$honnan = '/home/vendeg/'.$this->data['nagykep'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_file($honnan))
|
if (is_file($honnan))
|
||||||
{
|
{
|
||||||
$origSize=getimagesize($honnan);
|
$origSize=getimagesize($honnan);
|
||||||
if ($origSize[0]>=360 || $origSize[1]>=360)
|
if ($origSize[0]>=360 || $origSize[1]>=360)
|
||||||
{
|
{
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT']."/public/img/collection/".$this->manufacture->dir;
|
$hova=$_SERVER['DOCUMENT_ROOT']."/public/img/collection/".$this->manufacture->dir;
|
||||||
|
|
||||||
if (!is_dir($hova))
|
if (!is_dir($hova))
|
||||||
{
|
{
|
||||||
$ret=mkdir($hova, 0777);
|
$ret=mkdir($hova, 0777);
|
||||||
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hova.="/".$newID;
|
$hova.="/".$newID;
|
||||||
if (!is_dir($hova))
|
if (!is_dir($hova))
|
||||||
{
|
{
|
||||||
$ret=mkdir($hova, 0777);
|
$ret=mkdir($hova, 0777);
|
||||||
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."<br />";$this->hiba++;}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_dir($hova."/orig"))
|
if (!is_dir($hova."/orig"))
|
||||||
{
|
{
|
||||||
$ret=mkdir($hova."/orig", 0777);
|
$ret=mkdir($hova."/orig", 0777);
|
||||||
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."/orig<br />";$this->hiba++;}
|
if ($ret==FALSE) {$this->out['sorok'][$idx]['hiba'].="könyvtár létrehozási hiba: ".$hova."/orig<br />";$this->hiba++;}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->make_thumb($honnan, $hova.'/zz_big.jpg', (int)round(($origSize[0]/$origSize[1])*400),400);
|
$this->make_thumb($honnan, $hova.'/zz_big.jpg', (int)round(($origSize[0]/$origSize[1])*400),400);
|
||||||
$this->make_thumb($honnan, $hova.'/zz_thumb.jpg', (int)round(($origSize[0]/$origSize[1])*120),120);
|
$this->make_thumb($honnan, $hova.'/zz_thumb.jpg', (int)round(($origSize[0]/$origSize[1])*120),120);
|
||||||
$this->make_thumb($honnan, $hova.'/zz_small.jpg', (int)round(($origSize[0]/$origSize[1])*66),66);
|
$this->make_thumb($honnan, $hova.'/zz_small.jpg', (int)round(($origSize[0]/$origSize[1])*66),66);
|
||||||
|
|
||||||
if (is_file($honnan)) copy($honnan,$hova."/orig/".$this->data['nagykep']);
|
if (is_file($honnan)) copy($honnan,$hova."/orig/".$this->data['nagykep']);
|
||||||
if (is_file($honnan)) unlink($honnan);
|
if (is_file($honnan)) unlink($honnan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlink($descriptor);
|
unlink($descriptor);
|
||||||
}
|
}
|
||||||
else { $this->out['sorok'][$idx]['hiba'].="descriptor file '".$descriptor."' nem elérhető<br />";$this->hiba++; }
|
else { $this->out['sorok'][$idx]['hiba'].="descriptor file '".$descriptor."' nem elérhető<br />";$this->hiba++; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlink($grouplist);
|
unlink($grouplist);
|
||||||
}
|
}
|
||||||
else { $this->out['hiba']="File lista '".$grouplist."' nem elérhető";$this->hiba++; }
|
else { $this->out['hiba']="File lista '".$grouplist."' nem elérhető";$this->hiba++; }
|
||||||
|
|
||||||
$this->article=($this->hiba>0 ? $model->getErrorArticle() : $model->getSuccessArticle());
|
$this->article=($this->hiba>0 ? $model->getErrorArticle() : $model->getSuccessArticle());
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function make_thumb($src, $dest, $desired_width,$desired_h)
|
protected function make_thumb($src, $dest, $desired_width,$desired_h)
|
||||||
{
|
{
|
||||||
$source_image=imagecreatefromjpeg($src);
|
$source_image=imagecreatefromjpeg($src);
|
||||||
$width=imagesx($source_image);
|
$width=imagesx($source_image);
|
||||||
$height=imagesy($source_image);
|
$height=imagesy($source_image);
|
||||||
$desired_height=$desired_h;
|
$desired_height=$desired_h;
|
||||||
$virtual_image=imagecreatetruecolor($desired_width, $desired_height);
|
$virtual_image=imagecreatetruecolor($desired_width, $desired_height);
|
||||||
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
||||||
imagejpeg($virtual_image, $dest);
|
imagejpeg($virtual_image, $dest);
|
||||||
}
|
}
|
||||||
} // end of class
|
} // end of class
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,243 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*******************************************************************************
|
|
||||||
Az eredti descriptor file felépítése:
|
|
||||||
=====================================
|
|
||||||
$data["fajl"] = $adatok[0];
|
|
||||||
$data["eredeti"] = $adatok[1];
|
|
||||||
$data["vendegkep"] = $adatok[2];
|
|
||||||
$data["kepalap"] = $adatok[3];
|
|
||||||
$data["cim"] = $adatok[4];
|
|
||||||
$data["cimhun"] = $adatok[5] ? $adatok[5] : $adatok[4];
|
|
||||||
$data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6];
|
|
||||||
$data["man"] = $adatok[7];
|
|
||||||
$data["fam"] = $adatok[8];
|
|
||||||
|
|
||||||
|
|
||||||
Az új descriptor file felépítése:
|
|
||||||
=====================================
|
|
||||||
$data["file"]=$adatok[0],
|
|
||||||
$data["vendegkep"]=$adatok[1],
|
|
||||||
$data["nev_eng"]=$adatok[2],
|
|
||||||
$data["nev_hun"]=$adatok[3],
|
|
||||||
$data["tipus"]=$adatok[4],
|
|
||||||
$data["kategoria"]=$adatok[5],
|
|
||||||
$data["alkategoria"]=$adatok[6],
|
|
||||||
$data["gyarto"]=$adatok[7],
|
|
||||||
$data["prver"]=($adatok[8]=="-1" ? "2012" : $adatok[8]),
|
|
||||||
|
|
||||||
Pl. (valójában sortörés nélkül van):
|
|
||||||
------------------------------------
|
|
||||||
85151612-3251-2A4C-838D-BDAE5C2ED382.oli#
|
|
||||||
3000585D-7B7A-BF4D-A501-3ACDE09CCA31.bmp#
|
|
||||||
brown chair#
|
|
||||||
barna szék#
|
|
||||||
material#
|
|
||||||
Wood#
|
|
||||||
Oak#
|
|
||||||
Marrakesh#
|
|
||||||
-1
|
|
||||||
*******************************************************************************/
|
|
||||||
defined('_JEXEC') or die; // No direct access to this file
|
|
||||||
|
|
||||||
jimport('joomla.application.component.view'); // import Joomla view library
|
|
||||||
jimport('joomla.application.module.helper');
|
|
||||||
jimport('joomla.session.session');
|
|
||||||
|
|
||||||
class ShowroomViewUploadGroup extends JViewLegacy
|
|
||||||
{
|
|
||||||
protected $arrAllowedGroups=array(7,8);
|
|
||||||
protected $acceptLang=array('eng'=>'en-GB','hun'=>'hu-HU');
|
|
||||||
protected $defLang='eng';
|
|
||||||
protected $desc=array();
|
|
||||||
protected $data=array();
|
|
||||||
protected $selected_type;
|
|
||||||
protected $selected_manufacture;
|
|
||||||
protected $selected_family;
|
|
||||||
protected $selected_category;
|
|
||||||
protected $selected_subcategory;
|
|
||||||
|
|
||||||
public function display($tpl = null)
|
|
||||||
{
|
|
||||||
$app=&JFactory::getApplication();
|
|
||||||
$session=&JFactory::getSession();
|
|
||||||
$document=&JFactory::getDocument();
|
|
||||||
$model=$this->getModel();
|
|
||||||
|
|
||||||
$this->arrKiskep=array();
|
|
||||||
|
|
||||||
$document->addStyleSheet('/components/com_showroom/assets/css/showroom.css');
|
|
||||||
|
|
||||||
if (isset($_GET['lang']))
|
|
||||||
{
|
|
||||||
if (array_key_exists(trim($_GET['lang']), $this->acceptLang)) { $session->set('sr_lang',trim($_GET['lang'])); }
|
|
||||||
else { $session->set('sr_lang',$this->defLang); }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['file'])) $session->set('sr_file',(trim(addslashes($_GET['file']))=='none' ? '' : trim(addslashes($_GET['file']))));
|
|
||||||
if (isset($_GET['type'])) $session->set('sr_type',(trim(addslashes($_GET['type']))=='none' ? '' : trim(addslashes($_GET['type']))));
|
|
||||||
if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
|
|
||||||
if (!isset($_SESSION['__default']['sr_lang'])) $session->set('sr_lang',$this->defLang);
|
|
||||||
|
|
||||||
JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
|
|
||||||
|
|
||||||
$this->sess=$_SESSION['__default'];
|
|
||||||
$this->types=$this->get('Types');
|
|
||||||
$this->manufactures=$model->getManufactures($this->sess['sr_type']);
|
|
||||||
$this->families=$model->getFamilies($this->sess['sr_type'],$this->sess['sr_manufacture']);
|
|
||||||
$this->family=$model->getFamily(((int)$this->sess["sr_family"]>0 ? $this->sess['sr_family'] : 0));
|
|
||||||
$this->querystring='&lang='.$session->get('sr_lang')
|
|
||||||
.($session->get('sr_template')>'' ? '&template='.$session->get('sr_template') : '')
|
|
||||||
.($session->get('sr_file')>'' ? '&file='.$session->get('sr_file') : '')
|
|
||||||
.($session->get('sr_type')>'' ? '&type='.$session->get('sr_type') : '');
|
|
||||||
|
|
||||||
if (trim($session->get('sr_file'))>"")
|
|
||||||
{
|
|
||||||
$grouplist=trim('/home/vendeg/'.$session->get('sr_file'));
|
|
||||||
|
|
||||||
if (is_file($grouplist))
|
|
||||||
{
|
|
||||||
$lines=file($grouplist);
|
|
||||||
|
|
||||||
if (is_array($lines) && count($lines))
|
|
||||||
{
|
|
||||||
foreach ($lines as $idx=>$line)
|
|
||||||
{
|
|
||||||
$descriptor=trim('/home/vendeg/'.$line);
|
|
||||||
|
|
||||||
if (is_file($descriptor))
|
|
||||||
{
|
|
||||||
$this->desc=explode("#",file_get_contents($descriptor));
|
|
||||||
|
|
||||||
if (is_array($this->desc) && count($this->desc)) { foreach ($this->desc as $k=>$v) $this->desc[$k]=trim($v); }
|
|
||||||
|
|
||||||
if ($this->desc[0]==$this->desc[1]) // regi struktura
|
|
||||||
{
|
|
||||||
$this->data=array(
|
|
||||||
"file"=>$this->desc[0],
|
|
||||||
"vendegkep"=>$this->desc[2],
|
|
||||||
"nev_eng"=>($this->desc[5] ? $this->desc[5] : $this->desc[4]),
|
|
||||||
"nev_hun"=>($this->desc[5] ? $this->desc[5] : $this->desc[4]),
|
|
||||||
"tipus"=>$this->sess['sr_type'],
|
|
||||||
"kategoria"=>"",
|
|
||||||
"alkategoria"=>"",
|
|
||||||
"gyarto"=>$this->desc[7],
|
|
||||||
"termekcsalad"=>$this->desc[8],
|
|
||||||
"prver"=>($this->desc[6]=="-1" ? "2012" : $this->desc[6]),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else // uj struktura
|
|
||||||
{
|
|
||||||
$this->data=array(
|
|
||||||
"file"=>$this->desc[0],
|
|
||||||
"vendegkep"=>$this->desc[1],
|
|
||||||
"nev_eng"=>$this->desc[2],
|
|
||||||
"nev_hun"=>$this->desc[3],
|
|
||||||
"tipus"=>$this->desc[4],
|
|
||||||
"kategoria"=>$this->desc[5],
|
|
||||||
"alkategoria"=>$this->desc[6],
|
|
||||||
"gyarto"=>$this->desc[7],
|
|
||||||
"termekcsalad"=>((isset($this->desc[9]) && $this->desc[9]>'') ? $this->desc[9] : ''),
|
|
||||||
"prver"=>($this->desc[8]=="-1" ? "2012" : $this->desc[8]),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->data['gyarto']>"") { $manufacture=$model->getManufactureByName($this->data['gyarto']); }
|
|
||||||
if ($this->data['termekcsalad']>"" && (int)$manufacture->id>0) { $termekcsalad=$model->getFamilyByName($this->data['termekcsalad'],$manufacture->id); }
|
|
||||||
if ($this->data['kategoria']>"") { $kategoria=$model->getParentByName($this->data['tipus'],$this->data['kategoria']); }
|
|
||||||
if ($this->data['alkategoria']>"" && (int)$kategoria->id>0) { $alkategoria=$model->getSubcatByName($this->data['tipus'],$kategoria->id,$this->data['alkategoria']); }
|
|
||||||
|
|
||||||
$this->selected_type=$this->data['tipus'];
|
|
||||||
$this->selected_manufacture=((int)$manufacture->id>0 ? (int)$manufacture->id : 0);
|
|
||||||
$this->selected_family=((int)$termekcsalad->c_id>0 ? (int)$termekcsalad->c_id : 0);
|
|
||||||
$this->selected_category=((int)$kategoria->id>0 ? (int)$kategoria->id : 0);
|
|
||||||
$this->selected_subcategory=((int)$alkategoria->id>0 ? (int)$alkategoria->id : 0);
|
|
||||||
|
|
||||||
// kis kép elhelyezése a végleges helyére
|
|
||||||
$honnan='/home/vendeg/'.$this->data['vendegkep'];
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/img/collection/'.$this->data['tipus'];
|
|
||||||
if (!is_dir($hova)) mkdir($hova);
|
|
||||||
$hova.='/'.$this->data['vendegkep'];
|
|
||||||
if (is_file($honnan) && !is_file($hova)) { copy($honnan,$hova); }
|
|
||||||
|
|
||||||
$this->arrKiskep[]=substr($hova, strpos($hova, '/public'));
|
|
||||||
|
|
||||||
if (isset($_POST['save']))
|
|
||||||
{
|
|
||||||
$tomb=array(
|
|
||||||
'm_id'=>(int)$_POST['m_id'],
|
|
||||||
'c_id'=>(int)$_POST['c_id'],
|
|
||||||
'struct_id'=>(int)$_POST['subcat'],
|
|
||||||
'title_hun'=>trim(addslashes($this->data['nev_hun'])),
|
|
||||||
'title_eng'=>trim(addslashes($this->data['nev_eng'])),
|
|
||||||
'desc_hun'=>trim(addslashes($_POST['desc_hun'])),
|
|
||||||
'desc_eng'=>trim(addslashes($_POST['desc_eng'])),
|
|
||||||
'tipus'=>$_POST['tipus'],
|
|
||||||
'fajl'=>$this->data['file'],
|
|
||||||
'version'=>$this->data['prver'],
|
|
||||||
'deleted'=>(isset($_POST['deleted']) ? (int)$_POST['deleted'] : 1),
|
|
||||||
);
|
|
||||||
$newID=$model->saveRecord($tomb);
|
|
||||||
|
|
||||||
if ((int)$newID>0)
|
|
||||||
{
|
|
||||||
$man=$model->getManufacture($tomb['m_id']);
|
|
||||||
|
|
||||||
// objektum file elhelyezése a végleges helyére
|
|
||||||
$honnan='/home/vendeg/'.$this->data['file'];
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir;
|
|
||||||
if (!is_dir($hova)) mkdir($hova);
|
|
||||||
$hova.='/'.$newID;
|
|
||||||
if (!is_dir($hova)) mkdir($hova);
|
|
||||||
$hova.='/'.$this->data['file'];
|
|
||||||
if (is_file($honnan) && !is_file($hova)) { copy($honnan,$hova); }
|
|
||||||
|
|
||||||
// képek legyártása
|
|
||||||
$honnan='/home/vendeg/'.$this->data['vendegkep'];
|
|
||||||
if (is_file($honnan))
|
|
||||||
{
|
|
||||||
$origSize=getimagesize($honnan);
|
|
||||||
if ($origSize[0]>=400 || $origSize[1]>=400)
|
|
||||||
{
|
|
||||||
$hova=$_SERVER['DOCUMENT_ROOT']."/public/img/collection/".$man->dir;
|
|
||||||
if (!is_dir($hova)) mkdir($hova);
|
|
||||||
$hova.="/".$newID;
|
|
||||||
if (!is_dir($hova)) mkdir($hova);
|
|
||||||
if (!is_dir($hova."/orig")) mkdir($hova."/orig");
|
|
||||||
|
|
||||||
$this->make_thumb($honnan, $hova.'/zz_big.jpg', (int)round(($origSize[0]/$origSize[1])*400),400);
|
|
||||||
$this->make_thumb($honnan, $hova.'/zz_thumb.jpg', (int)round(($origSize[0]/$origSize[1])*120),120);
|
|
||||||
$this->make_thumb($honnan, $hova.'/zz_small.jpg', (int)round(($origSize[0]/$origSize[1])*66),66);
|
|
||||||
|
|
||||||
copy($honnan,$hova."/orig/".$this->data['vendegkep']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { print ("descriptor file '".$descriptor."' nem elérhető<br />"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { print ("grouplist file '".$grouplist."' nem elérhető<br />"); }
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->parents=$model->getParents();
|
|
||||||
$this->subcat=$model->getSubcat($this->selected_category);
|
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option=com_showroom&view=showroom');
|
|
||||||
$app->getPathway()->addItem(JText::_(COM_SHOWROOM_MULTIUPLOAD));
|
|
||||||
|
|
||||||
parent::display($tpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function make_thumb($src, $dest, $desired_width,$desired_h)
|
|
||||||
{
|
|
||||||
$source_image=imagecreatefromjpeg($src);
|
|
||||||
$width=imagesx($source_image);
|
|
||||||
$height=imagesy($source_image);
|
|
||||||
$desired_height=$desired_h;
|
|
||||||
$virtual_image=imagecreatetruecolor($desired_width, $desired_height);
|
|
||||||
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
|
||||||
imagejpeg($virtual_image, $dest);
|
|
||||||
}
|
|
||||||
} // end of class
|
|
||||||
?>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!class_exists('crm_users')) require_once("../common_cadline_libraries/crm_users.class.php");
|
if (!class_exists('crm_users')) require_once("../common_cadline_libraries/crm_users.class.php");
|
||||||
|
|
||||||
$response = Course::getCourses($_POST['id']);
|
$response = Course::getCourses($_POST['id']);
|
||||||
|
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once("../common_cadline_libraries/crm_database.class.php");
|
require_once("../common_cadline_libraries/crm_database.class.php");
|
||||||
require_once '../maintenance/PasswordHash.php';
|
require_once '../maintenance/PasswordHash.php';
|
||||||
|
|
||||||
define('_JEXEC', 1);
|
define('_JEXEC', 1);
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
define('JPATH_BASE', $_SERVER['DOCUMENT_ROOT']);
|
define('JPATH_BASE', $_SERVER['DOCUMENT_ROOT']);
|
||||||
|
|
||||||
require_once(JPATH_BASE . DS . 'includes' . DS . 'defines.php');
|
require_once(JPATH_BASE . DS . 'includes' . DS . 'defines.php');
|
||||||
require_once(JPATH_BASE . DS . 'includes' . DS . 'framework.php');
|
require_once(JPATH_BASE . DS . 'includes' . DS . 'framework.php');
|
||||||
|
|
||||||
jimport('joomla.user.helper');
|
jimport('joomla.user.helper');
|
||||||
jimport('joomla.session.session');
|
jimport('joomla.session.session');
|
||||||
|
|
||||||
$username = $_POST['username'];
|
$username = $_POST['username'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
$lang = $_POST['lang'];
|
$lang = $_POST['lang'];
|
||||||
|
|
||||||
$app = JFactory::getApplication('site');
|
$app = JFactory::getApplication('site');
|
||||||
$session = JFactory::getSession();
|
$session = JFactory::getSession();
|
||||||
|
|
||||||
$credentials = array();
|
$credentials = array();
|
||||||
$credentials['username'] = $username;
|
$credentials['username'] = $username;
|
||||||
$credentials['password'] = $password;
|
$credentials['password'] = $password;
|
||||||
|
|
||||||
$error = $app->login($credentials);
|
$error = $app->login($credentials);
|
||||||
|
|
||||||
header('Location: ' . $_POST['url']);
|
header('Location: ' . $_POST['url']);
|
||||||
|
|||||||
@ -1,143 +1,143 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* This is a PHP library that handles calling reCAPTCHA.
|
* This is a PHP library that handles calling reCAPTCHA.
|
||||||
* - Documentation and latest version
|
* - Documentation and latest version
|
||||||
* https://developers.google.com/recaptcha/docs/php
|
* https://developers.google.com/recaptcha/docs/php
|
||||||
* - Get a reCAPTCHA API Key
|
* - Get a reCAPTCHA API Key
|
||||||
* https://www.google.com/recaptcha/admin/create
|
* https://www.google.com/recaptcha/admin/create
|
||||||
* - Discussion group
|
* - Discussion group
|
||||||
* http://groups.google.com/group/recaptcha
|
* http://groups.google.com/group/recaptcha
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2014, Google Inc.
|
* @copyright Copyright (c) 2014, Google Inc.
|
||||||
* @link http://www.google.com/recaptcha
|
* @link http://www.google.com/recaptcha
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
* in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
* furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* The above copyright notice and this permission notice shall be included in
|
||||||
* all copies or substantial portions of the Software.
|
* all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A ReCaptchaResponse is returned from checkAnswer().
|
* A ReCaptchaResponse is returned from checkAnswer().
|
||||||
*/
|
*/
|
||||||
class ReCaptchaResponse
|
class ReCaptchaResponse
|
||||||
{
|
{
|
||||||
public $success;
|
public $success;
|
||||||
public $errorCodes;
|
public $errorCodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ReCaptcha
|
class ReCaptcha
|
||||||
{
|
{
|
||||||
private static $_signupUrl = "https://www.google.com/recaptcha/admin";
|
private static $_signupUrl = "https://www.google.com/recaptcha/admin";
|
||||||
private static $_siteVerifyUrl =
|
private static $_siteVerifyUrl =
|
||||||
"https://www.google.com/recaptcha/api/siteverify?";
|
"https://www.google.com/recaptcha/api/siteverify?";
|
||||||
private $_secret;
|
private $_secret;
|
||||||
private static $_version = "php_1.0";
|
private static $_version = "php_1.0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param string $secret shared secret between site and ReCAPTCHA server.
|
* @param string $secret shared secret between site and ReCAPTCHA server.
|
||||||
*/
|
*/
|
||||||
function ReCaptcha($secret)
|
function ReCaptcha($secret)
|
||||||
{
|
{
|
||||||
if ($secret == null || $secret == "") {
|
if ($secret == null || $secret == "") {
|
||||||
die("To use reCAPTCHA you must get an API key from <a href='"
|
die("To use reCAPTCHA you must get an API key from <a href='"
|
||||||
. self::$_signupUrl . "'>" . self::$_signupUrl . "</a>");
|
. self::$_signupUrl . "'>" . self::$_signupUrl . "</a>");
|
||||||
}
|
}
|
||||||
$this->_secret=$secret;
|
$this->_secret=$secret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encodes the given data into a query string format.
|
* Encodes the given data into a query string format.
|
||||||
*
|
*
|
||||||
* @param array $data array of string elements to be encoded.
|
* @param array $data array of string elements to be encoded.
|
||||||
*
|
*
|
||||||
* @return string - encoded request.
|
* @return string - encoded request.
|
||||||
*/
|
*/
|
||||||
private function _encodeQS($data)
|
private function _encodeQS($data)
|
||||||
{
|
{
|
||||||
$req = "";
|
$req = "";
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
|
$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cut the last '&'
|
// Cut the last '&'
|
||||||
$req=substr($req, 0, strlen($req)-1);
|
$req=substr($req, 0, strlen($req)-1);
|
||||||
return $req;
|
return $req;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submits an HTTP GET to a reCAPTCHA server.
|
* Submits an HTTP GET to a reCAPTCHA server.
|
||||||
*
|
*
|
||||||
* @param string $path url path to recaptcha server.
|
* @param string $path url path to recaptcha server.
|
||||||
* @param array $data array of parameters to be sent.
|
* @param array $data array of parameters to be sent.
|
||||||
*
|
*
|
||||||
* @return array response
|
* @return array response
|
||||||
*/
|
*/
|
||||||
private function _submitHTTPGet($path, $data)
|
private function _submitHTTPGet($path, $data)
|
||||||
{
|
{
|
||||||
$req = $this->_encodeQS($data);
|
$req = $this->_encodeQS($data);
|
||||||
$response = file_get_contents($path . $req);
|
$response = file_get_contents($path . $req);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls the reCAPTCHA siteverify API to verify whether the user passes
|
* Calls the reCAPTCHA siteverify API to verify whether the user passes
|
||||||
* CAPTCHA test.
|
* CAPTCHA test.
|
||||||
*
|
*
|
||||||
* @param string $remoteIp IP address of end user.
|
* @param string $remoteIp IP address of end user.
|
||||||
* @param string $response response string from recaptcha verification.
|
* @param string $response response string from recaptcha verification.
|
||||||
*
|
*
|
||||||
* @return ReCaptchaResponse
|
* @return ReCaptchaResponse
|
||||||
*/
|
*/
|
||||||
public function verifyResponse($remoteIp, $response)
|
public function verifyResponse($remoteIp, $response)
|
||||||
{
|
{
|
||||||
// Discard empty solution submissions
|
// Discard empty solution submissions
|
||||||
if ($response == null || strlen($response) == 0) {
|
if ($response == null || strlen($response) == 0) {
|
||||||
$recaptchaResponse = new ReCaptchaResponse();
|
$recaptchaResponse = new ReCaptchaResponse();
|
||||||
$recaptchaResponse->success = false;
|
$recaptchaResponse->success = false;
|
||||||
$recaptchaResponse->errorCodes = 'missing-input';
|
$recaptchaResponse->errorCodes = 'missing-input';
|
||||||
return $recaptchaResponse;
|
return $recaptchaResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
$getResponse = $this->_submitHttpGet(
|
$getResponse = $this->_submitHttpGet(
|
||||||
self::$_siteVerifyUrl,
|
self::$_siteVerifyUrl,
|
||||||
array (
|
array (
|
||||||
'secret' => $this->_secret,
|
'secret' => $this->_secret,
|
||||||
'remoteip' => $remoteIp,
|
'remoteip' => $remoteIp,
|
||||||
'v' => self::$_version,
|
'v' => self::$_version,
|
||||||
'response' => $response
|
'response' => $response
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$answers = json_decode($getResponse, true);
|
$answers = json_decode($getResponse, true);
|
||||||
$recaptchaResponse = new ReCaptchaResponse();
|
$recaptchaResponse = new ReCaptchaResponse();
|
||||||
|
|
||||||
if (trim($answers ['success']) == true) {
|
if (trim($answers ['success']) == true) {
|
||||||
$recaptchaResponse->success = true;
|
$recaptchaResponse->success = true;
|
||||||
} else {
|
} else {
|
||||||
$recaptchaResponse->success = false;
|
$recaptchaResponse->success = false;
|
||||||
$recaptchaResponse->errorCodes = $answers [error-codes];
|
$recaptchaResponse->errorCodes = $answers [error-codes];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_SERVER['REMOTE_ADDR'] == '85.66.171.33') {
|
if ($_SERVER['REMOTE_ADDR'] == '85.66.171.33') {
|
||||||
var_dump($recaptchaResponse);
|
var_dump($recaptchaResponse);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $recaptchaResponse;
|
return $recaptchaResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,75 +1,75 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_users
|
* @subpackage com_users
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
include( JPATH_SITE . '/components/com_users/views/registration/tmpl/default.php');
|
include( JPATH_SITE . '/components/com_users/views/registration/tmpl/default.php');
|
||||||
|
|
||||||
$config = JComponentHelper::getParams('com_jsn');
|
$config = JComponentHelper::getParams('com_jsn');
|
||||||
$layout_width=$config->get('layout_width','full');
|
$layout_width=$config->get('layout_width','full');
|
||||||
if( $layout_width == 'full' ) $max_width = 'none';
|
if( $layout_width == 'full' ) $max_width = 'none';
|
||||||
else $max_width = $config->get('layout_maxwidth','500');
|
else $max_width = $config->get('layout_maxwidth','500');
|
||||||
$layout=$config->get('layout_form','horizontal');
|
$layout=$config->get('layout_form','horizontal');
|
||||||
$lang = JFactory::getLanguage();
|
$lang = JFactory::getLanguage();
|
||||||
$result = $lang->getTag();
|
$result = $lang->getTag();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
<?php if($result == "hu-HU") :?>
|
<?php if($result == "hu-HU") :?>
|
||||||
.spacer-container{display: none;}
|
.spacer-container{display: none;}
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
.star {display: none;}
|
.star {display: none;}
|
||||||
div.registration{max-width:<?php if ( empty($max_width) ) echo 'none'; else echo $max_width.'px'; ?>;margin:auto;}
|
div.registration{max-width:<?php if ( empty($max_width) ) echo 'none'; else echo $max_width.'px'; ?>;margin:auto;}
|
||||||
div.registration.formfullwidth{max-width:none;}
|
div.registration.formfullwidth{max-width:none;}
|
||||||
#profile_tabs{font-weight:bold;}
|
#profile_tabs{font-weight:bold;}
|
||||||
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > input,
|
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > input,
|
||||||
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > .input-prepend input,
|
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > .input-prepend input,
|
||||||
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > fieldset.radio,
|
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > fieldset.radio,
|
||||||
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > fieldset.checkboxes,
|
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > fieldset.checkboxes,
|
||||||
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > textarea{padding-right:45px !important;}
|
#member-registration.form-horizontal .control-group.privacy + .control-group .controls > textarea{padding-right:45px !important;}
|
||||||
#member-registration .controls > input,#member-registration .controls > textarea,#member-registration .controls > .input-prepend,#member-registration .controls > .input-prepend input{width:100%;box-sizing:border-box;height:auto;}
|
#member-registration .controls > input,#member-registration .controls > textarea,#member-registration .controls > .input-prepend,#member-registration .controls > .input-prepend input{width:100%;box-sizing:border-box;height:auto;}
|
||||||
#member-registration .controls > input[type="file"]{width:auto;}
|
#member-registration .controls > input[type="file"]{width:auto;}
|
||||||
#member-registration .control-label label{font-weight:bold;}
|
#member-registration .control-label label{font-weight:bold;}
|
||||||
.jsn_registration_controls{border-top:1px solid #ccc;padding:20px 0 0;margin-top:20px;clear:both;}
|
.jsn_registration_controls{border-top:1px solid #ccc;padding:20px 0 0;margin-top:20px;clear:both;}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function($){
|
jQuery(document).ready(function($){
|
||||||
if( $('div.registration').parent().width() < 800 ) {
|
if( $('div.registration').parent().width() < 800 ) {
|
||||||
$('div.registration').addClass('formfullwidth');
|
$('div.registration').addClass('formfullwidth');
|
||||||
}
|
}
|
||||||
<?php if ( $layout == 'horizontal' ) : ?>
|
<?php if ( $layout == 'horizontal' ) : ?>
|
||||||
if( $('div.registration').parent().width() < 500 ) {
|
if( $('div.registration').parent().width() < 500 ) {
|
||||||
$('#member-registration').removeClass('form-horizontal');
|
$('#member-registration').removeClass('form-horizontal');
|
||||||
}
|
}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $layout == 'vertical' ) : ?>$('#member-registration').removeClass('form-horizontal');<?php endif; ?>
|
<?php if ( $layout == 'vertical' ) : ?>$('#member-registration').removeClass('form-horizontal');<?php endif; ?>
|
||||||
$(window).resize(function(){
|
$(window).resize(function(){
|
||||||
if( $('div.registration').parent().width() < 800 ) {
|
if( $('div.registration').parent().width() < 800 ) {
|
||||||
$('div.registration').addClass('formfullwidth');
|
$('div.registration').addClass('formfullwidth');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('div.registration').removeClass('formfullwidth');
|
$('div.registration').removeClass('formfullwidth');
|
||||||
}
|
}
|
||||||
<?php if ( $layout == 'horizontal' ) : ?>
|
<?php if ( $layout == 'horizontal' ) : ?>
|
||||||
if( $('div.registration').parent().width() < 500 ) {
|
if( $('div.registration').parent().width() < 500 ) {
|
||||||
$('#member-registration').removeClass('form-horizontal');
|
$('#member-registration').removeClass('form-horizontal');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#member-registration').addClass('form-horizontal');
|
$('#member-registration').addClass('form-horizontal');
|
||||||
}
|
}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
});
|
});
|
||||||
$('#member-registration a.btn:not([class*="btn-"])').addClass('btn-danger');
|
$('#member-registration a.btn:not([class*="btn-"])').addClass('btn-danger');
|
||||||
$('#member-registration .control-group > .control-label > label').each(function(){
|
$('#member-registration .control-group > .control-label > label').each(function(){
|
||||||
$(this).closest('.control-group').addClass($(this).attr('id').replace('jform_','').replace('-lbl','-group'));
|
$(this).closest('.control-group').addClass($(this).attr('id').replace('jform_','').replace('-lbl','-group'));
|
||||||
});
|
});
|
||||||
if($('#system-message-container').length) $('#system-message-container').prependTo("#member-registration");
|
if($('#system-message-container').length) $('#system-message-container').prependTo("#member-registration");
|
||||||
else $("#member-registration").prepend('<div id="system-message-container" />');
|
else $("#member-registration").prepend('<div id="system-message-container" />');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@ -1,422 +1,422 @@
|
|||||||
<?php
|
<?php
|
||||||
die();
|
die();
|
||||||
error_reporting(E_ERROR | E_PARSE);
|
error_reporting(E_ERROR | E_PARSE);
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
include('config.php');
|
include('config.php');
|
||||||
$connection = new mysqli($config2['db_host'], $config2['db_user'], $config2['db_pass'], $config2['db_name']);
|
$connection = new mysqli($config2['db_host'], $config2['db_user'], $config2['db_pass'], $config2['db_name']);
|
||||||
|
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
if ($_POST['modId']) {
|
if ($_POST['modId']) {
|
||||||
$id = $_POST['modId'];
|
$id = $_POST['modId'];
|
||||||
$text = mysqli_real_escape_string($connection, $_POST['modText']);
|
$text = mysqli_real_escape_string($connection, $_POST['modText']);
|
||||||
$update = "UPDATE `www_archline_hu`.`crash` SET `komment`='{$text}' WHERE `id`='{$id}'";
|
$update = "UPDATE `www_archline_hu`.`crash` SET `komment`='{$text}' WHERE `id`='{$id}'";
|
||||||
|
|
||||||
if ($connection->query($update) === FALSE) echo '<script type="text/javascript">alert("' . $connection->error . '");</script>';
|
if ($connection->query($update) === FALSE) echo '<script type="text/javascript">alert("' . $connection->error . '");</script>';
|
||||||
}
|
}
|
||||||
if ($_POST['listaid'] && isset($_POST['CbBoxValue'])) {
|
if ($_POST['listaid'] && isset($_POST['CbBoxValue'])) {
|
||||||
$listaid = substr($_POST['listaid'], 5);
|
$listaid = substr($_POST['listaid'], 5);
|
||||||
$update = "UPDATE `www_archline_hu`.`crash` SET `eredmeny`='{$_POST['CbBoxValue']}' WHERE `id`='{$listaid}'";
|
$update = "UPDATE `www_archline_hu`.`crash` SET `eredmeny`='{$_POST['CbBoxValue']}' WHERE `id`='{$listaid}'";
|
||||||
|
|
||||||
if ($connection->query($update) === FALSE) echo '<script type="text/javascript">alert("' . $connection->error . '");</script>';
|
if ($connection->query($update) === FALSE) echo '<script type="text/javascript">alert("' . $connection->error . '");</script>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function downloadFile($filename)
|
function downloadFile($filename)
|
||||||
{
|
{
|
||||||
if ($f = fopen($filename, "rb")) {
|
if ($f = fopen($filename, "rb")) {
|
||||||
$content_len = (int) filesize($filename);
|
$content_len = (int) filesize($filename);
|
||||||
//@ini_set('zlib.output_compression', 'Off');
|
//@ini_set('zlib.output_compression', 'Off');
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
//header('Last-Modified: '.gmdate('D, d M Y H(idea)(worry)') . ' GMT');
|
//header('Last-Modified: '.gmdate('D, d M Y H(idea)(worry)') . ' GMT');
|
||||||
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
|
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
|
||||||
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
|
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
|
||||||
header('Content-Transfer-Encoding: none');
|
header('Content-Transfer-Encoding: none');
|
||||||
header('Content-Type: plain/text');
|
header('Content-Type: plain/text');
|
||||||
header('Content-Disposition: inline; filename="' . $filename . '"');
|
header('Content-Disposition: inline; filename="' . $filename . '"');
|
||||||
header("Content-length: $content_len");
|
header("Content-length: $content_len");
|
||||||
|
|
||||||
while (!feof($f)) {
|
while (!feof($f)) {
|
||||||
echo fread($f, 2 << 20);
|
echo fread($f, 2 << 20);
|
||||||
}
|
}
|
||||||
fclose($f);
|
fclose($f);
|
||||||
} else {
|
} else {
|
||||||
print "error opening file";
|
print "error opening file";
|
||||||
}
|
}
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_SERVER['REMOTE_ADDR'] == '91.83.198.90') {
|
if ($_SERVER['REMOTE_ADDR'] == '91.83.198.90') {
|
||||||
$path = "../public";
|
$path = "../public";
|
||||||
$files = scandir($path);
|
$files = scandir($path);
|
||||||
|
|
||||||
print_r($files);
|
print_r($files);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET) && !empty($_GET)) {
|
if (isset($_GET) && !empty($_GET)) {
|
||||||
$filepath = "/home/vendeg/crash/";
|
$filepath = "/home/vendeg/crash/";
|
||||||
$filepath .= $_GET["guid"];
|
$filepath .= $_GET["guid"];
|
||||||
|
|
||||||
/*if (!file_exists($filepath))
|
/*if (!file_exists($filepath))
|
||||||
$filepath = "../public/crash/".$_GET['guid'];*/
|
$filepath = "../public/crash/".$_GET['guid'];*/
|
||||||
//$filepath .= ".DMP";
|
//$filepath .= ".DMP";
|
||||||
downloadFile($filepath);
|
downloadFile($filepath);
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
||||||
<style>
|
<style>
|
||||||
#submit {
|
#submit {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 1%;
|
right: 1%;
|
||||||
top: 1%;
|
top: 1%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr0 {
|
.tr0 {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr1 {
|
.tr1 {
|
||||||
background-color: #33cc33;
|
background-color: #33cc33;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr2,
|
.tr2,
|
||||||
.tr5,
|
.tr5,
|
||||||
.tr6 {
|
.tr6 {
|
||||||
background-color: #ff5050;
|
background-color: #ff5050;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr3 {
|
.tr3 {
|
||||||
background-color: #cccccc;
|
background-color: #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr4 {
|
.tr4 {
|
||||||
background-color: #99ff33;
|
background-color: #99ff33;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr7 {
|
.tr7 {
|
||||||
background-color: #808080;
|
background-color: #808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta0 {
|
.ta0 {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta1 {
|
.ta1 {
|
||||||
background-color: #33cc33;
|
background-color: #33cc33;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta2,
|
.ta2,
|
||||||
.ta5,
|
.ta5,
|
||||||
.ta6 {
|
.ta6 {
|
||||||
background-color: #ff5050;
|
background-color: #ff5050;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta3 {
|
.ta3 {
|
||||||
background-color: #cccccc;
|
background-color: #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta4 {
|
.ta4 {
|
||||||
background-color: #99ff33;
|
background-color: #99ff33;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta7 {
|
.ta7 {
|
||||||
background-color: #808080;
|
background-color: #808080;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
var textId;
|
var textId;
|
||||||
var CbBox;
|
var CbBox;
|
||||||
|
|
||||||
function valtoztat(id) {
|
function valtoztat(id) {
|
||||||
textId = id;
|
textId = id;
|
||||||
document.getElementById("modId").value = id;
|
document.getElementById("modId").value = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
function textChange() {
|
function textChange() {
|
||||||
var x = document.getElementById(textId).value;
|
var x = document.getElementById(textId).value;
|
||||||
document.getElementById("modText").value = x;
|
document.getElementById("modText").value = x;
|
||||||
|
|
||||||
var cbV = document.getElementById(CbBox).selectedIndex;
|
var cbV = document.getElementById(CbBox).selectedIndex;
|
||||||
document.getElementById("CbBoxValue").value = cbV;
|
document.getElementById("CbBoxValue").value = cbV;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cbboxid(CbId) {
|
function cbboxid(CbId) {
|
||||||
var cbV = document.getElementById(CbId).selectedIndex;
|
var cbV = document.getElementById(CbId).selectedIndex;
|
||||||
document.getElementById("CbBoxValue").value = cbV;
|
document.getElementById("CbBoxValue").value = cbV;
|
||||||
document.getElementById("listaid").value = CbId;
|
document.getElementById("listaid").value = CbId;
|
||||||
CbBox = CbId;
|
CbBox = CbId;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
$V0 = "Nem feldolgozott";
|
$V0 = "Nem feldolgozott";
|
||||||
$V1 = "Javítva";
|
$V1 = "Javítva";
|
||||||
$V2 = "Nem debuggolható";
|
$V2 = "Nem debuggolható";
|
||||||
$V3 = "Nem értelmezhető";
|
$V3 = "Nem értelmezhető";
|
||||||
$V4 = "Előzőleg javított";
|
$V4 = "Előzőleg javított";
|
||||||
$V5 = "Nem reprodukálható";
|
$V5 = "Nem reprodukálható";
|
||||||
$V6 = "Nem javítható";
|
$V6 = "Nem javítható";
|
||||||
$V7 = "Nem feldolgozandó";
|
$V7 = "Nem feldolgozandó";
|
||||||
$V8 = "Mind";
|
$V8 = "Mind";
|
||||||
|
|
||||||
if (isset($_POST['datemin'])) {
|
if (isset($_POST['datemin'])) {
|
||||||
$_SESSION["mindate"] = $_POST['datemin'];
|
$_SESSION["mindate"] = $_POST['datemin'];
|
||||||
$_SESSION["maxdate"] = $_POST['datemax'];
|
$_SESSION["maxdate"] = $_POST['datemax'];
|
||||||
$_SESSION["lista"] = $_POST['lista'];
|
$_SESSION["lista"] = $_POST['lista'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$maxdate = date("Y-m-d");
|
$maxdate = date("Y-m-d");
|
||||||
$mindate = date("Y-m-d", strtotime("-5 days"));
|
$mindate = date("Y-m-d", strtotime("-5 days"));
|
||||||
|
|
||||||
echo '<form method="post" action="">';
|
echo '<form method="post" action="">';
|
||||||
if (isset($_SESSION["maxdate"]) || isset($_SESSION["mindate"]) || isset($_SESSION["lista"])) {
|
if (isset($_SESSION["maxdate"]) || isset($_SESSION["mindate"]) || isset($_SESSION["lista"])) {
|
||||||
echo 'Dátum szűrés<br /> <input type="date" name="datemin" id="datemin" value="' . $_SESSION["mindate"] . '">-tól <input type="date" name="datemax" id="datemax" value="' . $_SESSION["maxdate"] . '">-ig';
|
echo 'Dátum szűrés<br /> <input type="date" name="datemin" id="datemin" value="' . $_SESSION["mindate"] . '">-tól <input type="date" name="datemax" id="datemax" value="' . $_SESSION["maxdate"] . '">-ig';
|
||||||
} else {
|
} else {
|
||||||
echo 'Dátum szűrés<br /> <input type="date" name="datemin" id="datemin" value="' . $mindate . '">-tól <input type="date" name="datemax" id="datemax" value="' . $maxdate . '">-ig';
|
echo 'Dátum szűrés<br /> <input type="date" name="datemin" id="datemin" value="' . $mindate . '">-tól <input type="date" name="datemax" id="datemax" value="' . $maxdate . '">-ig';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
Eredmény szűrő:<br />
|
Eredmény szűrő:<br />
|
||||||
<select name="lista">
|
<select name="lista">
|
||||||
<option value="0" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "0") echo ' selected'; ?>><?php echo $V0; ?></option>
|
<option value="0" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "0") echo ' selected'; ?>><?php echo $V0; ?></option>
|
||||||
<option value="1" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "1") echo ' selected'; ?>><?php echo $V1; ?></option>
|
<option value="1" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "1") echo ' selected'; ?>><?php echo $V1; ?></option>
|
||||||
<option value="2" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "2") echo ' selected'; ?>><?php echo $V2; ?></option>
|
<option value="2" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "2") echo ' selected'; ?>><?php echo $V2; ?></option>
|
||||||
<option value="3" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "3") echo ' selected'; ?>><?php echo $V3; ?></option>
|
<option value="3" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "3") echo ' selected'; ?>><?php echo $V3; ?></option>
|
||||||
<option value="4" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "4") echo ' selected'; ?>><?php echo $V4; ?></option>
|
<option value="4" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "4") echo ' selected'; ?>><?php echo $V4; ?></option>
|
||||||
<option value="5" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "5") echo ' selected'; ?>><?php echo $V5; ?></option>
|
<option value="5" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "5") echo ' selected'; ?>><?php echo $V5; ?></option>
|
||||||
<option value="6" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "6") echo ' selected'; ?>><?php echo $V6; ?></option>
|
<option value="6" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "6") echo ' selected'; ?>><?php echo $V6; ?></option>
|
||||||
<option value="7" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "7") echo ' selected'; ?>><?php echo $V7; ?></option>
|
<option value="7" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "7") echo ' selected'; ?>><?php echo $V7; ?></option>
|
||||||
<option value="%" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "%") echo ' selected'; ?>><?php echo $V8; ?></option>
|
<option value="%" <?php if (isset($_SESSION['lista']) && $_SESSION['lista'] == "%") echo ' selected'; ?>><?php echo $V8; ?></option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<input type="submit" value="Szűrés">
|
<input type="submit" value="Szűrés">
|
||||||
<br /><br />
|
<br /><br />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$query = "SELECT * FROM `www_archline_hu`.`crash` ";
|
$query = "SELECT * FROM `www_archline_hu`.`crash` ";
|
||||||
$feltetel = array();
|
$feltetel = array();
|
||||||
if (isset($_POST['datemin'])) $feltetel[] = "left(datum, 10) >= '" . $_POST['datemin'] . "'";
|
if (isset($_POST['datemin'])) $feltetel[] = "left(datum, 10) >= '" . $_POST['datemin'] . "'";
|
||||||
if (isset($_POST['datemax'])) $feltetel[] = "left(datum, 10) <= '" . $_POST['datemax'] . "'";
|
if (isset($_POST['datemax'])) $feltetel[] = "left(datum, 10) <= '" . $_POST['datemax'] . "'";
|
||||||
if (isset($_POST['lista']) && $_POST['lista'] != "%") $feltetel[] = "`eredmeny` = " . $_POST['lista'] . "";
|
if (isset($_POST['lista']) && $_POST['lista'] != "%") $feltetel[] = "`eredmeny` = " . $_POST['lista'] . "";
|
||||||
if (isset($_POST['lista']) && $_POST['lista'] == "%") $feltetel[] = "1";
|
if (isset($_POST['lista']) && $_POST['lista'] == "%") $feltetel[] = "1";
|
||||||
if (isset($_POST['datemax']) || isset($_POST['datemin']) || isset($_POST['lezart'])) $query .= "WHERE " . implode(' AND ', $feltetel);
|
if (isset($_POST['datemax']) || isset($_POST['datemin']) || isset($_POST['lezart'])) $query .= "WHERE " . implode(' AND ', $feltetel);
|
||||||
|
|
||||||
$query .= " ORDER BY id DESC LIMIT 500";
|
$query .= " ORDER BY id DESC LIMIT 500";
|
||||||
|
|
||||||
print "<form method='post' action='' onsubmit='textChange()'>";
|
print "<form method='post' action='' onsubmit='textChange()'>";
|
||||||
print "<table border = 1>";
|
print "<table border = 1>";
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<th>Email</th>";
|
print "<th>Email</th>";
|
||||||
print "<th>Üzenet</th>";
|
print "<th>Üzenet</th>";
|
||||||
print "<th>Dátum</th>";
|
print "<th>Dátum</th>";
|
||||||
print "<th>Dmp fájl</th>";
|
print "<th>Dmp fájl</th>";
|
||||||
print "<th>Txt fájl</th>";
|
print "<th>Txt fájl</th>";
|
||||||
print "<th>Megjegyzés</th>";
|
print "<th>Megjegyzés</th>";
|
||||||
print "<th>Eredmény</th>";
|
print "<th>Eredmény</th>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$msh2->query($query);
|
$msh2->query($query);
|
||||||
$results = $msh2->fetchAssoc();
|
$results = $msh2->fetchAssoc();
|
||||||
|
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
$r = (object)$result;
|
$r = (object)$result;
|
||||||
|
|
||||||
$filepath = "/home/vendeg/crash/";
|
$filepath = "/home/vendeg/crash/";
|
||||||
$filepath .= $r->guid;
|
$filepath .= $r->guid;
|
||||||
$filepath .= ".DMP";
|
$filepath .= ".DMP";
|
||||||
if (!file_exists($filepath))
|
if (!file_exists($filepath))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
print "<tr class='tr" . $r->eredmeny . "'>";
|
print "<tr class='tr" . $r->eredmeny . "'>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $r->email;
|
print $r->email;
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td style='width:300px'>";
|
print "<td style='width:300px'>";
|
||||||
print $r->info;
|
print $r->info;
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
//print substr($r->datum,0,10);
|
//print substr($r->datum,0,10);
|
||||||
print $r->datum;
|
print $r->datum;
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
?>
|
?>
|
||||||
<a href="http://sub.archline.hu/crashadmin/<?= $r->guid ?>.DMP"><?= $r->guid ?></a>
|
<a href="http://sub.archline.hu/crashadmin/<?= $r->guid ?>.DMP"><?= $r->guid ?></a>
|
||||||
<?php
|
<?php
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
echo '<a href="http://sub.archline.hu/crashadmin/' . $r->guid . '.TXT">Link...</a>';
|
echo '<a href="http://sub.archline.hu/crashadmin/' . $r->guid . '.TXT">Link...</a>';
|
||||||
|
|
||||||
if (file_exists('/home/vendeg/crash/' . $r->guid . '.TXT')) {
|
if (file_exists('/home/vendeg/crash/' . $r->guid . '.TXT')) {
|
||||||
$file = '/home/vendeg/crash/' . $r->guid . '.TXT';
|
$file = '/home/vendeg/crash/' . $r->guid . '.TXT';
|
||||||
$searchfor = 'developer';
|
$searchfor = 'developer';
|
||||||
$contents = file_get_contents($file);
|
$contents = file_get_contents($file);
|
||||||
$pattern = preg_quote($searchfor, '/');
|
$pattern = preg_quote($searchfor, '/');
|
||||||
$pattern = "/^.*$pattern.*\$/m";
|
$pattern = "/^.*$pattern.*\$/m";
|
||||||
if (preg_match_all($pattern, $contents, $matches)) {
|
if (preg_match_all($pattern, $contents, $matches)) {
|
||||||
echo "developer";
|
echo "developer";
|
||||||
}
|
}
|
||||||
|
|
||||||
$searchfor = 'Product: render';
|
$searchfor = 'Product: render';
|
||||||
$contents = file_get_contents($file);
|
$contents = file_get_contents($file);
|
||||||
$pattern = preg_quote($searchfor, '/');
|
$pattern = preg_quote($searchfor, '/');
|
||||||
$pattern = "/^.*$pattern.*\$/m";
|
$pattern = "/^.*$pattern.*\$/m";
|
||||||
if (preg_match_all($pattern, $contents, $matches)) {
|
if (preg_match_all($pattern, $contents, $matches)) {
|
||||||
echo "render";
|
echo "render";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
echo "<textarea rows='2' cols='60' class='ta" . $r->eredmeny . "' id='" . $r->id . "' onClick='valtoztat(this.id)'>" . $r->komment . "</textarea>";
|
echo "<textarea rows='2' cols='60' class='ta" . $r->eredmeny . "' id='" . $r->id . "' onClick='valtoztat(this.id)'>" . $r->komment . "</textarea>";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
switch ($r->eredmeny) {
|
switch ($r->eredmeny) {
|
||||||
case '0':
|
case '0':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0" selected>' . $V0 . '</option>
|
<option value="0" selected>' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '1':
|
case '1':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1" selected>' . $V1 . '</option>
|
<option value="1" selected>' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '2':
|
case '2':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2" selected>' . $V2 . '</option>
|
<option value="2" selected>' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '3':
|
case '3':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3" selected>' . $V3 . '</option>
|
<option value="3" selected>' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
case '4':
|
case '4':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4" selected>' . $V4 . '</option>
|
<option value="4" selected>' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
case '5':
|
case '5':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5" selected>' . $V5 . '</option>
|
<option value="5" selected>' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
case '6':
|
case '6':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6" selected>' . $V6 . '</option>
|
<option value="6" selected>' . $V6 . '</option>
|
||||||
<option value="7">' . $V7 . '</option>
|
<option value="7">' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
case '7':
|
case '7':
|
||||||
echo '
|
echo '
|
||||||
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
<select id="lista' . $r->id . '" onchange="cbboxid(this.id)">
|
||||||
<option value="0">' . $V0 . '</option>
|
<option value="0">' . $V0 . '</option>
|
||||||
<option value="1">' . $V1 . '</option>
|
<option value="1">' . $V1 . '</option>
|
||||||
<option value="2">' . $V2 . '</option>
|
<option value="2">' . $V2 . '</option>
|
||||||
<option value="3">' . $V3 . '</option>
|
<option value="3">' . $V3 . '</option>
|
||||||
<option value="4">' . $V4 . '</option>
|
<option value="4">' . $V4 . '</option>
|
||||||
<option value="5">' . $V5 . '</option>
|
<option value="5">' . $V5 . '</option>
|
||||||
<option value="6">' . $V6 . '</option>
|
<option value="6">' . $V6 . '</option>
|
||||||
<option value="7" selected>' . $V7 . '</option>
|
<option value="7" selected>' . $V7 . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
print '<input type="hidden" id="listaid" name="listaid" value="">';
|
print '<input type="hidden" id="listaid" name="listaid" value="">';
|
||||||
print '<input type="hidden" id="CbBoxValue" name="CbBoxValue" value="">';
|
print '<input type="hidden" id="CbBoxValue" name="CbBoxValue" value="">';
|
||||||
print '<input type="hidden" id="modId" name="modId" value="">';
|
print '<input type="hidden" id="modId" name="modId" value="">';
|
||||||
print '<input type="hidden" id="modText" name="modText" value="">';
|
print '<input type="hidden" id="modText" name="modText" value="">';
|
||||||
|
|
||||||
print '<input type="submit" value="Mentés" id="submit" name="submit">';
|
print '<input type="submit" value="Mentés" id="submit" name="submit">';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
|||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteRule ^([^\.]+)$ $1.php [NC,L]
|
RewriteRule ^([^\.]+)$ $1.php [NC,L]
|
||||||
|
|||||||
@ -1,325 +1,325 @@
|
|||||||
<?php
|
<?php
|
||||||
error_reporting(E_ERROR | E_PARSE);
|
error_reporting(E_ERROR | E_PARSE);
|
||||||
|
|
||||||
if (!class_exists('crm_hardlock')) require_once("../common_cadline_libraries/crm_hardlock.class.php");
|
if (!class_exists('crm_hardlock')) require_once("../common_cadline_libraries/crm_hardlock.class.php");
|
||||||
include('session.php');
|
include('session.php');
|
||||||
|
|
||||||
$query = "SELECT * FROM `" . CRMADATBAZIS . "`.`courses` WHERE school_id = ? ORDER BY is_archive ASC, name ASC";
|
$query = "SELECT * FROM `" . CRMADATBAZIS . "`.`courses` WHERE school_id = ? ORDER BY is_archive ASC, name ASC";
|
||||||
Database::getInstance()->query($query, array('i', $school_id));
|
Database::getInstance()->query($query, array('i', $school_id));
|
||||||
$courses = Database::getInstance()->fetchAssoc();
|
$courses = Database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
define('_JEXEC', 1);
|
define('_JEXEC', 1);
|
||||||
define('JPATH_BASE', '..');
|
define('JPATH_BASE', '..');
|
||||||
require_once(JPATH_BASE . '/includes/defines.php');
|
require_once(JPATH_BASE . '/includes/defines.php');
|
||||||
require_once(JPATH_BASE . '/includes/framework.php');
|
require_once(JPATH_BASE . '/includes/framework.php');
|
||||||
|
|
||||||
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
||||||
require_once('language/hu-HU.lang.php');
|
require_once('language/hu-HU.lang.php');
|
||||||
else
|
else
|
||||||
require_once('language/en-GB.lang.php');
|
require_once('language/en-GB.lang.php');
|
||||||
|
|
||||||
$course_end = $home['end_of_course'];
|
$course_end = $home['end_of_course'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="<?= $home['favicon'] ?>" type="image/vnd.microsoft.icon" />
|
<link rel="shortcut icon" href="<?= $home['favicon'] ?>" type="image/vnd.microsoft.icon" />
|
||||||
<link rel="stylesheet" href="public/css/bootstrap.min.css?<?= time() ?>">
|
<link rel="stylesheet" href="public/css/bootstrap.min.css?<?= time() ?>">
|
||||||
<link rel="stylesheet" href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" type="text/css" />
|
<link rel="stylesheet" href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="public/css/main.css?<?= time() ?>" type="text/css" />
|
<link rel="stylesheet" href="public/css/main.css?<?= time() ?>" type="text/css" />
|
||||||
|
|
||||||
<script src="public/js/jquery.min.js" type="text/javascript"></script>
|
<script src="public/js/jquery.min.js" type="text/javascript"></script>
|
||||||
<script src="public/js/bootstrap.min.js?<?= time() ?>" type="text/javascript"></script>
|
<script src="public/js/bootstrap.min.js?<?= time() ?>" type="text/javascript"></script>
|
||||||
<script src="public/js/gijgo.min.js" type="text/javascript"></script>
|
<script src="public/js/gijgo.min.js" type="text/javascript"></script>
|
||||||
<script src="public/js/main.js?ver=3" type="text/javascript"></script>
|
<script src="public/js/main.js?ver=3" type="text/javascript"></script>
|
||||||
|
|
||||||
<title><?= $home['home_page'] ?></title>
|
<title><?= $home['home_page'] ?></title>
|
||||||
|
|
||||||
<?php if ($_SERVER['HTTP_HOST'] == 'www.archlinexp.com') : ?>
|
<?php if ($_SERVER['HTTP_HOST'] == 'www.archlinexp.com') : ?>
|
||||||
<style media="screen">
|
<style media="screen">
|
||||||
#pelda_excel {
|
#pelda_excel {
|
||||||
margin-left: -30% !important;
|
margin-left: -30% !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="/iskolak"><?= $home['home_page'] ?> <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="/iskolak"><?= $home['home_page'] ?> <span class="sr-only">(current)</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="logout.php"><?= $home['logout'] ?></a>
|
<a class="nav-link" href="logout.php"><?= $home['logout'] ?></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
echo "<select class='form-control' id='course'>";
|
echo "<select class='form-control' id='course'>";
|
||||||
foreach ($courses as $course) {
|
foreach ($courses as $course) {
|
||||||
$begin = str_replace('-', '.', $course["from"]);
|
$begin = str_replace('-', '.', $course["from"]);
|
||||||
$end = str_replace('-', '.', $course["vegzes_ideje"]);
|
$end = str_replace('-', '.', $course["vegzes_ideje"]);
|
||||||
$c_end = str_replace('-', '.', $course["to"]);
|
$c_end = str_replace('-', '.', $course["to"]);
|
||||||
$c_name = $course["name"];
|
$c_name = $course["name"];
|
||||||
$c_id = $course["id"];
|
$c_id = $course["id"];
|
||||||
|
|
||||||
if ($course['is_archive'] == 0)
|
if ($course['is_archive'] == 0)
|
||||||
echo "<option data-archive='" . $course['is_archive'] . "' value = '{$c_id}'>{$school_name} {$c_name} {$begin} - {$end} ({$course_end}: {$c_end})</option>";
|
echo "<option data-archive='" . $course['is_archive'] . "' value = '{$c_id}'>{$school_name} {$c_name} {$begin} - {$end} ({$course_end}: {$c_end})</option>";
|
||||||
else
|
else
|
||||||
echo "<option data-archive='" . $course['is_archive'] . "' value = '{$c_id}'>{$school_name} {$c_name}</option>";
|
echo "<option data-archive='" . $course['is_archive'] . "' value = '{$c_id}'>{$school_name} {$c_name}</option>";
|
||||||
}
|
}
|
||||||
echo "</select>";
|
echo "</select>";
|
||||||
?>
|
?>
|
||||||
<input type="hidden" value="" id="c_end" />
|
<input type="hidden" value="" id="c_end" />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div id="archiv_text" class="row">
|
<div id="archiv_text" class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<?= $home['archiv_desc'] ?>
|
<?= $home['archiv_desc'] ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div id="modal-div" class="form-row">
|
<div id="modal-div" class="form-row">
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<button class="btn btn-primary" data-toggle="modal" onclick="showAddModal()"><?= $home['add_new_student'] ?></button>
|
<button class="btn btn-primary" data-toggle="modal" onclick="showAddModal()"><?= $home['add_new_student'] ?></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-3" id="h_div">
|
<div class="col-sm-3" id="h_div">
|
||||||
<h4><?= $home['import_from_excel'] ?>:</h4>
|
<h4><?= $home['import_from_excel'] ?>:</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<form id="export-form" action="process.php" method="post">
|
<form id="export-form" action="process.php" method="post">
|
||||||
<input type="hidden" name="action" value="excel_export" />
|
<input type="hidden" name="action" value="excel_export" />
|
||||||
<input type="hidden" id="excel_c_id" name="excel_c_id" value="<?= $courses[0]["id"] ?>" />
|
<input type="hidden" id="excel_c_id" name="excel_c_id" value="<?= $courses[0]["id"] ?>" />
|
||||||
|
|
||||||
<input type="submit" value="<?= $home['export_excel'] ?>" class="btn btn-info" />
|
<input type="submit" value="<?= $home['export_excel'] ?>" class="btn btn-info" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div style="display: flex; justify-content: flex-end">
|
<div style="display: flex; justify-content: flex-end">
|
||||||
<a href="<?= $home['sample_excel'] ?>" style="margin-right: 4%;"><button type="button" class="btn btn-info" id="pelda_excel" download><?= $home['download_sample'] ?></button></a>
|
<a href="<?= $home['sample_excel'] ?>" style="margin-right: 4%;"><button type="button" class="btn btn-info" id="pelda_excel" download><?= $home['download_sample'] ?></button></a>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div id="file_input">
|
<div id="file_input">
|
||||||
<input type="file" id="excl_file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
|
<input type="file" id="excl_file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-info" id="excl_btn" onclick="readExcel()"><?= $home['import_students'] ?></button>
|
<button class="btn btn-info" id="excl_btn" onclick="readExcel()"><?= $home['import_students'] ?></button>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<input type="text" class="form form-control col-md-4" id="search_name" id="search_btn" placeholder="<?= $home['search'] ?>..." />
|
<input type="text" class="form form-control col-md-4" id="search_name" id="search_btn" placeholder="<?= $home['search'] ?>..." />
|
||||||
<input type="checkbox" name="search_all" id="search_all">
|
<input type="checkbox" name="search_all" id="search_all">
|
||||||
<div id="search-txt"><label for="search_all"><?= $home['search_all'] ?></label></div>
|
<div id="search-txt"><label for="search_all"><?= $home['search_all'] ?></label></div>
|
||||||
<button style="margin-left: 5% !important;" type="button" class="btn btn-primary" id="email_btn" data-toggle="modal" data-target="#emailModal" onclick="emailModal()"><?= $home['send_email'] ?></button>
|
<button style="margin-left: 5% !important;" type="button" class="btn btn-primary" id="email_btn" data-toggle="modal" data-target="#emailModal" onclick="emailModal()"><?= $home['send_email'] ?></button>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<img src="public/loading.gif" id="loading_gif" style="display: none;" />
|
<img src="public/loading.gif" id="loading_gif" style="display: none;" />
|
||||||
<table id="student_table" class="table table-striped">
|
<table id="student_table" class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">#</th>
|
<th scope="col">#</th>
|
||||||
<th scope="col"><?= $home['name'] ?></th>
|
<th scope="col"><?= $home['name'] ?></th>
|
||||||
<th scope="col"><?= $home['email'] ?></th>
|
<th scope="col"><?= $home['email'] ?></th>
|
||||||
<th scope="col"><?= $home['telephone'] ?></th>
|
<th scope="col"><?= $home['telephone'] ?></th>
|
||||||
<th scope="col"><?= $home['status'] ?></th>
|
<th scope="col"><?= $home['status'] ?></th>
|
||||||
<th scope="col"><?= $home['serial_number'] ?></th>
|
<th scope="col"><?= $home['serial_number'] ?></th>
|
||||||
<th scope="col"></th>
|
<th scope="col"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="school_id" value="<?= $school_id ?>" />
|
<input type="hidden" id="school_id" value="<?= $school_id ?>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Email modal -->
|
<!-- Email modal -->
|
||||||
<div class="modal fade" id="emailModal" tabindex="-1" role="dialog" aria-labelledby="emailModal" aria-hidden="true">
|
<div class="modal fade" id="emailModal" tabindex="-1" role="dialog" aria-labelledby="emailModal" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-lg" role="document">
|
<div class="modal-dialog modal-lg" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="emailModalLabel"><?= $home['send_email'] ?></h5>
|
<h5 class="modal-title" id="emailModalLabel"><?= $home['send_email'] ?></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<table id="emailToStudents" class="table table-striped">
|
<table id="emailToStudents" class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" class="custom-control-input" id="checkAll">
|
<input type="checkbox" class="custom-control-input" id="checkAll">
|
||||||
<label class="custom-control-label" for="checkAll"></label>
|
<label class="custom-control-label" for="checkAll"></label>
|
||||||
</div>
|
</div>
|
||||||
</th>
|
</th>
|
||||||
<th scope="col"><?= $home['name'] ?></th>
|
<th scope="col"><?= $home['name'] ?></th>
|
||||||
<th scope="col"><?= $home['email'] ?></th>
|
<th scope="col"><?= $home['email'] ?></th>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
||||||
<button type="button" class="btn btn-success" onclick="sendEmail()" id="send_email_btn"><?= $home['send_email'] ?></button>
|
<button type="button" class="btn btn-success" onclick="sendEmail()" id="send_email_btn"><?= $home['send_email'] ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- New User Modal -->
|
<!-- New User Modal -->
|
||||||
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModal" aria-hidden="true">
|
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModal" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="addModalLabel"><?= $home['add_new_student'] ?></h5>
|
<h5 class="modal-title" id="addModalLabel"><?= $home['add_new_student'] ?></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['name'] ?>:</label>
|
<label><?= $home['name'] ?>:</label>
|
||||||
<input type="text" id="name" class="form-control" placeholder="<?= $home['name'] ?>" required />
|
<input type="text" id="name" class="form-control" placeholder="<?= $home['name'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['email'] ?>:</label>
|
<label><?= $home['email'] ?>:</label>
|
||||||
<input type="text" id="email" class="form-control" placeholder="<?= $home['email'] ?>" required />
|
<input type="text" id="email" class="form-control" placeholder="<?= $home['email'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['confirm_email'] ?>:</label>
|
<label><?= $home['confirm_email'] ?>:</label>
|
||||||
<input type="text" id="email2" class="form-control" placeholder="<?= $home['confirm_email'] ?>" required />
|
<input type="text" id="email2" class="form-control" placeholder="<?= $home['confirm_email'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['telephone'] ?>:</label>
|
<label><?= $home['telephone'] ?>:</label>
|
||||||
<input type="text" id="phone" class="form-control" placeholder="<?= $home['telephone'] ?>" <?= $_SERVER['HTTP_HOST'] == 'www.archline.hu' ? 'required' : '' ?> />
|
<input type="text" id="phone" class="form-control" placeholder="<?= $home['telephone'] ?>" <?= $_SERVER['HTTP_HOST'] == 'www.archline.hu' ? 'required' : '' ?> />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="error_div" class="alert alert-danger" role="alert"></div>
|
<div id="error_div" class="alert alert-danger" role="alert"></div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
||||||
<button type="button" class="btn btn-success" onclick="addRecord()"><?= $home['add'] ?></button>
|
<button type="button" class="btn btn-success" onclick="addRecord()"><?= $home['add'] ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Edit User Modal -->
|
<!-- Edit User Modal -->
|
||||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModal" aria-hidden="true">
|
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModal" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="editModalLabel"><?= $home['edit_student'] ?></h5>
|
<h5 class="modal-title" id="editModalLabel"><?= $home['edit_student'] ?></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['name'] ?>:</label>
|
<label><?= $home['name'] ?>:</label>
|
||||||
<input type="text" id="updatename" class="form-control" placeholder="<?= $home['name'] ?>" required />
|
<input type="text" id="updatename" class="form-control" placeholder="<?= $home['name'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['email'] ?>:</label>
|
<label><?= $home['email'] ?>:</label>
|
||||||
<input type="text" id="updateemail" class="form-control" placeholder="<?= $home['email'] ?>" required />
|
<input type="text" id="updateemail" class="form-control" placeholder="<?= $home['email'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['confirm_email'] ?>:</label>
|
<label><?= $home['confirm_email'] ?>:</label>
|
||||||
<input type="text" id="updateemail2" class="form-control" placeholder="<?= $home['confirm_email'] ?>" required />
|
<input type="text" id="updateemail2" class="form-control" placeholder="<?= $home['confirm_email'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['telephone'] ?>:</label>
|
<label><?= $home['telephone'] ?>:</label>
|
||||||
<input type="text" id="updatephone" class="form-control" placeholder="<?= $home['telephone'] ?>" required />
|
<input type="text" id="updatephone" class="form-control" placeholder="<?= $home['telephone'] ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['course'] ?>:</label>
|
<label><?= $home['course'] ?>:</label>
|
||||||
<select class="form-control" id="courses">
|
<select class="form-control" id="courses">
|
||||||
<?php foreach ($courses as $course) : ?>
|
<?php foreach ($courses as $course) : ?>
|
||||||
<option value="<?= $course['id'] ?>"><?= $course['name'] ?></option>
|
<option value="<?= $course['id'] ?>"><?= $course['name'] ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $home['status'] ?>:</label>
|
<label><?= $home['status'] ?>:</label>
|
||||||
<select class="form-control" id="status">
|
<select class="form-control" id="status">
|
||||||
<option value="1"><?= $home['active'] ?></option>
|
<option value="1"><?= $home['active'] ?></option>
|
||||||
<option value="0"><?= $home['passive'] ?></option>
|
<option value="0"><?= $home['passive'] ?></option>
|
||||||
<option value="2"><?= $home['exam_passed'] ?></option>
|
<option value="2"><?= $home['exam_passed'] ?></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="error_div2" class="alert alert-danger" role="alert"></div>
|
<div id="error_div2" class="alert alert-danger" role="alert"></div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
||||||
<button type="button" class="btn btn-success" onclick="updateUserDetails()"><?= $home['save'] ?></button>
|
<button type="button" class="btn btn-success" onclick="updateUserDetails()"><?= $home['save'] ?></button>
|
||||||
<input type="hidden" id="hidden_user_id" />
|
<input type="hidden" id="hidden_user_id" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#search_name').on('input', function() {
|
$('#search_name').on('input', function() {
|
||||||
readRecords();
|
readRecords();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Draggable modals
|
// Draggable modals
|
||||||
$(".modal-header").on("mousedown", function(mousedownEvt) {
|
$(".modal-header").on("mousedown", function(mousedownEvt) {
|
||||||
var $draggable = $(this);
|
var $draggable = $(this);
|
||||||
var x = mousedownEvt.pageX - $draggable.offset().left,
|
var x = mousedownEvt.pageX - $draggable.offset().left,
|
||||||
y = mousedownEvt.pageY - $draggable.offset().top;
|
y = mousedownEvt.pageY - $draggable.offset().top;
|
||||||
$("body").on("mousemove.draggable", function(mousemoveEvt) {
|
$("body").on("mousemove.draggable", function(mousemoveEvt) {
|
||||||
$draggable.closest(".modal-dialog").offset({
|
$draggable.closest(".modal-dialog").offset({
|
||||||
"left": mousemoveEvt.pageX - x,
|
"left": mousemoveEvt.pageX - x,
|
||||||
"top": mousemoveEvt.pageY - y
|
"top": mousemoveEvt.pageY - y
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").one("mouseup", function() {
|
$("body").one("mouseup", function() {
|
||||||
$("body").off("mousemove.draggable");
|
$("body").off("mousemove.draggable");
|
||||||
});
|
});
|
||||||
$draggable.closest(".modal").one("bs.modal.hide", function() {
|
$draggable.closest(".modal").one("bs.modal.hide", function() {
|
||||||
$("body").off("mousemove.draggable");
|
$("body").off("mousemove.draggable");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@ -1,44 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
$loginPage['login'] = 'Login';
|
$loginPage['login'] = 'Login';
|
||||||
$loginPage['username'] = 'Username';
|
$loginPage['username'] = 'Username';
|
||||||
$loginPage['password'] = 'Password';
|
$loginPage['password'] = 'Password';
|
||||||
$loginPage['login_error'] = 'Wrong username or password.';
|
$loginPage['login_error'] = 'Wrong username or password.';
|
||||||
|
|
||||||
$home['home_page'] = 'Home';
|
$home['home_page'] = 'Home';
|
||||||
$home['favicon'] = 'https://www.archlinexp.com/public/img/icons/favicon_2.ico';
|
$home['favicon'] = 'https://www.archlinexp.com/public/img/icons/favicon_2.ico';
|
||||||
$home['logout'] = 'Logout';
|
$home['logout'] = 'Logout';
|
||||||
$home['add_new_student'] = 'Add new student';
|
$home['add_new_student'] = 'Add new student';
|
||||||
$home['end_of_course'] = 'End of course';
|
$home['end_of_course'] = 'End of course';
|
||||||
$home['import_from_excel'] = 'Import from Excel';
|
$home['import_from_excel'] = 'Import from Excel';
|
||||||
$home['download_sample'] = 'Download excel sample';
|
$home['download_sample'] = 'Download excel sample';
|
||||||
$home['import_students'] = 'Import students from excel';
|
$home['import_students'] = 'Import students from excel';
|
||||||
$home['search'] = 'Search';
|
$home['search'] = 'Search';
|
||||||
$home['send_email'] = 'Send email';
|
$home['send_email'] = 'Send email';
|
||||||
$home['name'] = 'Name';
|
$home['name'] = 'Name';
|
||||||
$home['email'] = 'Email';
|
$home['email'] = 'Email';
|
||||||
$home['telephone'] = 'Telephone';
|
$home['telephone'] = 'Telephone';
|
||||||
$home['status'] = 'Status';
|
$home['status'] = 'Status';
|
||||||
$home['serial_number'] = 'Serial Number';
|
$home['serial_number'] = 'Serial Number';
|
||||||
$home['close'] = 'Close';
|
$home['close'] = 'Close';
|
||||||
$home['confirm_email'] = 'Confirm email';
|
$home['confirm_email'] = 'Confirm email';
|
||||||
$home['add'] = 'Add';
|
$home['add'] = 'Add';
|
||||||
$home['edit_student'] = 'Edit student';
|
$home['edit_student'] = 'Edit student';
|
||||||
$home['course'] = 'Course';
|
$home['course'] = 'Course';
|
||||||
$home['active'] = 'Active';
|
$home['active'] = 'Active';
|
||||||
$home['passive'] = 'Passive';
|
$home['passive'] = 'Passive';
|
||||||
$home['exam_passed'] = 'Passed the exam';
|
$home['exam_passed'] = 'Passed the exam';
|
||||||
$home['save'] = 'Save';
|
$home['save'] = 'Save';
|
||||||
$home['sample_excel'] = 'public/student_import.xlsx';
|
$home['sample_excel'] = 'public/student_import.xlsx';
|
||||||
$home['search_all'] = 'Search in all groups';
|
$home['search_all'] = 'Search in all groups';
|
||||||
$home['export_excel'] = 'Download group information';
|
$home['export_excel'] = 'Download group information';
|
||||||
$home['archiv_desc'] = 'The ARCHIV group contains the data of students who dropped out of their studies and were therefore deleted from the group. The student can be permanently deleted here. If the student needs to be placed in a student group again, he must be transferred to the appropriate group under the Edit menu item.';
|
$home['archiv_desc'] = 'The ARCHIV group contains the data of students who dropped out of their studies and were therefore deleted from the group. The student can be permanently deleted here. If the student needs to be placed in a student group again, he must be transferred to the appropriate group under the Edit menu item.';
|
||||||
|
|
||||||
$process['wrong_course'] = 'Incorrect course.';
|
$process['wrong_course'] = 'Incorrect course.';
|
||||||
$process['user_already'] = 'A student with such an email address has already been added.';
|
$process['user_already'] = 'A student with such an email address has already been added.';
|
||||||
$process['user_failed'] = 'Failed to add student.';
|
$process['user_failed'] = 'Failed to add student.';
|
||||||
$process['email_failed'] = 'Failed to send email.';
|
$process['email_failed'] = 'Failed to send email.';
|
||||||
$process['number_name'] = 'The name cannot be a number';
|
$process['number_name'] = 'The name cannot be a number';
|
||||||
$process['missing_email'] = 'Missing email address';
|
$process['missing_email'] = 'Missing email address';
|
||||||
$process['invalid_email'] = 'Invalid email address';
|
$process['invalid_email'] = 'Invalid email address';
|
||||||
$process['email_already'] = 'A student with such an email address has already been added';
|
$process['email_already'] = 'A student with such an email address has already been added';
|
||||||
$process['other_school'] = 'Student at another school';
|
$process['other_school'] = 'Student at another school';
|
||||||
|
|||||||
@ -1,44 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
$loginPage['login'] = 'Bejelentkezés';
|
$loginPage['login'] = 'Bejelentkezés';
|
||||||
$loginPage['username'] = 'Felhasználónév';
|
$loginPage['username'] = 'Felhasználónév';
|
||||||
$loginPage['password'] = 'Jelszó';
|
$loginPage['password'] = 'Jelszó';
|
||||||
$loginPage['login_error'] = 'Helytelen felhasználónév vagy jelszó!';
|
$loginPage['login_error'] = 'Helytelen felhasználónév vagy jelszó!';
|
||||||
|
|
||||||
$home['home_page'] = 'Főoldal';
|
$home['home_page'] = 'Főoldal';
|
||||||
$home['favicon'] = 'public/favicon_1.ico';
|
$home['favicon'] = 'public/favicon_1.ico';
|
||||||
$home['logout'] = 'Kijelentkezés';
|
$home['logout'] = 'Kijelentkezés';
|
||||||
$home['add_new_student'] = 'Új diák hozzáadása';
|
$home['add_new_student'] = 'Új diák hozzáadása';
|
||||||
$home['end_of_course'] = 'Kurzus vége';
|
$home['end_of_course'] = 'Kurzus vége';
|
||||||
$home['import_from_excel'] = 'Csoportos hozzáadás';
|
$home['import_from_excel'] = 'Csoportos hozzáadás';
|
||||||
$home['download_sample'] = 'Minta excel letöltése';
|
$home['download_sample'] = 'Minta excel letöltése';
|
||||||
$home['import_students'] = 'Diákok importálása excelből';
|
$home['import_students'] = 'Diákok importálása excelből';
|
||||||
$home['search'] = 'Keresés';
|
$home['search'] = 'Keresés';
|
||||||
$home['send_email'] = 'Email küldése';
|
$home['send_email'] = 'Email küldése';
|
||||||
$home['name'] = 'Név';
|
$home['name'] = 'Név';
|
||||||
$home['email'] = 'Email cím';
|
$home['email'] = 'Email cím';
|
||||||
$home['telephone'] = 'Telefonszám';
|
$home['telephone'] = 'Telefonszám';
|
||||||
$home['status'] = 'Státusz';
|
$home['status'] = 'Státusz';
|
||||||
$home['serial_number'] = 'Sorozatszám';
|
$home['serial_number'] = 'Sorozatszám';
|
||||||
$home['close'] = 'Bezárás';
|
$home['close'] = 'Bezárás';
|
||||||
$home['confirm_email'] = 'Email cím megerősítése';
|
$home['confirm_email'] = 'Email cím megerősítése';
|
||||||
$home['add'] = 'Hozzáadás';
|
$home['add'] = 'Hozzáadás';
|
||||||
$home['edit_student'] = 'Diák szerkesztése';
|
$home['edit_student'] = 'Diák szerkesztése';
|
||||||
$home['course'] = 'Kurzus';
|
$home['course'] = 'Kurzus';
|
||||||
$home['active'] = 'Aktív';
|
$home['active'] = 'Aktív';
|
||||||
$home['passive'] = 'Passzív';
|
$home['passive'] = 'Passzív';
|
||||||
$home['exam_passed'] = 'Levizsgázott';
|
$home['exam_passed'] = 'Levizsgázott';
|
||||||
$home['save'] = 'Mentés';
|
$home['save'] = 'Mentés';
|
||||||
$home['sample_excel'] = 'public/diak_import.xlsx';
|
$home['sample_excel'] = 'public/diak_import.xlsx';
|
||||||
$home['search_all'] = 'Keresés az összes csoportban';
|
$home['search_all'] = 'Keresés az összes csoportban';
|
||||||
$home['export_excel'] = 'Csoport adatainak letöltése';
|
$home['export_excel'] = 'Csoport adatainak letöltése';
|
||||||
$home['archiv_desc'] = 'Az ARCHIV csoportban azok a diákok adatai találhatók, akik félbe hagyták tanulmányaikat és ezért törölték a csoportból. A diákot véglegesen törölni itt lehet. Amennyiben a diákot újra hallgatói csoportba kell helyezni, akkor a Szerkesztés menüpont alatt a megfelelő csoportba kell áttenni.';
|
$home['archiv_desc'] = 'Az ARCHIV csoportban azok a diákok adatai találhatók, akik félbe hagyták tanulmányaikat és ezért törölték a csoportból. A diákot véglegesen törölni itt lehet. Amennyiben a diákot újra hallgatói csoportba kell helyezni, akkor a Szerkesztés menüpont alatt a megfelelő csoportba kell áttenni.';
|
||||||
|
|
||||||
$process['wrong_course'] = 'Hibás kurzus!';
|
$process['wrong_course'] = 'Hibás kurzus!';
|
||||||
$process['user_already'] = 'Ilyen email címmel van már felvéve diák!';
|
$process['user_already'] = 'Ilyen email címmel van már felvéve diák!';
|
||||||
$process['user_failed'] = 'Nem sikerült felvenni a diákot';
|
$process['user_failed'] = 'Nem sikerült felvenni a diákot';
|
||||||
$process['email_failed'] = 'Email küldés sikertelen!';
|
$process['email_failed'] = 'Email küldés sikertelen!';
|
||||||
$process['number_name'] = 'A név nem lehet szám';
|
$process['number_name'] = 'A név nem lehet szám';
|
||||||
$process['missing_email'] = 'Hiányzó email cím';
|
$process['missing_email'] = 'Hiányzó email cím';
|
||||||
$process['invalid_email'] = 'Nem érvényes email cím';
|
$process['invalid_email'] = 'Nem érvényes email cím';
|
||||||
$process['email_already'] = 'Ilyen email címmel van már felvéve diák';
|
$process['email_already'] = 'Ilyen email címmel van már felvéve diák';
|
||||||
$process['other_school'] = 'Másik iskola hallgatója';
|
$process['other_school'] = 'Másik iskola hallgatója';
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
session_unset();
|
session_unset();
|
||||||
session_destroy();
|
session_destroy();
|
||||||
|
|
||||||
header("location:login");
|
header("location:login");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@ -1,335 +1,335 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!class_exists('Student')) require_once("../common_cadline_libraries/crm_hardlock.class.php");
|
if (!class_exists('Student')) require_once("../common_cadline_libraries/crm_hardlock.class.php");
|
||||||
|
|
||||||
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
||||||
require_once('language/hu-HU.lang.php');
|
require_once('language/hu-HU.lang.php');
|
||||||
else
|
else
|
||||||
require_once('language/en-GB.lang.php');
|
require_once('language/en-GB.lang.php');
|
||||||
|
|
||||||
$action = isset($_POST['action']) ? $_POST['action'] : '';
|
$action = isset($_POST['action']) ? $_POST['action'] : '';
|
||||||
if (isset($action) && $action != '') {
|
if (isset($action) && $action != '') {
|
||||||
$student = new Student();
|
$student = new Student();
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'readrecord': { // Get the students
|
case 'readrecord': { // Get the students
|
||||||
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
|
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
|
||||||
if (!isset($course_id) || $course_id == '') {
|
if (!isset($course_id) || $course_id == '') {
|
||||||
echo json_encode($process['wrong_course']);
|
echo json_encode($process['wrong_course']);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$courses = json_decode($_POST['courseArray']);
|
$courses = json_decode($_POST['courseArray']);
|
||||||
|
|
||||||
$search = isset($_POST['search_name']) ? $_POST['search_name'] : '';
|
$search = isset($_POST['search_name']) ? $_POST['search_name'] : '';
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$studentsArray = $student->getAllStudents($search, $courses);
|
$studentsArray = $student->getAllStudents($search, $courses);
|
||||||
|
|
||||||
echo json_encode($studentsArray);
|
echo json_encode($studentsArray);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'readEmailRecord': {
|
case 'readEmailRecord': {
|
||||||
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
|
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
|
||||||
if (!isset($course_id) || $course_id == '') {
|
if (!isset($course_id) || $course_id == '') {
|
||||||
echo json_encode($process['wrong_course']);
|
echo json_encode($process['wrong_course']);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$studentsArray = $student->getAllStudents($search, []);
|
$studentsArray = $student->getAllStudents($search, []);
|
||||||
|
|
||||||
echo json_encode($studentsArray);
|
echo json_encode($studentsArray);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'create': { // Insert a new student
|
case 'create': { // Insert a new student
|
||||||
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
|
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
|
||||||
if (!isset($course_id) || $course_id == '') {
|
if (!isset($course_id) || $course_id == '') {
|
||||||
echo json_encode($process['wrong_course']);
|
echo json_encode($process['wrong_course']);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = $_POST["name"];
|
$name = $_POST["name"];
|
||||||
$email = $_POST["email"];
|
$email = $_POST["email"];
|
||||||
$phone = $_POST["phone"];
|
$phone = $_POST["phone"];
|
||||||
$school_id = $_POST["schoolid"];
|
$school_id = $_POST["schoolid"];
|
||||||
|
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$course = $student->getCourseByID();
|
$course = $student->getCourseByID();
|
||||||
|
|
||||||
$sql = "SELECT * FROM `" . CRMADATBAZIS . "`.`students` WHERE email = ?";
|
$sql = "SELECT * FROM `" . CRMADATBAZIS . "`.`students` WHERE email = ?";
|
||||||
$student->query($sql, array('s', $email));
|
$student->query($sql, array('s', $email));
|
||||||
$students = $student->fetchNext();
|
$students = $student->fetchNext();
|
||||||
|
|
||||||
if (!empty($students)) {
|
if (!empty($students)) {
|
||||||
if ($student->studentInOtherSchool($school_id, $students['school_id']))
|
if ($student->studentInOtherSchool($school_id, $students['school_id']))
|
||||||
echo json_encode($process['other_school']);
|
echo json_encode($process['other_school']);
|
||||||
else
|
else
|
||||||
echo json_encode($process['user_already']);
|
echo json_encode($process['user_already']);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$student->setName($name);
|
$student->setName($name);
|
||||||
$student->setEmail($email);
|
$student->setEmail($email);
|
||||||
$student->setPhone($phone);
|
$student->setPhone($phone);
|
||||||
$student->setSchoolID($school_id);
|
$student->setSchoolID($school_id);
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$student->setEndDate($course["vegzes_ideje"]);
|
$student->setEndDate($course["vegzes_ideje"]);
|
||||||
$student->setSchool();
|
$student->setSchool();
|
||||||
$student->setCourse();
|
$student->setCourse();
|
||||||
$student->addStudent();
|
$student->addStudent();
|
||||||
|
|
||||||
if ($student->getnUserID() == null) {
|
if ($student->getnUserID() == null) {
|
||||||
echo json_encode($process['user_failed']);
|
echo json_encode($process['user_failed']);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$student->generateStudentPassword();
|
$student->generateStudentPassword();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'delete': { // Delete the selected student
|
case 'delete': { // Delete the selected student
|
||||||
if (isset($_POST['deletedid'])) $student->deleteStudent($_POST['deletedid']);
|
if (isset($_POST['deletedid'])) $student->deleteStudent($_POST['deletedid']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'details': { // Get the selected student's details
|
case 'details': { // Get the selected student's details
|
||||||
if (isset($_POST["editid"])) {
|
if (isset($_POST["editid"])) {
|
||||||
$userid = $_POST["editid"];
|
$userid = $_POST["editid"];
|
||||||
$response = array();
|
$response = array();
|
||||||
$student->getStudent($_POST["editid"], $response);
|
$student->getStudent($_POST["editid"], $response);
|
||||||
|
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
} else {
|
} else {
|
||||||
$response["status"] = 200;
|
$response["status"] = 200;
|
||||||
$response["message"] = "Invalid Request!";
|
$response["message"] = "Invalid Request!";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'update': { // Edit the selected student
|
case 'update': { // Edit the selected student
|
||||||
if (isset($_POST["hidden_user_id"])) {
|
if (isset($_POST["hidden_user_id"])) {
|
||||||
$userid = $_POST["hidden_user_id"];
|
$userid = $_POST["hidden_user_id"];
|
||||||
$name = $_POST["name"];
|
$name = $_POST["name"];
|
||||||
$email = $_POST["email"];
|
$email = $_POST["email"];
|
||||||
$phone = $_POST["phone"];
|
$phone = $_POST["phone"];
|
||||||
$course_id = $_POST["course_id"];
|
$course_id = $_POST["course_id"];
|
||||||
$status = $_POST["status"];
|
$status = $_POST["status"];
|
||||||
$isDelete = $_POST["isDelete"] == "Y";
|
$isDelete = $_POST["isDelete"] == "Y";
|
||||||
|
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$course = $student->getCourseByID();
|
$course = $student->getCourseByID();
|
||||||
|
|
||||||
$student->setSchoolID($course['school_id']);
|
$student->setSchoolID($course['school_id']);
|
||||||
$school = $student->getSchoolByID();
|
$school = $student->getSchoolByID();
|
||||||
|
|
||||||
$begin = str_replace('-', '.', $course["begin"]);
|
$begin = str_replace('-', '.', $course["begin"]);
|
||||||
$end = str_replace('-', '.', $course["vegzes_ideje"]);
|
$end = str_replace('-', '.', $course["vegzes_ideje"]);
|
||||||
$strEducation = $school['username'] . " " . $course['course_code'] . " " . $begin . " - " . $end;
|
$strEducation = $school['username'] . " " . $course['course_code'] . " " . $begin . " - " . $end;
|
||||||
|
|
||||||
$student->setName($name);
|
$student->setName($name);
|
||||||
$student->setEmail($email);
|
$student->setEmail($email);
|
||||||
$student->setPhone($phone);
|
$student->setPhone($phone);
|
||||||
$student->setSchoolID($course['school_id']);
|
$student->setSchoolID($course['school_id']);
|
||||||
$student->setnSchoolID($school['nSchoolID']);
|
$student->setnSchoolID($school['nSchoolID']);
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$student->setEndDate($course["vegzes_ideje"]);
|
$student->setEndDate($course["vegzes_ideje"]);
|
||||||
$student->setEducation($strEducation);
|
$student->setEducation($strEducation);
|
||||||
$student->setSchool();
|
$student->setSchool();
|
||||||
$student->setCourse();
|
$student->setCourse();
|
||||||
$student->setStatus($status);
|
$student->setStatus($status);
|
||||||
$student->updateStudent($userid, $isDelete);
|
$student->updateStudent($userid, $isDelete);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'sendEmail': { // Send email to the selected students
|
case 'sendEmail': { // Send email to the selected students
|
||||||
if (isset($_POST['selected'])) {
|
if (isset($_POST['selected'])) {
|
||||||
$selected = json_decode(stripslashes($_POST['selected']));
|
$selected = json_decode(stripslashes($_POST['selected']));
|
||||||
$school_id = $_POST['school_id'];
|
$school_id = $_POST['school_id'];
|
||||||
$course_id = $_POST['course_id'];
|
$course_id = $_POST['course_id'];
|
||||||
$isSend = array();
|
$isSend = array();
|
||||||
$error = false;
|
$error = false;
|
||||||
|
|
||||||
$student->setSchoolID($school_id);
|
$student->setSchoolID($school_id);
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$student->setSchool();
|
$student->setSchool();
|
||||||
$student->setCourse();
|
$student->setCourse();
|
||||||
|
|
||||||
require_once($_SERVER['DOCUMENT_ROOT'] . '/maintenance/libraries/phpmailer/PHPMailerAutoload.php');
|
require_once($_SERVER['DOCUMENT_ROOT'] . '/maintenance/libraries/phpmailer/PHPMailerAutoload.php');
|
||||||
require_once($_SERVER['DOCUMENT_ROOT'] . '/maintenance/config.mail.php');
|
require_once($_SERVER['DOCUMENT_ROOT'] . '/maintenance/config.mail.php');
|
||||||
|
|
||||||
$mail = new PHPMailer();
|
$mail = new PHPMailer();
|
||||||
|
|
||||||
$mail->isSMTP();
|
$mail->isSMTP();
|
||||||
|
|
||||||
$mail->CharSet = 'UTF-8';
|
$mail->CharSet = 'UTF-8';
|
||||||
$mail->Host = $mailconfig['Host'];
|
$mail->Host = $mailconfig['Host'];
|
||||||
$mail->Port = $mailconfig['Port'];
|
$mail->Port = $mailconfig['Port'];
|
||||||
$mail->SMTPAuth = true;
|
$mail->SMTPAuth = true;
|
||||||
$mail->SMTPKeepAlive = true;
|
$mail->SMTPKeepAlive = true;
|
||||||
|
|
||||||
$mail->Username = $mailconfig['Username'];
|
$mail->Username = $mailconfig['Username'];
|
||||||
$mail->Password = $mailconfig['Password'];
|
$mail->Password = $mailconfig['Password'];
|
||||||
|
|
||||||
if ($student->schoolEmail != '') {
|
if ($student->schoolEmail != '') {
|
||||||
foreach ($selected as $student_id) {
|
foreach ($selected as $student_id) {
|
||||||
$student->sendDistributorEmail($student_id, $error, $isSend, $student->schoolEmail, $mail);
|
$student->sendDistributorEmail($student_id, $error, $isSend, $student->schoolEmail, $mail);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($isSend);
|
echo json_encode($isSend);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($selected as $student_id) {
|
foreach ($selected as $student_id) {
|
||||||
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
||||||
$student->sendEmail($student_id, $error, $isSend, $mail);
|
$student->sendEmail($student_id, $error, $isSend, $mail);
|
||||||
else
|
else
|
||||||
$student->sendEngEmail($student_id, $error, $isSend, $mail);
|
$student->sendEngEmail($student_id, $error, $isSend, $mail);
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg = "";
|
$msg = "";
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$to = "marketing@cadline.hu";
|
$to = "marketing@cadline.hu";
|
||||||
$subject = 'Email küldés hiba';
|
$subject = 'Email küldés hiba';
|
||||||
$headers = 'MIME-Version: 1.0' . "\r\n";
|
$headers = 'MIME-Version: 1.0' . "\r\n";
|
||||||
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
|
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
|
||||||
$headers .= "From: mate.nagy@cadline.hu" . "\r\n";
|
$headers .= "From: mate.nagy@cadline.hu" . "\r\n";
|
||||||
|
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
$msg .= "A következő email címekre nem ment ki a levél: ";
|
$msg .= "A következő email címekre nem ment ki a levél: ";
|
||||||
|
|
||||||
foreach ($isSend as $email) {
|
foreach ($isSend as $email) {
|
||||||
if ($counter == 0)
|
if ($counter == 0)
|
||||||
$msg .= $email;
|
$msg .= $email;
|
||||||
else
|
else
|
||||||
$msg .= ', ' . $email;
|
$msg .= ', ' . $email;
|
||||||
|
|
||||||
$counter++;
|
$counter++;
|
||||||
}
|
}
|
||||||
mail($to, $subject, $msg, $headers);
|
mail($to, $subject, $msg, $headers);
|
||||||
}
|
}
|
||||||
echo json_encode($isSend);
|
echo json_encode($isSend);
|
||||||
} else {
|
} else {
|
||||||
echo json_encode($process['email_failed']);
|
echo json_encode($process['email_failed']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'excel_export': {
|
case 'excel_export': {
|
||||||
require_once 'library/SimpleXLSXGen.php';
|
require_once 'library/SimpleXLSXGen.php';
|
||||||
|
|
||||||
$courses = array();
|
$courses = array();
|
||||||
$course_id = $_POST['excel_c_id'];
|
$course_id = $_POST['excel_c_id'];
|
||||||
$search = '';
|
$search = '';
|
||||||
|
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
|
|
||||||
$studentsArray = $student->getAllStudents($search, $courses);
|
$studentsArray = $student->getAllStudents($search, $courses);
|
||||||
$school = $student->getSchoolByCourse();
|
$school = $student->getSchoolByCourse();
|
||||||
|
|
||||||
$header = array();
|
$header = array();
|
||||||
|
|
||||||
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
||||||
$header = array('<b>Név</b>', '<b>Email</b>', '<b>Telefonszám</b>', '<b>Státusz</b>', '<b>ARCHLine.XP Sorozatszám</b>', '<b>Program indítások</b>');
|
$header = array('<b>Név</b>', '<b>Email</b>', '<b>Telefonszám</b>', '<b>Státusz</b>', '<b>ARCHLine.XP Sorozatszám</b>', '<b>Program indítások</b>');
|
||||||
else
|
else
|
||||||
$header = array('<b>Name</b>', '<b>Email</b>', '<b>Telephone Number</b>', '<b>Status</b>', '<b>ARCHLine.XP Serial Number</b>', '<b>Program Starts</b>');
|
$header = array('<b>Name</b>', '<b>Email</b>', '<b>Telephone Number</b>', '<b>Status</b>', '<b>ARCHLine.XP Serial Number</b>', '<b>Program Starts</b>');
|
||||||
|
|
||||||
$students = array($header);
|
$students = array($header);
|
||||||
$pwd = '';
|
$pwd = '';
|
||||||
|
|
||||||
foreach ($studentsArray as $stud) {
|
foreach ($studentsArray as $stud) {
|
||||||
if (preg_match('/>(.*?)</', $stud['prPass'], $pwd) == 1)
|
if (preg_match('/>(.*?)</', $stud['prPass'], $pwd) == 1)
|
||||||
$pwd = $pwd[1];
|
$pwd = $pwd[1];
|
||||||
|
|
||||||
$starts = $student->getProgramStarts($pwd);
|
$starts = $student->getProgramStarts($pwd);
|
||||||
$status = $student->getStudentStatus($stud['status']);
|
$status = $student->getStudentStatus($stud['status']);
|
||||||
$studentDatas = array($stud['name'], $stud['email'], $stud['phone'], $status, $pwd, $starts);
|
$studentDatas = array($stud['name'], $stud['email'], $stud['phone'], $status, $pwd, $starts);
|
||||||
array_push($students, $studentDatas);
|
array_push($students, $studentDatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
$xlsx = Shuchkin\SimpleXLSXGen::fromArray($students);
|
$xlsx = Shuchkin\SimpleXLSXGen::fromArray($students);
|
||||||
$xlsx->setDefaultFontSize(14);
|
$xlsx->setDefaultFontSize(14);
|
||||||
$xlsx->downloadAs($school['school_name'] . '_' . $school['course_name'] . '.xlsx');
|
$xlsx->downloadAs($school['school_name'] . '_' . $school['course_name'] . '.xlsx');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'excel_import': { // Import students from XLSX file
|
case 'excel_import': { // Import students from XLSX file
|
||||||
if (isset($_POST['schoolid'])) {
|
if (isset($_POST['schoolid'])) {
|
||||||
require_once 'library/SimpleXLSX.php';
|
require_once 'library/SimpleXLSX.php';
|
||||||
|
|
||||||
$school_id = $_POST["schoolid"];
|
$school_id = $_POST["schoolid"];
|
||||||
$course_id = $_POST["course_id"];
|
$course_id = $_POST["course_id"];
|
||||||
$values = array();
|
$values = array();
|
||||||
$error = array();
|
$error = array();
|
||||||
$xlsx = SimpleXLSX::parse($_FILES['file']['tmp_name']);
|
$xlsx = SimpleXLSX::parse($_FILES['file']['tmp_name']);
|
||||||
|
|
||||||
foreach ($xlsx->rows() as $k => $v) {
|
foreach ($xlsx->rows() as $k => $v) {
|
||||||
if ($k == 0) continue;
|
if ($k == 0) continue;
|
||||||
|
|
||||||
$values[] = array(
|
$values[] = array(
|
||||||
'name' => $v[0],
|
'name' => $v[0],
|
||||||
'email' => $v[1],
|
'email' => $v[1],
|
||||||
'phone' => $v[2]
|
'phone' => $v[2]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$student->setSchoolID($school_id);
|
$student->setSchoolID($school_id);
|
||||||
$student->setCourseID($course_id);
|
$student->setCourseID($course_id);
|
||||||
$student->setSchool();
|
$student->setSchool();
|
||||||
$student->setCourse();
|
$student->setCourse();
|
||||||
$course = $student->getCourseByID();
|
$course = $student->getCourseByID();
|
||||||
|
|
||||||
foreach ($values as $stud) {
|
foreach ($values as $stud) {
|
||||||
$name = $stud['name'];
|
$name = $stud['name'];
|
||||||
$email = str_replace(' ', '', $stud["email"]);
|
$email = str_replace(' ', '', $stud["email"]);
|
||||||
$phone = $stud["phone"];
|
$phone = $stud["phone"];
|
||||||
|
|
||||||
if ($name == '') continue;
|
if ($name == '') continue;
|
||||||
|
|
||||||
if (is_numeric($name)) {
|
if (is_numeric($name)) {
|
||||||
array_push($error, $process['number_name'] . ": " . $name);
|
array_push($error, $process['number_name'] . ": " . $name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($email == '') {
|
if ($email == '') {
|
||||||
array_push($error, $process['missing_email'] . ": " . $name);
|
array_push($error, $process['missing_email'] . ": " . $name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
array_push($error, $process['invalid_email'] . ": " . $email);
|
array_push($error, $process['invalid_email'] . ": " . $email);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT * FROM `" . CRMADATBAZIS . "`.`students` WHERE email = ?";
|
$sql = "SELECT * FROM `" . CRMADATBAZIS . "`.`students` WHERE email = ?";
|
||||||
$student->query($sql, array('s', $email));
|
$student->query($sql, array('s', $email));
|
||||||
$students = $student->fetchNext();
|
$students = $student->fetchNext();
|
||||||
|
|
||||||
if (!empty($students)) {
|
if (!empty($students)) {
|
||||||
if ($student->studentInOtherSchool($school_id, $students['school_id']))
|
if ($student->studentInOtherSchool($school_id, $students['school_id']))
|
||||||
array_push($error, $process['other_school'] . ": " . $email);
|
array_push($error, $process['other_school'] . ": " . $email);
|
||||||
else
|
else
|
||||||
array_push($error, $process['email_already'] . ": " . $email);
|
array_push($error, $process['email_already'] . ": " . $email);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$student->setName($name);
|
$student->setName($name);
|
||||||
$student->setEmail($email);
|
$student->setEmail($email);
|
||||||
$student->setPhone($phone);
|
$student->setPhone($phone);
|
||||||
$student->setEndDate($course["vegzes_ideje"]);
|
$student->setEndDate($course["vegzes_ideje"]);
|
||||||
$student->addStudent();
|
$student->addStudent();
|
||||||
|
|
||||||
if ($student->getnUserID() == null) {
|
if ($student->getnUserID() == null) {
|
||||||
array_push($error, $process['user_failed'] . ": " . $email);
|
array_push($error, $process['user_failed'] . ": " . $email);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$student->generateStudentPassword();
|
$student->generateStudentPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($error);
|
echo json_encode($error);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,58 +1,58 @@
|
|||||||
#login-form { margin-top: 15%; }
|
#login-form { margin-top: 15%; }
|
||||||
#error_div, #error_div2 { display: none; }
|
#error_div, #error_div2 { display: none; }
|
||||||
#pelda_excel { margin-left: -46%; }
|
#pelda_excel { margin-left: -46%; }
|
||||||
#excl_btn { margin-left: 73.5%; }
|
#excl_btn { margin-left: 73.5%; }
|
||||||
#file_input { margin-left: 73.5%; }
|
#file_input { margin-left: 73.5%; }
|
||||||
#h_div { margin-left: -2%; }
|
#h_div { margin-left: -2%; }
|
||||||
#loginbtn, .alert { margin-left: 1.3%; }
|
#loginbtn, .alert { margin-left: 1.3%; }
|
||||||
.disabled, .inactive { cursor: not-allowed !important; }
|
.disabled, .inactive { cursor: not-allowed !important; }
|
||||||
.modal-header { cursor: move; }
|
.modal-header { cursor: move; }
|
||||||
|
|
||||||
#div_pagination {
|
#div_pagination {
|
||||||
width:100%;
|
width:100%;
|
||||||
margin-top:5px;
|
margin-top:5px;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button1 {
|
.button1 {
|
||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
border:0px;
|
border:0px;
|
||||||
background-color:mediumpurple;
|
background-color:mediumpurple;
|
||||||
color:white;
|
color:white;
|
||||||
padding:10px 20px;
|
padding:10px 20px;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#loading_gif {
|
#loading_gif {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-left: 20%;
|
margin-left: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search_all {
|
#search_all {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-txt {
|
#search-txt {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#archiv_text {
|
#archiv_text {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 600px) {
|
@media only screen and (max-width: 600px) {
|
||||||
#pelda_excel { margin-left: -85% !important; }
|
#pelda_excel { margin-left: -85% !important; }
|
||||||
#excl_btn { margin-left: 0% !important; }
|
#excl_btn { margin-left: 0% !important; }
|
||||||
#email_btn { margin-top: 5% !important; }
|
#email_btn { margin-top: 5% !important; }
|
||||||
#h_div { margin-top: 5% !important; }
|
#h_div { margin-top: 5% !important; }
|
||||||
#file_input { margin-left: 0% !important; }
|
#file_input { margin-left: 0% !important; }
|
||||||
#h_div { margin-left: 0% !important; }
|
#h_div { margin-left: 0% !important; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 600px) {
|
@media only screen and (min-width: 600px) {
|
||||||
#export-form { position: absolute; }
|
#export-form { position: absolute; }
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
14
cadline/docroot/iskolak/public/js/gijgo.min.js
vendored
14
cadline/docroot/iskolak/public/js/gijgo.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,93 +1,93 @@
|
|||||||
<?php
|
<?php
|
||||||
if (version_compare(PHP_VERSION, '5.3.1', '<')) { die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!'); }
|
if (version_compare(PHP_VERSION, '5.3.1', '<')) { die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!'); }
|
||||||
|
|
||||||
define('_JEXEC', 1);
|
define('_JEXEC', 1);
|
||||||
|
|
||||||
if (file_exists(__DIR__ . '/defines.php')) { include_once __DIR__ . '/defines.php'; }
|
if (file_exists(__DIR__ . '/defines.php')) { include_once __DIR__ . '/defines.php'; }
|
||||||
|
|
||||||
if (!defined('_JDEFINES'))
|
if (!defined('_JDEFINES'))
|
||||||
{
|
{
|
||||||
define('JPATH_BASE', __DIR__);
|
define('JPATH_BASE', __DIR__);
|
||||||
require_once JPATH_BASE . '/includes/defines.php';
|
require_once JPATH_BASE . '/includes/defines.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once JPATH_BASE . '/includes/framework.php';
|
require_once JPATH_BASE . '/includes/framework.php';
|
||||||
|
|
||||||
$app = JFactory::getApplication('site'); // Instantiate the application.
|
$app = JFactory::getApplication('site'); // Instantiate the application.
|
||||||
|
|
||||||
jimport('joomla.plugin.helper');
|
jimport('joomla.plugin.helper');
|
||||||
|
|
||||||
require_once (JPATH_BASE .'/libraries/joomla/factory.php'); // JFactory
|
require_once (JPATH_BASE .'/libraries/joomla/factory.php'); // JFactory
|
||||||
|
|
||||||
$credentials['username'] = trim($_POST['username']);
|
$credentials['username'] = trim($_POST['username']);
|
||||||
$credentials['password'] = trim($_POST['password']);
|
$credentials['password'] = trim($_POST['password']);
|
||||||
$credentials['serial'] = (int)$_POST['serial'];
|
$credentials['serial'] = (int)$_POST['serial'];
|
||||||
|
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query
|
$query
|
||||||
->select('id, password')
|
->select('id, password')
|
||||||
->from('#__users')
|
->from('#__users')
|
||||||
->where('username=' . $db->quote($credentials['username']));
|
->where('username=' . $db->quote($credentials['username']));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$result = $db->loadObject();
|
$result = $db->loadObject();
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$match = JUserHelper::verifyPassword($credentials['password'], $result->password, $result->id);
|
$match = JUserHelper::verifyPassword($credentials['password'], $result->password, $result->id);
|
||||||
|
|
||||||
if ($match === true)
|
if ($match === true)
|
||||||
{
|
{
|
||||||
$user = JUser::getInstance($result->id); // Bring this in line with the rest of the system
|
$user = JUser::getInstance($result->id); // Bring this in line with the rest of the system
|
||||||
$error = $app->login($credentials); //perform the login action
|
$error = $app->login($credentials); //perform the login action
|
||||||
$logged_user = JFactory::getUser();
|
$logged_user = JFactory::getUser();
|
||||||
$expire = time()+86400;
|
$expire = time()+86400;
|
||||||
|
|
||||||
$db->setQuery('SELECT * FROM `panorama`.`user` WHERE serial='.$credentials['serial'].';');
|
$db->setQuery('SELECT * FROM `panorama`.`user` WHERE serial='.$credentials['serial'].';');
|
||||||
$res = $db->loadObjectList();
|
$res = $db->loadObjectList();
|
||||||
|
|
||||||
$tomb=array(
|
$tomb=array(
|
||||||
'serial'=>$db->quote($credentials['serial']),
|
'serial'=>$db->quote($credentials['serial']),
|
||||||
'nUserID'=>$db->quote($logged_user->nUserID),
|
'nUserID'=>$db->quote($logged_user->nUserID),
|
||||||
'strName'=>$db->quote($logged_user->name),
|
'strName'=>$db->quote($logged_user->name),
|
||||||
'expire'=>$db->quote(date("Y-m-d H:i:s", $expire)),
|
'expire'=>$db->quote(date("Y-m-d H:i:s", $expire)),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($res)) // ha még egyáltalán nincs benne a széria szám
|
if (empty($res)) // ha még egyáltalán nincs benne a széria szám
|
||||||
{
|
{
|
||||||
$query=$db->getQuery(true);
|
$query=$db->getQuery(true);
|
||||||
$query
|
$query
|
||||||
->insert("`panorama`.`user`")
|
->insert("`panorama`.`user`")
|
||||||
->columns($db->quoteName(array_keys($tomb)))
|
->columns($db->quoteName(array_keys($tomb)))
|
||||||
->values(implode(',', $tomb));
|
->values(implode(',', $tomb));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
$result=$db->insertid();
|
$result=$db->insertid();
|
||||||
}
|
}
|
||||||
else if ((int)$res[0]->nUserID==0) // ha facebook-al már be van jelentkezve
|
else if ((int)$res[0]->nUserID==0) // ha facebook-al már be van jelentkezve
|
||||||
{
|
{
|
||||||
foreach ($tomb as $k=>$v) $values[]=$db->quoteName($k)."=".$v;
|
foreach ($tomb as $k=>$v) $values[]=$db->quoteName($k)."=".$v;
|
||||||
|
|
||||||
$query=$db->getQuery(true);
|
$query=$db->getQuery(true);
|
||||||
$query
|
$query
|
||||||
->update("`panorama`.`user`")
|
->update("`panorama`.`user`")
|
||||||
->set($values)
|
->set($values)
|
||||||
->where(array('`id`='.$res[0]->id));
|
->where(array('`id`='.$res[0]->id));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$result=$db->execute();
|
$result=$db->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie("serial",$credentials['serial'],$expire,"/",".archlinexp.com");
|
setcookie("serial",$credentials['serial'],$expire,"/",".archlinexp.com");
|
||||||
//print_r($_COOKIE); die();
|
//print_r($_COOKIE); die();
|
||||||
$app->redirect('http://panorama.archlinexp.com/auth/'.$credentials['serial']); //redirect logged in user
|
$app->redirect('http://panorama.archlinexp.com/auth/'.$credentials['serial']); //redirect logged in user
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$app->redirect('http://panorama.archlinexp.com/auth/'.$credentials['serial'].'/invalid'); //redirect logged in user
|
$app->redirect('http://panorama.archlinexp.com/auth/'.$credentials['serial'].'/invalid'); //redirect logged in user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
die('Cound not find user in the database'); // Invalid user - Primitive error handling
|
die('Cound not find user in the database'); // Invalid user - Primitive error handling
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,476 +1,476 @@
|
|||||||
<?php
|
<?php
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* eredeti url: http://www.archlinexp.com/index.php?menu=tips2012&lang=hun&version=1&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
* eredeti url: http://www.archlinexp.com/index.php?menu=tips2012&lang=hun&version=1&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
||||||
* eredeti url: http://old.archlinexp.com/tips/tips2009/hun/1/OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=/46.139.109.235
|
* eredeti url: http://old.archlinexp.com/tips/tips2009/hun/1/OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=/46.139.109.235
|
||||||
* új url: http://www.archlinexp.com/maintenance/tips.php?lang=hun&version=2&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
* új url: http://www.archlinexp.com/maintenance/tips.php?lang=hun&version=2&session=OTA0NkEzMTlBMDcwQTE3NkE4NzRBMzc1QTc3NkEwNzJBNTc0Q0Y3NUE3NzdBMjdGQTc3RUE4NzJBNDcwQTgxOUNGNzVDRjc3QTA3NkEyNzdBMzZCQTM3MEJENzVBNTA3QkQ3MkEwN0ZBMDAzQTYxOUEyNjhBOTY4QTA3NEJFNzZCRTc3RTIyMUY1MjNCRTI4QTE3N0E4NzE=
|
||||||
* logfilter=0 - csak a legfontosabb logok;
|
* logfilter=0 - csak a legfontosabb logok;
|
||||||
* logfilter=10 - minden logot küld;
|
* logfilter=10 - minden logot küld;
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
//die();
|
//die();
|
||||||
if (!class_exists('crm_hardlock')) require_once("/var/www/hosting/archline.hu/sub/common_cadline_libraries/crm_hardlock.class.php");
|
if (!class_exists('crm_hardlock')) require_once("/var/www/hosting/archline.hu/sub/common_cadline_libraries/crm_hardlock.class.php");
|
||||||
if (!class_exists('crm_users')) require_once("/var/www/hosting/archline.hu/sub/common_cadline_libraries/crm_users.class.php");
|
if (!class_exists('crm_users')) require_once("/var/www/hosting/archline.hu/sub/common_cadline_libraries/crm_users.class.php");
|
||||||
|
|
||||||
error_log(print_r($_GET,TRUE),3,"../tmp/error_tips.log");
|
error_log(print_r($_GET,TRUE),3,"../tmp/error_tips.log");
|
||||||
|
|
||||||
$user_lang_db = $user_lang = $origlang = (isset($_GET['lang']) && empty($_GET['lang']) == false) ? trim($_GET['lang']) : 'eng';
|
$user_lang_db = $user_lang = $origlang = (isset($_GET['lang']) && empty($_GET['lang']) == false) ? trim($_GET['lang']) : 'eng';
|
||||||
//-$user_version = (isset($_GET['version']) && empty($_GET['version']) == false ? trim($_GET['version']) : NULL); nem ahsznalt valtozo volt, kivettem 2019-ben
|
//-$user_version = (isset($_GET['version']) && empty($_GET['version']) == false ? trim($_GET['version']) : NULL); nem ahsznalt valtozo volt, kivettem 2019-ben
|
||||||
$user_ssID = (isset($_GET['session']) && empty($_GET['session']) == false ? trim($_GET['session']) : NULL);
|
$user_ssID = (isset($_GET['session']) && empty($_GET['session']) == false ? trim($_GET['session']) : NULL);
|
||||||
$user_IP = $_SERVER['REMOTE_ADDR'];
|
$user_IP = $_SERVER['REMOTE_ADDR'];
|
||||||
$time=time();
|
$time=time();
|
||||||
|
|
||||||
//get country name from ip
|
//get country name from ip
|
||||||
$locale=@file_get_contents("http://freegeoip.net/xml/".$user_IP,FALSE, stream_context_create(array('http'=>array('timeout'=>2)) ) );
|
$locale=@file_get_contents("http://freegeoip.net/xml/".$user_IP,FALSE, stream_context_create(array('http'=>array('timeout'=>2)) ) );
|
||||||
$tomb = json_decode(json_encode(simplexml_load_string($locale)),TRUE);
|
$tomb = json_decode(json_encode(simplexml_load_string($locale)),TRUE);
|
||||||
$ctrname=$tomb["CountryName"];
|
$ctrname=$tomb["CountryName"];
|
||||||
$temp=explode(".", gethostbyaddr($user_IP));
|
$temp=explode(".", gethostbyaddr($user_IP));
|
||||||
|
|
||||||
if(!isset($ctrname) || $ctrname=='')
|
if(!isset($ctrname) || $ctrname=='')
|
||||||
$ctrname = 'unknown';
|
$ctrname = 'unknown';
|
||||||
|
|
||||||
if(!isset($user_ssID) || $user_ssID==''){
|
if(!isset($user_ssID) || $user_ssID==''){
|
||||||
$rec=array(
|
$rec=array(
|
||||||
'hiba'=>"Tips.php: unknown tips data\n",
|
'hiba'=>"Tips.php: unknown tips data\n",
|
||||||
'datum'=>date('Y-m-d H:i:s',time()));
|
'datum'=>date('Y-m-d H:i:s',time()));
|
||||||
crm_database::getInstance()->insert('a_hibak',$rec);
|
crm_database::getInstance()->insert('a_hibak',$rec);
|
||||||
return; //- ha nincs meg a kodolt stream, akkor semmilyen infor
|
return; //- ha nincs meg a kodolt stream, akkor semmilyen infor
|
||||||
}
|
}
|
||||||
|
|
||||||
$str_decoded = base64_decode($user_ssID); //decode the session string
|
$str_decoded = base64_decode($user_ssID); //decode the session string
|
||||||
|
|
||||||
sscanf(substr($str_decoded,0,4),'%04x',$keyDec);
|
sscanf(substr($str_decoded,0,4),'%04x',$keyDec);
|
||||||
$encoded = str_split(substr($str_decoded,4),4);
|
$encoded = str_split(substr($str_decoded,4),4);
|
||||||
$decoded = '';
|
$decoded = '';
|
||||||
|
|
||||||
foreach($encoded as $e) {
|
foreach($encoded as $e) {
|
||||||
sscanf($e,'%04x',$temp);
|
sscanf($e,'%04x',$temp);
|
||||||
if(strlen(substr(sprintf('%x',$temp^$keyDec),2))>0) {
|
if(strlen(substr(sprintf('%x',$temp^$keyDec),2))>0) {
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),0,2)));
|
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),0,2)));
|
||||||
} else {
|
} else {
|
||||||
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
$decoded .= chr(hexdec(substr(sprintf('%04x',$temp^$keyDec),2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pos = strpos($decoded, '#'); //ba 2018.07.04. atterunk a # separatorra. Ezidaig nem fordulhatott elo benne ilyen jel
|
$pos = strpos($decoded, '#'); //ba 2018.07.04. atterunk a # separatorra. Ezidaig nem fordulhatott elo benne ilyen jel
|
||||||
if($pos === false)
|
if($pos === false)
|
||||||
$separator = '_';
|
$separator = '_';
|
||||||
else
|
else
|
||||||
$separator = '#';
|
$separator = '#';
|
||||||
|
|
||||||
$numdata = substr_count($decoded, $separator); //ba most már kapunk adatot az oprendszerrol is
|
$numdata = substr_count($decoded, $separator); //ba most már kapunk adatot az oprendszerrol is
|
||||||
|
|
||||||
$osdata = '';
|
$osdata = '';
|
||||||
$reactivationCounter = 0;
|
$reactivationCounter = 0;
|
||||||
if( $numdata >= 11 )
|
if( $numdata >= 11 )
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $telepitesikod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID, $name, $email, $company, $phone, $newsletter, $reactivationCounter) = split($separator, $decoded);
|
list($empty, $pwd, $compID, $build, $ctrID, $telepitesikod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID, $name, $email, $company, $phone, $newsletter, $reactivationCounter) = split($separator, $decoded);
|
||||||
elseif( $numdata >= 6 )
|
elseif( $numdata >= 6 )
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $telepitesikod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID) = split($separator, $decoded);
|
list($empty, $pwd, $compID, $build, $ctrID, $telepitesikod, $osdata, $usGCMan, $usGCType, $usGCDriverVer, $npID, $partnerID) = split($separator, $decoded);
|
||||||
else
|
else
|
||||||
list($empty, $pwd, $compID, $build, $ctrID, $telepitesikod) = split($separator, $decoded);
|
list($empty, $pwd, $compID, $build, $ctrID, $telepitesikod) = split($separator, $decoded);
|
||||||
|
|
||||||
$crackedProgram = strpos($osdata, ".gray.") !== false ? true : false;
|
$crackedProgram = strpos($osdata, ".gray.") !== false ? true : false;
|
||||||
if($crackedProgram){ //- 2018-as proragramoktol(nehany 2018-as build nem fut ide be)
|
if($crackedProgram){ //- 2018-as proragramoktol(nehany 2018-as build nem fut ide be)
|
||||||
/*$crackedProgramDeactivated = false;
|
/*$crackedProgramDeactivated = false;
|
||||||
if(crm_hardlock::IsCalledFromMyIP()){
|
if(crm_hardlock::IsCalledFromMyIP()){
|
||||||
header('Content-Type: text/xml; charset=utf-8');
|
header('Content-Type: text/xml; charset=utf-8');
|
||||||
header('Content-Disposition: inline; filename=response.xml');
|
header('Content-Disposition: inline; filename=response.xml');
|
||||||
print '<'.'?'.'xml version="1.0" encoding="UTF-8" standalone="yes"'.'?'.'>
|
print '<'.'?'.'xml version="1.0" encoding="UTF-8" standalone="yes"'.'?'.'>
|
||||||
<Tips>
|
<Tips>
|
||||||
<Tip lang="en" version="2">
|
<Tip lang="en" version="2">
|
||||||
<path>/public/support/tips/en/</path>
|
<path>/public/support/tips/en/</path>
|
||||||
</Tip>
|
</Tip>
|
||||||
<actcode>'.$validTelepitesikod.'</actcode>
|
<actcode>'.$validTelepitesikod.'</actcode>
|
||||||
<Virtualization>true</Virtualization>
|
<Virtualization>true</Virtualization>
|
||||||
<logfilter>0</logfilter>
|
<logfilter>0</logfilter>
|
||||||
<loginEnabled>false</loginEnabled>
|
<loginEnabled>false</loginEnabled>
|
||||||
<PersonalMessage></PersonalMessage>
|
<PersonalMessage></PersonalMessage>
|
||||||
<graylink></graylink>
|
<graylink></graylink>
|
||||||
</Tips>';
|
</Tips>';
|
||||||
$crackedProgramDeactivated = true;
|
$crackedProgramDeactivated = true;
|
||||||
}*/
|
}*/
|
||||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
||||||
$message = "Crack: ".$decoded." || url: ".$actual_link;
|
$message = "Crack: ".$decoded." || url: ".$actual_link;
|
||||||
crm_hardlock::AddToDebugTable($message);
|
crm_hardlock::AddToDebugTable($message);
|
||||||
|
|
||||||
return; // A crackelt programokat nem taroljuk
|
return; // A crackelt programokat nem taroljuk
|
||||||
}
|
}
|
||||||
|
|
||||||
$validPassword = crm_hardlock::IsValidPassword($pwd);
|
$validPassword = crm_hardlock::IsValidPassword($pwd);
|
||||||
if($validPassword){
|
if($validPassword){
|
||||||
$verid=crm_hardlock::GetVeridFromPassword($pwd);
|
$verid=crm_hardlock::GetVeridFromPassword($pwd);
|
||||||
$softwareKey = crm_hardlock::IsSoftwareKey($pwd); // Software kulcs 2019
|
$softwareKey = crm_hardlock::IsSoftwareKey($pwd); // Software kulcs 2019
|
||||||
|
|
||||||
if(crm_hardlock::IsProgramExpiredByFixDate($pwd)) {
|
if(crm_hardlock::IsProgramExpiredByFixDate($pwd)) {
|
||||||
$message = "Tip error: expired program by IsProgramExpiredByFixDate || password: ".$pwd;
|
$message = "Tip error: expired program by IsProgramExpiredByFixDate || password: ".$pwd;
|
||||||
crm_hardlock::AddToDebugTable($message);
|
crm_hardlock::AddToDebugTable($message);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$verid = 0;
|
$verid = 0;
|
||||||
$softwareKey = false;
|
$softwareKey = false;
|
||||||
|
|
||||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
||||||
$message = "Tip error: invalid password || password: ".$pwd." || url: ".$actual_link;
|
$message = "Tip error: invalid password || password: ".$pwd." || url: ".$actual_link;
|
||||||
crm_hardlock::AddToDebugTable($message);
|
crm_hardlock::AddToDebugTable($message);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$validTelepitesikod = crm_hardlock::IsValidTimeCode($telepitesikod);
|
$validTelepitesikod = crm_hardlock::IsValidTimeCode($telepitesikod);
|
||||||
if($validTelepitesikod || ($validPassword && $softwareKey == false) ) //- hardware kulcseseten az isid a passwordbol generalhato
|
if($validTelepitesikod || ($validPassword && $softwareKey == false) ) //- hardware kulcseseten az isid a passwordbol generalhato
|
||||||
$isid=($softwareKey ? crm_hardlock::GetIsidFromTimeCode($telepitesikod) : substr($pwd,0,2).$verid);
|
$isid=($softwareKey ? crm_hardlock::GetIsidFromTimeCode($telepitesikod) : substr($pwd,0,2).$verid);
|
||||||
else {
|
else {
|
||||||
$telepitesikod = "";
|
$telepitesikod = "";
|
||||||
$isid = "";
|
$isid = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($validPassword == false && substr($decoded,0,2) == "##"){ //- 2018-as proragramoktol(nehany 2018-as build nem fut ide be)
|
if($validPassword == false && substr($decoded,0,2) == "##"){ //- 2018-as proragramoktol(nehany 2018-as build nem fut ide be)
|
||||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
||||||
$message = "Tip error: missing password || url: ".$actual_link;
|
$message = "Tip error: missing password || url: ".$actual_link;
|
||||||
crm_hardlock::AddToDebugTable($message);
|
crm_hardlock::AddToDebugTable($message);
|
||||||
}
|
}
|
||||||
if($validPassword && $validTelepitesikod == false && $verid > 35){ //- csak a 2019-es programokat es ujabbakat vizsgalunk, a regbbiekben elofordulhatnak hibas idokodok
|
if($validPassword && $validTelepitesikod == false && $verid > 35){ //- csak a 2019-es programokat es ujabbakat vizsgalunk, a regbbiekben elofordulhatnak hibas idokodok
|
||||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
||||||
$message = "Tip error: invalid timecode ".$decoded." || url: ".$actual_link;
|
$message = "Tip error: invalid timecode ".$decoded." || url: ".$actual_link;
|
||||||
crm_hardlock::AddToDebugTable($message);
|
crm_hardlock::AddToDebugTable($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($npID))
|
if(isset($npID))
|
||||||
$compid = crm_hardlock::AddOrUpdateComputer($npID, ''); // $comp_name = base64_decode($comp_name); // Ez meg nem jon be!
|
$compid = crm_hardlock::AddOrUpdateComputer($npID, ''); // $comp_name = base64_decode($comp_name); // Ez meg nem jon be!
|
||||||
|
|
||||||
$isNamirialAutoCreate = isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='2nt' /*-&& isset($telepitesikod) && $telepitesikod>''-*/ && $validPassword;
|
$isNamirialAutoCreate = isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='2nt' /*-&& isset($telepitesikod) && $telepitesikod>''-*/ && $validPassword;
|
||||||
$isBimLadderAutoCreate = isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='kbl' /*-&& isset($telepitesikod) && $telepitesikod>''-*/ && $validPassword;
|
$isBimLadderAutoCreate = isset($npID) && $npID>'' && isset($partnerID) && $partnerID=='kbl' /*-&& isset($telepitesikod) && $telepitesikod>''-*/ && $validPassword;
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*NAMIRIAL vagy BIMLADDER automata kulcskiadás és program létrehozás
|
*NAMIRIAL vagy BIMLADDER automata kulcskiadás és program létrehozás
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
if ($isNamirialAutoCreate || $isBimLadderAutoCreate) {
|
if ($isNamirialAutoCreate || $isBimLadderAutoCreate) {
|
||||||
$queryStr = "SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid."' AND partnerID = '".$partnerID."' AND verID =".$verid." LIMIT 1;";
|
$queryStr = "SELECT * FROM `".CRMADATBAZIS."`.`nonprofit` WHERE computer_id='".$compid."' AND partnerID = '".$partnerID."' AND verID =".$verid." LIMIT 1;";
|
||||||
crm_database::getInstance()->query($queryStr);
|
crm_database::getInstance()->query($queryStr);
|
||||||
$res=crm_database::getInstance()->fetchAssoc();
|
$res=crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
$rangeMin = $isNamirialAutoCreate ? 940001 : 920001;
|
$rangeMin = $isNamirialAutoCreate ? 940001 : 920001;
|
||||||
$rangeMax = $isNamirialAutoCreate ? 949999 : 929999;
|
$rangeMax = $isNamirialAutoCreate ? 949999 : 929999;
|
||||||
$interval = $isNamirialAutoCreate ? 90 : 30;
|
$interval = $isNamirialAutoCreate ? 90 : 30;
|
||||||
$country_id = $isNamirialAutoCreate ? 39 : 82;
|
$country_id = $isNamirialAutoCreate ? 39 : 82;
|
||||||
$topic_id = $isNamirialAutoCreate ? 366 : 368;
|
$topic_id = $isNamirialAutoCreate ? 366 : 368;
|
||||||
$info = $isNamirialAutoCreate ? 'Namirial nonprofit kulcs aktiválás' : 'BIMLadder nonprofit kulcs aktiválás';
|
$info = $isNamirialAutoCreate ? 'Namirial nonprofit kulcs aktiválás' : 'BIMLadder nonprofit kulcs aktiválás';
|
||||||
$contact = $isNamirialAutoCreate ? 8 : 9;
|
$contact = $isNamirialAutoCreate ? 8 : 9;
|
||||||
|
|
||||||
$type=crm_hardlock::GetTypeFromPassword($pwd);
|
$type=crm_hardlock::GetTypeFromPassword($pwd);
|
||||||
$ver=crm_hardlock::GetVersion(array('verPassword8and9'=>$verid));
|
$ver=crm_hardlock::GetVersion(array('verPassword8and9'=>$verid));
|
||||||
|
|
||||||
//ba nincs ehhez a gephez meg non-profit program regisztralva
|
//ba nincs ehhez a gephez meg non-profit program regisztralva
|
||||||
if (empty($res)) {
|
if (empty($res)) {
|
||||||
$hlNum=crm_hardlock::GetTheFirstNotUsedHlNumFromInterval($rangeMin,$rangeMax);
|
$hlNum=crm_hardlock::GetTheFirstNotUsedHlNumFromInterval($rangeMin,$rangeMax);
|
||||||
$pass=crm_hardlock::GeneratePassword($hlNum,0,$type,$ver['verCode']);
|
$pass=crm_hardlock::GeneratePassword($hlNum,0,$type,$ver['verCode']);
|
||||||
$aktKod=crm_hardlock::GenerateTimeCode($pass,$isid,$interval);
|
$aktKod=crm_hardlock::GenerateTimeCode($pass,$isid,$interval);
|
||||||
|
|
||||||
// Ha nincs benne a user a CRM-be, akkor hozza adjuk
|
// Ha nincs benne a user a CRM-be, akkor hozza adjuk
|
||||||
$userID=crm_users::addUser(array(
|
$userID=crm_users::addUser(array(
|
||||||
'strName'=>$name,
|
'strName'=>$name,
|
||||||
'strEMail'=>$email,
|
'strEMail'=>$email,
|
||||||
'strTel'=>$phone,
|
'strTel'=>$phone,
|
||||||
'nCtrID'=>$country_id,
|
'nCtrID'=>$country_id,
|
||||||
'old_db'=>'clusers_eng',
|
'old_db'=>'clusers_eng',
|
||||||
'dateInsert'=>$time,
|
'dateInsert'=>$time,
|
||||||
'strCompany'=>$company
|
'strCompany'=>$company
|
||||||
), $newsletter);
|
), $newsletter);
|
||||||
|
|
||||||
//ba regisztraljuk hozza a non-profit programot
|
//ba regisztraljuk hozza a non-profit programot
|
||||||
crm_hardlock::AddNonprofit(array(
|
crm_hardlock::AddNonprofit(array(
|
||||||
'isid'=>$isid,
|
'isid'=>$isid,
|
||||||
'verid'=>$verid,
|
'verid'=>$verid,
|
||||||
'hlID'=>$hlNum,
|
'hlID'=>$hlNum,
|
||||||
'nUserID'=>$userID,
|
'nUserID'=>$userID,
|
||||||
'add_datetime'=>date('Y-m-d H:i:s',$time),
|
'add_datetime'=>date('Y-m-d H:i:s',$time),
|
||||||
'expire_datetime'=>date('Y-m-d H:i:s', strtotime('+90 day', $time)),
|
'expire_datetime'=>date('Y-m-d H:i:s', strtotime('+90 day', $time)),
|
||||||
'activation_datetime'=>date('Y-m-d H:i:s',$time),
|
'activation_datetime'=>date('Y-m-d H:i:s',$time),
|
||||||
'old_db'=>'clusers_eng',
|
'old_db'=>'clusers_eng',
|
||||||
'partnerID'=>$partnerID,
|
'partnerID'=>$partnerID,
|
||||||
'enabled'=>'Y',
|
'enabled'=>'Y',
|
||||||
'computer_id'=>$compid
|
'computer_id'=>$compid
|
||||||
));
|
));
|
||||||
|
|
||||||
//Namirial vagy BIMLADDER non-profit kod aktivalas beszurasa crm -> u_history tablaba
|
//Namirial vagy BIMLADDER non-profit kod aktivalas beszurasa crm -> u_history tablaba
|
||||||
crm_users::AddUserHistory(array(
|
crm_users::AddUserHistory(array(
|
||||||
'nUserID'=>$userID,
|
'nUserID'=>$userID,
|
||||||
'nTopicID'=>$topic_id,
|
'nTopicID'=>$topic_id,
|
||||||
'dateEvent'=>date('Y-m-d H:i:s',$time),
|
'dateEvent'=>date('Y-m-d H:i:s',$time),
|
||||||
'strPlace'=>'',
|
'strPlace'=>'',
|
||||||
'strInfo'=>$info,
|
'strInfo'=>$info,
|
||||||
'nManagerID'=>36,
|
'nManagerID'=>36,
|
||||||
'insertDate'=>date('Y-m-d H:i:s',$time)
|
'insertDate'=>date('Y-m-d H:i:s',$time)
|
||||||
));
|
));
|
||||||
|
|
||||||
crm_hardlock::AddHardlock(array(
|
crm_hardlock::AddHardlock(array(
|
||||||
'hlNum'=>$hlNum,
|
'hlNum'=>$hlNum,
|
||||||
'hlCtrID'=>$country_id,
|
'hlCtrID'=>$country_id,
|
||||||
'hlLan'=>0,
|
'hlLan'=>0,
|
||||||
'hlStat'=>1,
|
'hlStat'=>1,
|
||||||
'hlDateIssue'=>date('Y-m-d',$time),
|
'hlDateIssue'=>date('Y-m-d',$time),
|
||||||
'hlManID'=>36,
|
'hlManID'=>36,
|
||||||
'hlTime'=>date('Y-m-d H:i:s',$time),
|
'hlTime'=>date('Y-m-d H:i:s',$time),
|
||||||
'hlUser'=>$userID,
|
'hlUser'=>$userID,
|
||||||
'hlDealer'=>62103,
|
'hlDealer'=>62103,
|
||||||
'bUjithato'=>1,
|
'bUjithato'=>1,
|
||||||
'old_db'=>'clusers_eng'
|
'old_db'=>'clusers_eng'
|
||||||
));
|
));
|
||||||
|
|
||||||
crm_hardlock::AddProgram(array(
|
crm_hardlock::AddProgram(array(
|
||||||
'prTypeID'=>$type,
|
'prTypeID'=>$type,
|
||||||
'prVerID'=>$ver['verID'],
|
'prVerID'=>$ver['verID'],
|
||||||
'prLan'=>0,
|
'prLan'=>0,
|
||||||
'prPass'=>trim($pass),
|
'prPass'=>trim($pass),
|
||||||
'prSellDate'=>date('Y-m-d',$time),
|
'prSellDate'=>date('Y-m-d',$time),
|
||||||
'prActDate'=>date('Y-m-d',$time+$interval*86400), // 90 vagy 30 nap
|
'prActDate'=>date('Y-m-d',$time+$interval*86400), // 90 vagy 30 nap
|
||||||
'prFizetve'=>date('Y-m-d',$time+$interval*86400),
|
'prFizetve'=>date('Y-m-d',$time+$interval*86400),
|
||||||
'prActCode'=>trim($aktKod),
|
'prActCode'=>trim($aktKod),
|
||||||
'prTime'=>date('Y-m-d H:i:s',$time),
|
'prTime'=>date('Y-m-d H:i:s',$time),
|
||||||
'prLastMod'=>date('Y-m-d H:i:s',$time),
|
'prLastMod'=>date('Y-m-d H:i:s',$time),
|
||||||
'prContact'=>$contact, // Non-profit
|
'prContact'=>$contact, // Non-profit
|
||||||
'prHlNum'=>$hlNum, // 99xxxx
|
'prHlNum'=>$hlNum, // 99xxxx
|
||||||
'prManID'=>36, // web
|
'prManID'=>36, // web
|
||||||
'prStat'=>0,
|
'prStat'=>0,
|
||||||
'prHiType'=>1 // 1 Rendelés | 2 Tipus Valtas | 3 Frissites | 4 Auto Friss.
|
'prHiType'=>1 // 1 Rendelés | 2 Tipus Valtas | 3 Frissites | 4 Auto Friss.
|
||||||
));
|
));
|
||||||
|
|
||||||
$pwd = $pass; //ba 2018.07.02. mostantol az uj jelszava a usernek a most generalt, 94-es lesz, nem pedig a 93-as!
|
$pwd = $pass; //ba 2018.07.02. mostantol az uj jelszava a usernek a most generalt, 94-es lesz, nem pedig a 93-as!
|
||||||
} else {
|
} else {
|
||||||
//ba ehhez a gephez mar volt non-profit regisztracio, keressuk ki a sorozatszamot neki
|
//ba ehhez a gephez mar volt non-profit regisztracio, keressuk ki a sorozatszamot neki
|
||||||
$hlNum = $res[0]['hlID'];
|
$hlNum = $res[0]['hlID'];
|
||||||
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prHlNum='{$hlNum}' limit 1");
|
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prHlNum='{$hlNum}' limit 1");
|
||||||
$programQuery=crm_database::getInstance()->fetchAssoc();
|
$programQuery=crm_database::getInstance()->fetchAssoc();
|
||||||
$pwd = $programQuery[0]['prPass'];
|
$pwd = $programQuery[0]['prPass'];
|
||||||
}
|
}
|
||||||
} //- if ($isNamirialAutoCreate || $isBimLadderAutoCreate) vege
|
} //- if ($isNamirialAutoCreate || $isBimLadderAutoCreate) vege
|
||||||
|
|
||||||
$hlNum = crm_hardlock::GetHlnumFromPassword($pwd);
|
$hlNum = crm_hardlock::GetHlnumFromPassword($pwd);
|
||||||
|
|
||||||
//insert stats to the userstats table
|
//insert stats to the userstats table
|
||||||
$stats = array(
|
$stats = array(
|
||||||
'usLang' => $user_lang_db,
|
'usLang' => $user_lang_db,
|
||||||
'usDate' => time(),
|
'usDate' => time(),
|
||||||
'usPwd' => $pwd,
|
'usPwd' => $pwd,
|
||||||
'usVer'=>$verid,
|
'usVer'=>$verid,
|
||||||
'usCompID' => $compID,
|
'usCompID' => $compID,
|
||||||
'usCtrID' => $ctrID,
|
'usCtrID' => $ctrID,
|
||||||
'usBuild' => $build,
|
'usBuild' => $build,
|
||||||
'usCtrName' => $ctrname,
|
'usCtrName' => $ctrname,
|
||||||
'usIP' => $user_IP,
|
'usIP' => $user_IP,
|
||||||
'usOSData' => $osdata,
|
'usOSData' => $osdata,
|
||||||
'usISID' => $isid,
|
'usISID' => $isid,
|
||||||
'usInditasokSzama' => 1
|
'usInditasokSzama' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
crm_database::getInstance()->query("SELECT hlLan, hlCtrID FROM `".CRMADATBAZIS."`.`hardlock` WHERE hlNum='".$hlNum."'");
|
crm_database::getInstance()->query("SELECT hlLan, hlCtrID FROM `".CRMADATBAZIS."`.`hardlock` WHERE hlNum='".$hlNum."'");
|
||||||
$hardlock = crm_database::getInstance()->fetchAssoc();
|
$hardlock = crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
$isLanProgram = empty($hardlock) == false && $hardlock[0]['hlLan'] > 0;
|
$isLanProgram = empty($hardlock) == false && $hardlock[0]['hlLan'] > 0;
|
||||||
|
|
||||||
// A szarmazasi orszag beallitasa
|
// A szarmazasi orszag beallitasa
|
||||||
if($softwareKey) {
|
if($softwareKey) {
|
||||||
$liveKey = crm_hardlock::IsLiveKey($pwd); // Live kulcs 2019
|
$liveKey = crm_hardlock::IsLiveKey($pwd); // Live kulcs 2019
|
||||||
if(empty($hardlock) == false && ($liveKey || in_array(substr($pwd,0,2), array('99','98','95'))) ) { // Azok a programok, amik regisztrálódnak a CRM-ben 2019
|
if(empty($hardlock) == false && ($liveKey || in_array(substr($pwd,0,2), array('99','98','95'))) ) { // Azok a programok, amik regisztrálódnak a CRM-ben 2019
|
||||||
$hl=$hardlock[0];
|
$hl=$hardlock[0];
|
||||||
if(isset($hl['hlCtrID']))
|
if(isset($hl['hlCtrID']))
|
||||||
$stats['usHlCtrID'] = $hl['hlCtrID'];
|
$stats['usHlCtrID'] = $hl['hlCtrID'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$stats['usHlCtrID'] = substr($pwd,0,2);
|
$stats['usHlCtrID'] = substr($pwd,0,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$trialProgram = crm_hardlock::IsTrialKey($pwd);
|
$trialProgram = crm_hardlock::IsTrialKey($pwd);
|
||||||
$trialSpecialEditionProgram = $trialProgram ? crm_hardlock::IsSpecialEditionTrial($pwd) : false;
|
$trialSpecialEditionProgram = $trialProgram ? crm_hardlock::IsSpecialEditionTrial($pwd) : false;
|
||||||
|
|
||||||
// Kereskedelmi valtozatok lekezelese (a statisztika miatt bekerulnek a Namirial es a BIMLadder programok is)
|
// Kereskedelmi valtozatok lekezelese (a statisztika miatt bekerulnek a Namirial es a BIMLadder programok is)
|
||||||
if($verid>29 && ($trialProgram == false || $trialSpecialEditionProgram)) {
|
if($verid>29 && ($trialProgram == false || $trialSpecialEditionProgram)) {
|
||||||
if($trialSpecialEditionProgram == false) {
|
if($trialSpecialEditionProgram == false) {
|
||||||
$query = "SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prPass='".$pwd."'";
|
$query = "SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prPass='".$pwd."'";
|
||||||
if($softwareKey && $isLanProgram) //- szoftveres lan kulcsnal mindig telepitesenkent egyedi az aktivalo kod
|
if($softwareKey && $isLanProgram) //- szoftveres lan kulcsnal mindig telepitesenkent egyedi az aktivalo kod
|
||||||
$query .= " AND prActCode LIKE '%-".$isid."-%'";
|
$query .= " AND prActCode LIKE '%-".$isid."-%'";
|
||||||
$query .= ";";
|
$query .= ";";
|
||||||
|
|
||||||
crm_database::getInstance()->query($query);
|
crm_database::getInstance()->query($query);
|
||||||
$prgrm=crm_database::getInstance()->fetchAssoc();
|
$prgrm=crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
if(empty($prgrm) && $softwareKey && $isLanProgram) { //- a lan-os valtozatnal na nem volt telepitve lehet, hogy nem volt talalat
|
if(empty($prgrm) && $softwareKey && $isLanProgram) { //- a lan-os valtozatnal na nem volt telepitve lehet, hogy nem volt talalat
|
||||||
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prPass='".$pwd."' and (prActCode = '' or prActCode is null) LIMIT 1;");
|
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE prPass='".$pwd."' and (prActCode = '' or prActCode is null) LIMIT 1;");
|
||||||
$prgrm=crm_database::getInstance()->fetchAssoc();
|
$prgrm=crm_database::getInstance()->fetchAssoc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($softwareKey) { //- a telepitesi datum frissitese
|
if($softwareKey) { //- a telepitesi datum frissitese
|
||||||
if($validTelepitesikod) {
|
if($validTelepitesikod) {
|
||||||
//- telepitesi datum tarolasanak elokeszitese
|
//- telepitesi datum tarolasanak elokeszitese
|
||||||
$telepitesota_eltelt_napok_szama = crm_hardlock::GetDayFromTimeCode($telepitesikod);
|
$telepitesota_eltelt_napok_szama = crm_hardlock::GetDayFromTimeCode($telepitesikod);
|
||||||
$date = new DateTime(date("Y-m-d"));
|
$date = new DateTime(date("Y-m-d"));
|
||||||
$date->modify('-'.$telepitesota_eltelt_napok_szama.' day');
|
$date->modify('-'.$telepitesota_eltelt_napok_szama.' day');
|
||||||
$installDate = $date->format('Y-m-d');
|
$installDate = $date->format('Y-m-d');
|
||||||
} else
|
} else
|
||||||
$installDate = time();
|
$installDate = time();
|
||||||
} else {
|
} else {
|
||||||
if(empty($prgrm)) {
|
if(empty($prgrm)) {
|
||||||
$installDate = time();
|
$installDate = time();
|
||||||
//- todo ez gigantikus hiba, jelezni kell, ha ilyen elofordul
|
//- todo ez gigantikus hiba, jelezni kell, ha ilyen elofordul
|
||||||
} else
|
} else
|
||||||
$installDate = $prgrm[0]['prSellDate'];
|
$installDate = $prgrm[0]['prSellDate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$stats['usTelepitesiDatum'] = $installDate;
|
$stats['usTelepitesiDatum'] = $installDate;
|
||||||
|
|
||||||
if(empty($prgrm) == false)
|
if(empty($prgrm) == false)
|
||||||
$jelenlegi_aktivalokod = $prgrm[0]['prActCode'];
|
$jelenlegi_aktivalokod = $prgrm[0]['prActCode'];
|
||||||
else
|
else
|
||||||
$jelenlegi_aktivalokod = '';
|
$jelenlegi_aktivalokod = '';
|
||||||
|
|
||||||
// A userstats2013 tablaba megkeresi az utolso bejegyzest és amennyiben valtozatlan, updateli az inditasok szamat, különben uj bejegyzést hoz letre
|
// A userstats2013 tablaba megkeresi az utolso bejegyzest és amennyiben valtozatlan, updateli az inditasok szamat, különben uj bejegyzést hoz letre
|
||||||
if($trialSpecialEditionProgram == false) {
|
if($trialSpecialEditionProgram == false) {
|
||||||
//- idokod generalasa
|
//- idokod generalasa
|
||||||
$aktivalokod = crm_hardlock::GetOrGenerateTimeCode($pwd,$isid,$telepitesikod);
|
$aktivalokod = crm_hardlock::GetOrGenerateTimeCode($pwd,$isid,$telepitesikod);
|
||||||
$usstatid = crm_hardlock::UpdateInstallationDate($pwd, $compID, $build, $aktivalokod, $user_IP, $installDate, $stats);
|
$usstatid = crm_hardlock::UpdateInstallationDate($pwd, $compID, $build, $aktivalokod, $user_IP, $installDate, $stats);
|
||||||
|
|
||||||
// Nonprofit regisztracio beirasa a user-hez
|
// Nonprofit regisztracio beirasa a user-hez
|
||||||
crm_database::getInstance()->query("SELECT hlStat,hlUser FROM `".CRMADATBAZIS."`.`hardlock` WHERE hlNum='".$hlNum."'");
|
crm_database::getInstance()->query("SELECT hlStat,hlUser FROM `".CRMADATBAZIS."`.`hardlock` WHERE hlNum='".$hlNum."'");
|
||||||
$res=crm_database::getInstance()->fetchAssoc();
|
$res=crm_database::getInstance()->fetchAssoc();
|
||||||
$kulcs=$res[0];
|
$kulcs=$res[0];
|
||||||
|
|
||||||
if (in_array((int)substr($pwd,0,3),array(995,996,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989)) && (int)$kulcs['hlUser']>0) { // nonprofitos program első indítása
|
if (in_array((int)substr($pwd,0,3),array(995,996,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989)) && (int)$kulcs['hlUser']>0) { // nonprofitos program első indítása
|
||||||
// TODO: Megakasztotta a programinditasokat!!! 2019.08.28. SQL HIBA
|
// TODO: Megakasztotta a programinditasokat!!! 2019.08.28. SQL HIBA
|
||||||
/*crm_database::getInstance()->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`h_aktivalas_infok` WHERE kulcs='".$hlNum."';");
|
/*crm_database::getInstance()->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`h_aktivalas_infok` WHERE kulcs='".$hlNum."';");
|
||||||
$tmp=crm_database::getInstance()->fetchAssoc();
|
$tmp=crm_database::getInstance()->fetchAssoc();
|
||||||
$darab=(int)$tmp[0]['darab'];*/
|
$darab=(int)$tmp[0]['darab'];*/
|
||||||
|
|
||||||
crm_database::getInstance()->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`u_history` WHERE `nUserID`=".(int)$kulcs['hlUser']." AND nTopicID IN (314,315);");
|
crm_database::getInstance()->query("SELECT COUNT(*) AS `darab` FROM `".CRMADATBAZIS."`.`u_history` WHERE `nUserID`=".(int)$kulcs['hlUser']." AND nTopicID IN (314,315);");
|
||||||
$tmp=crm_database::getInstance()->fetchAssoc();
|
$tmp=crm_database::getInstance()->fetchAssoc();
|
||||||
$esem=(int)$tmp[0]['darab'];
|
$esem=(int)$tmp[0]['darab'];
|
||||||
|
|
||||||
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`users` WHERE nUserID='".(int)$kulcs['hlUser']."';");
|
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`users` WHERE nUserID='".(int)$kulcs['hlUser']."';");
|
||||||
$usr=crm_database::getInstance()->fetchAssoc();
|
$usr=crm_database::getInstance()->fetchAssoc();
|
||||||
$usr=$usr[0];
|
$usr=$usr[0];
|
||||||
|
|
||||||
if (!empty($usr) && (/*$darab==0 ||*/ $esem==0)) {
|
if (!empty($usr) && (/*$darab==0 ||*/ $esem==0)) {
|
||||||
crm_database::getInstance()->insert("`".CRMADATBAZIS."`.`u_history`",array(
|
crm_database::getInstance()->insert("`".CRMADATBAZIS."`.`u_history`",array(
|
||||||
'nUserID'=>(int)$kulcs['hlUser'],
|
'nUserID'=>(int)$kulcs['hlUser'],
|
||||||
'nTopicID'=>($usr['old_db']=='clusers' ? 314 : 315),
|
'nTopicID'=>($usr['old_db']=='clusers' ? 314 : 315),
|
||||||
'dateEvent'=>date('Y-m-d'),
|
'dateEvent'=>date('Y-m-d'),
|
||||||
'strPlace'=>'web',
|
'strPlace'=>'web',
|
||||||
'strInfo'=>($usr['old_db']=='clusers' ? 'Non-profit kód regisztráció' : 'Non-profit code registration').': '.$hlNum,
|
'strInfo'=>($usr['old_db']=='clusers' ? 'Non-profit kód regisztráció' : 'Non-profit code registration').': '.$hlNum,
|
||||||
'nManagerID'=>36,
|
'nManagerID'=>36,
|
||||||
'insertDate'=>date('Y-m-d H:i:s')
|
'insertDate'=>date('Y-m-d H:i:s')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
$usstatid = crm_hardlock::UpdateInstallationDate($pwd, $compID, $build, $jelenlegi_aktivalokod, $user_IP, $installDate, $stats);
|
$usstatid = crm_hardlock::UpdateInstallationDate($pwd, $compID, $build, $jelenlegi_aktivalokod, $user_IP, $installDate, $stats);
|
||||||
|
|
||||||
$virtualization = ($kulcs['hlStat']=='2' ? "false" : "true"); // letiltott kulcs visszajelzése a programnak
|
$virtualization = ($kulcs['hlStat']=='2' ? "false" : "true"); // letiltott kulcs visszajelzése a programnak
|
||||||
|
|
||||||
$valasz = ($aktivalokod!="") ? $aktivalokod : "(( nem kapott valaszt ))";
|
$valasz = ($aktivalokod!="") ? $aktivalokod : "(( nem kapott valaszt ))";
|
||||||
|
|
||||||
|
|
||||||
// TODO: Megakasztotta a programinditasokat!!! 2019.08.28. SQL HIBA
|
// TODO: Megakasztotta a programinditasokat!!! 2019.08.28. SQL HIBA
|
||||||
/*crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_aktivalas_infok` WHERE leiras LIKE 'programinditas -pw: ".$pwd."%' ORDER BY datum desc LIMIT 1;");
|
/*crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_aktivalas_infok` WHERE leiras LIKE 'programinditas -pw: ".$pwd."%' ORDER BY datum desc LIMIT 1;");
|
||||||
$res=crm_database::getInstance()->fetchAssoc();
|
$res=crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
if(empty($res) == false)
|
if(empty($res) == false)
|
||||||
crm_database::getInstance()->query("UPDATE `".CRMADATBAZIS."`.`h_aktivalas_infok` SET leiras='programinditas - pw: {$pwd}, build: {$build}, isid: {$isid}, időkód: {$telepitesikod}, valasz: ".$valasz."', datum='". time()."' WHERE id=".$res[0]['id']." LIMIT 1");
|
crm_database::getInstance()->query("UPDATE `".CRMADATBAZIS."`.`h_aktivalas_infok` SET leiras='programinditas - pw: {$pwd}, build: {$build}, isid: {$isid}, időkód: {$telepitesikod}, valasz: ".$valasz."', datum='". time()."' WHERE id=".$res[0]['id']." LIMIT 1");
|
||||||
else
|
else
|
||||||
crm_hardlock::_Hibajelento("tips",substr($pwd,0,6),"programinditas - pw: {$pwd}, build: {$build}, isid: {$isid}, időkód: {$telepitesikod}, valasz: ".$valasz,(isset($arrGCData)?$arrGCData:array()),(isset($usstatid)?$usstatid:NULL));*/
|
crm_hardlock::_Hibajelento("tips",substr($pwd,0,6),"programinditas - pw: {$pwd}, build: {$build}, isid: {$isid}, időkód: {$telepitesikod}, valasz: ".$valasz,(isset($arrGCData)?$arrGCData:array()),(isset($usstatid)?$usstatid:NULL));*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tavoli logolasi parameterek beallitasa
|
// Tavoli logolasi parameterek beallitasa
|
||||||
$logfilter=0;
|
$logfilter=0;
|
||||||
if ($validPassword && $crackedProgram == false && $trialProgram == false) {
|
if ($validPassword && $crackedProgram == false && $trialProgram == false) {
|
||||||
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE `prPass`='".$pwd."' LIMIT 1;");
|
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`h_programs` WHERE `prPass`='".$pwd."' LIMIT 1;");
|
||||||
$res=crm_database::getInstance()->fetchAssoc();
|
$res=crm_database::getInstance()->fetchAssoc();
|
||||||
$logfilter=$res[0]['prLogFilter'];
|
$logfilter=$res[0]['prLogFilter'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ha a verid >= 36, akkor beinsertalja a hardlockot és a computer id-t a hardlock_computers tablaba, ha meg nincs benne
|
// Ha a verid >= 36, akkor beinsertalja a hardlockot és a computer id-t a hardlock_computers tablaba, ha meg nincs benne
|
||||||
if($softwareKey && $crackedProgram == false && $trialProgram == false)
|
if($softwareKey && $crackedProgram == false && $trialProgram == false)
|
||||||
crm_hardlock::AddHardlockComputer($hlNum, $compid, $verid);
|
crm_hardlock::AddHardlockComputer($hlNum, $compid, $verid);
|
||||||
|
|
||||||
// Kulcsok tesztelese
|
// Kulcsok tesztelese
|
||||||
if($softwareKey && $crackedProgram == false && $trialProgram == false) {
|
if($softwareKey && $crackedProgram == false && $trialProgram == false) {
|
||||||
$valasz = crm_hardlock::sCheckPassword($pwd);
|
$valasz = crm_hardlock::sCheckPassword($pwd);
|
||||||
|
|
||||||
if(empty($valasz) == false) {
|
if(empty($valasz) == false) {
|
||||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
||||||
$message = "Checked Password || Serial: ".$pwd." || Valasz: ".$valasz." || url: ".$actual_link;
|
$message = "Checked Password || Serial: ".$pwd." || Valasz: ".$valasz." || url: ".$actual_link;
|
||||||
crm_hardlock::AddToDebugTable($message);
|
crm_hardlock::AddToDebugTable($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modul es reaktivalo kodok kiiratasa
|
// Modul es reaktivalo kodok kiiratasa
|
||||||
if($crackedProgram == false && $trialProgram == false) {
|
if($crackedProgram == false && $trialProgram == false) {
|
||||||
|
|
||||||
// Modul kodok osszegyujtese
|
// Modul kodok osszegyujtese
|
||||||
crm_database::getInstance()->query("SELECT prID FROM `".CRMADATBAZIS."`.`h_programs` WHERE `prPass`='".$pwd."' LIMIT 1;");
|
crm_database::getInstance()->query("SELECT prID FROM `".CRMADATBAZIS."`.`h_programs` WHERE `prPass`='".$pwd."' LIMIT 1;");
|
||||||
$programs = crm_database::getInstance()->fetchAssoc();
|
$programs = crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
$moduleList = "";
|
$moduleList = "";
|
||||||
if(empty($programs) == false) {
|
if(empty($programs) == false) {
|
||||||
$prID = $programs[0]['prID'];
|
$prID = $programs[0]['prID'];
|
||||||
crm_database::getInstance()->query("SELECT mdCode FROM `".CRMADATBAZIS."`.`p_modules` WHERE `mdPrID`='".$prID."'");
|
crm_database::getInstance()->query("SELECT mdCode FROM `".CRMADATBAZIS."`.`p_modules` WHERE `mdPrID`='".$prID."'");
|
||||||
$modules = crm_database::getInstance()->fetchAssoc();
|
$modules = crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
if(empty($moduleList) == false)
|
if(empty($moduleList) == false)
|
||||||
$moduleList .= ";";
|
$moduleList .= ";";
|
||||||
|
|
||||||
$moduleList .= $module['mdCode'];
|
$moduleList .= $module['mdCode'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reaktivalokodok kuldese
|
// Reaktivalokodok kuldese
|
||||||
if($virtualization == "true" && $reactivationCounter > 0) {
|
if($virtualization == "true" && $reactivationCounter > 0) {
|
||||||
$reactivationCounter--;
|
$reactivationCounter--;
|
||||||
$modulIsid = substr($pwd, 0,2).$verid;
|
$modulIsid = substr($pwd, 0,2).$verid;
|
||||||
|
|
||||||
if($reactivationCounter > 4) // 5-nel tobb nem lehet
|
if($reactivationCounter > 4) // 5-nel tobb nem lehet
|
||||||
$reactivationCounter = 4;
|
$reactivationCounter = 4;
|
||||||
|
|
||||||
for($i=0; $i<=$reactivationCounter; $i++) {
|
for($i=0; $i<=$reactivationCounter; $i++) {
|
||||||
$modulID = 35+$i;
|
$modulID = 35+$i;
|
||||||
$reactivationCode = crm_hardlock::GenerateTimeCode($pwd, $modulIsid, $modulID);
|
$reactivationCode = crm_hardlock::GenerateTimeCode($pwd, $modulIsid, $modulID);
|
||||||
|
|
||||||
if(empty($moduleList) == false)
|
if(empty($moduleList) == false)
|
||||||
$moduleList .= ";";
|
$moduleList .= ";";
|
||||||
|
|
||||||
$moduleList .= $reactivationCode;
|
$moduleList .= $reactivationCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(crm_hardlock::IsCalledFromMyIP() && $softwareKey) {
|
if(crm_hardlock::IsCalledFromMyIP() && $softwareKey) {
|
||||||
$utst = time();
|
$utst = time();
|
||||||
(int)$convertedDay = crm_hardlock::ConvertDay(date('w'));
|
(int)$convertedDay = crm_hardlock::ConvertDay(date('w'));
|
||||||
$tid = (int)($utst / $convertedDay);
|
$tid = (int)($utst / $convertedDay);
|
||||||
|
|
||||||
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`p_serial_isid` WHERE serial='".$pwd."' AND isid='".$isid."' AND aktiv = 1");
|
crm_database::getInstance()->query("SELECT * FROM `".CRMADATBAZIS."`.`p_serial_isid` WHERE serial='".$pwd."' AND isid='".$isid."' AND aktiv = 1");
|
||||||
$p_serial_isid=crm_database::getInstance()->fetchAssoc();
|
$p_serial_isid=crm_database::getInstance()->fetchAssoc();
|
||||||
|
|
||||||
if(empty($p_serial_isid))
|
if(empty($p_serial_isid))
|
||||||
$regenr = crm_hardlock::No($utst, 39);
|
$regenr = crm_hardlock::No($utst, 39);
|
||||||
else
|
else
|
||||||
$regenr = crm_hardlock::Yes($utst, 39);
|
$regenr = crm_hardlock::Yes($utst, 39);
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-Type: text/xml; charset=utf-8');
|
header('Content-Type: text/xml; charset=utf-8');
|
||||||
header('Content-Disposition: inline; filename=response.xml');
|
header('Content-Disposition: inline; filename=response.xml');
|
||||||
print '<'.'?'.'xml version="1.0" encoding="UTF-8" standalone="yes"'.'?'.'>
|
print '<'.'?'.'xml version="1.0" encoding="UTF-8" standalone="yes"'.'?'.'>
|
||||||
<Tips>
|
<Tips>
|
||||||
<Tip lang="en" version="2">
|
<Tip lang="en" version="2">
|
||||||
<path>/public/support/tips/en/</path>
|
<path>/public/support/tips/en/</path>
|
||||||
</Tip>
|
</Tip>
|
||||||
'.((isset($aktivalokod) && $aktivalokod) ? '<actcode>'.$aktivalokod.'</actcode>' : '').'
|
'.((isset($aktivalokod) && $aktivalokod) ? '<actcode>'.$aktivalokod.'</actcode>' : '').'
|
||||||
'.((isset($virtualization) && $virtualization) ? '<Virtualization>'.$virtualization.'</Virtualization>' : '').'
|
'.((isset($virtualization) && $virtualization) ? '<Virtualization>'.$virtualization.'</Virtualization>' : '').'
|
||||||
'.((isset($usstatid) && (int)$usstatid>0) ? '<actid>'.(int)$usstatid.'</actid>' : '').'
|
'.((isset($usstatid) && (int)$usstatid>0) ? '<actid>'.(int)$usstatid.'</actid>' : '').'
|
||||||
<logfilter>'.$logfilter.'</logfilter>
|
<logfilter>'.$logfilter.'</logfilter>
|
||||||
'.((empty($moduleList) == false) ? '<Modules>'.$moduleList.'</Modules>' : '').'
|
'.((empty($moduleList) == false) ? '<Modules>'.$moduleList.'</Modules>' : '').'
|
||||||
<loginEnabled>'.($hlNum=='360006' ? 'true' : 'false').'</loginEnabled>
|
<loginEnabled>'.($hlNum=='360006' ? 'true' : 'false').'</loginEnabled>
|
||||||
'.((isset($regenr) && (int)$regenr>0) ? '<regnr>'.(int)$regenr.'</regnr>' : '').'
|
'.((isset($regenr) && (int)$regenr>0) ? '<regnr>'.(int)$regenr.'</regnr>' : '').'
|
||||||
'.((isset($tid) && (int)$tid>0) ? '<tid>'.(int)$tid.'</tid>' : '').'
|
'.((isset($tid) && (int)$tid>0) ? '<tid>'.(int)$tid.'</tid>' : '').'
|
||||||
</Tips>';
|
</Tips>';
|
||||||
?>
|
?>
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
.past { background-color:#e6a8a8; opacity: 0.7; }
|
.past { background-color:#e6a8a8; opacity: 0.7; }
|
||||||
.present { background-color:#ffffff; border:2px solid #155215; }
|
.present { background-color:#ffffff; border:2px solid #155215; }
|
||||||
.future { background-color:#71bf73; opacity: 0.9; }
|
.future { background-color:#71bf73; opacity: 0.9; }
|
||||||
.mb25 { margin-bottom:25px; }
|
.mb25 { margin-bottom:25px; }
|
||||||
.cimke { font-size: 90% !important;font-weight:bold !important; }
|
.cimke { font-size: 90% !important;font-weight:bold !important; }
|
||||||
|
|
||||||
#alapplicationsContainer .controlls {margin-top:15px;}
|
#alapplicationsContainer .controlls {margin-top:15px;}
|
||||||
#alapplicationsContainer a, #alapplicationsContainer a:hover {font-weight:bold;}
|
#alapplicationsContainer a, #alapplicationsContainer a:hover {font-weight:bold;}
|
||||||
#alapplicationsContainer .past a, #alapplicationsContainer .future a {color:#003060;}
|
#alapplicationsContainer .past a, #alapplicationsContainer .future a {color:#003060;}
|
||||||
#alapplicationsContainer .past a:hover, #alapplicationsContainer .future a:hover {color:#ffffff;}
|
#alapplicationsContainer .past a:hover, #alapplicationsContainer .future a:hover {color:#ffffff;}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
require_once($_SERVER['DOCUMENT_ROOT'] . '/maintenance/config.course.php');
|
require_once($_SERVER['DOCUMENT_ROOT'] . '/maintenance/config.course.php');
|
||||||
require_once __DIR__ . '/helper.php'; // Include the ALWorkshops functions only once
|
require_once __DIR__ . '/helper.php'; // Include the ALWorkshops functions only once
|
||||||
|
|
||||||
$doc = JFactory::getDocument();
|
$doc = JFactory::getDocument();
|
||||||
$doc->addStyleSheet("/modules/mod_al_applications/assets/css/style.css");
|
$doc->addStyleSheet("/modules/mod_al_applications/assets/css/style.css");
|
||||||
$doc->addScript("/modules/mod_al_applications/assets/js/script.js");
|
$doc->addScript("/modules/mod_al_applications/assets/js/script.js");
|
||||||
|
|
||||||
$_POST['course_id'] = isset($_POST['course_id']) ? $_POST['course_id'] : 0;
|
$_POST['course_id'] = isset($_POST['course_id']) ? $_POST['course_id'] : 0;
|
||||||
|
|
||||||
if (isset($_POST) && (int)$_POST['course_id'] > 0) {
|
if (isset($_POST) && (int)$_POST['course_id'] > 0) {
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
$course_id = $input->get('course_id', '', 'int');
|
$course_id = $input->get('course_id', '', 'int');
|
||||||
|
|
||||||
$application = ModAlapplicationsHelper::getPublishedApplication($course_id);
|
$application = ModAlapplicationsHelper::getPublishedApplication($course_id);
|
||||||
if ($application) {
|
if ($application) {
|
||||||
ModAlapplicationsHelper::unPublishApplication($course_id);
|
ModAlapplicationsHelper::unPublishApplication($course_id);
|
||||||
JFactory::getApplication()->enqueueMessage(JText::_(MOD_ALAPPLICATIONS_UNPUBLISHED) . ": " . $application[0]->title, 'message');
|
JFactory::getApplication()->enqueueMessage(JText::_(MOD_ALAPPLICATIONS_UNPUBLISHED) . ": " . $application[0]->title, 'message');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$applications = ModAlapplicationsHelper::getOtherApplications();
|
$applications = ModAlapplicationsHelper::getOtherApplications();
|
||||||
$level = array(
|
$level = array(
|
||||||
1 => JText::_('MOD_ALAPPLICATIONS_PRELIMINARY'),
|
1 => JText::_('MOD_ALAPPLICATIONS_PRELIMINARY'),
|
||||||
2 => JText::_('MOD_ALAPPLICATIONS_INTERMEDIATE'),
|
2 => JText::_('MOD_ALAPPLICATIONS_INTERMEDIATE'),
|
||||||
3 => JText::_('MOD_ALAPPLICATIONS_TUTOR_EXAM'),
|
3 => JText::_('MOD_ALAPPLICATIONS_TUTOR_EXAM'),
|
||||||
4 => JText::_('MOD_ALAPPLICATIONS_ADVANCED')
|
4 => JText::_('MOD_ALAPPLICATIONS_ADVANCED')
|
||||||
);
|
);
|
||||||
|
|
||||||
require JModuleHelper::getLayoutPath('mod_al_applications', $params->get('layout', 'default'));
|
require JModuleHelper::getLayoutPath('mod_al_applications', $params->get('layout', 'default'));
|
||||||
|
|||||||
@ -1,49 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<extension type="module" method="upgrade" client="site">
|
<extension type="module" method="upgrade" client="site">
|
||||||
<name>MOD_ARCHLINE_APPLICATIONS_MODULE</name>
|
<name>MOD_ARCHLINE_APPLICATIONS_MODULE</name>
|
||||||
<creationDate>Nov 2017</creationDate>
|
<creationDate>Nov 2017</creationDate>
|
||||||
<author>Zsolt Fekete</author>
|
<author>Zsolt Fekete</author>
|
||||||
<authorEmail>mcleod78@gmail.com</authorEmail>
|
<authorEmail>mcleod78@gmail.com</authorEmail>
|
||||||
<authorUrl>https://www.facbook.com/mcleod78</authorUrl>
|
<authorUrl>https://www.facbook.com/mcleod78</authorUrl>
|
||||||
<copyright>Copyright © 2017 - All rights reserved.</copyright>
|
<copyright>Copyright © 2017 - All rights reserved.</copyright>
|
||||||
<license>GNU General Public License v2.0</license>
|
<license>GNU General Public License v2.0</license>
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<description>MOD_ARCHLINE_APPLICATIONS_MODULE_DESCRIPTION</description>
|
<description>MOD_ARCHLINE_APPLICATIONS_MODULE_DESCRIPTION</description>
|
||||||
<files>
|
<files>
|
||||||
<filename module="mod_al_applications">mod_al_applications.php</filename>
|
<filename module="mod_al_applications">mod_al_applications.php</filename>
|
||||||
<filename>mod_al_applications.xml</filename>
|
<filename>mod_al_applications.xml</filename>
|
||||||
<filename>helper.php</filename>
|
<filename>helper.php</filename>
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<folder>language</folder>
|
<folder>language</folder>
|
||||||
<folder>tmpl</folder>
|
<folder>tmpl</folder>
|
||||||
<folder>assets</folder>
|
<folder>assets</folder>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<config>
|
<config>
|
||||||
<fields name="params">
|
<fields name="params">
|
||||||
<fieldset name="advanced">
|
<fieldset name="advanced">
|
||||||
<field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
<field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||||
|
|
||||||
<field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
<field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||||
|
|
||||||
<field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC">
|
<field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC">
|
||||||
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
||||||
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
<field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
||||||
<field name="cachemode" type="hidden" default="static">
|
<field name="cachemode" type="hidden" default="static">
|
||||||
<option value="static"></option>
|
<option value="static"></option>
|
||||||
</field>
|
</field>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fields>
|
</fields>
|
||||||
</config>
|
</config>
|
||||||
|
|
||||||
<languages folder="language">
|
<languages folder="language">
|
||||||
<language tag="en-GB">en-GB/en-GB.mod_al_applications.sys.ini</language>
|
<language tag="en-GB">en-GB/en-GB.mod_al_applications.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.mod_al_applications.ini</language>
|
<language tag="en-GB">en-GB/en-GB.mod_al_applications.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.mod_al_applications.sys.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.mod_al_applications.sys.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.mod_al_applications.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.mod_al_applications.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,104 +1,104 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
jimport('joomla.access.access');
|
jimport('joomla.access.access');
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$groups = JAccess::getGroupsByUser($user->id, false);
|
$groups = JAccess::getGroupsByUser($user->id, false);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if ((int)$user->id == 0) : ?>
|
<?php if ((int)$user->id == 0) : ?>
|
||||||
|
|
||||||
<p><?= JText::_('MOD_ALAPPLICATIONS_MUST_LOGIN') ?></p>
|
<p><?= JText::_('MOD_ALAPPLICATIONS_MUST_LOGIN') ?></p>
|
||||||
<?= JModuleHelper::renderModule(JModuleHelper::getModule('login', 'Felhasználó - Workshop Bejelentkezés')) ?>
|
<?= JModuleHelper::renderModule(JModuleHelper::getModule('login', 'Felhasználó - Workshop Bejelentkezés')) ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.smaller-text {
|
.smaller-text {
|
||||||
font-size: 18px !important;
|
font-size: 18px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bigger-text {
|
.bigger-text {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
margin-top: 10px !important;
|
margin-top: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-row {
|
.app-row {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cimke {
|
.cimke {
|
||||||
line-height: 32px !important;
|
line-height: 32px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-info,
|
.panel-info,
|
||||||
.panel-heading {
|
.panel-heading {
|
||||||
color: black !important;
|
color: black !important;
|
||||||
border-color: #ecf0f1 !important;
|
border-color: #ecf0f1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-heading {
|
.panel-heading {
|
||||||
background-color: #ecf0f1 !important;
|
background-color: #ecf0f1 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="alCoursesContainer" class="container">
|
<div id="alCoursesContainer" class="container">
|
||||||
<?php
|
<?php
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$tanfolyam = ModAlapplicationsHelper::getCourseTable();
|
$tanfolyam = ModAlapplicationsHelper::getCourseTable();
|
||||||
foreach ($tanfolyam as $k => $ws) : ?>
|
foreach ($tanfolyam as $k => $ws) : ?>
|
||||||
<?php if ($ws->level == 3 && !in_array(18, $groups)) continue; ?>
|
<?php if ($ws->level == 3 && !in_array(18, $groups)) continue; ?>
|
||||||
<?php if ($k == 0 || ($k > 0 && $tanfolyam[$k - 1]->level != $tanfolyam[$k]->level)) : ?>
|
<?php if ($k == 0 || ($k > 0 && $tanfolyam[$k - 1]->level != $tanfolyam[$k]->level)) : ?>
|
||||||
|
|
||||||
<?php if ($k > 0) : ?>
|
<?php if ($k > 0) : ?>
|
||||||
<!--belso lezaras-->
|
<!--belso lezaras-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--belso lezaras-->
|
<!--belso lezaras-->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="bigger-text"><?= $ws->title ?></h3>
|
<h3 class="bigger-text"><?= $ws->title ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6 smaller-text"><strong><?= JText::_('MOD_ALAPPLICATIONS_SIGNED') ?></strong></div>
|
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6 smaller-text"><strong><?= JText::_('MOD_ALAPPLICATIONS_SIGNED') ?></strong></div>
|
||||||
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6 smaller-text"><strong><?= JText::_('MOD_ALAPPLICATIONS_CHANGE') ?></strong></div>
|
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6 smaller-text"><strong><?= JText::_('MOD_ALAPPLICATIONS_CHANGE') ?></strong></div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="row app-row">
|
<div class="row app-row">
|
||||||
<?php $wsapplications = ModAlapplicationsHelper::getWorkshopApplications((int)$user->id, $ws->id); ?>
|
<?php $wsapplications = ModAlapplicationsHelper::getWorkshopApplications((int)$user->id, $ws->id); ?>
|
||||||
|
|
||||||
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||||
<?php if (count($wsapplications)) : ?>
|
<?php if (count($wsapplications)) : ?>
|
||||||
<?php foreach ($wsapplications as $wsapp) : ?>
|
<?php foreach ($wsapplications as $wsapp) : ?>
|
||||||
<?php if ($wsapp->session_date < date('Y-m-d')) $class = "danger";
|
<?php if ($wsapp->session_date < date('Y-m-d')) $class = "danger";
|
||||||
if ($wsapp->session_date <= date('Y-m-d') && $application->finish_date >= date('Y-m-d')) $class = "info";
|
if ($wsapp->session_date <= date('Y-m-d') && $application->finish_date >= date('Y-m-d')) $class = "info";
|
||||||
if ($wsapp->session_date > date('Y-m-d')) $class = "success"; ?>
|
if ($wsapp->session_date > date('Y-m-d')) $class = "success"; ?>
|
||||||
<span class="cimke label label-<?= $class ?> smaller-text"><?= $wsapp->session_date ?></span>
|
<span class="cimke label label-<?= $class ?> smaller-text"><?= $wsapp->session_date ?></span>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
<div class="col col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||||
<?php if (count($wsapplications)) : ?>
|
<?php if (count($wsapplications)) : ?>
|
||||||
<a href="/<?= $ws->path ?>/<?= ($ws->alias2 > '' ? $ws->alias2 : $ws->alias) ?>" class="sppb-btn custom-al <?php if (date('Y-m-d', time() + 86400 * _RESIGN_DAYS_) <= $wsapp->session_date) : ?>active<?php else : ?>disabled<?php endif ?>" target="_self"><?= JText::_('MOD_ALAPPLICATIONS_CHANGE_2') ?></a><br />
|
<a href="/<?= $ws->path ?>/<?= ($ws->alias2 > '' ? $ws->alias2 : $ws->alias) ?>" class="sppb-btn custom-al <?php if (date('Y-m-d', time() + 86400 * _RESIGN_DAYS_) <= $wsapp->session_date) : ?>active<?php else : ?>disabled<?php endif ?>" target="_self"><?= JText::_('MOD_ALAPPLICATIONS_CHANGE_2') ?></a><br />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<!--vegso lezaras-->
|
<!--vegso lezaras-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--vegso lezaras-->
|
<!--vegso lezaras-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function resignation(id) {
|
function resignation(id) {
|
||||||
jQuery('#course_id').val(id);
|
jQuery('#course_id').val(id);
|
||||||
jQuery('#alapplicationsForm').submit();
|
jQuery('#alapplicationsForm').submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="module" version="3.1.0" client="site" method="upgrade">
|
<extension type="module" version="3.1.0" client="site" method="upgrade">
|
||||||
<name>AL Login</name>
|
<name>AL Login</name>
|
||||||
<author>Nagy Máté</author>
|
<author>Nagy Máté</author>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<description>Login into ARCHLine</description>
|
<description>Login into ARCHLine</description>
|
||||||
<files>
|
<files>
|
||||||
<filename>mod_al_login.xml</filename>
|
<filename>mod_al_login.xml</filename>
|
||||||
<filename module="mod_al_login">mod_al_login.php</filename>
|
<filename module="mod_al_login">mod_al_login.php</filename>
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>helper.php</filename>
|
<filename>helper.php</filename>
|
||||||
<filename>tmpl/default.php</filename>
|
<filename>tmpl/default.php</filename>
|
||||||
<filename>tmpl/index.html</filename>
|
<filename>tmpl/index.html</filename>
|
||||||
</files>
|
</files>
|
||||||
<languages>
|
<languages>
|
||||||
<language tag="en-GB">en-GB.mod_al_login.ini</language>
|
<language tag="en-GB">en-GB.mod_al_login.ini</language>
|
||||||
<language tag="en-GB">en-GB.mod_al_login.sys.ini</language>
|
<language tag="en-GB">en-GB.mod_al_login.sys.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
<config>
|
<config>
|
||||||
</config>
|
</config>
|
||||||
</extension>
|
</extension>
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,87 +1,87 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
jimport('joomla.user.helper');
|
jimport('joomla.user.helper');
|
||||||
|
|
||||||
class ModAlNewsletterHelper
|
class ModAlNewsletterHelper
|
||||||
{
|
{
|
||||||
public static function insertUser($name, $email, $phone, $cntr, $prof)
|
public static function insertUser($name, $email, $phone, $cntr, $prof)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
|
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
|
|
||||||
$query->select(array('e.*'));
|
$query->select(array('e.*'));
|
||||||
$query->from($db->quoteName('cl_hlusers.u_emails', 'e'));
|
$query->from($db->quoteName('cl_hlusers.u_emails', 'e'));
|
||||||
$query->where($db->quoteName('e.email') . ' = ' . $db->quote($email));
|
$query->where($db->quoteName('e.email') . ' = ' . $db->quote($email));
|
||||||
|
|
||||||
// Reset the query using our newly populated query object.
|
// Reset the query using our newly populated query object.
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
||||||
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
|
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
|
||||||
$existingUser = $db->loadObject();
|
$existingUser = $db->loadObject();
|
||||||
|
|
||||||
if (!empty($existingUser)) {
|
if (!empty($existingUser)) {
|
||||||
if ($existingUser->newsletter == 1)
|
if ($existingUser->newsletter == 1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
$db->getQuery(true);
|
$db->getQuery(true);
|
||||||
$query = "UPDATE cl_hlusers.u_emails SET newsletter = 1 WHERE u_emails_id = '{$existingUser->u_emails_id}'";
|
$query = "UPDATE cl_hlusers.u_emails SET newsletter = 1 WHERE u_emails_id = '{$existingUser->u_emails_id}'";
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$old_db = (JFactory::getLanguage()->getTag() == 'hu-HU' ? "clusers" : "clusers_eng");
|
$old_db = (JFactory::getLanguage()->getTag() == 'hu-HU' ? "clusers" : "clusers_eng");
|
||||||
$ctrID = (JFactory::getLanguage()->getTag() == 'hu-HU' ? 36 : 0);
|
$ctrID = (JFactory::getLanguage()->getTag() == 'hu-HU' ? 36 : 0);
|
||||||
|
|
||||||
if ($phone != '') {
|
if ($phone != '') {
|
||||||
$phone = str_replace('-', '', $phone);
|
$phone = str_replace('-', '', $phone);
|
||||||
$phone = str_replace(' ', '', $phone);
|
$phone = str_replace(' ', '', $phone);
|
||||||
$phone = str_replace('+', '', $phone);
|
$phone = str_replace('+', '', $phone);
|
||||||
$phone = str_replace('/', '', $phone);
|
$phone = str_replace('/', '', $phone);
|
||||||
$phone = str_replace('.', '', $phone);
|
$phone = str_replace('.', '', $phone);
|
||||||
$phone = str_replace(' ', '', $phone);
|
$phone = str_replace(' ', '', $phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = new stdClass();
|
$user = new stdClass();
|
||||||
$user->strName = $name;
|
$user->strName = $name;
|
||||||
$user->strEMail = $email;
|
$user->strEMail = $email;
|
||||||
$user->nUserType = 0;
|
$user->nUserType = 0;
|
||||||
$user->nUserStatus = 0;
|
$user->nUserStatus = 0;
|
||||||
$user->nUserProf = 0;
|
$user->nUserProf = 0;
|
||||||
$user->old_db = $old_db;
|
$user->old_db = $old_db;
|
||||||
$user->nSchoolID = 0;
|
$user->nSchoolID = 0;
|
||||||
$user->nCtrID = $ctrID;
|
$user->nCtrID = $ctrID;
|
||||||
$user->strTel = $phone;
|
$user->strTel = $phone;
|
||||||
$user->nCtrID = $cntr;
|
$user->nCtrID = $cntr;
|
||||||
$user->nUserProf = $prof;
|
$user->nUserProf = $prof;
|
||||||
|
|
||||||
JFactory::getDbo()->insertObject('cl_hlusers.users', $user);
|
JFactory::getDbo()->insertObject('cl_hlusers.users', $user);
|
||||||
|
|
||||||
$nUserID = $db->insertid();
|
$nUserID = $db->insertid();
|
||||||
|
|
||||||
$history = new stdClass();
|
$history = new stdClass();
|
||||||
$history->nUserID = $nUserID;
|
$history->nUserID = $nUserID;
|
||||||
$history->nTopicID = (JFactory::getLanguage()->getTag() == 'hu-HU' ? 38 : 150);
|
$history->nTopicID = (JFactory::getLanguage()->getTag() == 'hu-HU' ? 38 : 150);
|
||||||
$history->dateEvent = date('Y-m-d');
|
$history->dateEvent = date('Y-m-d');
|
||||||
$history->insertDate = date('Y-m-d H:i:s');
|
$history->insertDate = date('Y-m-d H:i:s');
|
||||||
$history->strPlace = 'web';
|
$history->strPlace = 'web';
|
||||||
$history->nManagerID = 36;
|
$history->nManagerID = 36;
|
||||||
|
|
||||||
JFactory::getDbo()->insertObject('cl_hlusers.u_history', $history);
|
JFactory::getDbo()->insertObject('cl_hlusers.u_history', $history);
|
||||||
|
|
||||||
$emails = new stdClass();
|
$emails = new stdClass();
|
||||||
$emails->email = $email;
|
$emails->email = $email;
|
||||||
$emails->nUserID = $nUserID;
|
$emails->nUserID = $nUserID;
|
||||||
$emails->default = 1;
|
$emails->default = 1;
|
||||||
$emails->active = 1;
|
$emails->active = 1;
|
||||||
$emails->deleted = 0;
|
$emails->deleted = 0;
|
||||||
$emails->newsletter = 1;
|
$emails->newsletter = 1;
|
||||||
|
|
||||||
JFactory::getDbo()->insertObject('cl_hlusers.u_emails', $emails);
|
JFactory::getDbo()->insertObject('cl_hlusers.u_emails', $emails);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Jetzt unseren wöchentlichen Newsletter abonnieren!"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Jetzt unseren wöchentlichen Newsletter abonnieren!"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Werden Sie Mitglied in unserer Community und erhalten Sie die neuesten Tutorials, Angebote und Nachrichten direkt per E-Mail."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Werden Sie Mitglied in unserer Community und erhalten Sie die neuesten Tutorials, Angebote und Nachrichten direkt per E-Mail."
|
||||||
MOD_AL_NEWSLETTER_NAME="Name"
|
MOD_AL_NEWSLETTER_NAME="Name"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="E-mail Adresse"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="E-mail Adresse"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Abonnieren"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Abonnieren"
|
||||||
MOD_AL_NEWSLETTER_DONE="Danke für Ihr Abonnement"
|
MOD_AL_NEWSLETTER_DONE="Danke für Ihr Abonnement"
|
||||||
MOD_AL_NEWSLETTER_PHONE="Telefonnummer"
|
MOD_AL_NEWSLETTER_PHONE="Telefonnummer"
|
||||||
MOD_AL_NEWSLETTER_PHONE_DESC="Telefonnummer"
|
MOD_AL_NEWSLETTER_PHONE_DESC="Telefonnummer"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="GET OUR NEWSLETTER"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="GET OUR NEWSLETTER"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Want the latest and greatest from our blog straight to your inbox? Chucks us your details and get a sweet weekly email."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Want the latest and greatest from our blog straight to your inbox? Chucks us your details and get a sweet weekly email."
|
||||||
MOD_AL_NEWSLETTER_NAME="Name"
|
MOD_AL_NEWSLETTER_NAME="Name"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
||||||
@ -1,8 +1,8 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Subscribe to our weekly newsletter!"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Subscribe to our weekly newsletter!"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Join our community to get the latest tutorials, offers and news delivered directly in your inbox."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Join our community to get the latest tutorials, offers and news delivered directly in your inbox."
|
||||||
MOD_AL_NEWSLETTER_NAME="Name"
|
MOD_AL_NEWSLETTER_NAME="Name"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
||||||
MOD_AL_NEWSLETTER_DONE="Thank you for subscribing"
|
MOD_AL_NEWSLETTER_DONE="Thank you for subscribing"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="GET OUR NEWSLETTER"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="GET OUR NEWSLETTER"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Want the latest and greatest from our blog straight to your inbox? Chucks us your details and get a sweet weekly email."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Want the latest and greatest from our blog straight to your inbox? Chucks us your details and get a sweet weekly email."
|
||||||
MOD_AL_NEWSLETTER_NAME="Name"
|
MOD_AL_NEWSLETTER_NAME="Name"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
||||||
@ -1,10 +1,10 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Iratkozz fel heti hírlevelünkre!"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Iratkozz fel heti hírlevelünkre!"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Csatlakozz az ARCHLine.XP közösségéhez, értesülj elsők között oktatóvideóinkról, akcióinkről és híreinkről! "
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Csatlakozz az ARCHLine.XP közösségéhez, értesülj elsők között oktatóvideóinkról, akcióinkről és híreinkről! "
|
||||||
MOD_AL_NEWSLETTER_NAME="Név"
|
MOD_AL_NEWSLETTER_NAME="Név"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Név"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Név"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Email"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Email"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Feliratkozom"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Feliratkozom"
|
||||||
MOD_AL_NEWSLETTER_DONE="Köszönjük, hogy feliratkozott hírlevelünkre"
|
MOD_AL_NEWSLETTER_DONE="Köszönjük, hogy feliratkozott hírlevelünkre"
|
||||||
MOD_AL_NEWSLETTER_PHONE="Telefonszám"
|
MOD_AL_NEWSLETTER_PHONE="Telefonszám"
|
||||||
MOD_AL_NEWSLETTER_PHONE_DESC="Telefonszám"
|
MOD_AL_NEWSLETTER_PHONE_DESC="Telefonszám"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Iratkozzon fel hírlevelünkre"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Iratkozzon fel hírlevelünkre"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Szeretné a legújabb és legjobb híreket blogunkról egyenesen a postaládájába? Elküldi nekünk az adatait, és kap egy kedves heti e-mailt."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Szeretné a legújabb és legjobb híreket blogunkról egyenesen a postaládájába? Elküldi nekünk az adatait, és kap egy kedves heti e-mailt."
|
||||||
MOD_AL_NEWSLETTER_NAME="Név"
|
MOD_AL_NEWSLETTER_NAME="Név"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="A neve"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="A neve"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Az email címe"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Az email címe"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Feliratkozás"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Feliratkozás"
|
||||||
@ -1,72 +1,72 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
require_once dirname(__FILE__) . '/helper.php';
|
require_once dirname(__FILE__) . '/helper.php';
|
||||||
|
|
||||||
if (isset($_POST['action']) && $_POST['action'] == 'subscribe') {
|
if (isset($_POST['action']) && $_POST['action'] == 'subscribe') {
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
|
|
||||||
if ($_POST['name'] != '' || $_POST['email'] != '') {
|
if ($_POST['name'] != '' || $_POST['email'] != '') {
|
||||||
$datetime = new \DateTime('');
|
$datetime = new \DateTime('');
|
||||||
$date = $datetime->format('c');
|
$date = $datetime->format('c');
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
$browser = $_SERVER['HTTP_USER_AGENT'];
|
$browser = $_SERVER['HTTP_USER_AGENT'];
|
||||||
|
|
||||||
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
|
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
|
||||||
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
|
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||||
$resq_data = array(
|
$resq_data = array(
|
||||||
'secret' => '6Le1o70lAAAAAE125nVz9KQYBX1h2-o5kmlx4tJw',
|
'secret' => '6Le1o70lAAAAAE125nVz9KQYBX1h2-o5kmlx4tJw',
|
||||||
'response' => $_POST['g-recaptcha-response'],
|
'response' => $_POST['g-recaptcha-response'],
|
||||||
'remoteip' => $_SERVER['REMOTE_ADDR']
|
'remoteip' => $_SERVER['REMOTE_ADDR']
|
||||||
);
|
);
|
||||||
|
|
||||||
$curlConfig = array(
|
$curlConfig = array(
|
||||||
CURLOPT_URL => $api_url,
|
CURLOPT_URL => $api_url,
|
||||||
CURLOPT_POST => true,
|
CURLOPT_POST => true,
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
CURLOPT_POSTFIELDS => $resq_data
|
CURLOPT_POSTFIELDS => $resq_data
|
||||||
);
|
);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt_array($ch, $curlConfig);
|
curl_setopt_array($ch, $curlConfig);
|
||||||
$response = curl_exec($ch);
|
$response = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
$responseData = json_decode($response);
|
$responseData = json_decode($response);
|
||||||
|
|
||||||
if (!$responseData->success) {
|
if (!$responseData->success) {
|
||||||
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
|
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
|
||||||
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
|
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
|
||||||
|
|
||||||
$app->enqueueMessage('Captcha failed', 'error');
|
$app->enqueueMessage('Captcha failed', 'error');
|
||||||
}
|
}
|
||||||
|
|
||||||
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'SUCCESS' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
|
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'SUCCESS' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
|
||||||
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
|
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
|
||||||
|
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
$name = $input->get('name', '', 'string');
|
$name = $input->get('name', '', 'string');
|
||||||
$email = $input->get('email', '', 'string');
|
$email = $input->get('email', '', 'string');
|
||||||
$phone = $input->get('phone', '', 'string');
|
$phone = $input->get('phone', '', 'string');
|
||||||
$cntr = $input->get('cntr', '', 'int');
|
$cntr = $input->get('cntr', '', 'int');
|
||||||
$prof = $input->get('prof', '', 'int');
|
$prof = $input->get('prof', '', 'int');
|
||||||
|
|
||||||
$user = ModAlNewsletterHelper::insertUser($name, $email, $phone, $cntr, $prof);
|
$user = ModAlNewsletterHelper::insertUser($name, $email, $phone, $cntr, $prof);
|
||||||
|
|
||||||
unset($_POST['subscribe-newsletter-btn']);
|
unset($_POST['subscribe-newsletter-btn']);
|
||||||
unset($_POST['name']);
|
unset($_POST['name']);
|
||||||
unset($_POST['email']);
|
unset($_POST['email']);
|
||||||
|
|
||||||
if ($user) {
|
if ($user) {
|
||||||
$app->enqueueMessage(JText::_('MOD_AL_NEWSLETTER_DONE'));
|
$app->enqueueMessage(JText::_('MOD_AL_NEWSLETTER_DONE'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
|
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
|
||||||
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
|
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['Itemid'] != 744 && $_GET['Itemid'] != 745)
|
if ($_GET['Itemid'] != 744 && $_GET['Itemid'] != 745)
|
||||||
require JModuleHelper::getLayoutPath('mod_al_newsletter', $params->get('layout', 'default'));
|
require JModuleHelper::getLayoutPath('mod_al_newsletter', $params->get('layout', 'default'));
|
||||||
|
|||||||
@ -1,44 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="module" method="upgrade" client="site">
|
<extension type="module" method="upgrade" client="site">
|
||||||
<name>mod_al_newsletter</name>
|
<name>mod_al_newsletter</name>
|
||||||
<creationDate>August 2022</creationDate>
|
<creationDate>August 2022</creationDate>
|
||||||
<author>Nagy Máté</author>
|
<author>Nagy Máté</author>
|
||||||
<authorEmail>mate.nagy@cadline.hu</authorEmail>
|
<authorEmail>mate.nagy@cadline.hu</authorEmail>
|
||||||
<copyright>Copyright © 2021 - All rights reserved.</copyright>
|
<copyright>Copyright © 2021 - All rights reserved.</copyright>
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<description>Create a newsletter subscription popup modal</description>
|
<description>Create a newsletter subscription popup modal</description>
|
||||||
<files>
|
<files>
|
||||||
<filename module="mod_al_newsletter">mod_al_newsletter.php</filename>
|
<filename module="mod_al_newsletter">mod_al_newsletter.php</filename>
|
||||||
<filename>mod_al_newsletter.xml</filename>
|
<filename>mod_al_newsletter.xml</filename>
|
||||||
<filename>index.html</filename>
|
<filename>index.html</filename>
|
||||||
<filename>helper.php</filename>
|
<filename>helper.php</filename>
|
||||||
<folder>language</folder>
|
<folder>language</folder>
|
||||||
<folder>tmpl</folder>
|
<folder>tmpl</folder>
|
||||||
</files>
|
</files>
|
||||||
<config>
|
<config>
|
||||||
<fields name="params">
|
<fields name="params">
|
||||||
<fieldset name="advanced">
|
<fieldset name="advanced">
|
||||||
<field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
<field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||||
<field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
<field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||||
<field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC">
|
<field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC">
|
||||||
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
||||||
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
<field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
||||||
<field name="cachemode" type="hidden" default="static">
|
<field name="cachemode" type="hidden" default="static">
|
||||||
<option value="static"></option>
|
<option value="static"></option>
|
||||||
</field>
|
</field>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fields>
|
</fields>
|
||||||
</config>
|
</config>
|
||||||
|
|
||||||
<languages folder="language">
|
<languages folder="language">
|
||||||
<language tag="en-GB">en-GB/en-GB.mod_al_newsletter.sys.ini</language>
|
<language tag="en-GB">en-GB/en-GB.mod_al_newsletter.sys.ini</language>
|
||||||
<language tag="en-GB">en-GB/en-GB.mod_al_newsletter.ini</language>
|
<language tag="en-GB">en-GB/en-GB.mod_al_newsletter.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.mod_al_newsletter.sys.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.mod_al_newsletter.sys.ini</language>
|
||||||
<language tag="hu-HU">hu-HU/hu-HU.mod_al_newsletter.ini</language>
|
<language tag="hu-HU">hu-HU/hu-HU.mod_al_newsletter.ini</language>
|
||||||
<language tag="de-DE">de-DE/de-DE.mod_al_newsletter.sys.ini</language>
|
<language tag="de-DE">de-DE/de-DE.mod_al_newsletter.sys.ini</language>
|
||||||
<language tag="de-DE">de-DE/de-DE.mod_al_newsletter.ini</language>
|
<language tag="de-DE">de-DE/de-DE.mod_al_newsletter.ini</language>
|
||||||
</languages>
|
</languages>
|
||||||
</extension>
|
</extension>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
jimport('joomla.user.helper');
|
jimport('joomla.user.helper');
|
||||||
|
|
||||||
class ModAlUploadHelper
|
class ModAlUploadHelper
|
||||||
{
|
{
|
||||||
public static function isImage($img)
|
public static function isImage($img)
|
||||||
{
|
{
|
||||||
return (bool)getimagesize($img);
|
return (bool)getimagesize($img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
<a href="http://xdsoft.net/joomla/module_generator/">Joomla Module Generator</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
MOD_AL_UPLOAD_SUCCESS="Thank you for participating in the poll, your vote was valid. <br>
|
MOD_AL_UPLOAD_SUCCESS="Thank you for participating in the poll, your vote was valid. <br>
|
||||||
Best regards, CadLine Kft."
|
Best regards, CadLine Kft."
|
||||||
MOD_AL_UPLOAD_VOTE="Vote"
|
MOD_AL_UPLOAD_VOTE="Vote"
|
||||||
MOD_AL_UPLOAD_VOTE_2="I vote"
|
MOD_AL_UPLOAD_VOTE_2="I vote"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="GET OUR NEWSLETTER"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="GET OUR NEWSLETTER"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Want the latest and greatest from our blog straight to your inbox? Chucks us your details and get a sweet weekly email."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Want the latest and greatest from our blog straight to your inbox? Chucks us your details and get a sweet weekly email."
|
||||||
MOD_AL_NEWSLETTER_NAME="Name"
|
MOD_AL_NEWSLETTER_NAME="Name"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="Your name"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Your email address"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Subscribe"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
MOD_AL_UPLOAD_SUCCESS="Köszönjük, hogy részt vettél a szavazáson, leadott szavazatod érvényes volt. <br>
|
MOD_AL_UPLOAD_SUCCESS="Köszönjük, hogy részt vettél a szavazáson, leadott szavazatod érvényes volt. <br>
|
||||||
Üdvözlettel, CadLine Kft."
|
Üdvözlettel, CadLine Kft."
|
||||||
MOD_AL_UPLOAD_VOTE="Szavazat"
|
MOD_AL_UPLOAD_VOTE="Szavazat"
|
||||||
MOD_AL_UPLOAD_VOTE_2="Szavazok"
|
MOD_AL_UPLOAD_VOTE_2="Szavazok"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Iratkozzon fel hírlevelünkre"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_HEADER="Iratkozzon fel hírlevelünkre"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Szeretné a legújabb és legjobb híreket blogunkról egyenesen a postaládájába? Elküldi nekünk az adatait, és kap egy kedves heti e-mailt."
|
MOD_AL_NEWSLETTER_SUBSCRIBE_TEXT="Szeretné a legújabb és legjobb híreket blogunkról egyenesen a postaládájába? Elküldi nekünk az adatait, és kap egy kedves heti e-mailt."
|
||||||
MOD_AL_NEWSLETTER_NAME="Név"
|
MOD_AL_NEWSLETTER_NAME="Név"
|
||||||
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="A neve"
|
MOD_AL_NEWSLETTER_NAME_PLACEHOLDER="A neve"
|
||||||
MOD_AL_NEWSLETTER_EMAIL="Email"
|
MOD_AL_NEWSLETTER_EMAIL="Email"
|
||||||
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Az email címe"
|
MOD_AL_NEWSLETTER_EMAIL_PLACEHOLDER="Az email címe"
|
||||||
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Feliratkozás"
|
MOD_AL_NEWSLETTER_SUBSCRIBE_BTN="Feliratkozás"
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user