aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo/www/policy/private
diff options
context:
space:
mode:
authorM.Gergo2024-09-29 04:30:59 +0200
committerM.Gergo2024-09-29 04:30:59 +0200
commitf55bad6878c678ce5aed406a5d2b31a6b3a523eb (patch)
tree27e7421dd8a7b65f4a1af3bc0a7f1ae073d97e78 /mayor-orig/mayor-naplo/www/policy/private
parent3d2ab46cef4f29a500f9a125460bb2993613c67e (diff)
parent8ba4eb09ddb764eaf01fabe30bdd49a202858d4d (diff)
downloadmayor-f55bad6878c678ce5aed406a5d2b31a6b3a523eb.tar.gz
mayor-f55bad6878c678ce5aed406a5d2b31a6b3a523eb.zip
Diffstat (limited to 'mayor-orig/mayor-naplo/www/policy/private')
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg-pre.php71
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg.php0
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg-pre.php68
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg.php30
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarendModosito-pre.php1
5 files changed, 170 insertions, 0 deletions
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg-pre.php
new file mode 100644
index 00000000..ccccf906
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg-pre.php
@@ -0,0 +1,71 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ require_once('include/share/date/names.php');
+ require_once('include/share/print/pdf.php');
+
+ if (__PORTAL_CODE!=='kanizsay' || __PORTAL_CODE!=='mzsg') {
+ $_SESSION['alert'][] = 'page:insufficient_access';
+ }
+
+ $token = readVariable($_GET['token'],'strictstring');
+ if (
+ (_USERACCOUNT === 'mayoradmin' || __FELVETELIADMIN === true) && $token==''
+ ) {
+ $q = "SELECT * FROM felveteli_eredmeny ORDER BY evfolyam,nev";
+ $r = db_query($q, array('modul'=>'naplo','result'=>'indexed'));
+ $ADAT['level'] = $r;
+ for ($i = 0; $i < count($ADAT['level']); $i++) {
+ $D = $ADAT['level'][$i];
+ if (chop($D['mashova']) == "") $ADAT['level'][$i]['mashova'] = array(); else $ADAT['level'][$i]['mashova'] = explode(',',$D['mashova']);
+ if (chop($D['helyhiany']) == "") $ADAT['level'][$i]['helyhiany'] = array(); else $ADAT['level'][$i]['helyhiany'] = explode(',',$D['helyhiany']);
+ if (chop($D['elutasitott']) == "") $ADAT['level'][$i]['elutasitott'] = array(); else $ADAT['level'][$i]['elutasitott'] = explode(',',$D['elutasitott']);
+ }
+ $file = __INTEZMENY.'_'.date('Y').'_teljes';
+ if (pdfLevel($file, $ADAT)) {
+ header('Location: '.location('index.php?page=session&f=download&download=true&dir=naplo/felveteli/level&file='.$file.'.pdf'));
+ } else {
+ $_SESSION['alert'][] = 'info::Hiba a file-generáláskor!';
+ }
+
+ } else {
+
+ if (strlen($token)==40) {
+
+ $q = "SELECT oId FROM felveteli_levelLog WHERE token='%s' AND generalasDt>= NOW() - interval 10 MINUTE";
+ $v = array($token);
+ $oId = db_query($q, array('modul'=>'naplo','result'=>'value','values'=>$v,'debug'=>false));
+
+ if ($oId=='') {
+ $_SESSION['alert'][] = 'info::Ez a token már nem érvényes!';
+ } else {
+ //$q = "SELECT * FROM adatok_"._EV." ORDER BY evfolyam,nev";
+ $q = "SELECT * FROM felveteli_eredmeny WHERE oId='%s'";
+ $v = array($oId);
+ $r = db_query($q, array('modul'=>'naplo','result'=>'indexed','values'=>$v));
+ $ADAT['level'] = $r;
+ $D = $ADAT['level'][0];
+ if (chop($D['mashova']) == "") $ADAT['level'][0]['mashova'] = array(); else $ADAT['level'][0]['mashova'] = explode(',',$D['mashova']);
+ if (chop($D['helyhiany']) == "") $ADAT['level'][0]['helyhiany'] = array(); else $ADAT['level'][0]['helyhiany'] = explode(',',$D['helyhiany']);
+ if (chop($D['elutasitott']) == "") $ADAT['level'][0]['elutasitott'] = array(); else $ADAT['level'][0]['elutasitott'] = explode(',',$D['elutasitott']);
+# $ADAT['iktsz'] = 'C8-62/2021';
+ $file = __INTEZMENY.'_'.date('Y').'_'.$oktid.$token;
+ if (pdfLevel($file, $ADAT)) {
+ $q = "UPDATE felveteli_levelLog SET letoltesDt=NOW() WHERE token='%s'";
+ $v = array($token);
+ db_query($q, array('modul'=>'naplo','values'=>$v,'debug'=>false));
+ header('Location: '.location('index.php?page=session&f=download&download=true&dir=naplo/felveteli/level&file='.$file.'.pdf'));
+ exit;
+ } else {
+ $_SESSION['alert'][] = 'info::Hiba a file-generáláskor!';
+ }
+ }
+ } else {
+ $_SESSION['alert'][] = 'info::Nem adtál meg érvényes kulcsot a letöltéshez!';
+ }
+ }
+ // ha eljutottunk idáig, visszairányíthatnánk a lekérdező oldalra
+ //header('Location: '.location('index.php?page=felveteli&f=kozponti'));
+
+?>
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg.php
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/level-mzsg.php
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg-pre.php
new file mode 100644
index 00000000..b954f0c2
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg-pre.php
@@ -0,0 +1,68 @@
+<?php
+
+ define('_EV',date('Y'));
+ if (_RIGHTS_OK !== true) die();
+ if (
+ _USERACCOUNT != 'mayoradmin' && __FELVETELIADMIN !== true && __PORTAL_CODE!=='kanizsay'
+ ) {
+ $_SESSION['alert'][] = 'page:insufficient_access';
+ } else {
+
+ require_once('include/share/date/names.php');
+ require_once('include/share/print/pdf.php');
+ require_once('include/share/net/class.smtp.php');
+ require_once('include/share/net/phpmailer.php');
+
+ $IKTSZ = 'klik037775001/04442-1/2024';
+
+ $ADAT['generatePDF'] = readVariable($_POST['generatePDF'],'id',null);
+ $ADAT['sendMAIL'] = readVariable($_POST['sendMAIL'],'strictstring',null);
+
+// $q = "SELECT *, iskolaEmail as email, iskolaTelepules AS telepules, iskolaIrsz as irsz, iskolaNev as nev, iskolaCim as cim FROM felveteli_iskolak";
+ $q = "SELECT distinct OM, isk_email as email, isk_telepules AS telepules, isk_irsz as irsz, isk_nev as nev, isk_utcahazszam as cim FROM felveteli_eredmeny where OM <> 'FIKTIV'";
+// $ADAT['iskola'] = db_query($q, array('modul'=>'naplo','result'=>'assoc','keyfield'=>'omkod'));
+ $ADAT['iskola'] = db_query($q, array('modul'=>'naplo','result'=>'assoc','keyfield'=>'OM'));
+// $q = "SELECT distinct omkod FROM felveteli WHERE level2 != 'nem kell értesíteni' AND omkod != '' ORDER BY omkod";
+ $q = "SELECT distinct OM FROM felveteli_eredmeny WHERE OM != '' ORDER BY OM";
+ $ADAT['OM'] = $R = db_query($q, array('modul'=>'naplo','result'=>'idonly'));
+ for ($i=0; $i<count($R); $i++) {
+ $ADAT['diak'] = array();
+ $_om = $R[$i]; // iskola OM kódja
+ $ADAT['iskola'][$_om]['id'] = i+1;
+# $q = "SELECT * FROM felveteli WHERE level2 != 'nem kell értesíteni' AND omkod='%s' ORDER BY omkod,nev";
+ $q = "SELECT * FROM felveteli_eredmeny WHERE OM='%s' ORDER BY nev";
+ $ADAT['diak'] = db_query($q, array('modul'=>'naplo','result'=>'indexed','values'=>array($_om)));
+ $file = _EV . '_' . ($i+1) . '_' . $_om;
+ $ADAT['iktsz'] = $IKTSZ; // . ($i+1) . '/' . _EV;
+ if ($ADAT['generatePDF']==true) pdfLevel($file, $ADAT);
+ if (is_array($ADAT['sendMAIL']) && in_array($_om,$ADAT['sendMAIL'])) {
+ //echo $ADAT['iskola'][$_om]['email'];
+ $mail = new PHPMailer;
+// $mail->isSMTP();
+// $mail->Host = 'smtp.gmail.com';
+// $mail->Port = 587;
+// $mail->SMTPSecure = 'tls';
+// $mail->SMTPAuth = true;
+// $mail->Username = _FELVETELI_SMTP_USERNAME;
+// $mail->Password = _FELVETELI_SMTP_PASSWORD;
+ $mail->setFrom('igazgato@moricz-bp.hu', 'Budapest II. Kerületi Móricz Zsigmond Gimnázium');
+ $mail->addReplyTo('felveteli@moricz-bp.hu', 'Felvételi ügyintézés - Móricz Zsigmond Gimnázium');
+ $mail->addAddress($ADAT['iskola'][$_om]['email'], 'Igazgató');
+ $mail->addAddress('bence.barnkopf@moricz-bp.hu', 'Igazgató');
+ $mail->Subject = 'Értesítés felvételi eredményekről - 2024/2025-ös beiskolázás';
+ $mail->msgHTML("A levelet a MaYoR elektronikus napló generálta PDF csatolmány tartalmazza.");
+ $mail->AltBody="A levelet a MaYoR elektronikus napló generálta PDF csatolmány tartalmazza.";
+ $mail->addAttachment(_DOWNLOADDIR."/private/naplo/felveteli/levelIgazgato/".$file.'.pdf');
+ if (!$mail->send()) {
+ echo "Mailer Error: " . $mail->ErrorInfo;
+ } else {
+ echo "Message sent! " . $ADAT['iskola'][$_om]['email'];
+ $qr = "UPDATE felveteli SET level2='értesítve' WHERE omkod='%s'";
+ db_query($qr, array('modul'=>'naplo','values'=>array($_om)));
+ }
+ }
+ // header('Location: '.location('index.php?page=session&f=download&download=true&dir=felveteli/levelIgazgato&file='.$file.'.pdf'));
+ }
+ }
+
+?>
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg.php
new file mode 100644
index 00000000..9a862f17
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/felveteli/levelIgazgato-mzsg.php
@@ -0,0 +1,30 @@
+<?php
+ global $ADAT;
+
+ putLevelIgazgato($ADAT);
+
+ // phtml
+ function putLevelIgazgato($ADAT) {
+ formBegin();
+ echo '<h1>PDF generálás?</h1>Generáljunk pdf-eket? (Lassan fut!)<input type="checkbox" name="generatePDF" value="1" /><br/>';
+ echo '<input type="submit" />';
+
+ echo '<h1>Email küldés</h1>';
+ echo '<input type="submit" /><br />';
+ for ($i=0; $i<count($ADAT['OM']); $i++) {
+ $_om = $ADAT['OM'][$i];
+// echo '<input type="checkbox" name="sendMAIL[]" value="'.$_om.'" checked="checked" />';
+ echo $i.". ";
+ echo 'SENDEMAIL <input type="checkbox" name="sendMAIL[]" value="'.$_om.'" />';
+ echo $_om.' : ';
+ var_dump($ADAT['iskola'][$_om]['email']);
+ $file= $file = _EV . '_' . ($i+1) . '_' . $_om;
+ echo '<a href="'.href('index.php?page=session&f=download&download=true&dir=naplo/felveteli/levelIgazgato&file='.$file.'.pdf').'">PDF</a>';
+ echo '<br/>';
+ if ($i%5==0) echo '<hr/>';
+ }
+ echo '<input type="submit" />';
+ formEnd();
+ }
+
+?> \ No newline at end of file
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarendModosito-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarendModosito-pre.php
index 250197a0..dc26ec7b 100644
--- a/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarendModosito-pre.php
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarendModosito-pre.php
@@ -185,6 +185,7 @@
$ADAT['termek'] = getTermek(array('result'=>'assoc'));
+ $ADAT['szabadTermek'] = getSzabadTermekByDtInterval($tolDt,$igDt,'');
$ADAT['tanarok'] = getTanarok(array('result'=>'assoc'));
// =====================
if ($tankorId!='') {