aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/www/include/modules
diff options
context:
space:
mode:
authorM.Gergo2018-07-06 11:34:04 +0200
committerM.Gergo2018-07-06 11:34:04 +0200
commit095e5987eadbe3786be5e12ef385bda9640155b0 (patch)
treee796dcd1c575094cf43e0b0b7d4c8fb22896e66f /mayor-orig/www/include/modules
parent43de9af71f7f4ca5731b94a06d688ae8412ba427 (diff)
downloadmayor-095e5987eadbe3786be5e12ef385bda9640155b0.tar.gz
mayor-095e5987eadbe3786be5e12ef385bda9640155b0.zip
checkupdate.sh + portal 2018/Feb kiinduló
Diffstat (limited to 'mayor-orig/www/include/modules')
-rw-r--r--mayor-orig/www/include/modules/portal/base/rights.php10
-rw-r--r--mayor-orig/www/include/modules/portal/hirek/egyhir.php47
-rw-r--r--mayor-orig/www/include/modules/portal/kerdoiv/kerdoivAdmin.php32
-rw-r--r--mayor-orig/www/include/modules/portal/share/hirek.php50
-rw-r--r--mayor-orig/www/include/modules/portal/share/kerdoiv.php45
-rw-r--r--mayor-orig/www/include/modules/portal/share/nevnap.php8
6 files changed, 192 insertions, 0 deletions
diff --git a/mayor-orig/www/include/modules/portal/base/rights.php b/mayor-orig/www/include/modules/portal/base/rights.php
new file mode 100644
index 00000000..c1a5c039
--- /dev/null
+++ b/mayor-orig/www/include/modules/portal/base/rights.php
@@ -0,0 +1,10 @@
+<?php
+
+ if (_POLICY=='private' && @memberOf(_USERACCOUNT, 'hirekadmin')) {
+ $AUTH['my']['categories'][] = 'hirekadmin';
+ define('__HIREKADMIN',true);
+ } else {
+ define('__HIREKADMIN',false);
+ }
+
+?>
diff --git a/mayor-orig/www/include/modules/portal/hirek/egyhir.php b/mayor-orig/www/include/modules/portal/hirek/egyhir.php
new file mode 100644
index 00000000..c93a81bd
--- /dev/null
+++ b/mayor-orig/www/include/modules/portal/hirek/egyhir.php
@@ -0,0 +1,47 @@
+<?php
+
+ function saveHir($DATA) {
+ global $LANGUAGES;
+
+ $cim = $DATA['cim'];
+ $txt = $DATA['txt'];
+ $pic = $DATA['pic'];
+ $owner = $DATA['owner'];
+ $hirId = $DATA['hirId'];
+ $kdt = $DATA['kdt'];
+ $vdt = $DATA['vdt'];
+ $flag = intval($DATA['flag']);
+ $class = intval($DATA['class']);
+ $lang = (in_array($DATA['lang'],$LANGUAGES)) ? $DATA['lang'] : _DEFAULT_LANG;
+ if ($DATA['cid']>0) $cid = $DATA['cid'];
+ $csoport = $DATA['csoport'];
+ if ($hirId!='' && __HIREKADMIN == false ) {
+ $q = "SELECT owner FROM hirek WHERE owner='%s'";
+ $v = array($owner);
+ $_owner = db_query($q,array('modul'=>'portal','result'=>'value','values'=>$v));
+ $isOwner = ($_owner===$owner);
+ } else $isOwner = false;
+ if ($hirId=='') {
+ $keys = array('`pic`','`owner`','`cim`','`txt`','`kdt`','`vdt`','`flag`','`class`','`lang`','`csoport`');
+ $pattern = array("'%s'","'%s'","'%s'","'%s'","'%s'","'%s'","%u","%u","'%s'","'%s'");
+ $v = array($pic,$owner,$cim,$txt,$kdt,$vdt,$flag,$class,$lang,$csoport);
+ if (isset($cid)) {
+ $keys[] = 'cid';
+ $pattern[] = '%u';
+ $v[] = $cid;
+ }
+ $q = "insert INTO `hirek` (".implode(',',$keys).") VALUES (".implode(',',$pattern).")";
+ } elseif (isset($hirId) && (__HIREKADMIN || $isOwner)) {
+ if (isset($cid)) {
+ $q = "update `hirek` SET pic='%s', cim='%s', txt='%s',kdt='%s',vdt='%s',flag=%u,class=%u,lang='%s',csoport='%s',cid=%u WHERE id=%u";
+ $v = array($pic,$cim,$txt,$kdt,$vdt,$flag,$class,$lang,$csoport, $cid, $hirId);
+ } else {
+ $q = "update `hirek` SET pic='%s', cim='%s', txt='%s',kdt='%s',vdt='%s',flag=%u,class=%u,lang='%s',csoport='%s' WHERE id=%u";
+ $v = array($pic,$cim,$txt,$kdt,$vdt,$flag,$class,$lang,$csoport, $hirId);
+ }
+ } else $q = '';
+ if ($q!='') $r = db_query($q,array('modul'=>'portal','result'=>'insert','values'=>$v));
+ return $r;
+ }
+
+?>
diff --git a/mayor-orig/www/include/modules/portal/kerdoiv/kerdoivAdmin.php b/mayor-orig/www/include/modules/portal/kerdoiv/kerdoivAdmin.php
new file mode 100644
index 00000000..237b6dc6
--- /dev/null
+++ b/mayor-orig/www/include/modules/portal/kerdoiv/kerdoivAdmin.php
@@ -0,0 +1,32 @@
+<?php
+
+ function addKerdoiv($kerdes, $valaszok) {
+
+ $v = $Pattern = array();
+ // ellenőrizük, hogy van-e válasz...
+ for ($i = 0; $i < count($valaszok); $i++) if ($valaszok[$i] != '') {
+ $Pattern[] = "(%u, '%s')";
+ }
+
+ if (count($Pattern) > 0) {
+ // A kérdés felvétele
+ $q = "INSERT INTO kerdesek (vszam,kerdes) VALUES (%u,'%s')";
+ $kszam = db_query($q, array('fv' => 'addKerdoiv', 'modul' => 'portal', 'result' => 'insert', 'values' => array(count($valaszok), $kerdes)));
+ // A válaszok rögzítése
+ for ($i = 0; $i < count($valaszok); $i++) if ($valaszok[$i] != '') { $v[] = $kszam; $v[] = $valaszok[$i]; }
+ $q = "INSERT INTO valaszok (kszam,valasz) VALUES ".implode(',', $Pattern);
+ return db_query($q, array('fv' => 'addKerdoiv', 'modul' => 'portal', 'values' => $v));
+ } else {
+ return false;
+ }
+ }
+
+ function delKerdoivKerdes($kerdesek) {
+ $q = "DELETE FROM kerdesek WHERE sorszam IN (".implode(',',array_fill(0, count($kerdesek), '%u')).")";
+ $v = $kerdesek;
+ db_query($q, array('fv' => 'delKeroivKerdes', 'modul' => 'portal', 'values'=>$v));
+ $q = "DELETE FROM valaszok WHERE kszam IN (".implode(',',array_fill(0, count($kerdesek), '%u')).")";
+ db_query($q, array('fv' => 'delKeroivKerdes', 'modul' => 'portal', 'values'=>$v));
+ }
+
+?>
diff --git a/mayor-orig/www/include/modules/portal/share/hirek.php b/mayor-orig/www/include/modules/portal/share/hirek.php
new file mode 100644
index 00000000..f9a64f62
--- /dev/null
+++ b/mayor-orig/www/include/modules/portal/share/hirek.php
@@ -0,0 +1,50 @@
+<?php
+
+ function isOwner($hirId) {
+ if ($hirId=='') return false;
+ $q = "SELECT owner FROM hirek WHERE id=%u";
+ $r = db_query($q,array('modul'=>'portal','result'=>'value','values'=>array($hirId)));
+ return ($r === _USERACCOUNT);
+ }
+
+ function getKategoriak() {
+ $q = "SELECT * FROM kategoriak ORDER BY leiras";
+ $r = db_query($q,array('modul'=>'portal','result'=>'indexed'));
+ return $r;
+ }
+
+ function getHirek($SET = array('all'=>true,'tolDt'=>'', 'igDt'=>'', 'id' => '', 'flag'=>array(), 'class'=>array(), 'cid'=>array(), 'limit'=>'', 'lang'=>'hu_HU') ) {
+ $tolDt = $SET['tolDt']; $igDt = $SET['igDt'];
+ if ($tolDt!='') $W[] = "kdt<='$tolDt'";
+ if ($igDt!='') $W[] = "vdt>='$igDt'";
+ if (count($SET['flag'])>0) $W[] = "flag IN (".implode(',',$SET['flag']).")";
+ if (count($SET['class'])>0) $W[] = "class IN (".implode(',',$SET['class']).")";
+ if (count($SET['cid'])>0) $W[] = "cid IN (".implode(',',$SET['cid']).")";
+ if ($SET['lang']!='') $W[] = "lang='".$SET['lang']."'";
+
+ if ($SET['limit']!='') $L = ' LIMIT '.$SET['limit'];
+ if ($SET['id']!='') $W[] = 'id='.$SET['id'];
+
+ if ($SET['id']=='') {
+ if (is_array($SET['csoport'])) {
+ for ($i=0; $i<count($SET['csoport']); $i++) {
+ $GW[] = "csoport like '%".$SET['csoport'][$i]."%'";
+ }
+ if (count($GW)>0) $WOR = ' OR '.implode(' OR ',$GW);
+ } else {
+ $WOR = '';
+ }
+ $W[] = '(csoport="" '.$WOR.')';
+ }
+ if (is_array($W) && count($W)>0) {
+ $WHERE = "WHERE ".implode(' AND ',$W);
+ } else $WHERE = '';
+
+ //hack
+ if ($SET['all']===true) $WHERE='';
+ $q = "SELECT * FROM hirek $WHERE ORDER BY kdt DESC,vdt DESC".$L;
+ $HIREK['szovegek'] = db_query($q, array('modul'=>'portal','result'=>'indexed'));
+ return $HIREK;
+ }
+
+?>
diff --git a/mayor-orig/www/include/modules/portal/share/kerdoiv.php b/mayor-orig/www/include/modules/portal/share/kerdoiv.php
new file mode 100644
index 00000000..36a7e8b1
--- /dev/null
+++ b/mayor-orig/www/include/modules/portal/share/kerdoiv.php
@@ -0,0 +1,45 @@
+<?php
+
+ function getKerdoiv($policy='public') {
+
+ $v = array($policy);
+ $q = "select * from kerdesek where sorszam=(select max(sorszam) from kerdesek WHERE policy='%s')";
+ $R['kerdes'] = db_query($q, array('fv' => 'getKerdoiv', 'modul' => 'portal', 'values'=>$v,'result' => 'record'));
+
+ $q = "select * from valaszok where kszam=(select max(sorszam) from kerdesek WHERE policy='%s')";
+ $R['valaszok'] = db_query($q, array('fv' => 'getKerdoiv', 'modul' => 'portal', 'result' => 'indexed', 'values'=>$v, 'keyfiled' => 'kszam'));
+ return $R;
+
+ }
+
+ function szavazotte($kerdoivId) {
+ if (defined('_USERACCOUNT') && defined('_POLICY') && _USERACCOUNT!='' && _POLICY != '') {
+ $q = "SELECT count(*) AS db FROM kerdoivSzavazott WHERE kerdoivId=%u AND policy='%s' AND userAccount='%s'";
+ $v = array($kerdoivId, _POLICY, _USERACCOUNT);
+ return (db_query($q, array('fv' => 'szavaz', 'modul' => 'portal', 'result'=>'value','values' => $v))>0);
+ } else {
+ if (isset($_SESSION['kerdoivSzavazott']))
+ return true;
+ else
+ return false;
+ }
+ }
+
+ function szavaz($id, $db = 1, $kerdoivId) {
+ if (defined('_USERACCOUNT') && defined('_POLICY')) {
+ $q = "INSERT INTO kerdoivSzavazott (kerdoivId,policy,userAccount) VALUES (%u,'%s','%s')";
+ $v = array($kerdoivId, _POLICY, _USERACCOUNT);
+ db_query($q, array('fv' => 'szavaz', 'modul' => 'portal', 'values' => $v));
+ }
+ $q = "UPDATE valaszok SET pontszam=pontszam + (%u) WHERE sorszam=%u";
+ $v = array($db, $id);
+ return db_query($q, array('fv' => 'szavaz', 'modul' => 'portal', 'values' => $v));
+ }
+
+ function getRegiKerdesek() {
+ $q = "SELECT * FROM kerdesek ORDER BY sorszam DESC LIMIT 10";
+ return db_query($q, array('modul'=>'portal','result'=>'indexed'));
+ }
+
+
+?> \ No newline at end of file
diff --git a/mayor-orig/www/include/modules/portal/share/nevnap.php b/mayor-orig/www/include/modules/portal/share/nevnap.php
new file mode 100644
index 00000000..7a9ae971
--- /dev/null
+++ b/mayor-orig/www/include/modules/portal/share/nevnap.php
@@ -0,0 +1,8 @@
+<?php
+
+ function getNevnap($ho,$nap) {
+ $v = array($ho,$nap);
+ return db_query("SELECT `nevnap` FROM `nevnap` WHERE `honap`=%u AND `nap`=%u", array('modul'=>'portal','values'=>$v,'result'=>'value'));
+ }
+
+?>