public function consultarReserva()
 {
     $proteccion = new Proteccion();
     $cod_reserva = $proteccion->html($_POST['cod_reserva']);
     $reserva = new Reserva();
     $result = $reserva->BuscarReserva($cod_reserva);
     foreach ($result['result'] as $r) {
         $cod_reserva = $r['cod_reserva'];
     }
     $nom_hotel = $r['nom_hotel'];
     $nombre = $r['nombre'];
     $apellido = $r['apellido'];
     $email = $r['email'];
     $fec_llegada = $r['fec_llegada'];
     $fec_salida = $r['fec_salida'];
     $fec_reserva = $r['fec_reserva'];
     $piso = $r['piso'];
     $ubicacion = $r['ubicacion'];
     $tp = new TemplatePower("templates/reserva.html");
     $tp->prepare();
     $tp->gotoBlock("_ROOT");
     $tp->newBlock("generarreserva");
     $tp->assign("cod_reserva", $cod_reserva);
     $tp->assign("nom_hotel", $nom_hotel);
     $tp->assign("nombre", $nombre);
     $tp->assign("apellido", $apellido);
     $tp->assign("email", $email);
     $tp->assign("fec_llegada", $fec_llegada);
     $tp->assign("fec_salida", $fec_salida);
     $tp->assign("fec_reserva", $fec_reserva);
     $tp->assign("piso", $piso);
     $tp->assign("ubicacion", $ubicacion);
     echo $tp->getOutputContent();
 }
 public function registrar()
 {
     $proteccion = new Proteccion();
     $nombre = $proteccion->html($_POST['nombre']);
     $apellido = $proteccion->html($_POST['apellido']);
     $sexo = $proteccion->html($_POST['sexo']);
     $fecha_nacimiento = $proteccion->html($_POST['fecha_nacimiento']);
     $direccion = $proteccion->html($_POST['direccion']);
     $email = $proteccion->html($_POST['email']);
     $dni = $proteccion->html($_POST['dni']);
     $pass = $proteccion->html($_POST['password']);
     $persona = new Usuario($email, $pass);
     $existe = $persona->existe();
     if ($existe) {
         $tp = new TemplatePower("templates/registro.html");
         $tp->prepare();
         $tp->gotoBlock("_ROOT");
         $tp->newblock("no_registro");
         $tp->assign("usuario", $email);
         $webapp = $tp->getOutputContent();
     } else {
         $persona->setDatosUsuario($nombre, $apellido, $sexo, $fecha_nacimiento, $direccion, $dni);
         $persona->insertar();
         $_SESSION['user'] = $email;
         $tp = new TemplatePower("templates/index.html");
         $tp->prepare();
         $tp->gotoBlock("_ROOT");
         $tp->newBlock("sesion");
         $tp->assign("usuario", $_SESSION['user']);
         $webapp = $tp->getOutputContent();
     }
     echo $webapp;
 }
Exemplo n.º 3
0
function makePlanetTooltip($options, $actions, $actionName = 'missiontype')
{
    global $lang;
    if (!$options or !is_array($options)) {
        return false;
    }
    $tp = new TemplatePower(PATH . TEMPLATE_DIR . TEMPLATE_NAME . "/planet_actions.tpl");
    $tp->prepare();
    switch ($options[type]) {
        case "planet":
            $tp->newBlock("planet");
            break;
        case "moon":
            $tp->newBlock("moon");
            break;
        case "debris":
            $tp->newBlock("debris");
            break;
        case "ally":
            $tp->newBlock("ally");
            break;
        default:
            return false;
            break;
    }
    $actionName = $lang[$actionName];
    foreach ($options as $k => $v) {
        $tp->assign($k, $v);
    }
    if ($actions and is_array($actions)) {
        foreach ($actions[id] as $k => $actionId) {
            //echo $actionId . "<-- <br>";
            $tp->newBlock($options[type] . "_actions");
            $tp->assign("action_name", $actionName[$actionId]);
            $tp->assign("action_link", $actions[alink][$k]);
        }
    }
    $tool = $tp->getOutputContent();
    $find = array('"', "'", "\n", "\r");
    $rep = array('\\"', "\\'", "", "");
    $tool = str_replace($find, $rep, $tool);
    return $tool;
}
Exemplo n.º 4
0
function savePluginFile($tplName, $fileName, $fields)
{
    $pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
    $template = new TemplatePower($pluginTpl);
    $template->prepare();
    if (is_array($fields)) {
        foreach ($fields as $block => $data) {
            $template->gotoBlock("_ROOT");
            if (is_array($data)) {
                foreach ($data as $rowId => $row) {
                    $template->newBlock($block);
                    foreach ($row as $key => $val) {
                        $template->assign($key, $val);
                    }
                }
            } else {
                $template->assign($block, $data);
            }
        }
    }
    $content = $template->getOutputContent();
    $iSize = file_put_contents($fileName, $content);
    return $iSize;
}
Exemplo n.º 5
0
 private function _extjs()
 {
     G::LoadClass('serverConfiguration');
     $oServerConf =& serverConf::getSingleton();
     $oHeadPublisher =& headPublisher::getSingleton();
     if ($oHeadPublisher->extJsInit === true) {
         $header = $oHeadPublisher->getExtJsVariablesScript();
         $styles = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
         $body = $oHeadPublisher->getExtJsScripts();
         //default
         $templateFile = G::ExpandPath("skinEngine") . 'base' . PATH_SEP . 'extJsInitLoad.html';
         //Custom skins
         if (defined('PATH_CUSTOM_SKINS') && is_dir(PATH_CUSTOM_SKINS . $this->mainSkin)) {
             $templateFile = PATH_CUSTOM_SKINS . $this->mainSkin . PATH_SEP . 'extJsInitLoad.html';
         }
         //Skin uxs - simplified
         if (!isset($_SESSION['user_experience'])) {
             $_SESSION['user_experience'] = 'NORMAL';
         }
         if ($_SESSION['user_experience'] != 'NORMAL') {
             $templateFile = is_dir(PATH_CUSTOM_SKINS . 'uxs') ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile;
         }
     } else {
         $styles = "";
         $header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
         $header .= $oHeadPublisher->includeExtJs();
         $body = $oHeadPublisher->renderExtJs();
         $templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileExtjs['basename'];
     }
     $template = new TemplatePower($templateFile);
     $template->prepare();
     $template->assign('header', $header);
     $template->assign('styles', $styles);
     $template->assign('bodyTemplate', $body);
     $doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
     $meta = null;
     $dirBody = null;
     if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/^.*\\(.*MSIE (\\d+)\\..+\\).*\$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) {
         $ie = intval($arrayMatch[1]);
         $swTrident = preg_match("/^.*Trident.*\$/", $_SERVER["HTTP_USER_AGENT"]) ? 1 : 0;
         //Trident only in IE8+
         $sw = 1;
         if (($ie == 7 && $swTrident == 1 || $ie == 8) && !preg_match("/^ux.+\$/", SYS_SKIN)) {
             //IE8
             $sw = 0;
         }
         if ($sw == 1) {
             if ($ie == 10) {
                 $ie = 8;
             }
             $doctype = null;
             $meta = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE={$ie}\" />";
         }
     }
     $serverConf =& serverConf::getSingleton();
     if ($serverConf->isRtl(SYS_LANG)) {
         $dirBody = "dir=\"RTL\"";
     }
     $template->assign("doctype", $doctype);
     $template->assign("meta", $meta);
     $template->assign("dirBody", $dirBody);
     echo $template->getOutputContent();
 }
Exemplo n.º 6
0
session_start();
include "inc.includes.php";
$db = new BaseDatos($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['db']);
$tpl = new TemplatePower("templates/index.html");
$tpl->prepare();
$tpl->gotoBlock("_ROOT");
//isset determina si una variable esta definida o es null
//$_REQUEST tiene el contenido de get y post
if (!isset($_REQUEST["action"]) || $_REQUEST["action"] == "") {
    $tpl->newBlock("contenido");
    $mhotels = new MHotels();
    $result = $mhotels->allhoteles();
    if ($result['found']) {
        foreach ($result['result'] as $r) {
            $tpl->newblock("hotels");
            $tpl->assign("idHotel", $r['id_hotel']);
            $tpl->assign("name", $r['nom_hotel']);
            $tpl->assign("prov", $r['provincia']);
            $tpl->assign("local", $r['localidad']);
            $tpl->assign("calle", $r['calle']);
            $tpl->assign("ncalle", $r['nro_calle']);
            $tpl->assign("tel", $r['telefono']);
            $tpl->assign("precio", $r['precio_persona']);
        }
    } else {
        $tpl->newblock("no_hotels");
    }
    $webapp = $tpl->getOutputContent();
} else {
    if (!strpos($_REQUEST["action"], "::")) {
        $_REQUEST["action"] .= "::main";
Exemplo n.º 7
0
<?php

//llamamos al constructor de la plantilla y la preparamos para ser mostrada
$tplCitaRealizar = new TemplatePower("plantilla/cita_realizar.html");
$tplCitaRealizar->prepare();
$citaId = addslashes($_GET['id']);
$query = "SELECT pacientes.nombre_pac, pacientes.historia, citas.fecha, citas.hora, usuarios.nombre \r\n                FROM pacientes, citas\r\n                LEFT JOIN usuarios\r\n                ON citas.responsable=usuarios.usuario\r\n                WHERE citas.id_cita='{$citaId}'\r\n                AND citas.mascota=pacientes.id_pac";
$rec = mysql_query($query);
$datosCita = mysql_fetch_assoc($rec);
//si no hay datos de la cita indicada lo envio a index
if (!$datosCita) {
    echo "NO EXISTEN CITAS";
    exit;
    header("Location: /gicorec/index.php");
    exit;
}
$tplCitaRealizar->assign("nombre_mascota", $datosCita['nombre_pac']);
$tplCitaRealizar->assign("historia", $datosCita['historia']);
$tplCitaRealizar->assign("fecha", $datosCita['fecha']);
$tplCitaRealizar->assign("hora", $datosCita['hora']);
$tplCitaRealizar->assign("vet_responsable", $datosCita['nombre']);
$tplCitaRealizar->assign("id_cita", $citaId);
//imprimimos por pantalla
$tplIndex->assign("contenido", $tplCitaRealizar->getOutputContent());
Exemplo n.º 8
0
}
$oTemplatePower = new TemplatePower($fileGetStart);
$oTemplatePower->prepare();
/*
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
*/
$userName = '******';
$userPass = "******";
if (isset($_SESSION['NW_PASSWORD'])) {
    if ($_SESSION['NW_PASSWORD'] != '') {
        $userPass = $_SESSION['NW_PASSWORD'];
    }
}
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->add(UsersPeer::USR_UID, '00000000000000000000000000000001', Criteria::IN);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aData = array();
if ($oDataset->next()) {
    $aData = $oDataset->getRow();
    $userName = $aData['USR_USERNAME'];
}
$oTemplatePower->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$oTemplatePower->assign("name", $userName);
$oTemplatePower->assign("pass", $userPass);
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
G::RenderPage('publish', 'raw');
Exemplo n.º 9
0
    /**
     * DEPRECATED createPropelClasses()
     *
     * Don't use this method, it was left only for backward compatibility
     * for some external plugins that still is using it
     */
    public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid, $connection = 'workflow')
    {
        try {
            /* $aUID = array('FLD_NAME'           => 'PM_UNIQUE_ID',
              'FLD_TYPE'           => 'INT',
              'FLD_KEY'            => 'on',
              'FLD_SIZE'           => '11',
              'FLD_NULL'           => '',
              'FLD_AUTO_INCREMENT' => 'on');
              array_unshift($aFields, $aUID); */
            $aTypes = array(
                'VARCHAR' => 'string',
                'TEXT'    => 'string',
                'DATE'    => 'int',
                'INT'     => 'int',
                'FLOAT'   => 'double'
            );
            $aCreoleTypes = array(
                'VARCHAR' => 'VARCHAR',
                'TEXT'    => 'LONGVARCHAR',
                'DATE'    => 'TIMESTAMP',
                'INT'     => 'INTEGER',
                'FLOAT'   => 'DOUBLE'
            );
            if ($sClassName == '') {
                $sClassName = $this->getPHPName($sTableName);
            }

            $sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
            if (!file_exists($sPath)) {
                G::mk_dir($sPath);
            }
            if (!file_exists($sPath . 'map')) {
                G::mk_dir($sPath . 'map');
            }
            if (!file_exists($sPath . 'om')) {
                G::mk_dir($sPath . 'om');
            }
            $aData = array();
            $aData['pathClasses'] = substr(PATH_DB, 0, -1);
            $aData['tableName'] = $sTableName;
            $aData['className'] = $sClassName;
            $aData['connection'] = $connection;
            $aData['GUID'] = $sAddTabUid;

            $aData['firstColumn'] = isset($aFields[0])
                                    ? strtoupper($aFields[0]['FLD_NAME'])
                                    : ($aFields[1]['FLD_NAME']);
            $aData['totalColumns'] = count($aFields);
            $aData['useIdGenerator'] = 'false';
            $oTP1 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'Table.tpl');
            $oTP1->prepare();
            $oTP1->assignGlobal($aData);
            file_put_contents($sPath . $sClassName . '.php', $oTP1->getOutputContent());
            $oTP2 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'TablePeer.tpl');
            $oTP2->prepare();
            $oTP2->assignGlobal($aData);
            file_put_contents($sPath . $sClassName . 'Peer.php', $oTP2->getOutputContent());
            $aColumns = array();
            $aPKs = array();
            $aNotPKs = array();
            $i = 0;
            foreach ($aFields as $iKey => $aField) {
                $aField['FLD_NAME'] = strtoupper($aField['FLD_NAME']);
                if ($aField['FLD_TYPE'] == 'DATE') {
                    $aField['FLD_NULL'] = '';
                }
                $aColumn = array(
                    'name' => $aField['FLD_NAME'],
                    'phpName' => $this->getPHPName($aField['FLD_NAME']),
                    'type' => $aTypes[$aField['FLD_TYPE']],
                    'creoleType' => $aCreoleTypes[$aField['FLD_TYPE']],
                    'notNull' => ($aField['FLD_NULL'] == 'on' ? 'true' : 'false'),
                    'size' => (($aField['FLD_TYPE'] == 'VARCHAR')
                              || ($aField['FLD_TYPE'] == 'INT')
                              || ($aField['FLD_TYPE'] == 'FLOAT') ? $aField['FLD_SIZE'] : 'null'),
                    'var' => strtolower($aField['FLD_NAME']),
                    'attribute' => (($aField['FLD_TYPE'] == 'VARCHAR')
                                   || ($aField['FLD_TYPE'] == 'TEXT')
                                   || ($aField['FLD_TYPE'] == 'DATE')
                                   ? '$' . strtolower($aField['FLD_NAME']) . " = ''"
                                   : '$' . strtolower($aField['FLD_NAME']) . ' = 0'),
                    'index' => $i,
                );
                if ($aField['FLD_TYPE'] == 'DATE') {
                    $aColumn['getFunction'] = '/**
   * Get the [optionally formatted] [' . $aColumn['var'] . '] column value.
   *
   * @param      string $format The date/time format string (either date()-style or strftime()-style).
   *              If format is NULL, then the integer unix timestamp will be returned.
   * @return     mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
   * @throws     PropelException - if unable to convert the date/time to timestamp.
   */
  public function get' . $aColumn['phpName'] . '($format = "Y-m-d")
  {

    if ($this->' . $aColumn['var'] . ' === null || $this->' . $aColumn['var'] . ' === "") {
      return null;
    } elseif (!is_int($this->' . $aColumn['var'] . ')) {
      // a non-timestamp value was set externally, so we convert it
      if (($this->' . $aColumn['var'] . ' == "0000-00-00 00:00:00")
           || ($this->' . $aColumn['var'] . ' == "0000-00-00") || !$this->' . $aColumn['var'] . ') {
        $ts = "0";
      }
      else {
        $ts = strtotime($this->' . $aColumn['var'] . ');
      }
      if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
        throw new PropelException("Unable to parse value of [' . $aColumn['var'] . '] as date/time value: "
                                 . var_export($this->' . $aColumn['var'] . ', true));
      }
    } else {
      $ts = $this->' . $aColumn['var'] . ';
    }
    if ($format === null) {
      return $ts;
    } elseif (strpos($format, "%") !== false) {
      return strftime($format, $ts);
    } else {
      return date($format, $ts);
    }
  }';
                } else {
                    $aColumn['getFunction'] = '/**
   * Get the [' . $aColumn['var'] . '] column value.
   *
   * @return     string
   */
  public function get' . $aColumn['phpName'] . '()
  {

    return $this->' . $aColumn['var'] . ';
  }';
                }
                switch ($aField['FLD_TYPE']) {
                    case 'VARCHAR':
                    case 'TEXT':
                        $aColumn['setFunction'] = '// Since the native PHP type for this column is string,
    // we will cast the input to a string (if it is not).
    if ($v !== null && !is_string($v)) {
      $v = (string) $v;
    }

    if ($this->' . $aColumn['var'] . ' !== $v) {
      $this->' . $aColumn['var'] . ' = $v;
      $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
    }';
                        break;
                    case 'DATE':
                        $aColumn['setFunction'] = 'if ($v !== null && !is_int($v)) {
      // if($v == \'\')
      //   $ts = null;
     // else
       $ts = strtotime($v);
     if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
       //throw new PropelException("Unable to parse date/time value for [' . $aColumn['var'] . '] from input: "
       //                          . var_export($v, true));
     }
   } else {
     $ts = $v;
   }
   if ($this->' . $aColumn['var'] . ' !== $ts) {
     $this->' . $aColumn['var'] . ' = $ts;
     $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
   }';
                        break;
                    case 'INT':
                        $aColumn['setFunction'] = '// Since the native PHP type for this column is integer,
   // we will cast the input value to an int (if it is not).
   if ($v !== null && !is_int($v) && is_numeric($v)) {
     $v = (int) $v;
   }
   if ($this->' . $aColumn['var'] . ' !== $v || $v === 1) {
     $this->' . $aColumn['var'] . ' = $v;
     $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
   }';
                        break;
                    case 'FLOAT':
                        $aColumn['setFunction'] = 'if ($this->' . $aColumn['var'] . ' !== $v || $v === 0) {
     $this->' . $aColumn['var'] . ' = $v;
     $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
   }';
                        break;
                }
                $aColumns[] = $aColumn;
                if ($aField['FLD_KEY'] == 1 || $aField['FLD_KEY'] === 'on') {
                    $aPKs[] = $aColumn;
                } else {
                    $aNotPKs[] = $aColumn;
                }
                if ($aField['FLD_AUTO_INCREMENT'] == 1 || $aField['FLD_AUTO_INCREMENT'] === 'on') {
                    $aData['useIdGenerator'] = 'true';
                }
                $i++;
            }
            $oTP3 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'map'
                                    . PATH_SEP . 'TableMapBuilder.tpl');
            $oTP3->prepare();
            $oTP3->assignGlobal($aData);
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP3->newBlock('primaryKeys');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP3->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP3->gotoBlock('_ROOT');
            foreach ($aNotPKs as $iIndex => $aColumn) {
                $oTP3->newBlock('columnsWhitoutKeys');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP3->assign($sKey, $aColumn[$sKey]);
                }
            }
            file_put_contents($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName
                           . 'MapBuilder.php', $oTP3->getOutputContent());
            $oTP4 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTable.tpl');
            $oTP4->prepare();
            switch (count($aPKs)) {
                case 0:
                    $aData['getPrimaryKeyFunction'] = 'return null;';
                    $aData['setPrimaryKeyFunction'] = '';
                    break;
                case 1:
                    $aData['getPrimaryKeyFunction'] = 'return $this->get' . $aPKs[0]['phpName'] . '();';
                    $aData['setPrimaryKeyFunction'] = '$this->set' . $aPKs[0]['phpName'] . '($key);';
                    break;
                default:
                    $aData['getPrimaryKeyFunction'] = '$pks = array();' . "\n";
                    $aData['setPrimaryKeyFunction'] = '';
                    foreach ($aPKs as $iIndex => $aColumn) {
                        $aData['getPrimaryKeyFunction'] .= '$pks[' . $iIndex . '] = $this->get'
                                                         . $aColumn['phpName'] . '();' . "\n";
                        $aData['setPrimaryKeyFunction'] .= '$this->set' . $aColumn['phpName']
                                                         . '($keys[' . $iIndex . ']);' . "\n";
                    }
                    $aData['getPrimaryKeyFunction'] .= 'return $pks;' . "\n";
                    break;
            }
            $oTP4->assignGlobal($aData);
            foreach ($aColumns as $iIndex => $aColumn) {
                $oTP4->newBlock('allColumns1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns3');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns4');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns5');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns6');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns7');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns8');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns9');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP4->gotoBlock('_ROOT');
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP4->newBlock('primaryKeys1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP4->gotoBlock('_ROOT');
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP4->newBlock('primaryKeys2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP4->gotoBlock('_ROOT');
            foreach ($aNotPKs as $iIndex => $aColumn) {
                $oTP4->newBlock('columnsWhitoutKeys');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            file_put_contents($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base'
                            . $sClassName . '.php', $oTP4->getOutputContent());
            $oTP5 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTablePeer.tpl');
            $oTP5->prepare();
            $sKeys = '';
            foreach ($aPKs as $iIndex => $aColumn) {
                $sKeys .= '$' . $aColumn['var'] . ', ';
            }
            $sKeys = substr($sKeys, 0, -2);
            //$sKeys = '$pm_unique_id';
            if ($sKeys != '') {
                $aData['sKeys'] = $sKeys;
            } else {
                $aData['sKeys'] = '$DUMMY';
            }
            $oTP5->assignGlobal($aData);
            foreach ($aColumns as $iIndex => $aColumn) {
                $oTP5->newBlock('allColumns1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns3');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns4');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns5');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns6');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns7');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns8');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns9');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns10');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP5->gotoBlock('_ROOT');
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP5->newBlock('primaryKeys1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
            }
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP5->newBlock('primaryKeys2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
            }
            file_put_contents($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base'
                            . $sClassName . 'Peer.php', $oTP5->getOutputContent());
        } catch (Exception $oError) {
            throw($oError);
        }
    }
Exemplo n.º 10
0
<?php

$content = new TemplatePower("template/files/login.tpl");
$content->prepare();
if (isset($_SESSION['accountid'])) {
    // is al ingelogd, dus niks doen
    $content->newBlock("MELDING");
    $content->assign("MELDING", "Je bent al ingelogd");
} else {
    if (!empty($_POST['gnaam']) and !empty($_POST['password'])) {
        // formulier is verstuurd
        $check_user = $db->prepare("SELECT count(*) FROM accounts a, users u\n                                    WHERE a.Users_idUsers = u.idUsers\n                                    AND a.Username = :username\n                                    AND a.Password = :password");
        $check_user->bindParam(":username", $_POST['gnaam']);
        $password = sha1($_POST['password']);
        $check_user->bindParam(":password", $password);
        $check_user->execute();
        if ($check_user->fetchColumn() == 1) {
            // gebruiker gevonden
            $get_user = $db->prepare("SELECT a.*, u.* FROM accounts a, users u\n                                    WHERE a.Users_idUsers = u.idUsers\n                                    AND a.Username = :username\n                                    AND a.Password = :password");
            $get_user->bindParam(":username", $_POST['gnaam']);
            $get_user->bindParam(":password", $password);
            $get_user->execute();
            $user = $get_user->fetch(PDO::FETCH_ASSOC);
            $_SESSION['accountid'] = $user['idAccounts'];
            $_SESSION['username'] = $user['Username'];
            $_SESSION['roleid'] = $user['Role_idRole'];
            $content->newBlock("MELDING");
            $content->assign("MELDING", "Je bent ingelogd");
        } else {
            // gebruiker niet gevonden: combinatie username + password klopt niet
            $errors->newBlock("ERRORS");
Exemplo n.º 11
0
<?php

$tpl = new TemplatePower('template/eventos/consultaEventos.tpl');
$tpl->prepare();
foreach ($_POST as $nombre_campo => $valor) {
    $asignacion = '$' . $nombre_campo . '=\'' . $valor . '\';';
    if (!is_numeric($nombre_campo)) {
        eval($asignacion);
    }
}
$eventos = new Eventos($conn);
$lista_eventos = $eventos->listaEventos();
foreach ($lista_eventos as $evento) {
    $tpl->newBlock("eventos");
    $tpl->assign("nombre", $evento['nombre']);
    $tpl->assign("f_inicio", $evento['f_inicio']);
    $tpl->assign("f_fin", $evento['f_fin']);
    $tpl->assign("logotipo", $evento['logotipo']);
    $tpl->assign("descripcion", $evento['descripcion']);
    $tpl->assign("id", $evento['id']);
    $tpl->gotoBlock("_ROOT");
}
//$tpl->assign('anterior', $anterior);
//$tpl->assign('siguiente', $siguiente);
$tpl->printToScreen();
?>

Exemplo n.º 12
0
$tpl->prepare();
$servername = "localhost";
$username = "******";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM news";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while ($row = $result->fetch_assoc()) {
        $tpl->newBlock("News");
        $title = $row["title"];
        $news_content = $row["text"];
        $tpl->assign("news_title", "{$title}");
        $tpl->assign("news_content", "{$news_content}");
        $tpl->gotoBlock("_ROOT");
    }
} else {
    $tpl->newBlock("News");
    $tpl->assign("news_title", "Geen nieuws beschikbaar.");
    $tpl->assign("news_content", "Er is op dit moment geen nieuws aanwezig.");
    $tpl->gotoBlock("_ROOT");
}
$tpl->printToScreen();
$conn->close();
Exemplo n.º 13
0
         $system = 1;
     }
     if ($system > MAX_SYSTEM_IN_GALAXY) {
         $system = MAX_SYSTEM_IN_GALAXY;
     }
 }
 $position[galaxy] = empty($galaxy) ? $planetrow['galaxy'] : $galaxy;
 $position[system] = empty($system) ? $planetrow['system'] : $system;
 $position[planet] = empty($planet) ? $planetrow['planet'] : $planet;
 $position[planet_type] = empty($planet_type) ? $planetrow['planet_type'] : $planet_type;
 $tp = new TemplatePower($ugamela_root_path . TEMPLATE_DIR . TEMPLATE_NAME . "/galaxy_body_new.tpl");
 $tp->prepare();
 // MOVEMENT BLOCK
 $tp->newBlock("movement");
 foreach ($position as $name => $trans) {
     $tp->assign($name, $trans);
 }
 // SHORT DEFINITION
 $g = $position[galaxy];
 $s = $position[system];
 // GALAXY TABLE BLOCK
 // PREPARE THE $galaxy:$system
 $lang['Solar_system_at'] = $lang['Solar_system'] . " " . $g . ":" . $s;
 // PLANET INFORMATION
 $sql = "SELECT \r\n\t\t\t\tl.temp_min, l.diameter, l.name as moon_name,\r\n\t\t\t\tg.*, g.metal as debris_metal, g.crystal as debris_crystal, g.planet as planetpos,\r\n\t\t\t\tp.*, p.name as planet_name,\r\n\t\t\t\tu.*,\r\n\t\t\t\ts.total_points, s.total_rank,\r\n\t\t\t\ta.ally_tag, a.ally_name, a.ally_web, a.ally_members\r\n\t\t\tFROM {{table}}planets as p\r\n\t\t\t\t\r\n\t\t\t\tLEFT JOIN {{table}}galaxy as g ON g.id_planet = p.id\r\n\t\t\t\tLEFT JOIN {{table}}users as u ON u.id = p.id_owner\r\n\t\t\t\tLEFT JOIN {{table}}alliance as a ON a.id = u.ally_id\r\n\t\t\t\tLEFT JOIN {{table}}planets as l ON l.id = g.id_luna AND l.planet_type = 3\r\n\t\t\t\tLEFT JOIN {{table}}statpoints as s ON s.id_owner = u.id AND stat_type = 1 AND stat_code = 1 \r\n\t\t\t\t\r\n\t\t\tWHERE \r\n\t\t\t\t\tg.galaxy = {$g} \r\n\t\t\t\tAND g.system = {$s} \r\n\t\t\tORDER BY g.planet ASC";
 $rs = doquery($sql, '');
 if ($temprow = mysql_fetch_assoc($rs)) {
     do {
         $planetsrow[$temprow[planetpos]] = $temprow;
     } while ($temprow = mysql_fetch_assoc($rs));
 }
Exemplo n.º 14
0
<?php

/* $Id: host_view.php 1831 2008-09-26 12:18:54Z carenas $ */
$tpl = new TemplatePower(template("host_view.tpl"));
$tpl->assignInclude("extra", template("host_extra.tpl"));
$tpl->prepare();
$tpl->assign("cluster", $clustername);
$tpl->assign("host", $hostname);
$tpl->assign("node_image", node_image($metrics));
$tpl->assign("sort", $sort);
$tpl->assign("range", $range);
if ($hosts_up) {
    $tpl->assign("node_msg", "This host is up and running.");
} else {
    $tpl->assign("node_msg", "This host is down.");
}
$cluster_url = rawurlencode($clustername);
$tpl->assign("cluster_url", $cluster_url);
$tpl->assign("graphargs", "h={$hostname}&amp;{$get_metric_string}&amp;st={$cluster['LOCALTIME']}");
# For the node view link.
$tpl->assign("node_view", "./?p=2&amp;c={$cluster_url}&amp;h={$hostname}");
# No reason to go on if this node is down.
if ($hosts_down) {
    $tpl->printToScreen();
    return;
}
$tpl->assign("ip", $hosts_up['IP']);
$tpl->newBlock('columns_dropdown');
$tpl->assign("metric_cols_menu", $metric_cols_menu);
$g_metrics_group = array();
foreach ($metrics as $name => $v) {
Exemplo n.º 15
0
<?php

//Ver. 1.1 Ago-13
$tpl = new TemplatePower('template/eventos/formaEventos.tpl');
$tpl->prepare();
$eventos = new Eventos($conn);
if (!empty($_GET['id_evento'])) {
    $id_evento = $_GET['id_evento'];
} else {
    $id_evento = '';
}
if ($id_evento != '') {
    //Editar
    $tpl->assign("titulo", "Edita evento");
    $eventos->setID($id_evento);
    $datos_evento = $eventos->eventoByid();
    $tpl->assign("nombrevento", $datos_evento['nombre']);
    $tpl->assign("descripcion", $datos_evento['descripcion']);
    $tpl->assign("f_ini", $datos_evento['f_inicio']);
    $tpl->assign("f_fin", $datos_evento['f_fin']);
    $tpl->assign("id", $id_evento);
} else {
    //Nuevo
    $tpl->assign("titulo", "Alta evento");
}
$tpl->printToScreen();
Exemplo n.º 16
0
                $stmt = $conn->prepare($sql);
                $enabled = 1;
                // execute the query
                $stmt->execute();
            } else {
                $sql = "UPDATE projects SET enabled='0' WHERE id={$id}";
                // Prepare statement
                $stmt = $conn->prepare($sql);
                $enabled = 0;
                // execute the query
                $stmt->execute();
            }
        }
        $tpl->newBlock("project");
        $title = $row["title"];
        $content = $row["content"];
        $id = $row["id"];
        $tpl->assign("enabled", "{$enabled}");
        $tpl->assign("title", "{$title}");
        $tpl->assign("content", "{$content}");
        $tpl->assign("id", "{$id}");
        if ($enabled == 1) {
            $tpl->assign("checked", "checked");
        } else {
            $tpl->assign("checked", "");
        }
        $tpl->gotoBlock("_ROOT");
    }
}
$tpl->printToScreen();
$conn->close();
Exemplo n.º 17
0
 switch ($action) {
     case "toevoegen":
         if (!empty($_POST['username']) && !empty($_POST['title']) && !empty($_POST['content'])) {
             // insert
             // insert
             $insert_blog = $db->prepare("INSERT INTO blog SET\n                  Username = :username,\n                  Title = :title,\n                  Content = :content,\n                  Accounts_idAccounts = :accountid");
             $insert_blog->bindParam(":username", $_POST['username']);
             $insert_blog->bindParam(":title", $_POST['title']);
             $insert_blog->bindParam(":content", $_POST['content']);
             $insert_blog->bindValue(":accountid", 4);
             $insert_blog->execute();
             $userid = $db->lastInsertId();
         } else {
             // formulier
             $content->newBlock("BLOGFORM");
             $content->assign("ACTION", "index.php?pageid=3&action=toevoegen");
             $content->assign("BUTTON", "Toevoegen Blog");
         }
         break;
     case "wijzigen":
         if (isset($_POST['accountid'])) {
             $update_blog = $db->prepare("UPDATE blog\n                                          SET Title = :title,\n                                              Content= :content\n                                          WHERE  idBlog=:blogid");
             $update_blog->bindParam(":title", $_POST['title']);
             $update_blog->bindParam(":content", $_POST['content']);
             $update_blog->bindParam(":blogid", $_POST['blogid']);
             $update_blog->execute();
             $content->newBlock("MELDING");
             $content->assign("MELDING", "blog is gewijzigd");
         } else {
             $get_blog = $db->prepare("SELECT blog.*, accounts.* FROM blog, accounts\n                                      WHERE blog.idBlog = :blogid\n                                      ");
             $get_blog->bindParam(":blogid", $_GET['blogid']);
Exemplo n.º 18
0
         $TotalMess[$MessType] = 0;
     }
 }
 while ($CurMess = mysql_fetch_array($UsrMess)) {
     $MessType = $CurMess['message_type'];
     $TotalMess[$MessType] += 1;
     $TotalMess[100] += 1;
 }
 foreach ($MessageType as $k => $id) {
     $tp->newBlock("message_type");
     $replace[type] = $id;
     $replace[unread] = $WaitingMess[$id];
     $replace[total] = $TotalMess[$id];
     $replace[name] = $lang['type'][$id];
     foreach ($replace as $k => $v) {
         $tp->assign($k, $v);
     }
 }
 switch ($MessPageMode) {
     case 'write':
         if ($_REQUEST['subject']) {
             $subject = $_REQUEST['subject'];
         }
         if (!is_numeric($OwnerID)) {
             message($lang['mess_no_ownerid'], $lang['mess_error']);
         }
         $OwnerRecord = doquery("SELECT SQL_CACHE * FROM {{table}} WHERE `id` = " . mysql_escape_string($OwnerID), 'users', true);
         if (!$OwnerRecord) {
             message($lang['mess_no_owner'], $lang['mess_error']);
         }
         $OwnerHome = doquery("SELECT SQL_CACHE * FROM {{table}} WHERE `id_planet` = " . mysql_escape_string($OwnerRecord["id_planet"]), 'galaxy', true);
Exemplo n.º 19
0
$servername = "localhost";
$username = "******";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM projects WHERE enabled = 1";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while ($row = $result->fetch_assoc()) {
        $tpl->newBlock("project");
        $title = $row["title"];
        $content = $row["summary"];
        $id = $row["id"];
        $tpl->assign("title", "{$title}");
        $tpl->assign("content", "{$content}");
        $tpl->assign("id", "{$id}");
        $tpl->gotoBlock("_ROOT");
    }
} else {
    $tpl->newBlock("no_found");
    $tpl->assign("no_found", "<h3>Op het moment zijn er geen projecten beschikbaar</h3>");
    $tpl->gotoBlock("_ROOT");
}
$tpl->printToScreen();
$conn->close();
Exemplo n.º 20
0
<?php

// Hier laad ik de header.html in
$header = new TemplatePower("template/files/header.tpl");
$header->prepare();
if (!empty($_SESSION['accountid'])) {
    $header->newBlock("LOGGEDIN");
    $header->assign("USERNAME", $_SESSION['username']);
    //    if($_SESSION['roleid'] == 2){
    //        $header->newBlock("ADMINMENU");
    //    }
} else {
    $header->newBlock("LOGINTOP");
}
     //print "\n<a href='$link' target='_new' > $link </a>";
 } else {
     $G_FORM = new Form($sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false);
     $G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
     $scriptCode = '';
     $scriptCode = $G_FORM->render(PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode);
     $scriptCode = str_replace('/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode);
     $scriptCode = str_replace('/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode);
     //render the template
     $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl';
     $template = new TemplatePower($pluginTpl);
     $template->prepare();
     require_once 'classes/model/Step.php';
     $oStep = new Step();
     $sUidGrids = $oStep->lookingforUidGrids($sPRO_UID, $sDYNAFORM);
     $template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
     $template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
     $template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
     $template->assign("sysSys", SYS_SYS);
     $template->assign("sysLang", SYS_LANG);
     $template->assign("sysSkin", SYS_SKIN);
     $template->assign("processUid", $sPRO_UID);
     $template->assign("dynaformUid", $sDYNAFORM);
     $template->assign("taskUid", $sTASKS);
     $template->assign("dynFileName", $sPRO_UID . "/" . $sDYNAFORM);
     $template->assign("formId", $G_FORM->id);
     $template->assign("scriptCode", $scriptCode);
     if (sizeof($sUidGrids) > 0) {
         foreach ($sUidGrids as $k => $v) {
             $template->newBlock('grid_uids');
             $template->assign('siteUrl', $http . $_SERVER['HTTP_HOST']);
        }
    }
    $changeCount--;
}
$oDataset = ArrayBasePeer::doSelectRs($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$changeCount = 0;
while ($oDataset->next()) {
    $aRow = $oDataset->getRow();
    $changeCount++;
    $changedValues = unserialize($aRow['HISTORY_DATA']);
    $tpl->newBlock("DYNLOG");
    $tableName = "_TCHANGE_" . $changeCount;
    $changeCountA = $changeCount + 1;
    $tableNameA = "_TCHANGE_" . $changeCountA;
    $tpl->assign("dynTitle", addslashes($aRow["DYN_TITLE"]));
    $tpl->assign("dynDate", $aRow["HISTORY_DATE"]);
    $tpl->assign("dynUser", addslashes($aRow["USR_NAME"]));
    $tpl->assign("changes", G::LoadTranslation("ID_CHANGES"));
    $tpl->assign("dynUID", $aRow["DYN_UID"]);
    $tpl->assign("tablename", $tableName);
    $tpl->assign("viewForm", $aRow["OBJ_TYPE"] == "DYNAFORM" ? "<a href=\"javascript:;\" onclick=\"showDynaformHistory('" . $aRow["DYN_UID"] . "', '{$tableName}', '" . $aRow["HISTORY_DATE"] . "', '" . addslashes($aRow["DYN_TITLE"]) . "'); return false;\">" . G::LoadTranslation("ID_VIEW") . "</a>" : "");
    $tpl->assign("dynaform", G::LoadTranslation("ID_DYNAFORM"));
    $tpl->assign("date", G::LoadTranslation("ID_DATE"));
    $tpl->assign("user", G::LoadTranslation("ID_USER"));
    $tpl->assign("fieldNameLabel", G::LoadTranslation("ID_FIELDS"));
    $tpl->assign("previousValuesLabel", G::LoadTranslation("ID_PREV_VALUES"));
    $tpl->assign("currentValuesLabel", G::LoadTranslation("ID_CURRENT_VALUES"));
    $count = 0;
    foreach ($changedValues as $key => $value) {
        if ($value != null && !is_array($value)) {
Exemplo n.º 23
0
<?php

$tpl = new TemplatePower('template/codigos/formaCodigo.tpl');
$tpl->prepare();
$objestados = new Estado($conn);
$objeventos = new Eventos($conn);
$objcodigo = new Codigos($conn);
$objasociado = new Asociados($conn);
$id_codigo = '';
if (!empty($_GET['id_codigo'])) {
    $id_codigo = $_GET['id_codigo'];
}
if ($id_codigo != '') {
    //Editar
    $tpl->assign("discodigo", "disabled='disabled'");
    $tpl->assign("id_codigo", $id_codigo);
    $objcodigo->setID($id_codigo);
    $codigo = $objcodigo->codigoByid();
    /*
    echo "<pre>";
        print_r($codigo);
    echo "</pre>";
    */
    $tpl->assign("pulsera", $codigo['codigo_pulsera']);
    $lista_eventos = $objeventos->listaEventos();
    foreach ($lista_eventos as $evento) {
        $tpl->newBlock("eventos");
        $tpl->assign("nombre", $evento['nombre']);
        $tpl->assign("id", $evento['id']);
        if ($evento['id'] == $codigo['id_evento']) {
            $tpl->assign("seleve", "selected='selected'");
Exemplo n.º 24
0
 function update($aData)
 {
     $oConnection = Propel::getConnection(EventPeer::DATABASE_NAME);
     try {
         $oEvent = EventPeer::retrieveByPK($aData['EVN_UID']);
         if (!is_null($oEvent)) {
             //$oEvent->setProUid( $aData['PRO_UID'] );
             if (isset($aData['EVN_RELATED_TO'])) {
                 $oEvent->setEvnRelatedTo($aData['EVN_RELATED_TO']);
                 if ($aData['EVN_RELATED_TO'] == 'SINGLE') {
                     if (isset($aData['TAS_UID']) && $aData['TAS_UID'] != '') {
                         $oEvent->setTasUid($aData['TAS_UID']);
                     }
                     $oEvent->setEvnTasUidTo('');
                     $oEvent->setEvnTasUidFrom('');
                 } else {
                     $oEvent->setTasUid('');
                     if (isset($aData['EVN_TAS_UID_TO'])) {
                         $oEvent->setEvnTasUidTo($aData['EVN_TAS_UID_TO']);
                     }
                     if (isset($aData['EVN_TAS_UID_FROM'])) {
                         $oEvent->setEvnTasUidFrom($aData['EVN_TAS_UID_FROM']);
                     }
                 }
             }
             if (isset($aData['EVN_POSX'])) {
                 $oEvent->setEvnPosx($aData['EVN_POSX']);
             }
             if (isset($aData['EVN_POSY'])) {
                 $oEvent->setEvnPosy($aData['EVN_POSY']);
             }
             if (isset($aData['EVN_TAS_ESTIMATED_DURATION'])) {
                 $oEvent->setEvnTasEstimatedDuration($aData['EVN_TAS_ESTIMATED_DURATION']);
             }
             if (isset($aData['EVN_WHEN_OCCURS'])) {
                 $oEvent->setEvnWhenOccurs($aData['EVN_WHEN_OCCURS']);
             }
             if (isset($aData['EVN_STATUS'])) {
                 $oEvent->setEvnStatus($aData['EVN_STATUS']);
             }
             if (isset($aData['EVN_WHEN'])) {
                 $oEvent->setEvnWhen($aData['EVN_WHEN']);
             }
             if (isset($aData['TRI_UID'])) {
                 $oEvent->setTriUid($aData['TRI_UID']);
             }
             if (isset($aData['EVN_TYPE'])) {
                 $oEvent->setEvnType($aData['EVN_TYPE']);
             }
             if (isset($aData['EVN_CONDITIONS'])) {
                 $oEvent->setEvnConditions($aData['EVN_CONDITIONS']);
             }
             if (isset($aData['EVN_ACTION'])) {
                 $oEvent->setEvnAction($aData['EVN_ACTION']);
             }
             //if ( isset ($aData['ENV_MAX_ATTEMPTS'] )) $oEvent->setEvnMaxAttempts( 3 );
             if (isset($aData['EVN_ACTION_PARAMETERS']) && $aData['EVN_ACTION_PARAMETERS'] != 0) {
                 $oTP = new TemplatePower(PATH_TPL . 'events' . PATH_SEP . 'sendMessage.tpl');
                 $oTP->prepare();
                 $oTP->assign('from', '*****@*****.**');
                 $oTP->assign('subject', addslashes($aData['EVN_ACTION_PARAMETERS']['SUBJECT']));
                 $oTP->assign('template', $aData['EVN_ACTION_PARAMETERS']['TEMPLATE']);
                 $oTP->assign('timestamp', date("l jS \\of F Y h:i:s A"));
                 $recipientTO = implode(',', $aData['EVN_ACTION_PARAMETERS']['TO']);
                 $recipientCC = implode(',', $aData['EVN_ACTION_PARAMETERS']['CC']);
                 $recipientBCC = implode(',', $aData['EVN_ACTION_PARAMETERS']['BCC']);
                 $oTP->assign('TO', addslashes($recipientTO));
                 $oTP->assign('CC', addslashes($recipientCC));
                 $oTP->assign('BCC', addslashes($recipientBCC));
                 $sTrigger = $oTP->getOutputContent();
                 $oTrigger = new Triggers();
                 $aTrigger = $oTrigger->load($oEvent->getTriUid());
                 $aTrigger['TRI_WEBBOT'] = $sTrigger;
                 $oTrigger->update($aTrigger);
                 $oParameters = new StdClass();
                 $oParameters->hash = md5($sTrigger);
                 $oParameters->SUBJECT = $aData['EVN_ACTION_PARAMETERS']['SUBJECT'];
                 $oParameters->TO = $aData['EVN_ACTION_PARAMETERS']['TO'];
                 $oParameters->CC = $aData['EVN_ACTION_PARAMETERS']['CC'];
                 $oParameters->BCC = $aData['EVN_ACTION_PARAMETERS']['BCC'];
                 $oParameters->TEMPLATE = $aData['EVN_ACTION_PARAMETERS']['TEMPLATE'];
                 //$oParameters->TRI_UID  = $sTrigger->getTriUid();
                 $oEvent->setEvnActionParameters(serialize($oParameters));
             }
             if ($oEvent->validate()) {
                 //start the transaction
                 $oConnection->begin();
                 if (array_key_exists('EVN_DESCRIPTION', $aData)) {
                     $oEvent->setEvnDescription($aData['EVN_DESCRIPTION']);
                 }
                 $iResult = $oEvent->save();
                 $oConnection->commit();
                 return $iResult;
             } else {
                 $sMessage = '';
                 $aValidationFailures = $oEvent->getValidationFailures();
                 foreach ($aValidationFailures as $oValidationFailure) {
                     $sMessage .= $oValidationFailure->getMessage() . '<br />';
                 }
                 throw new Exception('The registry cannot be updated!<br />' . $sMessage);
             }
         } else {
             throw new Exception('This row doesn\'t exist!');
         }
     } catch (Exception $oError) {
         $oConnection->rollback();
         throw $oError;
     }
 }
Exemplo n.º 25
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
$G_PUBLISH = new Publisher();
$fileGetStart = PATH_SKINS . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
if (!file_exists($fileGetStart)) {
    $fileGetStart = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
    if (!file_exists($fileGetStart)) {
        $fileGetStart = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
        if (!file_exists($fileGetStart)) {
            $fileGetStart = PATH_TPL . 'services/login_getStarted.html';
        }
    }
}
$oTemplatePower = new TemplatePower($fileGetStart);
$oTemplatePower->prepare();
/*
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
*/
$oTemplatePower->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
G::RenderPage('publish', 'raw');
Exemplo n.º 26
0
if (($RBAC_Response = $RBAC->userCanAccess("PM_SETUP")) != 1) {
    return $RBAC_Response;
}
$G_MAIN_MENU = "processmaker";
$G_ID_MENU_SELECTED = "SETUP";
$G_PUBLISH = new Publisher();
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load('setup');
$toolItems = array();
foreach ($oMenu->Options as $i => $option) {
    $toolItems[] = array('id' => $oMenu->Id[$i], 'link' => $oMenu->Options[$i] != '' ? $oMenu->Options[$i] : '#', 'onclick' => $oMenu->JS[$i] != '' ? $oMenu->JS[$i] : '', 'label' => $oMenu->Labels[$i], 'icon' => $oMenu->Icons[$i] != '' ? $oMenu->Icons[$i] : 'icon-pmlogo.png', 'target' => $oMenu->JS[$i] != '' ? '' : 'admToolsContent');
}
$template = new TemplatePower(PATH_TPL . 'setup' . PATH_SEP . 'tools.html');
$template->prepare();
$template->assign('LeftWidth', '230');
$template->assign('contentHeight', '520');
if (isset($_GET['i18'])) {
    $_SESSION['TOOLS_VIEWTYPE'] = true;
    $template->assign('displayLanguageTool', 'block');
} else {
    $template->assign('displayLanguageTool', 'none');
}
if (isset($_GET['newSite'])) {
    $template->assign('displayNewSiteTool', 'block');
} else {
    $template->assign('displayNewSiteTool', 'none');
}
foreach ($toolItems as $item) {
    $template->newBlock('tool_options');
    foreach ($item as $propertyName => $propertyValue) {
Exemplo n.º 27
0
}
switch ($action) {
    case "toevoegen":
        if (!empty($_POST['username']) && !empty($_POST['Text'])) {
            // insert
            // insert
            $insert_comment = $db->prepare("INSERT INTO comments SET\n                  Username = :username,\n                  Text = :text,\n                  Accounts_idAccounts = :accountid");
            $insert_comment->bindParam(":username", $_POST['username']);
            $insert_comment->bindParam(":text", $_POST['Text']);
            $insert_comment->bindValue(":accountid", 4);
            $insert_comment->execute();
            $userid = $db->lastInsertId();
        } else {
            // formulier
            $content->newBlock("COMMENTFORM");
            $content->assign("ACTION", "index.php?pageid=10&action=toevoegen");
            $content->assign("BUTTON", "Toevoegen Comment");
        }
        break;
    case "wijzigen":
        if (isset($_POST['accountid'])) {
            $update_comment = $db->prepare("UPDATE comments\n                                          SET Text = :text\n                                          WHERE  idComments=:commentid");
            $update_comment->bindParam(":text", $_POST['Text']);
            $update_comment->bindParam(":commentid", $_POST['commentid']);
            $update_comment->execute();
            $content->newBlock("MELDING");
            $content->assign("MELDING", "comment is gewijzigd");
        } else {
            $get_comment = $db->prepare("SELECT comments.*, accounts.* FROM comments, accounts\n                                      WHERE idComments = :commentid\n                                      ");
            $get_comment->bindParam(":commentid", $_GET['commentid']);
            $get_comment->execute();
Exemplo n.º 28
0
    exit;
}
if (isset($_GET['token'])) {
    $token = $_GET['token'];
    //en caso de que haya un token en la querystring gestionamos el proceso para nueva contraseña
    //debemos comprobar que el toquen sea valido, sino mostramos un mensaje de error
    $fecha = new DateTime(date("Y-m-d H:m:s"));
    $fecha->modify("-1 day");
    $query = "SELECT token, usuarios.usuario FROM usuarios_recuperar_clave, usuarios\n                WHERE token='{$token}' \n                AND fecha>'" . $fecha->format("Y-m-d H:m:s") . "'\n                AND usuarios_recuperar_clave.idusuario = usuarios.idusuario";
    $datos = mysql_fetch_assoc(mysql_query($query));
    if (!$datos) {
        //token invalido o no presente en la base de datos
        $tplClave->newBlock("errortoken");
        $tplClave->newBlock("generar_token");
    } else {
        //token valido
        $tplClave->newBlock("nueva_clave");
        //mostramos el usuario para el cual se va a asignar la nueva clave
        $tplClave->assign("user", $datos['usuario']);
        $tplClave->assign("token", $datos['token']);
    }
} else {
    //comprobamos si ha ocurrido un error durante la recepcion del formulario para generar el token
    if (isset($_GET['error'])) {
        $tplClave->newBlock("error" . $_GET['error']);
    }
    //si no hay token mostramos el html para que se pueda recuperar la contraseña
    $tplClave->newBlock("generar_token");
}
//imprimimos por pantalla
$tplIndex->assign("contenido", $tplClave->getOutputContent());
         $insert_user = $db->prepare("INSERT INTO users SET\n                  Surename = :achternaam,\n                  Name = :voornaam,\n                  Email = :email");
         $insert_user->bindParam(":achternaam", $_POST['achternaam']);
         $insert_user->bindParam(":voornaam", $_POST['voornaam']);
         $insert_user->bindParam(":email", $_POST['email']);
         $insert_user->execute();
         $userid = $db->lastInsertId();
         $insert_account = $db->prepare("INSERT INTO accounts SET\n                  Username = :username,\n                  Password = :password,\n                  salt = :salt,\n                  Users_idUsers = :userid,\n                  Role_idRole = :roleid");
         $insert_account->bindParam(":username", $_POST['gebruikersnaam']);
         $password = sha1($_POST['password1']);
         $insert_account->bindParam(":password", $password);
         $insert_account->bindParam(":salt", $userid);
         $insert_account->bindParam(":userid", $userid);
         $insert_account->bindValue(":roleid", 1);
         $insert_account->execute();
         $content->newBlock("MELDING");
         $content->assign("MELDING", "Gebruiker is toegevoegd");
         print "Gelukt";
     } else {
         $errors->newBlock("ERRORS");
         $errors->assign("ERROR", "Wachtwoord komt niet overeen!");
         $content->newBlock("FORMULIER");
         $content->assign("ACTION", "index.php?pageid=1&action=registreren");
         $content->assign("BUTTON", "Toevoegen Gebruiker");
     }
 } else {
     // formulier
     $content->newBlock("FORMULIER");
     $content->assign("ACTION", "index.php?pageid=3&action=registreren");
     $content->assign("BUTTON", "Toevoegen Gebruiker");
 }
 break;
Exemplo n.º 30
0
<?php

include 'tplutil.inc';
include 'class.TemplatePower.inc.php';
$tpl = new TemplatePower('presentations/slides/intro/templatepower.tpl');
$tpl->prepare();
$tpl->assign("TITLE", 'My Title');
$tpl->assign("USER", get_user());
foreach (get_users() as $user) {
    $tpl->newBlock('USERS');
    $tpl->assign('USER', $user);
}
$tpl->printToScreen();