Exemplo n.º 1
0
 public function getKommun()
 {
     if (!$this->kommun) {
         $this->kommun = Kommun::loadById($this->getKommunId());
     }
     return $this->kommun;
 }
Exemplo n.º 2
0
 public function getKommun()
 {
     if (!$this->kommun && $this->kommun_id != "") {
         $this->kommun = Kommun::loadById($this->kommun_id);
     }
     return $this->kommun;
 }
Exemplo n.º 3
0
 public function setKommunId($id)
 {
     $kommun = Kommun::loadById($id);
     Security::demand(KOMMUN, $kommun);
     $this->kommun_id = $id;
     $this->kommun = null;
 }
Exemplo n.º 4
0
 public function getKommunTill()
 {
     if (!$this->kommunTill) {
         $this->kommunTill = Kommun::loadById($this->getKommunTillId());
     }
     return $this->kommunTill;
 }
Exemplo n.º 5
0
<?php

// LILLA RUTTKARTAN PÅ "PLANERAD RUTT"
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
//Security::demand(USER);
error_reporting(0);
if (isset($_GET["medlem"])) {
    $medlem = Medlem::loadById($_GET["medlem"]);
} else {
    $medlem = $USER;
}
$rutt = new Rutt($medlem);
$rutten = $rutt->getRutt();
$sista = $rutt->getCurrentIndex();
$just_nu_id = $medlem->getJustNuKommunId();
$just_nu_kommun = Kommun::loadById($just_nu_id);
$exclude[] = $just_nu_kommun->getKod();
$kommuntext = array();
$c = 0;
while (list($key, $stracka) = each($rutten)) {
    $c++;
    $key = $stracka["Kommun"]->getKod();
    $kommuntext[$key] = $kommuntext[$key] ? $kommuntext[$key] . ",{$c}" : $c;
}
reset($rutten);
?>
<map animation='1' showShadow='1' mapLeftMargin='0' mapRightMargin='0' mapBottomMargin='0'  maptopMargin='0' showBevel='0' showCanvasBorder='0'  showMarkerLabels='1' fillColor='F1f1f1' borderColor='CCCCCC' baseFont='Arial Narrow' baseFontSize='10' markerBorderColor='000000' markerBgColor='FF5904' markerRadius='6' legendPosition='bottom' useHoverColor='0' hoverColor='FF0000' showMarkerToolTip='1'  markerFontColor='FF5904' connectorColor='FF0000' showLabels='0'  includeValueInLabels='1' BorderColor='0372AB' showToolTip='1' waterBodyColor='00CCFF' waterBodyAlpha='50' >
	<data>
		<entity id= '<?php 
echo $just_nu_kommun->getKod();
?>
Exemplo n.º 6
0
         SajtDelar::giveAccess($level, $sajtdel);
     } else {
         SajtDelar::removeAccess($level, $sajtdel);
     }
     $urlHandler->redirect("Level", URL_ADMIN_LIST);
     break;
 case "kommundialekt":
     try {
         if (isset($_POST["id"])) {
             $dialekt = Kommundialekt::loadById($_POST["id"]);
             $dialekt->setKon($_POST["kon"]);
             $dialekt->setAlder($_POST["alder"]);
             $dialekt->setUrl($_POST["url"]);
             $dialekt->commit();
         } else {
             $kommun = Kommun::loadById($_POST["kommun_id"]);
             $dialekt = new Kommundialekt($kommun, $_POST["kon"], $_POST["alder"], $_POST["url"]);
         }
     } catch (KommundialektException $e) {
         $msg = $e->getMessage();
         if (isset($_POST["id"])) {
             $url = $urlHandler->getUrl("Kommundialekt", URL_ADMIN_EDIT, $_POST["id"]);
         } 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);
Exemplo n.º 7
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(EDITOR);
$smarty = new AdminSmarty();
if (!empty($_GET["kid"])) {
    $kommun = Kommun::loadById($_GET["kid"]);
}
$smarty->display('kommun.tpl');
Exemplo n.º 8
0
     $order->setMedlem($objekt);
     $order->commit();
     $order->gorUppslag();
     break;
 case isset($_REQUEST["typ"]) && $_REQUEST["typ"] == "foretag":
     if (isset($_POST["startdatumRadio"])) {
         if ($_POST["startdatumRadio"] != 'egetdatum') {
             $startdatum = $_POST["startdatumRadio"];
         } else {
             $startdatum = $_POST["startdatum"];
         }
     }
     $typ = "foretag";
     $kampanjkod = "";
     $antal = "";
     $kommun = Kommun::loadById(150);
     //Ale - legacy
     $foretagLosen = Foretag::skapaLosen();
     //a new is created in api/order if a purchase is made
     $isValid = 0;
     $objekt = new Foretag($_REQUEST["namn"], $kommun, $foretagLosen, $startdatum, $kanal, $compAffCode, $isValid);
     //last param is "Order::isValid" and is set to 0 - i.e. not a valid order yet
     $objekt->setTempLosenord($foretagLosen);
     $objekt->commit();
     if (isset($_REQUEST['$camparray'])) {
         $camparray = $_REQUEST['$camparray'];
         $refId = "first_iteration";
         foreach ($camparray as $ord => $arr) {
             if ($arr["antal"] > 0) {
                 //$objekt->generateNycklar($arr["antal"], true);
                 if ($refId == "first_iteration") {
Exemplo n.º 9
0
 public function getKommun()
 {
     if (!$this->kommun) {
         if ($this->getKommunId()) {
             $this->kommun = Kommun::loadById($this->kommun_id);
         } else {
             $this->kommun = null;
         }
     }
     return $this->kommun;
 }
Exemplo n.º 10
0
!empty($_REQUEST['country']) ? $order->country = $_REQUEST['country'] : ($order->country = '');
$order->street = $order->street1;
!empty($order->street2) ? $order->street = $order->street . ' ' . $order->street2 : null;
!empty($order->street3) ? $order->street = $order->street . ' ' . $order->street3 : null;
$redirPage = $SETTINGS["url"] . "/pages/foretag_kampanj.php?anamn=" . $order->anamn . "&mailone=" . $order->email . '&firstname=' . $order->fname . '&lastname=' . $order->lname . '&co=' . $order->co . '&phone=' . $order->phone . '&street1=' . $order->street1 . '&street2=' . $order->street2 . '&street3=' . $order->street3 . '&zip=' . $order->zip . '&city=' . $order->city;
if ($order->compcampcode == '' or $order->email == '' or $order->fname == '' or $order->lname == '') {
    Misc::logMotiomera("Error action/medlem_foretagskod.php  Fält saknas!  \n Params:\n" . print_r($order, true) . "\n ", 'ERROR');
    $redirPage .= "&msg=fields_missing";
    header('Location: ' . $redirPage);
}
$companyId = Foretag::getCompanyIdByCampaignMemberCode($order->compcampcode);
if (is_numeric($companyId) && $companyId > 0) {
    //everthing looks fine sofar, create the user
    try {
        $foretag = Foretag::loadById($companyId);
        $kommun = Kommun::loadById($order->kid);
        $kontotyp = '';
        //legacy or not used right now
        $maffcode = '';
        //legacy or not used right now
        $medlem = new Medlem($order->email, $order->anamn, $kommun, $order->sex, $order->fname, $order->lname, $kontotyp, $maffcode);
        $medlem->confirm($order->pass);
        $medlem->setAddress($order->street);
        $medlem->setCo($order->co);
        $medlem->setZip($order->zip);
        $medlem->setCity($order->city);
        $medlem->setPhone($order->phone);
        $medlem->setCountry($order->country);
        $medlem->setEpostBekraftad(1);
        //medlem valid
        $medlem->setLevelId(1);
$rutten = $rutt->getRutt();
$last_stracka = null;
while (list($key, $stracka) = each($rutten)) {
    $last_stracka = $stracka;
}
$rutten = $rutt->getRutt();
$sista = $rutt->getCurrentIndex();
$just_nu_id = $USER->getJustNuKommunId();
$just_nu_kommun = Kommun::loadById($just_nu_id);
$exclude[] = $just_nu_kommun->getKod();
$exclude[] = $last_stracka["Kommun"]->getKod();
$avstand = $last_stracka["Kommun"]->listAvstand();
$grannkommuner = array();
foreach ($avstand as $tmp) {
    $exclude[] = $tmp["id"];
    $tk = Kommun::loadById($tmp["id"]);
    $grannkommuner[] = $tk;
}
?>
<map animation='1' showShadow='1' mapLeftMargin='0' mapRightMargin='0' mapBottomMargin='0'  maptopMargin='0' showBevel='0' showCanvasBorder='0'  showMarkerLabels='1' fillColor='F1f1f1' borderColor='CCCCCC' baseFont='Arial Narrow' baseFontSize='16' markerBorderColor='000000' markerBgColor='FF5904' markerRadius='6' legendPosition='bottom' useHoverColor='0' hoverColor='FFCC66' showMarkerToolTip='1'  markerFontColor='FF5904' connectorColor='FF0000' showLabels='0' BorderColor='0372AB' showToolTip='1' waterBodyColor='00CCFF' waterBodyAlpha='50' >
	<data>
	
		<entity id= '<?php 
echo $just_nu_kommun->getKod();
?>
' color='#DBB444'/>
		<entity id= '<?php 
echo $last_stracka["Kommun"]->getKod();
?>
' color='#EDDCA9'/>
Exemplo n.º 12
0
 public function getBeskrivningNinja()
 {
     global $urlHandler;
     if ($this->getRelationTagId()) {
         $kommun = Kommun::loadById($this->getRelationTagId());
         $tagg = "<br /><strong>Taggar: </strong><a href='" . $urlHandler->getUrl('Kommun', URL_VIEW, $kommun->getNamn()) . "' title='" . $kommun->getNamn() . "'>" . $kommun->getNamn() . "</a>";
     }
     return strip_tags(stripslashes($this->beskrivning)) . $tagg;
 }
Exemplo n.º 13
0
 public function getCurrentKommun($setKommun = false)
 {
     /*//defaultvärde
     		if (!isset($this->currentIndex)) {
     		global $USER;
     		return $USER->getKommun();
     		}*/
     if (isset($this->currentIndex)) {
         $kommun = $this->rutt[$this->currentIndex]["Kommun"];
     }
     if (!isset($kommun)) {
         if ($setKommun == true) {
             new Stracka(Kommun::loadById($this->getMedlem()->getJustNuKommunId()), $this->getMedlem());
             $kommun = $this->getMedlem()->getKommun();
         } else {
             new Stracka($this->getMedlem()->getKommun(), $this->getMedlem());
             $kommun = $this->getMedlem()->getKommun();
         }
     }
     return $kommun;
 }
Exemplo n.º 14
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(USER);
$rutt = new Rutt($USER);
$rutten = $rutt->getRutt();
$sista = $rutt->getCurrentIndex();
$just_nu_id = $USER->getJustNuKommunId();
$just_nu_kommun = Kommun::loadById($just_nu_id);
$exclude[] = $just_nu_kommun->getKod();
$avstand = $just_nu_kommun->listAvstand();
$grannkommuner = array();
foreach ($avstand as $tmp) {
    $exclude[] = $tmp["id"];
    $grannkommuner[] = Kommun::loadById($tmp["id"]);
}
?>
<map animation='1' showShadow='1' mapLeftMargin='0' mapRightMargin='0' mapBottomMargin='0'  maptopMargin='0' showBevel='0' showCanvasBorder='0'  showMarkerLabels='1' fillColor='F1f1f1' borderColor='CCCCCC' baseFont='Arial Narrow' baseFontSize='16' markerBorderColor='000000' markerBgColor='FF5904' markerRadius='6' legendPosition='bottom' useHoverColor='1' hoverColor='000000' showMarkerToolTip='1'  markerFontColor='FF5904' connectorColor='FF0000' showLabels='0' BorderColor='0372AB' showToolTip='1' waterBodyColor='00CCFF' waterBodyAlpha='50' >
	<data>
	
		<entity id= '<?php 
echo $just_nu_kommun->getKod();
?>
' color='#FF0000'/>

		<?php 
while (list($key, $kommun) = each($grannkommuner)) {
    $exclude[] = $kommun->getKod();
    ?>
<entity id= '<?php 
    echo $kommun->getKod();