Example #1
0
         } else {
             $url = $urlHandler->getUrl("Kommundialekt", URL_ADMIN_CREATE, $_POST["kommun_id"]);
         }
         throw new UserException("Inmatningsfel", $msg, $url, "Försök igen");
     }
     $urlHandler->redirect("Kommundialekt", URL_ADMIN_EDIT, $dialekt->getId());
     break;
 case "paminnelse_sql":
     Security::Demand(SUPERADMIN);
     if (empty($_GET['id'])) {
         $obj = new Paminnelse_sql($_POST);
     } else {
         if (!is_numeric($_GET['id'])) {
             throw new Exception("Ett felaktigt ID angavs", 1);
         } else {
             $sql = Paminnelse_sql::loadById($_GET['id']);
             $sql->setNamn($_POST['namn']);
             $sql->setDagarMellanUtskick($_POST['dagar_mellan_utskick']);
             $sql->setQuery($_POST['query']);
             $sql->setTitel($_POST['titel']);
             $sql->setInreMall($_POST['inre_mall']);
             $sql->setMeddelandeId(!empty($_POST['meddelande_id']) ? $_POST['meddelande_id'] : 0);
             $sql->commit();
         }
     }
     $urlHandler->redirect('Paminnelser', URL_ADMIN_LIST);
     break;
 case "paminnelse_meddelanden":
     if (empty($_GET['id'])) {
         $obj = new Paminnelse_meddelanden($_POST);
     } else {
Example #2
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(ADMIN);
$smarty = new AdminSmarty();
$smarty->assign("pagetitle", "Påminnelser");
$queries = Paminnelse_sql::listQueries();
$smarty->assign('queries', $queries);
$yttre_mallar = Paminnelse_meddelanden::listMeddelanden();
$smarty->assign('yttre_mallar', $yttre_mallar);
if (isset($ADMIN) && $ADMIN->isTyp(SUPERADMIN)) {
    $smarty->assign('superAdmin', true);
} else {
    $smarty->assign('superAdmin', false);
}
$smarty->display('paminnelser.tpl');
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(ADMIN);
$smarty = new AdminSmarty();
$smarty->assign("pagetitle", "Ändra påminnelse");
if (!isset($_GET['qid']) || !is_numeric($_GET['qid'])) {
    throw new Paminnelse_sqlException("Felaktigt SQL-ID angivet", 1);
}
$query = Paminnelse_sql::loadById($_GET['qid']);
$yttre_mallar = Paminnelse_meddelanden::listAll();
$smarty->assign('query', $query);
$smarty->assign('yttre_mallar', $yttre_mallar);
if (isset($ADMIN) && $ADMIN->isTyp(SUPERADMIN)) {
    $smarty->assign('superAdmin', true);
} else {
    $smarty->assign('superAdmin', false);
}
$smarty->display('paminnelser_andrasql.tpl');
Example #4
0
				<div id="motiomera_andra_losenord_link">
					<a href="#" onclick="getById('andraLosen').value='1';getById('motiomera_andra_losenord_link').style.display='none'; getById('motiomera_andra_losenord_field').style.display='block';return false;" title="&Auml;ndra ditt l&ouml;senord">&Auml;ndra l&ouml;senord</a>
				</div>
				<div id="motiomera_andra_losenord_field">
					<input type="password" name="losen" class="mmTextField" /><br />
					<input type="password" name="losen2" class="mmTextField" /> <small class="grey">(Upprepa)</small><br />
					<a href="#" onclick="getById('andraLosen').value='0';getById('motiomera_andra_losenord_link').style.display='block'; getById('motiomera_andra_losenord_field').style.display='none';return false;" title="&Aring;ngra">&Aring;ngra</a>
				</div>
			</td>
		</tr>
		<tr>
			<th>Skicka påminnelsemail</th>
			<td>
				<?php 
$notifications = Paminnelse_sql::listAll();
$aktiva = Paminnelse_sql::getAktivaIDn($USER);
foreach ($notifications as $key => $notification) {
    ?>
					<input type="checkbox" name="notifications[<?php 
    echo $notification->getId();
    ?>
]" id="notification_<?php 
    echo $notification->getId();
    ?>
"<?php 
    if (in_array($notification->getId(), $aktiva)) {
        ?>
 checked="checked"<?php 
    }
    ?>
> <label for="notification_<?php 
Example #5
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/php/init.php';
$allaPaminnelser = Paminnelse_sql::listAll();
if (DEBUG) {
    echo "--- DEBUG INFORMATION -----------------\n";
}
foreach ($allaPaminnelser as $paminnelse) {
    $medlemsLista = Paminnelse_sql::getAktivaByPaminnelse($paminnelse);
    if (count($medlemsLista)) {
        $query = str_replace(array('#medlemslista#', '#sql_id#'), array(implode(', ', $medlemsLista), $paminnelse->getId()), $paminnelse->getQuery());
        $resultat = array();
        $yttre_mall = $paminnelse->getMeddelandeId() ? Paminnelse_meddelanden::loadById($paminnelse->getMeddelandeId()) : '';
        $yttre_mall_code = html_entity_decode($yttre_mall->getMall());
        $res = mysql_query($query) or die(mysql_error() . "\n" . $query);
        while ($data = mysql_fetch_assoc($res)) {
            if (isset($data['epost'])) {
                $key = $data['epost'];
                $title = $paminnelse->getTitel();
                $content = $paminnelse->getInreMall();
                foreach ($data as $field => $value) {
                    $content = str_replace('#' . $field . '#', $value, $content);
                    $title = str_replace('#' . $field . '#', $value, $title);
                }
                ob_start();
                eval($yttre_mall_code);
                $resultat[$data['epost']]['text'] = ob_get_clean();
                $resultat[$data['epost']]['subject'] = $title;
            }
        }
        if (count($resultat)) {
Example #6
0
         $USER->setProfilDataText($id, substr(trim($profilDataText), 0, 40));
         if (strlen(trim($profilDataText))) {
             $USER->setProfilDataVal($id, false);
         }
     }
 }
 $notifications = array();
 if (isset($_POST['notifications'])) {
     foreach ($_POST['notifications'] as $notification_id => $value) {
         if ($value === 'on') {
             $notifications[] = $notification_id;
         }
     }
 }
 $data = Paminnelse_sql::getAktivaIDn($USER);
 Paminnelse_sql::uppdateraAktiva($USER, $notifications);
 if ($USER->getForetagsnyckel(true) == "" && !empty($_POST["foretagsnyckel"])) {
     $USER->setForetagsnyckel($_POST["foretagsnyckel"]);
     $USER->commit();
     if ($USER->getLag() == null) {
         $urlHandler->redirect("Foretag", URL_VIEW, $USER->getForetag(true)->getId());
     } else {
         $urlHandler->redirect("Lag", URL_VIEW, $USER->getLag()->getId());
     }
 }
 if (isset($_POST["tab"])) {
     $urlHandler->redirect("Medlem", URL_EDIT, $_POST["tab"]);
 } else {
     $urlHandler->redirect("Medlem", URL_EDIT);
 }
 break;
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(ADMIN);
$smarty = new AdminSmarty();
$smarty->assign("pagetitle", "Provkör påminnelse");
if (!isset($_GET['qid']) || !is_numeric($_GET['qid'])) {
    throw new Paminnelse_sqlException("Felaktigt SQL-ID angivet", 1);
}
$query = Paminnelse_sql::loadById($_GET['qid']);
$yttre_mall = $query->getMeddelandeId() ? Paminnelse_meddelanden::loadById($query->getMeddelandeId()) : '';
$yttre_mall_code = html_entity_decode($yttre_mall->getMall());
$medlemsLista = Paminnelse_sql::getAktivaByPaminnelse($query);
if (!count($medlemsLista) && isset($_GET['fake']) && $_GET['fake']) {
    $medlemsLista = $db->valuesAsArray('SELECT id FROM mm_medlem ' . 'WHERE epostBekraftad = 1 ' . 'ORDER BY RAND() LIMIT 0, 20');
}
if (count($medlemsLista)) {
    $theQuery = str_replace(array('#medlemslista#', '#sql_id#'), array(implode(', ', $medlemsLista), $query->getId()), $query->getQuery());
    $allResults = $db->allValuesAsArray($theQuery);
    $resultat = array();
    foreach ($allResults as $key => $data) {
        if (isset($data['epost'])) {
            $key = $data['epost'];
        }
        $title = $query->getTitel();
        $content = $query->getInreMall();
        foreach ($data as $field => $value) {
            $content = str_replace('#' . $field . '#', $value, $content);
            $title = str_replace('#' . $field . '#', $value, $title);
        }
        ob_start();