public function showPage(Request $request)
 {
     // fetch sql data
     // fetch view
     // apply data to view
     // show view
     $page = MainPage::create();
     $page->getLayoutElem("topbar")->applyData(array("name" => "Hans"));
     $page->showPage($page->layoutElementMap);
 }
예제 #2
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $this->idpuskesmas = $this->Pengguna->getDataUser('idpuskesmas');
     $this->nama_puskesmas = $this->Pengguna->getDataUser('nama_puskesmas');
     if (!$this->IsPostBack && !$this->IsCallBack) {
     }
 }
예제 #3
0
        $styles[] = WorkoutDesign::getStyles();
        $scripts[] = WorkoutDesign::getScripts();
        break;
    case 'register':
        Register::process();
        $styles[] = WorkoutDesign::getStyles();
        $content .= Register::renderContent();
        break;
    case 'assign':
        WorkoutAssign::process();
        $content .= WorkoutAssign::renderContent();
        break;
    case 'list':
        WorkoutListing::process();
        $content .= WorkoutListing::renderContent();
        break;
    case 'workout':
        Workingout::process();
        $content .= Workingout::renderContent();
        break;
    default:
        MainPage::process();
        $content .= MainPage::renderContent();
        break;
}
ob_end_clean();
ob_start();
include '_doc/page_start.tpl.php';
$header = ob_get_contents();
ob_end_clean();
Page::renderPage($styles, $scripts, $header, $content, $footer);
    public function showPage(Request $request)
    {
        // creating MainPage and modifing header information
        $page = MainPage::create();
        $page->getLayoutElem("header")->addHeaderElem('<link rel="stylesheet" type="text/css" href="' . Registry::$settings['config']['CSS_PATH'] . 'products_view_layout.css">');
        $page->getLayoutElem("header")->addHeaderElem('
        <script type="text/javascript">
                 var edi_feld_focused = false;
                 var basket = new Basket();
                 document.onkeydown = function(e){
                     var evt = e ? e:event;
                     var keyCode = evt.keyCode;
                     if(keyCode == 13 && edi_feld_focused){
                         search();
                     }
                 };
                function search(){
                    //alert(document.getElementById("search_string").value);
                     var url ="products?search="+document.getElementById("search_string").value;
                     window.location.href = url;
                }
                function addToBasket(productid){
                 var oldCookie = document.cookie;
                 document.cookie = oldCookie+""

                }
                function Basket(){
                    this.items = {};

                }
                Basket.prototype.addItem = function(itemID){
                    if(this.items[itemID] == undefined){
                        this.items[itemID] = 1;

                    }else{
                       var tmp = this.items[itemID];
                       this.items[itemID] = tmp+1;

                    }
                };
                Basket.prototype.removeItem = function(itemID){
                    if(!this.items[itemID] == undefined){
                       var tmp = this.items[itemID];
                       this.items[itemID] = tmp-1;

                    }
                };
         </script>');
        // deciding which content to build
        // this $request->get doesnt mean get, its the PHP $_GET which is wraped in Request class
        ErrorReporter::logVarExport(__CLASS__ . "::showPage(request) => request get export", $request->get);
        ErrorReporter::logVarExport(__CLASS__ . "::showPage(request) => request post export", $request->post);
        $search_string = $request->get["search"];
        $basketItem = $request->get["itemID"];
        if (!empty($basketItem)) {
            if (empty($_SESSION["basket"])) {
                $_SESSION["basket"] = array();
            }
            $itemID = mysql_real_escape_string($basketItem);
            $count = $_SESSION["basket"][$itemID];
            if (!empty($count)) {
                $_SESSION["basket"][$itemID] = $count + 1;
            } else {
                $_SESSION["basket"][$itemID] = 1;
            }
        }
        if (!empty($search_string)) {
            // fetch sql data
            //            var_dump(mysql_real_escape_string($search_string));
            $resultSet = TeileMapperImpl::make()->getListOfTeileByBezeichnung(mysql_real_escape_string($search_string));
            if (count($resultSet) == 1) {
                MonitorEntry::updateEntry($resultSet[0]->getBezeichnung);
            }
            $prev_search = "search=" . $search_string . "&";
        } else {
            // fetch sql data
            //            $resultSet = TeileMapperImpl::make()->getAlleProdukte();
            $resultSet = TeileMapperImpl::make()->getProdukte();
        }
        // fetch view and apply data to view
        $page->setContentView(Products_View::create());
        $page->getLayoutElem("contentview")->applyData(array("products" => $resultSet, "prev_search" => $prev_search));
        // show view
        $page->showPage($page->layoutElementMap);
    }
예제 #5
0
파일: Index.php 프로젝트: nemtos/PhotoShow
 function __construct()
 {
     /// Initialize variables
     Settings::init();
     /// Initialize CurrentUser
     try {
         CurrentUser::init();
     } catch (Exception $e) {
         $page = new RegisterPage(true);
         $page->toHTML();
         return;
     }
     /// Check what to do
     switch (CurrentUser::$action) {
         case "Judge":
             // Same as page
         // Same as page
         case "Page":
             $page = new MainPage();
             $page->toHTML();
             break;
         case "Log":
             $page = new LoginPage();
             $page->toHTML();
             break;
         case "Reg":
             $page = new RegisterPage();
             $page->toHTML();
             break;
         case "JS":
             $page = new JS();
             break;
         case "Img":
             Provider::Image(CurrentUser::$path);
             break;
         case "BDl":
             Provider::Image(CurrentUser::$path, false, true, true, true);
             break;
         case "Big":
             Provider::Image(CurrentUser::$path, false, true);
             break;
         case "Thb":
             Provider::Image(CurrentUser::$path, true);
             break;
         case "Zip":
             Provider::Zip(CurrentUser::$path);
             break;
         case "Acc":
             if (CurrentUser::$admin && isset($_POST['login'])) {
                 $acc = new Account($_POST['login']);
             } else {
                 $acc = CurrentUser::$account;
             }
             $acc->toHTML();
             break;
         case "Adm":
             $page = new Admin();
             $page->toHTML();
             break;
     }
 }
예제 #6
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack && !$this->IsCallBack) {
     }
 }
    public function showPage(Request $request)
    {
        // creating MainPage and modifing header information
        $page = MainPage::create();
        $page->getLayoutElem("header")->addHeaderElem('<link rel="stylesheet" type="text/css" href="' . Registry::$settings['config']['CSS_PATH'] . 'adminpanel_view_layout.css">');
        $page->getLayoutElem("header")->addHeaderElem('
        <script type="text/javascript">
               var old_color = "white";
               function highlight_row($divElem){
                    if(old_color == "white") old_color = $divElem.style.backgroundColor;
                    $divElem.style.backgroundColor = "#FFF2D5";
               }

               function unhighlight_row($divElem){
                    $divElem.style.backgroundColor = old_color;
               }

               function stueckListeVonAnfordern(){
                    var produkt = document.getElementById("stueckliste_produkt").value;
                    window.location.href = "adminpanel?stuecklisteVon="+produkt;
               }

               function teil_hinzufuegen(){
                        var bezeichnung,preis,kategorie,wirdAngeboten,bild,beschreibung;
                        bezeichnung = document.getElementById("teil_bezeichnung").value;
                        preis = document.getElementById("teil_preis").value;
                        kategorie = document.getElementById("teil_typ").value;
                        wirdAngeboten = document.getElementById("teil_angeboten").value;
                        bild = document.getElementById("teil_bild").value;
                        beschreibung = document.getElementById("teil_beschreibung").value;
                        window.location.href = "adminpanel?teil_bezeichnung="+bezeichnung+
                                               "&teil_preis="+preis+
                                               "&teil_typ="+kategorie+
                                               "&teil_angeboten="+wirdAngeboten+
                                               "&teil_bild="+bild+
                                               "&teil_beschreibung="+beschreibung;
               }

               /*
               *          <input type="text" id="struktur_otnr" value="OTNR">
                        <input type="text" id="struktur_utnr" value="UTNR">
                        <input type="text" id="struktur_menge" value="Menge">
                        <button onclick="javascript:struktur_hinzufuegen()">Eintragen</button>*/
               function struktur_hinzufuegen(){
                     var otnr,utnr,menge;
                        otnr = document.getElementById("struktur_otnr").value;
                        utnr = document.getElementById("struktur_utnr").value;
                        menge = document.getElementById("struktur_menge").value;

                         window.location.href = "adminpanel?struktur_otnr="+otnr+
                                               "&struktur_utnr="+utnr+
                                               "&struktur_menge="+menge;

               }

               function berechnen(){

                    var glaettungsfaktor = parseFloat(document.getElementById("glaettungsfaktor").value);
                    var monat = document.getElementById("monat").value;
                    var jahr = document.getElementById("jahr").value;
                    var teilName = document.getElementById("teilname").value;

                     window.location.href = "adminpanel?monat="+monat+
                                             "&jahr="+jahr+
                                             "&teilname="+teilName+
                                             "&faktor="+glaettungsfaktor;

               }

               function kunde_hinzufuegen(){
//                                       <input type="text" id="kunde_Name" value="Name">
//                        <input type="text" id="kunde_Vorname" value="Vorname">
//                        <input type="text" id="kunde_eMail" value="eMail">
                    var name,vorname,email;
                    name = document.getElementById("kunde_Name").value;
                    vorname = document.getElementById("kunde_Vorname").value;
                    email = document.getElementById("kunde_eMail").value;

                    window.location.href = "adminpanel?kunde_Name="+name+
                                               "&kunde_Vorname="+vorname+
                                               "&kunde_eMail="+email;

               }

       </script>');
        // deciding which content to build
        // this $request->get doesnt mean get, its the PHP $_GET which is wraped in Request class
        ErrorReporter::logVarExport(__CLASS__ . "::showPage(request) => request get export", $request->get);
        ErrorReporter::logVarExport(__CLASS__ . "::showPage(request) => request post export", $request->post);
        $stuecklisteProdukt = $request->get["stuecklisteVon"];
        $teil_bezeichnung = $request->get["teil_bezeichnung"];
        $teil_preis = $request->get["teil_preis"];
        $teil_typ = $request->get["teil_typ"];
        $teil_angeboten = $request->get["teil_angeboten"];
        $teil_bild = $request->get["teil_bild"];
        $teil_beschreibung = $request->get["teil_beschreibung"];
        $struktur_otnr = $request->get["struktur_otnr"];
        $struktur_utnr = $request->get["struktur_utnr"];
        $struktur_menge = $request->get["struktur_menge"];
        $kunde_name = $request->get["kunde_Name"];
        $kunde_vorname = $request->get["kunde_Vorname"];
        $kunde_email = $request->get["kunde_eMail"];
        if (isset($teil_bezeichnung) && isset($teil_preis) && isset($teil_typ) && isset($teil_angeboten) && isset($teil_beschreibung)) {
            TeileMapperImpl::make()->teilErstellen($teil_bezeichnung, $teil_preis, $teil_typ, $teil_angeboten, "application/view/images/" . $teil_bild, $teil_beschreibung);
        }
        if (isset($struktur_otnr) && isset($struktur_utnr) && isset($struktur_menge)) {
            StrukturMapperImpl::make()->strukturAnlegen($struktur_otnr, $struktur_utnr, $struktur_menge);
        }
        if (isset($kunde_name) && isset($kunde_vorname) && isset($kunde_email)) {
            KundeMapperImpl::make()->kundeHinzufuegen($kunde_name, $kunde_vorname, $kunde_email);
        }
        //testdaten initialisieren
        if (isset($stuecklisteProdukt)) {
            StrukturMapperImpl::make()->getAlleStrukturen();
            //listeVonTeilen und ListeVonStrukturen wird in getAlleStrukuren erzeugt
            Stueckliste::bestimmeOberUndUnterteile(Stueckliste::$listeVonTeilen, Stueckliste::$listeVonStrukturen);
            //          Stueckliste::stueckliste_test();
            $stuecklisteProdukt = Stueckliste::getProdukt($stuecklisteProdukt);
            //AuftragsVerfolgung::teilHinzufuegen($stuecklisteProdukt,200,AuftragsVerfolgung::getTimestamp(5,12,2012));
        }
        //        $abc_analyse_result = ABC_Analyse::abc_analyse_test();
        $abc_analyse_result = ABC_Analyse::analyse(ABC_Analyse::convertToABC_ADT(TeileMapperImpl::make()->getAlleTeile()));
        //var_dump(BestellungMapperImpl::make()->getBestellungenByKundenID(1));
        $bedarfs_daten = AuftragsVerfolgung::getAlleBedarfe();
        $bedarfsableitungs_daten = AuftragsVerfolgung::getAlleBedarfsAbleitungen();
        $faktor = $request->get["faktor"];
        $monat = $request->get["monat"];
        $jahr = $request->get["jahr"];
        $teilname = $request->get["teilname"];
        if (isset($teilname) and isset($jahr) and isset($monat) and isset($faktor)) {
            $bedarfsanalyse_ergebnis = PrimaerbedarfsAnalyse::calcZukuenftigenBedarf($teilname, $monat, $jahr, $faktor);
        } else {
            $bedarfsanalyse_ergebnis = " ";
            $teilname = "Aircar";
            $monat = "12";
            $jahr = "2012";
            $faktor = "0.20";
        }
        //        PrimaerbedarfsAnalyse::primaerbedarfstest();
        // fetch view and apply data to view
        $page->setContentView(AdminPanel_View::create());
        $page->getLayoutElem("contentview")->applyData(array("stueckliste_produkt" => $stuecklisteProdukt, "abc_analyse_array" => $abc_analyse_result, "bedarfs_daten" => $bedarfs_daten, "bedarfsableitungs_daten" => $bedarfsableitungs_daten, "bedarfsanalyse_ergebnis" => $bedarfsanalyse_ergebnis, "bedarfsanalyse_teilname" => $teilname, "bedarfsanalyse_monat" => $monat, "bedarfsanalyse_jahr" => $jahr, "bedarfsanalyse_faktor" => $faktor));
        // show view
        $page->showPage($page->layoutElementMap);
    }
    public function showPage(Request $request)
    {
        // creating MainPage and modifing header information
        $page = MainPage::create();
        $page->getLayoutElem("header")->addHeaderElem('<link rel="stylesheet" type="text/css" href="' . Registry::$settings['config']['CSS_PATH'] . 'basketoverview_view_layout.css">');
        $page->getLayoutElem("header")->addHeaderElem('<script type="text/javascript">
            function removeItems(itemID,oldCount){
                var count_field = document.getElementById("product_"+itemID+"_count");
                var currentCount = count_field.value;
                if(currentCount >= 0 && currentCount < oldCount){
                    if(confirm("Sie sind dabei "+(oldCount-currentCount)+" Artikel von diesem Artikel entfernen")){
                          window.location.href = "basketoverview?itemID="+itemID+"&count="+currentCount;
                    }else{

                    }
                }else{
                    if(currentCount == oldCount){
                        alert("Zum entfernen die neue Menge die Sie behalten wollen eintragen.")
                    }
                    count_field.value=oldCount;
                }
            }

            function bestellen(){
                var day = document.getElementById("day").value;
                var month = document.getElementById("month").value;
                var year = document.getElementById("year").value;
                var gesamtpreis = document.getElementById("gesamtpreis").innerHTML;
                if(confirm("Sie sind dabei ihre Bestellung im Wert von "+gesamtpreis+" abzuschicken, bestätigen Sie dies bitte!")){
                   window.location.href = "basketoverview?bestellen=1&day="+day+"&month="+month+"&year="+year;
                }
            }

        </script>');
        // deciding which content to build
        // this $request->get doesnt mean get, its the PHP $_GET which is wraped in Request class
        ErrorReporter::logVarExport(__CLASS__ . "::showPage(request) => request get export", $request->get);
        ErrorReporter::logVarExport(__CLASS__ . "::showPage(request) => request post export", $request->post);
        $basketItem = $request->get["itemID"];
        $count = $request->get["count"];
        if (isset($basketItem) && isset($count)) {
            $basketItem = mysql_real_escape_string($basketItem);
            $count = mysql_real_escape_string($count);
            if ($_SESSION["basket"][$basketItem] > $count) {
                if (!($count <= 0)) {
                    $_SESSION["basket"][$basketItem] = $count;
                } else {
                    $_SESSION["basket"] = array_diff_key($_SESSION["basket"], array($basketItem => $count));
                }
            }
        }
        $products = array();
        if (isset($_SESSION["basket"])) {
            foreach ($_SESSION["basket"] as $productID => $count) {
                array_push($products, TeileMapperImpl::make()->getTeileById($productID));
            }
        }
        $month = $request->get["month"];
        $day = $request->get["day"];
        $year = $request->get["year"];
        if (isset($request->get["bestellen"]) and isset($month) and isset($day) and isset($year)) {
            StrukturMapperImpl::make()->getAlleStrukturen();
            //listeVonTeilen und ListeVonStrukturen wird in getAlleStrukuren erzeugt
            Stueckliste::bestimmeOberUndUnterteile(Stueckliste::$listeVonTeilen, Stueckliste::$listeVonStrukturen);
            //          Stueckliste::stueckliste_test();
            $lieferdatum = AuftragsVerfolgung::getTimestamp($day, $month, $year);
            foreach ($products as $product) {
                $teil = Stueckliste::getProdukt($product->getBezeichnung());
                AuftragsVerfolgung::teilHinzufuegen($teil, $_SESSION["basket"][$teil->id()], $lieferdatum);
            }
            $_SESSION["basket"] = array();
            $products = array();
        }
        // fetch view and apply data to view
        $page->setContentView(BasketOverview_View::create());
        $page->getLayoutElem("contentview")->applyData(array("basket" => $_SESSION['basket'], "products" => $products));
        // show view
        $page->showPage($page->layoutElementMap);
    }
예제 #9
0
<?php

function myEcho($msg)
{
    echo "{$msg}\r\n";
    echo str_pad('', 4096);
}
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . "src" . PATH_SEPARATOR);
require_once 'src/MainPage.php';
$page = new MainPage('myEcho');
$page->render();
function eb($x)
{
    global $debug;
    if (!isset($debug) || !$debug) {
        return;
    }
    echo "<br>" . $x . "<br>";
}
function vdx($xml)
{
    vd(str_replace("<", "&lt;", str_replace(">", "&gt;", $xml)));
}
function vd($x)
{
    global $debug;
    if (!isset($debug) || !$debug) {
        return;
    }
    echo "<pre>";
    var_export($x);
예제 #10
0
<?php

require "md5base.php";
$page = new MainPage();
$hof = $page->getHallOfFame(10);
$recent = $page->getMostRecent(10);
require "head.php";
?>
	<div id="contentdiv">
		<div id="halloffame">
			<h1>Hall of fame</h1>
			<table>
			<tr class="table_heading"><td><b>#</b></td><td><b>Username</b></td><td><b>Hashes</b></td></tr>
			<?php 
for ($i = 0; $i < count($hof); $i++) {
    if ($i % 2 == 0) {
        $class = ' class="altrow"';
    } else {
        $class = "";
    }
    echo '<tr><td' . $class . '>' . ($i + 1) . '.</td><td' . $class . '>' . $hof[$i]->getName() . '</td><td' . $class . '>' . $hof[$i]->getNHashes() . '</td></tr>' . "\n";
}
?>
			</table>
		</div>
		<div id="recentcontrib">
			<h1>Recently added</h1>
			<table>
			<?php 
$datearray = array();
for ($i = 0; $i < count($recent); $i++) {
예제 #11
0
     return $link;
 }
 /**
  * Ссылка по имени модуля
  *
  * @param int $id ID записи
  */
 function linkByModule($module)
 {
     global $siteDocumentsByModule;
     $link = linkById($siteDocumentsByModule[$module]['id'], true);
     return $link;
 }
 //Главная страница
 if (!isset($regs[1])) {
     $module = new MainPage();
     echo $module->Output();
     return;
 }
 /**
  * Проверка корректности пути и составление карты пути ($GLOBALS['path'])
  *
  * @param int $urinum
  * @param int $parent
  */
 function validateURI($urinum = 0, $parent = 0)
 {
     global $uriPath, $siteDocumentsByParent;
     if ($urinum > count($uriPath) - 1) {
         return 'content';
     }