Beispiel #1
0
 /**
  * @param string $str our original string
  * @param string $len the lenght of the resulting string
  *
  * @return string example: leadingZero("2", 3) => "002"
  */
 function leadingZero($str, $len)
 {
     // Moved to lib.utils.php
     //require_once(_base_.'/lib/lib.utils.php');
     return leadingZero($str, $len);
 }
function formateTime($time)
{
    return leadingZero($time['hours']) . ':' . leadingZero($time['minutes']) . ':' . leadingZero($time['seconds']);
}
Beispiel #3
0
						<script>
							$('#predefined').button({icons: {primary: "ui-icon-link"}});
							$('#predefined').mousemove(function(event) {ShowPopup(event, dic("Routes.PopupDO"))});
							$('#predefined').mouseout(function() {HidePopup()});
						</script-->
					</td>
					<td width=47%>
						<span class="text2" style="font-weight: bold"><?php echo dic("Routes.StartDatetime")?>: </span>
						<input id="txtSDate" type="text" width="80px" onchange="unchange()" class="textboxCalender corner5 text2" value="<?php echo $tmpDT?>" style="width: 105px;position: relative; top: -1px;"/>
						<select class="textboxCalender corner5 text2" id="txt_vreme" onchange="unchange()" style="width:77px; position: relative; margin-top: 2px; padding-top:5px; padding-bottom:3px; margin-left:<?php if($yourbrowser == "1") { echo '-10px'; } else { echo '-10px'; } ?>" onclick="$(this).focus();">
							<?
							for ($i=0; $i < 24; $i++) {
								if ($tmpDT1 == leadingZero($i)) $selectedOpt = "selected";
								else $selectedOpt = "";
							?>
								<option value="<?php echo leadingZero($i) . ":00"?>" <?php echo $selectedOpt?>><?php echo DateTimeFormat((leadingZero($i) . ":00"), $tf)?></option>
							<?php
							}
							?>
							<!--option value="00:00">00:00</option>
							<option value="01:00">01:00</option>
							<option value="02:00">02:00</option>
							<option value="03:00">03:00</option>
							<option value="04:00">04:00</option>
							<option value="05:00">05:00</option>
							<option value="06:00">06:00</option>
							<option value="07:00">07:00</option>
							<option value="08:00">08:00</option>
							<option value="09:00">09:00</option>
							<option value="10:00">10:00</option>
							<option value="11:00">11:00</option>
function debug($ar)
{
    echo "<table class='debug' width='50%'>";
    echo "<tr><th>ID</th><th>MAPPING</th><th>Cost</th><th>Fitness</th></tr>\n";
    foreach ($ar as $element => $value) {
        //echo "<tr><td>" . leadingZero($element) . "</td><td>" . $value['dna'] . "</td><td>" . $value['rate'] . "</td><td>" . sprintf("%01.2f", $value['chances'] * 100) . "%</td></tr>\n";
        echo "<tr><td>" . leadingZero($element) . "</td><td>" . $value['dna'] . "</td><td>" . $value['rate'] . "</td><td>" . sprintf("%01.2f", $value['chances'] * 100) . "%</td></tr>\n";
    }
    echo "</table>\n";
}
Beispiel #5
0
 function savePage($wiki_id, $data, $language, $page_code = FALSE, $page_temp_info = FALSE)
 {
     require_once $GLOBALS["where_framework"] . "/lib/lib.wiki_revision.php";
     //require_once(_base_.'/lib/lib.utils.php');
     $page_id = (int) $data["page_id"];
     $title = $data["title"];
     $content = $data["content"];
     if ($page_id < 1) {
         // Add
         if ($page_temp_info !== FALSE && $page_code !== FALSE) {
             $lev = $page_temp_info["parent_info"]["lev"] + 1;
             $parent_id = $page_temp_info["parent_info"]["page_id"];
             $version = 1;
             $ord = $this->getLastPageOrd($wiki_id, $lev) + 1;
             $page_path = $page_temp_info["parent_info"]["page_path"] . "/" . leadingZero($ord, 8);
             // Creating page
             $field_list = "page_code, parent_id, page_path, lev, wiki_id";
             $field_val = "'" . $page_code . "', '" . (int) $parent_id . "', '" . $page_path . "', '" . (int) $lev . "', ";
             $field_val .= "'" . (int) $wiki_id . "'";
             $qtxt = "INSERT INTO " . $this->getWikiPageTable() . " (" . $field_list . ") VALUES (" . $field_val . ")";
             $res = $this->_executeInsert($qtxt);
             // Adding revision (page text)
             $rev = new WikiRevisionManager(array($wiki_id, $res, $language));
             $revision_data = array("content" => $content);
             $rev->addRevision($revision_data);
             // Adding other page information
             $this->createPageInfo($res, $language, $title, $version, $wiki_id);
         } else {
             $res = FALSE;
         }
     } else {
         // Update
         $rev = new WikiRevisionManager(array($wiki_id, $page_id, $language));
         $revision_data = array("content" => $content);
         $version = $rev->addRevision($revision_data);
         $qtxt = "SELECT * FROM " . $this->getWikiPageInfoTable() . " ";
         $qtxt .= "WHERE page_id='" . $page_id . "' AND language='" . $language . "'";
         $q = $this->_executeQuery($qtxt);
         if ($q && mysql_num_rows($q) > 0) {
             $qtxt = "UPDATE " . $this->getWikiPageInfoTable() . " SET title='" . $title . "', ";
             $qtxt .= "version='" . $version . "', last_update=NOW() ";
             $qtxt .= "WHERE page_id='" . $page_id . "' AND language='" . $language . "'";
             $q = $this->_executeQuery($qtxt);
         } else {
             if ($q && mysql_num_rows($q) == 0) {
                 $this->createPageInfo($page_id, $language, $title, $version, $wiki_id);
             }
         }
         $res = $page_id;
     }
     return $res;
 }
 public function createFZinfo($fzData, $cinputs, $noenergie = false)
 {
     $session = $this->soapsession;
     $templateclient = getSoapClient('template');
     $documentclient = getSoapClient('document');
     $sessionclient = getSoapClient('session');
     $ticketclient = getSoapClient('ticket');
     if ($noenergie == false) {
         $eObj = $fzData[1];
         $co2val = strlen($eObj->co2) < 3 ? '0' . $eObj->co2 : $eObj->co2;
         $eArr = array('Marke' => $eObj->markeBez, 'Typ' => $eObj->typBez, 'Treibstoff' => $eObj->treibstoff, 'Getriebeart' => $eObj->getriebeart, 'Leergewicht' => $eObj->leergewicht, 'Verbrauch' => $eObj->verbrauch, 'CO2' => $eObj->co2, 'Emissionsbild' => 'CO2_' . $co2val . '.eps', 'Kategoriebild' => 'Kategorie' . $eObj->energieeffizienz . '.eps');
         $iSessionArr = array();
         foreach ($eArr as $item => $value) {
             $eArr[$item] = urldecode($value);
             //         Mage::log("$item: " . urldecode($value));
             $res = makeSoapCall($sessionclient, 'session_setValue', array($session, $item, urldecode($value)));
         }
         //     $res = makeSoapCall($sessionclient, 'session_setValueList', array($session, $iSessionArr));
         //     exit;
     }
     $dObj = $fzData[0];
     $dArr = array('Typencode' => $dObj->markeBezeichnung, 'Modell' => $dObj->basisModellInfo->modellBezeichnung, 'Motor' => $dObj->basisModellInfo->motorBezeichnung, 'Getriebe' => $dObj->basisModellInfo->getriebeBezeichnung, 'Bauart' => $dObj->basisModellInfo->motorBauart, 'LeistungKw' => $dObj->basisModellInfo->leistungKw, 'LeistungPs' => $dObj->basisModellInfo->leistungPs, 'Basismodell' => $dObj->basisModellInfo->modellBezeichnung, 'PreisModellBasis' => setQuotes($dObj->basisModellInfo->grundpreis), 'ModellAM' => $dObj->modellInfo->modellLinie, 'MotorAM' => $dObj->modellInfo->motorBezeichnung, 'GetriebeAM' => $dObj->modellInfo->getriebeBezeichnung, 'BauartAM' => $dObj->modellInfo->motorBauart, 'LeistungKwAM' => $dObj->modellInfo->leistungKw, 'LeistungPsAM' => $dObj->modellInfo->leistungPs, 'PreisModellAM' => setQuotes($dObj->modellInfo->grundpreis));
     $i = 1;
     if (isset($dObj->iconInfos->array) && is_array($dObj->iconInfos->array)) {
         foreach ($dObj->iconInfos->array as $item) {
             $dArr['Picto' . $i] = str_replace(' ', '', $item->iconName) . '_' . strtolower($cinputs['lang']) . '.psd';
             $i++;
         }
     }
     $i = 1;
     $nStr = '';
     $preisam = $dObj->modellInfo->grundpreis;
     if (!isset($dObj->highlights->array)) {
         $dObj->highlights->array = array();
     }
     foreach ($dObj->highlights->array as $item) {
         $nStr = leadingZero($i);
         $fussnote = $item->fussnote ? '|' . $item->fussnote : '';
         $dArr['Ausstattung' . $nStr] = $item->text . $fussnote;
         $i++;
     }
     while ($i < 21) {
         $nStr = leadingZero($i);
         $dArr['Ausstattung' . $nStr] = 'KEINE';
         $i++;
     }
     $i = 1;
     if (!isset($dObj->options->array)) {
         $dObj->options->array = array();
     }
     if (!is_array($dObj->options->array)) {
         $dObj->options->array = array($dObj->options->array);
     }
     foreach ($dObj->options->array as $item) {
         $nStr = leadingZero($i);
         $fussnote = $item->fussnote ? '|' . $item->fussnote : '';
         $dArr['Option' . $nStr] = $item->bezeichnung . $fussnote;
         $dArr['PreisOp' . $nStr] = setQuotes($item->preis);
         $preisam = $preisam + $item->preis;
         $i++;
     }
     for ($a = 1; $a < 5; $a++) {
         $nStr = leadingZero($i);
         if ($cinputs['opt' . $a] == '') {
             continue;
         }
         $dArr['Option' . $nStr] = $cinputs['opt' . $a];
         if ($cinputs['val' . $a] != '') {
             $dArr['PreisOp' . $nStr] = setQuotes((int) $cinputs['val' . $a]);
             try {
                 $preisam = $preisam + (int) $cinputs['val' . $a];
             } catch (Exception $e) {
             }
         }
         $i++;
     }
     //     while ($i < 21) {
     //         $nStr = leadingZero($i);
     //         $dArr['Option' . $nStr] = 'KEINE';
     //         $i++;
     //     }
     /**
      *    missing in Obj: PreisLieferung, PreisLeasing
      *    $dArr['PreisLieferung'] = ???;
      *    $dArr['PreisLeasing'] = ???;
      */
     if (isset($cinputs['auslieferung']) && $cinputs['auslieferung'] !== '') {
         $dArr['Ablieferungspauschale'] = $cinputs['Ablieferungspauschale'];
         $dArr['PreisLieferung'] = 'CHF ' . setQuotes($cinputs['auslieferung']);
         try {
             $preisam = $preisam + (int) $cinputs['auslieferung'];
         } catch (Exception $e) {
         }
     }
     $dArr['PreisTotal'] = setQuotes($preisam);
     $dArr['Währung'] = 'CHF';
     if (isset($cinputs['leasing_monatlich']) && $cinputs['leasing_monatlich'] !== '') {
         $dArr['St'] = '*';
         $dArr['PreisLeasing'] = 'CHF ' . setQuotes($cinputs['leasing_monatlich']);
         $dArr['MonateLeasing'] = $cinputs['leasing_dauer'];
         $dArr['KmMaxLeasing'] = $cinputs['leasing_kilometer'];
         $dArr['RestwertLeasing'] = setQuotes($cinputs['leasing_restwert']);
         $dArr['SonderLeasing'] = setQuotes($cinputs['leasing_anzahlung']);
         $dArr['ZsLeasing'] = $cinputs['leasing_zinssatz'];
         $dArr['ZinsEffLeasing'] = $cinputs['leasing_jahreszins'];
         $dArr['Leasing'] = $cinputs['Leasing'];
         $dArr['Leasingtext'] = $cinputs['Leasingtext'];
         //         $dArr['Leasing'] = 'Leasing ' . $cinputs['leasing_dauer'] . ' Monate, ' . $cinputs['leasing_zinssatz'] . '%, bereits ab ';
         //         $dArr['Leasingtext'] = 'Leasingzins CHF ' . setQuotes(number_format($cinputs['leasing_monatlich'], 2, '.', '')) . ' mtl., inkl. MwSt. bei '
         //                               . $cinputs['leasing_dauer'] . ' Monaten Laufzeit und ' . $cinputs['leasing_kilometer']
         //                               . 'km/Jahr. Sonderzahlung CHF ' . setQuotes(number_format($cinputs['leasing_anzahlung'], 2, '.', ''))
         //                               . ', Restwert CHF ' . setQuotes(number_format($cinputs['leasing_restwert'], 2, '.', ''))
         //                               . ', Kaution vom Finanzierungsbetrag 5% (mindestens CHF 1000.-), effektiver Jahreszins '
         //                               . $cinputs['leasing_jahreszins'] . '%, Vollkaskoversicherung obligatorisch. Weitere Berechnungsvarianten auf Anfrage. '
         //                               . 'Eine Leasingvergabe wird nicht gewährt, falls Sie zur Überschuldung des Konsumenten führt.';
     }
     //     var_dump($dArr);
     //     exit;
     foreach ($dArr as $item => $value) {
         //         Mage::log("$item: " . serialize($value));
         //         $dArr[$item] = urldecode($value);
         $res = makeSoapCall($sessionclient, 'session_setValue', array($session, $item, urldecode($value)));
     }
     //     $res = makeSoapCall($sessionclient, 'session_setValueList', array($session, $dArr));
     $lang = 'de_DE';
     switch ($cinputs['lang']) {
         case 'DE':
             $lang = 'de_DE';
             break;
         case 'FR':
             $lang = 'fr_FR';
             break;
         case 'IT':
             $lang = 'it_IT';
     }
     $templatelist = makeSoapCall($templateclient, 'template_getTemplateList', array('categories' => '', 'sessionid' => $session));
     if (is_object($templatelist) && is_array($templatelist->item)) {
         $templatename = $noenergie ? 'Preisblatt_Toyota_' : 'Preisblatt_energieEtikette_Toyota_';
         foreach ($templatelist->item as $template) {
             if ($template->title == $templatename . $cinputs['lang']) {
                 $templateid = $template->id;
             }
         }
     }
     if (!isset($templateid)) {
         Mage::log('no templateid found for name: ' . $templatename . $cinputs['lang']);
         return false;
     }
     $ticket = makeSoapCall($documentclient, 'document_create', array('templateid' => $templateid, 'title' => '', 'description' => '', 'sessionid' => $session, 'language' => $lang));
     /** ticket getStatus */
     $status = $this->_checkTicket($ticket, $session);
     if ($status == 'READY') {
         /** ticket getResult */
         $ticketresult = makeSoapCall($ticketclient, 'ticket_getResult', array('ticketlist' => array($ticket->id), 'sessionid' => $session));
         //Zend_Debug::dump($ticketresult, 'ticketresult');
     } else {
         // Mage::log($status . 'ticketresult');
         return false;
     }
     $documentid = $ticketresult->item->result;
     $ticket = makeSoapCall($documentclient, 'document_createPDF', array('documentid' => $documentid, 'quality' => 'Preview', 'sessionid' => $session));
     // check status of ticket
     $status = $this->_checkTicket($ticket, $session);
     //
     if ($status == 'READY') {
         // ticket getResult
         $ticketresult = makeSoapCall($ticketclient, 'ticket_getResult', array('ticketlist' => array($ticket->id), 'sessionid' => $session));
     } else {
         return false;
     }
     //     $res = makeSoapCall($sessionclient, 'session_unsetValueList', array($session, array_merge($eArr, $dArr)));
     if (!$noenergie) {
         foreach ($eArr as $item => $value) {
             $res = makeSoapCall($sessionclient, 'session_unsetValue', array($session, $item));
         }
     }
     foreach ($dArr as $item => $value) {
         $res = makeSoapCall($sessionclient, 'session_unsetValue', array($session, $item));
     }
     return $ticketresult;
 }
Beispiel #7
0
$CurrentMonth = date('m');
$CurrentYear = date('Y');
$LastMonth = $CurrentMonth - 1;
$YearOfPrevMonth = $CurrentYear;
if ($LastMonth == 0) {
    $LastMonth = 12;
    $YearOfPrevMonth = $CurrentYear - 1;
}
$LastDateOfMonth = cal_days_in_month(CAL_GREGORIAN, $LastMonth, $YearOfPrevMonth);
//Kolku dena ima prethodniot mesec
$Today = DateTimeFormat(now(), 'd-m-Y');
$LastDay = DatetimeFormat(addDay(-1), 'd-m-Y');
$LastWeek = DatetimeFormat(addDay(-7), 'd-m-Y');
$LastWeek1 = DatetimeFormat(addDay("-" . ($TodayDayOfWeek + 6)), 'd-m-Y');
$startLastMonth = "01-" . leadingZero($LastMonth) . "-" . $CurrentYear;
$endLastMonth = $LastDateOfMonth . "-" . leadingZero($LastMonth) . "-" . $CurrentYear;
$currentWeek = DatetimeFormat(addDay("-" . ($TodayDayOfWeek + 6) + 7), 'd-m-Y');
$startCurrYear = "01-01-" . $CurrentYear;
$Last10 = DatetimeFormat(addDay(-10), 'd-m-Y');
?>
<html>
	<script type="text/javascript">
		lang = '<?php 
echo $cLang;
?>
';
	</script>
	<head>
	<link rel="stylesheet" type="text/css" href="../style.css">
	<link rel="stylesheet" type="text/css" href="./gui.css">
	<link rel="stylesheet" type="text/css" href="./timeframe.css">
Beispiel #8
0
    /**
     * return all fields from SeminarCycleDate and old style
     * metadata_dates, combined with info about rooms
     *
     * @return array
     */
    function toArray()
    {
        $ret = $this->cycle_date->toArray();
        foreach($this->alias as $a => $o) {
            $ret[$a] = $this->cycle_date->$o;
        }
        $ret['assigned_rooms'] = $this->getPredominantRoom();
        $ret['freetext_rooms'] = $this->getFreetextPredominantRoom();
        $ret['tostring']       = $this->toString();
        $ret['tostring_short'] = $this->toString(true);

        $ret['start_minute'] = leadingZero($ret['start_minute']);
        $ret['end_minute'] = leadingZero($ret['end_minute']);
        return $ret;
    }
Beispiel #9
0
 /**
  * Returns the ID of the cycle of a course specified by start and end.
  *
  * @param  Seminar $seminar  an instance of a Seminar
  * @param  string  $start  the start of the cycle
  * @param  string  $end  the end of the cycle
  * @return string  $day  numeric day
  */
 static function getSeminarCycleId(Seminar $seminar, $start, $end, $day)
 {
     $ret = array();
     $day = ($day + 1) % 7;
     foreach ($seminar->getCycles() as $cycle) {
         if (leadingZero($cycle->getStartStunde()) . leadingZero($cycle->getStartMinute()) == $start && leadingZero($cycle->getEndStunde()) . leadingZero($cycle->getEndMinute()) == $end && $cycle->getDay() == $day) {
             $ret[] = $cycle;
         }
     }
     return $ret;
 }