function afficher()
 {
     $html = '';
     if ($this->existe()) {
         $t = new Template('modules/archi/templates/');
         $t->set_filenames(array('afficherErreurs' => 'listeErreurs.tpl'));
         foreach ($this->array_erreurs as $message) {
             $t->assign_block_vars('erreur', array('message' => $message));
         }
         ob_start();
         $t->pparse('afficherErreurs');
         $html = ob_get_contents();
         ob_get_clean();
     }
     return $html;
 }
 public function getDiv($params = array())
 {
     $t = new Template($this->cheminTemplates);
     $t->set_filenames(array('popup' => 'popupGeneric.tpl'));
     $width = 500;
     if (isset($params['width']) && $params['width'] != '') {
         $width = $params['width'];
     }
     $height = 500;
     if (isset($params['height']) && $params['height'] != '') {
         $height = $params['height'];
     }
     $left = 100;
     if (isset($params['left']) && $params['left'] != '') {
         $left = $params['left'];
     }
     $top = 50;
     if (isset($params['top']) && $params['top'] != '') {
         $top = $params['top'];
     }
     $titrePopup = "";
     if (isset($params['titre']) && $params['titre'] != '') {
         $titrePopup = $params['titre'];
     }
     $codeJsFermer = "";
     if (isset($params['codeJsFermerButton']) && $params['codeJsFermerButton'] != '') {
         $codeJsFermer = $params['codeJsFermerButton'];
     }
     $hiddenFields = "";
     if (isset($params['hiddenFields'])) {
         foreach ($params['hiddenFields'] as $indice => $value) {
             $hiddenFields .= "<input type='hidden' id='" . $indice . "' name='" . $indice . "' value='" . $value . "'>";
         }
     }
     $t->assign_vars(array('width' => $width, 'height' => $height, 'left' => $left, 'top' => $top, 'hiddenFields' => $hiddenFields, 'divIdPopup' => 'div' . $this->idPopup, 'tdIdPopup' => 'td' . $this->idPopup, 'iFrameIdPopup' => 'iFrame' . $this->idPopup, 'lienSrcIFrame' => $params['lienSrcIFrame'], 'titrePopup' => $titrePopup, 'codeJsFermer' => $codeJsFermer));
     ob_start();
     $t->pparse('popup');
     $html = ob_get_contents();
     ob_end_clean();
     return $html;
 }
Example #3
0
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
	global $db, $template, $board_config, $theme, $lang, $phpbb_root_path, $nav_links, $gen_simple_header;
	global $userdata, $user_ip, $session_length;
	global $starttime;

	$sql_store = $sql;

	//
	// Get SQL error if we are debugging. Do this as soon as possible to prevent
	// subsequent queries from overwriting the status of sql_error()
	//
	if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
	{
		$sql_error = $db->sql_error();

		$debug_text = '';

		if ( $sql_error['message'] != '' )
		{
			$debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'];
		}

		if ( $sql_store != '' )
		{
			$debug_text .= "<br /><br />$sql_store";
		}

		if ( $err_line != '' && $err_file != '' )
		{
			$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file;
		}
	}

	if( empty($userdata) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) )
	{
		$userdata = session_pagestart($user_ip, PAGE_INDEX);
		init_userprefs($userdata);
	}

	//
	// If the header hasn't been output then do it
	//
	if ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR )
	{
		if ( empty($lang) )
		{
			if ( !empty($board_config['default_lang']) )
			{
				include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.php');
			}
			else
			{
				include($phpbb_root_path . 'language/lang_english/lang_main.php');
			}
		}

		if ( empty($template) )
		{
			$template = new Template($phpbb_root_path . 'templates/' . $board_config['board_template']);
		}
		if ( empty($theme) )
		{
			$theme = setup_style($board_config['default_style']);
		}

		//
		// Load the Page Header
		//
		if ( !defined('IN_ADMIN') )
		{
			include($phpbb_root_path . 'includes/page_header.php');
		}
		else
		{
			include($phpbb_root_path . 'admin/page_header_admin.php');
		}
	}

	switch($msg_code)
	{
		case GENERAL_MESSAGE:
			if ( $msg_title == '' )
			{
				$msg_title = $lang['Information'];
			}
			break;

		case CRITICAL_MESSAGE:
			if ( $msg_title == '' )
			{
				$msg_title = $lang['Critical_Information'];
			}
			break;

		case GENERAL_ERROR:
			if ( $msg_text == '' )
			{
				$msg_text = $lang['An_error_occured'];
			}

			if ( $msg_title == '' )
			{
				$msg_title = $lang['General_Error'];
			}
			break;

		case CRITICAL_ERROR:
			//
			// Critical errors mean we cannot rely on _ANY_ DB information being
			// available so we're going to dump out a simple echo'd statement
			//
			include($phpbb_root_path . 'language/lang_english/lang_main.php');

			if ( $msg_text == '' )
			{
				$msg_text = $lang['A_critical_error'];
			}

			if ( $msg_title == '' )
			{
				$msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
			}
			break;
	}

	//
	// Add on DEBUG info if we've enabled debug mode and this is an error. This
	// prevents debug info being output for general messages should DEBUG be
	// set TRUE by accident (preventing confusion for the end user!)
	//
	if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
	{
		if ( $debug_text != '' )
		{
			$msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;
		}
	}

	if ( $msg_code != CRITICAL_ERROR )
	{
		if ( !empty($lang[$msg_text]) )
		{
			$msg_text = $lang[$msg_text];
		}

		if ( !defined('IN_ADMIN') )
		{
			$template->set_filenames(array(
				'message_body' => 'message_body.tpl')
			);
		}
		else
		{
			$template->set_filenames(array(
				'message_body' => 'admin/admin_message_body.tpl')
			);
		}

		$template->assign_vars(array(
			'MESSAGE_TITLE' => $msg_title,
			'MESSAGE_TEXT' => $msg_text)
		);
		$template->pparse('message_body');

		if ( !defined('IN_ADMIN') )
		{
			include($phpbb_root_path . 'includes/page_tail.php');
		}
		else
		{
			include($phpbb_root_path . 'admin/page_footer_admin.php');
		}
	}
	else
	{
		echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
	}

	exit;
}
Example #4
0
		$banco->desfazerTransacao();
		array_push($msg_erro,$e->getMessage());
		#exit;
	}
}


##############################################################################
##############                INDEXA O TEMPLATE             	##############
##############################################################################	

$_nome_programa = basename($_SERVER['PHP_SELF'],'.php');

$theme = ".";
$model = new Template($theme);
$model->set_filenames(array($_nome_programa => $_nome_programa.'.htm'));
$model->assign_vars(array('_NOME_PROGRAMA' => $_nome_programa.".php"));

/*         PROFESSOR         */

$usuario_id    = "";
$usuario_nome  = "";
$usuario_email = "";

try {
	if (strlen($_login_professor)>0){
		$professor      = $sessionFacade->recuperarProfessor($_login_professor);
		$pesquisa       = $sessionFacade->recuperarPesquisaTodos($professor);
		$fazer_pesquisa = $sessionFacade->recuperarFazerPesquisa($professor);
		if (count($pesquisa)>0 AND $fazer_pesquisa == 0){
			header("Location: ../logout.php?pesquisa=n");
Example #5
0
/**
 * Redirects to the given URL (HTML method).
 * once this function called, the execution doesn't go further
 * (presence of an exit() instruction.
 *
 * @param string $url
 * @param string $msg
 * @param integer $refresh_time
 * @return void
 */
function redirect_html($url, $msg = '', $refresh_time = 0)
{
    global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug;
    if (!isset($lang_info) || !isset($template)) {
        $user = build_user($conf['guest_id'], true);
        load_language('common.lang');
        trigger_notify('loading_lang');
        load_language('lang', PHPWG_ROOT_PATH . PWG_LOCAL_DIR, array('no_fallback' => true, 'local' => true));
        $template = new Template(PHPWG_ROOT_PATH . 'themes', get_default_theme());
    } elseif (defined('IN_ADMIN') and IN_ADMIN) {
        $template = new Template(PHPWG_ROOT_PATH . 'themes', get_default_theme());
    }
    if (empty($msg)) {
        $msg = nl2br(l10n('Redirection...'));
    }
    $refresh = $refresh_time;
    $url_link = $url;
    $title = 'redirection';
    $template->set_filenames(array('redirect' => 'redirect.tpl'));
    include PHPWG_ROOT_PATH . 'include/page_header.php';
    $template->set_filenames(array('redirect' => 'redirect.tpl'));
    $template->assign('REDIRECT_MSG', $msg);
    $template->parse('redirect');
    include PHPWG_ROOT_PATH . 'include/page_tail.php';
    exit;
}
Example #6
0
<?php

/**
 * Charge le template de l'en-tête
 * 
 * PHP Version 5.3.3
 * 
 * @category General
 * @package  ArchiWiki
 * @author   Pierre Rudloff <*****@*****.**>
 * @license  GNU GPL v3 https://www.gnu.org/licenses/gpl.html
 * @link     http://archi-wiki.org/
 * 
 * */
$t = new Template('modules/header/templates/');
$t->set_filenames(array('header' => 'header.tpl'));
$authentification = new archiAuthentification();
$recherche = new archiRecherche();
$config = new ArchiConfig();
$adresse = new archiAdresse();
$evenement = new archiEvenement();
$image = new archiImage();
$ajax = new ajaxObject();
$calque = new calqueObject();
$string = new stringObject();
$utilisateur = new archiUtilisateur();
$session = new objetSession();
$i = new imageObject();
if (!isset($jsHeader)) {
    // variables récupérée de chaque fonction des classes du site permettant de mettre du javascript recupéré , dans le header , plutot qu'en plein milieu de la page ou dans le bas de page s'il faut qu'il soit executé a la fin
    $jsHeader = "";
Example #7
0
    define('APP_TEST_BRANCH', FALSE);
}
// optimization for search engines: hostname/key1~val1[/key2~val2[/key3~val3 ...]] -> $key1=val1...
if (isset($_GET['a'])) {
    foreach (explode('/', $_GET['a']) as $a) {
        $a = explode('~', $a);
        if ($a[0]) {
            $_GET[$a[0]] = urldecode($a[1]);
        }
    }
}
include_once 'class.template.inc';
include_once 'app.inc';
$template = new Template(ME_WWWROOT);
$app = new App();
$template->set_filenames(array('page' => 'tpl/me.tpl'));
$options = $app->fetchAll('SELECT * FROM `options`');
foreach ($options as $key => $option) {
    ${$option}['name'] = $option['value'];
}
$products_per_page = (int) $products_per_page < 1 ? 15 : $products_per_page;
$template->assign_vars(array('copyright' => $copyright, 'currency_exchange_rate' => $currency_exchange_rate, 'short_name' => $name, 'full_name' => $long_name, 'address' => $address, 'email_address' => $shop_mail, 'webadmin_email_address' => $web_admin_mail, 'page_bottom_info' => $page_bottom_info, 'test_branch_min' => APP_TEST_BRANCH ? '' : '.min'));
function get_url_compatible($text)
{
    return urlencode(preg_replace('/\\s{1,}/', ' ', trim(preg_replace('/\\([^\\)]*?\\)/', '', $text))));
}
$html = '';
$menu = array();
// for menu tree
$categories = $app->fetchAll("SELECT `id`, `name`, `parent` FROM `categories` WHERE `hidden` = 0 ORDER BY `name`");
// sections of top level
 function get_home_page()
 {
     global $Sql, $User, $Template, $Cache, $Bread_crumb, $_WIKI_CONFIG, $_WIKI_CATS, $LANG;
     load_module_lang('wiki');
     include_once '../wiki/wiki_functions.php';
     $bread_crumb_key = 'wiki';
     require_once '../wiki/wiki_bread_crumb.php';
     unset($Template);
     $Template = new Template();
     $Template->set_filenames(array('wiki' => 'wiki/wiki.tpl', 'index' => 'wiki/index.tpl'));
     $Template->assign_vars(array('WIKI_PATH' => $Template->get_module_data_path('wiki')));
     if ($_WIKI_CONFIG['last_articles'] > 1) {
         $result = $Sql->query_while("SELECT a.title, a.encoded_title, a.id\n\t\t\tFROM " . PREFIX . "wiki_articles a\n\t\t\tLEFT JOIN " . PREFIX . "wiki_contents c ON c.id_contents = a.id_contents\n\t\t\tWHERE a.redirect = 0\n\t\t\tORDER BY c.timestamp DESC\n\t\t\tLIMIT 0, " . $_WIKI_CONFIG['last_articles'], __LINE__, __FILE__);
         $articles_number = $Sql->num_rows($result, "SELECT COUNT(*) FROM " . PREFIX . "wiki_articles WHERE encoded_title = '" . $encoded_title . "'", __LINE__, __FILE__);
         $Template->assign_block_vars('last_articles', array('L_ARTICLES' => $LANG['wiki_last_articles_list'], 'RSS' => $articles_number > 0 ? '<a href="{PATH_TO_ROOT}/syndication.php?m=wiki"><img src="../templates/' . get_utheme() . '/images/rss.png" alt="RSS" /></a>' : ''));
         $i = 0;
         while ($row = $Sql->fetch_assoc($result)) {
             $Template->assign_block_vars('last_articles.list', array('ARTICLE' => $row['title'], 'TR' => $i > 0 && $i % 2 == 0 ? '</tr><tr>' : '', 'U_ARTICLE' => url('wiki.php?title=' . $row['encoded_title'], $row['encoded_title'])));
             $i++;
         }
         if ($articles_number == 0) {
             $Template->assign_vars(array('L_NO_ARTICLE' => '<td style="text-align:center;" class="row2">' . $LANG['wiki_no_article'] . '</td>'));
         }
     }
     if ($_WIKI_CONFIG['display_cats'] != 0) {
         $Template->assign_block_vars('cat_list', array('L_CATS' => $LANG['wiki_cats_list']));
         $i = 0;
         foreach ($_WIKI_CATS as $id => $infos) {
             if ($infos['id_parent'] == 0) {
                 $Template->assign_block_vars('cat_list.list', array('CAT' => $infos['name'], 'U_CAT' => url('wiki.php?title=' . url_encode_rewrite($infos['name']), url_encode_rewrite($infos['name']))));
                 $i++;
             }
         }
         if ($i == 0) {
             $Template->assign_vars(array('L_NO_CAT' => $LANG['wiki_no_cat']));
         }
     }
     $Template->assign_vars(array('TITLE' => !empty($_WIKI_CONFIG['wiki_name']) ? $_WIKI_CONFIG['wiki_name'] : $LANG['wiki'], 'INDEX_TEXT' => !empty($_WIKI_CONFIG['index_text']) ? second_parse(wiki_no_rewrite($_WIKI_CONFIG['index_text'])) : $LANG['wiki_empty_index'], 'L_EXPLORER' => $LANG['wiki_explorer'], 'U_EXPLORER' => url('explorer.php'), 'WIKI_PATH' => $Template->get_module_data_path('wiki')));
     $page_type = 'index';
     include '../wiki/wiki_tools.php';
     $tmp = $Template->pparse('wiki', TRUE);
     return $tmp;
 }
Example #9
0
<?php

// deuxième page
include 'include_dao.php';
session_start();
// on precise le repertoire où se trouve les fichiers templates et le répértoire où on met les fichiers compilés (cache)
$template = new Template('template', 'cache');
// on precise la variable langage
$template->set_language_var($lang);
page_header('Supprimer une note', 'Supprimer une note', 'SUPPRIMERNOTE');
page_footer();
$template->set_filenames(array('body' => 'supprimernote.html'));
$submit = isset($_POST['submit']);
$id = $_GET['idLigne'];
$template->assign_var('IDLIGNE', $id);
if ($submit) {
    $frais = new LignefraisMySqlDAO();
    $fraisQuery = $frais->delete($id);
    header('Location: gererbordereau.php');
}
$template->display('body');
Example #10
0
<?php

// deuxième page
include 'include_dao.php';
session_start();
// on precise le repertoire où se trouve les fichiers templates et le répértoire où on met les fichiers compilés (cache)
$template = new Template('template', 'cache');
$template->assign_var('LOG', FALSE);
$template->assign_var('ONUPDATE', FALSE);
$template->assign_var('UPDATESUCCES', FALSE);
$template->assign_var('UPDATEFAIL', FALSE);
// on precise la variable langage
$template->set_language_var($lang);
page_header('Mon profil', 'Mon profil', 'PROFIL');
page_footer();
$template->set_filenames(array('body' => 'profil.html'));
$submitRequest = isset($_POST['request']);
$submit = isset($_POST['submit']);
if ($submit) {
    $nom = $_POST['nom'];
    $prenom = $_POST['prenom'];
    $sexe = $_POST['sexe'];
    $date = $_POST['ddn'];
    $type = $_POST['type'];
    $adresse = $_POST['adresse'];
    $cp = $_POST['cp'];
    $ville = $_POST['ville'];
    $nmdp = $_POST['npwd'];
    $mdp = $_POST['pwd'];
    $demandeur = new DemandeurMySqlDAO();
    $demandeurQuery = $demandeur->queryByNom($nom);
function adr_update_general_config()
{
    global $db, $lang, $phpEx, $userdata, $phpbb_root_path, $table_prefix;
    $template = new Template($phpbb_root_path);
    include_once $phpbb_root_path . 'adr/includes/adr_constants.' . $phpEx;
    $template->set_filenames(array('cache' => 'adr/cache/cache_tpls/cache_config_def.tpls'));
    $sql = "SELECT * FROM " . ADR_GENERAL_TABLE . "\n\t\t\tORDER BY config_name ASC";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Unable to query config infos (updating cache)', '', __LINE__, __FILE__, $sql);
    }
    while ($row = $db->sql_fetchrow($result)) {
        $id = $row['config_name'];
        $cell_res = $row['config_value'];
        $template->assign_block_vars('cache_row', array('ID' => sprintf("'%s'", str_replace("'", "\\'", $id)), 'CELLS' => sprintf("'%s'", str_replace("'", "\\'", $cell_res))));
    }
    $template->assign_var_from_handle('cache', 'cache');
    $res = "<?php\n" . $template->_tpldata['.'][0]['cache'] . "\n?>";
    $fname = $phpbb_root_path . './adr/cache/cache_config' . '.' . $phpEx;
    @chmod($fname, 0666);
    $handle = @fopen($fname, 'w');
    @fwrite($handle, $res);
    @fclose($handle);
}
Example #12
0
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
    global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images;
    global $userdata, $user_ip, $session_length;
    global $starttime;
    //-- mod : sub-template ----------------------------------------------------------------------------
    //-- add
    //-- fix
    global $sub_template_key_image, $sub_templates;
    //-- fin mod : sub-template ------------------------------------------------------------------------
    //-- mod : profile cp ------------------------------------------------------------------------------
    //-- add
    global $admin_level, $level_prior;
    //-- fin mod : profile cp --------------------------------------------------------------------------
    if (defined('HAS_DIED')) {
        die("message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?");
    }
    define('HAS_DIED', 1);
    $sql_store = $sql;
    //
    // Get SQL error if we are debugging. Do this as soon as possible to prevent
    // subsequent queries from overwriting the status of sql_error()
    //
    if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) {
        $debug_text = '';
        if (isset($db)) {
            $sql_error = $db->sql_error();
        } else {
            $sql_error['message'] = '';
        }
        if ($sql_error['message'] != '') {
            $debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'];
        }
        if ($sql_store != '') {
            $debug_text .= "<br /><br />{$sql_store}";
        }
        if ($err_line != '' && $err_file != '') {
            $debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file;
        }
    }
    if (empty($userdata) && ($msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR)) {
        $userdata = session_pagestart($user_ip, PAGE_INDEX);
        init_userprefs($userdata);
    }
    //
    // If the header hasn't been output then do it
    //
    if (!defined('HEADER_INC') && $msg_code != CRITICAL_ERROR) {
        if (empty($lang)) {
            if (!empty($board_config['default_lang'])) {
                include $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx;
            } else {
                include $phpbb_root_path . 'language/lang_english/lang_main.' . $phpEx;
            }
            //-- mod : language settings -----------------------------------------------------------------------
            //-- add
            include $phpbb_root_path . './includes/lang_extend_mac.' . $phpEx;
            //-- fin mod : language settings -------------------------------------------------------------------
        }
        if (empty($template)) {
            $template = new Template($phpbb_root_path . 'templates/' . $board_config['board_template']);
        }
        if (empty($theme)) {
            $theme = setup_styles($board_config['default_style']);
        }
        //
        // Load the Page Header
        //
        if (!defined('IN_ADMIN')) {
            include $phpbb_root_path . 'includes/page_header.' . $phpEx;
        } else {
            include $phpbb_root_path . 'admin/page_header_admin.' . $phpEx;
        }
    }
    switch ($msg_code) {
        case GENERAL_MESSAGE:
            if ($msg_title == '') {
                $msg_title = $lang['Information'];
            }
            break;
        case CRITICAL_MESSAGE:
            if ($msg_title == '') {
                $msg_title = $lang['Critical_Information'];
            }
            break;
        case GENERAL_ERROR:
            if ($msg_text == '') {
                $msg_text = $lang['An_error_occured'];
            }
            if ($msg_title == '') {
                $msg_title = $lang['General_Error'];
            }
            break;
        case CRITICAL_ERROR:
            //
            // Critical errors mean we cannot rely on _ANY_ DB information being
            // available so we're going to dump out a simple echo'd statement
            //
            include $phpbb_root_path . 'language/lang_english/lang_main.' . $phpEx;
            if ($msg_text == '') {
                $msg_text = $lang['A_critical_error'];
            }
            if ($msg_title == '') {
                $msg_title = 'Minerva : <b>' . $lang['Critical_Error'] . '</b>';
            }
            break;
    }
    //
    // Add on DEBUG info if we've enabled debug mode and this is an error. This
    // prevents debug info being output for general messages should DEBUG be
    // set TRUE by accident (preventing confusion for the end user!)
    //
    if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) {
        if ($debug_text != '') {
            $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;
        }
    }
    if ($msg_code != CRITICAL_ERROR) {
        if (!empty($lang[$msg_text])) {
            $msg_text = $lang[$msg_text];
        }
        if (!defined('IN_ADMIN')) {
            $template->set_filenames(array('message_body' => 'message_body.tpl'));
        } else {
            $template->set_filenames(array('message_body' => 'admin_message_body.tpl'));
        }
        $template->assign_vars(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text));
        //--------------------------------------------------------------------------------
        // Prillian - Begin Code Addition
        //
        if ($gen_simple_header) {
            $template->assign_vars(array('U_INDEX' => '', 'L_INDEX' => ''));
        }
        //
        // Prillian - End Code Addition
        //--------------------------------------------------------------------------------
        $template->pparse('message_body');
        if (!defined('IN_ADMIN')) {
            include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
        } else {
            include $phpbb_root_path . 'admin/page_footer_admin.' . $phpEx;
        }
    } else {
        echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>' . strip_tags($msg_title) . '</title>' . "\n";
        echo '<body><h1 style="font-family:Verdana,serif;font-size:18pt;font-weight:bold">' . $msg_title . '</h1><hr style="height:2px;border-style:dashed;color:black" /><p style="font-family:Verdana,serif;font-size:10pt">' . $msg_text . '</p><hr style="height:2px;border-style:dashed;color:black" /><p style="font-family:Verdana,serif;font-size:10pt">Contact the site administrator to report this failure</p></body></html>';
    }
    exit;
}
Example #13
0
<?php

// deuxième page
include 'include_dao.php';
session_start();
// on precise le repertoire où se trouve les fichiers templates et le répértoire où on met les fichiers compilés (cache)
$template = new Template('template', 'cache');
$template->assign_var('UPDATESUCCES', FALSE);
// on precise la variable langage
$template->set_language_var($lang);
page_header('Modifier une note', 'Modifier une note', 'MODIFIERNOTE');
page_footer();
$template->set_filenames(array('body' => 'modifiernote.html'));
$submit = isset($_POST['submit']);
$id = $_GET['idLigne'];
$template->assign_var('IDLIGNE', $id);
if ($submit) {
    $date = $_POST['date'];
    $annee = $_POST['annee'];
    $motif = $_POST['idmotif'];
    $trajet = $_POST['trajet'];
    $kms = $_POST['kms'];
    $cpeages = $_POST['cpeages'];
    $crepas = $_POST['crepas'];
    $chebergement = $_POST['chebergement'];
    $indemnites = new IndemniteMySqlDAO();
    $indemniteQuery = $indemnites->queryByAnnee($annee);
    $ligne = new LignefraisMySqlDAO();
    $FraisInsert = new Lignefrai();
    $FraisInsert->idLigne = $id;
    $FraisInsert->date = $date;
Example #14
0
    email                : jonasge@gmx.net
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   any later version.                                  		   *
 *                                                                         *
 ***************************************************************************/
session_start();
session_destroy();
setcookie("ck_userid", "", time() - 172800000);
setcookie("ck_passwd", "", time() - 172800000);
include "./includes/conf.inc.php";
include "./language/" . $config['language'] . ".inc.php";
include "./includes/functions.php";
include "./includes/template.php";
$dataB->sql_connect($sql["host"], $sql["dbuser"], $sql["dbpasswd"], $sql["db"]);
$result = $dataB->sql_query("SELECT conf,value FROM config WHERE conf='default_template'");
$daten = $dataB->sql_fetch_assoc($result);
$dataB->sql_close();
$L_template = $daten[value];
$template = new Template("./templates/" . $L_template);
$template->set_filenames(array('overall_body' => 'templates/' . $L_template . '/logout.tpl'));
$template->assign_vars(array('L_LOGOUT' => $textdata['logoff']));
$template->assign_vars(array('L_MSG_FORWARD' => $textdata['msg_logoff_forward']));
$template->pparse('overall_body');
?>

 /**
  * Display a single event with event data in input
  *
  * @param unknown $evenement
  * @return string
  */
 public function displaySingleEvent($evenement)
 {
     $t = new Template('modules/archi/templates/');
     $t->set_filenames(array('evenement' => 'evenement/singleEvent.tpl'));
     //Filling the template with the infos
     $t->assign_block_vars('evenement', $evenement['evenementData']);
     //Menu (ajouter image/event, modifier image/event etc..)
     if (isset($evenement['menuArray'])) {
         foreach ($evenement['menuArray'] as $menuElt) {
             $t->assign_block_vars($menuElt[0], $menuElt[1]);
         }
     }
     //Personnes
     if (isset($evenement['arrayPersonne'])) {
         foreach ($evenement['arrayPersonne'] as $personne) {
             $t->assign_block_vars($personne[0], $personne[1]);
         }
     }
     //Formulaire pour les modifications d'images
     if (isset($evenement['arrayFormEvent'])) {
         $t->assign_block_vars($personne[0], $personne[1]);
     }
     //Courant architectural
     if (isset($evenement['arrayCourantArchi'])) {
         foreach ($evenement['arrayCourantArchi'] as $courantArchi) {
             $t->assign_block_vars($courantArchi[0], $courantArchi[1]);
         }
     }
     ob_start();
     $t->pparse('evenement');
     $html .= ob_get_contents();
     ob_end_clean();
     return $html;
 }
Example #16
0
    include PHPWG_ROOT_PATH . 'install/php5_apache_configuration.php';
}
// +-----------------------------------------------------------------------+
// |                          database connection                          |
// +-----------------------------------------------------------------------+
include_once PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php';
include PHPWG_ROOT_PATH . 'include/dblayer/functions_' . $conf['dblayer'] . '.inc.php';
upgrade_db_connect();
pwg_db_check_charset();
list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
define('CURRENT_DATE', $dbnow);
// +-----------------------------------------------------------------------+
// |                        template initialization                        |
// +-----------------------------------------------------------------------+
$template = new Template(PHPWG_ROOT_PATH . 'admin/themes', 'clear');
$template->set_filenames(array('upgrade' => 'upgrade.tpl'));
$template->assign(array('RELEASE' => PHPWG_VERSION, 'L_UPGRADE_HELP' => l10n('Need help ? Ask your question on <a href="%s">Piwigo message board</a>.', PHPWG_URL . '/forum')));
// +-----------------------------------------------------------------------+
// | Remote sites are not compatible with Piwigo 2.4+                      |
// +-----------------------------------------------------------------------+
$has_remote_site = false;
$query = 'SELECT galleries_url FROM ' . SITES_TABLE . ';';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result)) {
    if (url_is_remote($row['galleries_url'])) {
        $has_remote_site = true;
    }
}
if ($has_remote_site) {
    include_once PHPWG_ROOT_PATH . 'admin/include/updates.class.php';
    include_once PHPWG_ROOT_PATH . 'admin/include/pclzip.lib.php';
// Vérification de la bonne connexion de l'adherent dans le cas contraire redirection vers le formulaire de connexion
if (isset($_SESSION[DROIT_ID]) && (isset($_SESSION[MOD_COMMANDE]) || isset($_SESSION[DROIT_SUPER_ZEYBU]))) {
    // Inclusion des classes
    include_once CHEMIN_CLASSES_CONTROLEURS . MOD_COMMANDE . "/MesAchatsControleur.php";
    include_once CHEMIN_CLASSES_UTILS . "InfobullesUtils.php";
    include_once CHEMIN_CLASSES_UTILS . "Template.php";
    include_once CHEMIN_CLASSES_UTILS . "StringUtils.php";
    $lControleur = new MesAchatsControleur();
    $lPage = $lControleur->getListe();
    $lLogger->log("Affichage de la vue MesAchats par le compte de l'Adhérent : " . $_SESSION[ID_CONNEXION], PEAR_LOG_INFO);
    // Maj des logs
    // Constante de titre de la page
    define("TITRE", ZEYBUX_TITRE_DEBUT . "Mes Achats - " . ZEYBUX_TITRE_FIN);
    $lTemplate = new Template(CHEMIN_TEMPLATE);
    // Entete
    $lTemplate->set_filenames(array('entete' => COMMUN_TEMPLATE . 'Entete.html'));
    $lTemplate->assign_vars(array('TITRE' => TITRE));
    InfobullesUtils::generer($lTemplate);
    // Messages d'erreur
    $lTemplate->assign_var_from_handle('ENTETE', 'entete');
    // Menu
    $lTemplate->set_filenames(array('menu' => COMMUN_TEMPLATE . 'Menu.html'));
    $lTemplate->assign_vars(array('menu-MesAchats' => "ui-state-active"));
    $lTemplate->assign_var_from_handle('MENU', 'menu');
    // Body
    $lTemplate->set_filenames(array('body' => MOD_COMMANDE . '/' . 'MesAchats.html'));
    $lListeAchat = $lPage->getAchats();
    if (!is_null($lListeAchat[0]->getOpeId())) {
        $lTemplate->set_filenames(array('listeAchat' => MOD_COMMANDE . '/' . 'ListeAchat.html'));
        foreach ($lListeAchat as $lAchat) {
            $lTemplate->assign_block_vars('achat', array('numero' => $lAchat->getComNumero(), 'dateMarcheDebut' => StringUtils::extractDate($lAchat->getOpeDate()), 'idAchat' => $lAchat->getOpeId()));
 public function afficherOpendata()
 {
     $html = "";
     $t = new Template('modules/archi/templates/');
     $t->set_filenames(array('opendata' => 'opendata/index.tpl'));
     $t->assign_vars(array('urlContact' => $this->creerUrl('', 'contact')));
     $filesArray = array(array('name' => 'Adresses par architectes', 'xml' => 'opendata-adressesArchitecte.xml', 'csv' => 'opendata-adressesArchitecte.csv', 'filename' => 'adressesArchitecte'), array('name' => 'Adresses par quartiers', 'xml' => 'opendata-adressesQuartier.xml', 'csv' => 'opendata-adressesQuartier.csv', 'filename' => 'adressesQuartier'), array('name' => 'Adresses par rues', 'xml' => 'opendata-adressesRue.xml', 'csv' => 'opendata-adressesRue.csv', 'filename' => 'adressesRue'), array('name' => 'Quartiers par villes', 'xml' => 'opendata-quartiersVille.xml', 'csv' => 'opendata-quartiersVille.csv', 'filename' => 'quartiersVille'), array('name' => 'Rues par quartiers', 'xml' => 'opendata-ruesQuartier.xml', 'csv' => 'opendata-ruesQuartier.csv', 'filename' => 'ruesQuartier'), array('name' => 'Rues par sous quartiers', 'xml' => 'opendata-ruesSousQuartier.xml', 'csv' => 'opendata-ruesSousQuartier.csv', 'filename' => 'ruesSousQuartier'), array('name' => 'Rues par villes', 'xml' => 'opendata-ruesVille.xml', 'csv' => 'opendata-ruesVille.csv', 'filename' => 'ruesVille'), array('name' => 'Photos par quartiers', 'xml' => 'opendata-urlPhotosQuartier.xml', 'csv' => 'opendata-urlPhotosQuartier.csv', 'filename' => 'urlPhotosQuartier'), array('name' => 'Photos par rues', 'xml' => 'opendata-urlPhotosRue.xml', 'csv' => 'opendata-urlPhotosRue.csv', 'filename' => 'urlPhotosRue'));
     foreach ($filesArray as $file) {
         if (file_exists("modules/opendata/xml/" . $file['filename'] . ".xml")) {
             $file['date'] = date("d/m/Y H:i:s", filemtime("modules/opendata/xml/" . $file['filename'] . ".xml"));
         }
         $t->assign_block_vars('fichier', $file);
     }
     ob_start();
     $t->pparse('opendata');
     $html .= ob_get_contents();
     ob_end_clean();
     return $html;
 }
Example #19
0
<?php

// deuxième page
include 'include_dao.php';
session_start();
// on precise le repertoire où se trouve les fichiers templates et le répértoire où on met les fichiers compilés (cache)
$template = new Template('template', 'cache');
$template->assign_var('LOG', FALSE);
// on precise la variable langage
$template->set_language_var($lang);
page_header('Déconnection', 'Déconnection', 'DECONNECTION');
page_footer();
$submit = isset($_POST['submit']);
if ($submit) {
    session_start();
    session_unset();
    session_destroy();
    header('Location: index.php');
}
if (isset($_SESSION['Nom'])) {
    $template->assign_var('LOG', TRUE);
    $template->assign_var('MESSAGE', "Vous allez être déconnecté, confirmer ?<br /><br />");
} else {
    $template->assign_var('MESSAGE', "Vous n'êtes pas connecté !<br /><br />");
}
$template->set_filenames(array('body' => 'deconnection.html'));
$template->display('body');
 /**
  * This function display the informations related to the addresses whom idHistoriqueAdresse is given in param
  *
  * @param array of idHistorique $idList : a list of idHistoriqueAdresse to display
  * @return $html : the list of addresses to display
  */
 public function displayList($idList = array(), $nbResult = 0)
 {
     $html = "";
     //Template loading
     $t = new Template('modules/archi/templates/');
     $t->set_filenames(array('addressesList' => 'addressesList.tpl'));
     if (empty($idList)) {
         $t->assign_vars(array('messageInfo' => "Aucun résultat !", 'titre' => 'Résultats'));
         $this->messages->addWarning("Aucun résultat à afficher.");
         $this->messages->display();
     } else {
         $starttime = microtime(true);
         $optionsPagination = array('nbResult' => 0, 'nbPages' => 0, 'currentPage' => 0, 'nextPage' => 0, 'previousPage' => 0, 'nbResultPerPage' => 10, 'offset' => 4);
         //Pagination display
         if (isset($this->variablesGet['debut']) && $this->variablesGet['debut'] != '') {
             $optionsPagination['currentPage'] = $this->variablesGet['debut'] / $optionsPagination['nbResultPerPage'];
         } else {
             $optionsPagination['debut'] = 0;
             $optionsPagination['currentPage'] = 0;
         }
         $addressesInfromations = $this->getAddressesInfoFromIdHA($idList, $optionsPagination);
         if ($nbResult > 1) {
             $optionsPagination['nbResult'] = $nbResult;
             $nbReponses = $nbResult;
             $optionsPagination['nbPages'] = ceil($nbReponses / $optionsPagination['nbResultPerPage']);
             if ($optionsPagination['currentPage'] < $optionsPagination['nbPages']) {
                 $optionsPagination['nextPage'] = $optionsPagination['currentPage'] + 1;
             } else {
                 $optionsPagination['nextPage'] = $optionsPagination['nbPages'];
             }
             if ($optionsPagination['currentPage'] > 1) {
                 $optionsPagination['previousPage'] = $optionsPagination['currentPage'] - 1;
             } else {
                 $optionsPagination['previousPage'] = 1;
             }
             $url = array();
             //Call link generation
             $url = $this->generatePaginationLinks($optionsPagination);
             $nbReponses .= " réponses";
         } else {
             $nbReponses = $nbResult . " réponse";
         }
         $t->assign_vars(array('nbReponses' => $nbReponses, 'titre' => 'Résultats'));
         // Template filling
         $paramsUrlDesc = $this->variablesGet;
         $paramsUrlAsc = $this->variablesGet;
         $paramsUrlDesc['order'] = "desc";
         $paramsUrlAsc['order'] = "asc";
         $urlAsc = $this->creerUrl('', '', $paramsUrlAsc);
         $urlDesc = $this->creerUrl('', '', $paramsUrlDesc);
         $t->assign_block_vars('liens', array('urlDesc' => $urlAsc, 'urlAsc' => $urlDesc));
         //Generating next/previous pagination link
         $siblingIndex = $this->getNextPreviousPages($optionsPagination['currentPage'], $optionsPagination['nbPages']);
         $indexToDisplay = $this->getPaginationIndex($optionsPagination);
         foreach ($indexToDisplay as $indexPage) {
             $t->assign_block_vars('nav', array('urlNbOnClick' => '', 'urlNb' => $url[$indexPage], 'nb' => $indexPage + 1, 'urlPrecendant' => $url[$siblingIndex['previousPage']], 'urlSuivant' => $url[$siblingIndex['nextPage']]));
             // Dirty hack for displaying strong tag on current page
             if ($indexPage == $optionsPagination['currentPage']) {
                 $t->assign_block_vars('nav.courant', array());
             }
         }
         $t->assign_block_vars('urlNextPagination', array('urlSuivant' => $url[$siblingIndex['nextPage']]));
         $t->assign_block_vars('urlBackPagination', array('urlPrecedent' => $url[$siblingIndex['previousPage']]));
         /*
         * Addresses display
         * Loop on each address infos
         *
         *
         * Structure of $info :
         *
         * Array
         				(
         				    [nom] => 22 rue du général castelnau
         				    [idHistoriqueAdresse] => 2
         				    [idAdresse] => 2
         				    [idEvenementGroupeAdresse] => 1289
         				    [titresEvenements] => Array
         				        (
         				            [0] => 22 rue du général castelnau
         				            [1] => Photos de nuit
         				            [2] => Visite des appartements
         				            [3] => Evenement sans titre
         				            [4] => Visite des parties communes
         				            [5] => détails art nouveau
         				        )
         				)
         */
         foreach ($addressesInfromations as $info) {
             $titreEvenements = "";
             $illustration = $this->getUrlImageFromAdresse($info['idHistoriqueAdresse'], 'moyen', array('idEvenementGroupeAdresse' => $info['idEvenementGroupeAdresse'], 'placeholder' => "images/placeholder.jpg"));
             //Processing name of the address
             $nom = ucfirst($info['nom']);
             $fulladdress = ucfirst($this->getIntituleAdresseFrom($info['idEvenementGroupeAdresse'], $type = 'idEvenementGroupeAdresse'));
             $titre = $info['titre'];
             $input = array('idEvenementGA' => $info['idEvenementGroupeAdresse'], 'idAdresse' => $info['idAdresse']);
             $intituleAdresse = "";
             if (isset($titre) && !empty($titre) && $titre != '') {
                 $intituleAdresse = "<b>" . $titre . "</b> ";
             }
             $intituleAdresse .= $fulladdress . ' ';
             $arrayUrl = $this->generateUrlListAddresses($input, $this->variablesGet['modeAffichage'], $intituleAdresse);
             //Regular case
             //Personne case
             if (isset($info['idPersonne']) && $info['idPersonne'] != '') {
                 $urlImageIllustration = archiPersonne::getImage($info['idPersonne'], 'resized', true, array('height' => 130, 'width' => 130));
                 $addressUrl = $this->creerUrl('', 'evenementListe', array('selection' => 'personne', "id" => $info['idPersonne']));
                 $titre = $info['nom'];
                 $urlDetailOnClick = '';
             } else {
                 $urlImageIllustration = $illustration['url'];
                 $addressUrl = $this->creerUrl('', '', array('archiAffichage' => 'adresseDetail', "archiIdAdresse" => $info['idAdresse'], "archiIdEvenementGroupeAdresse" => $info['idEvenementGroupeAdresse']));
                 $addressUrl = $arrayUrl['urlDetailHref'];
                 $urlDetailOnClick = $arrayUrl['urlDetailOnClick'];
             }
             // Event title
             $titreEvenements = implode(" - ", $info['titresEvenements']);
             // Getting all the events links on one line
             $modeAffichage = $this->variablesGet['modeAffichage'];
             if ($modeAffichage == 'calqueImage' || $modeAffichage == 'calqueImageChampsMultiples' || $modeAffichage == 'calqueImageChampsMultiplesRetourSimple' || $modeAffichage == 'calqueEvenement' || $modeAffichage == 'popupRechercheAdressePrisDepuis' || $modeAffichage == 'popupRechercheAdresseVueSur' || $modeAffichage == "popupAjoutAdressesLieesSurEvenement" || $modeAffichage == "popupDeplacerEvenementVersGroupeAdresse" || $modeAffichage == 'popupRechercheAdresseAdminParcours') {
                 $titreEvenements = "";
             } else {
                 $titreEvenements = implode(" - ", $info['titresEvenements']);
                 // Getting all the events links on one line
             }
             $t->assign_block_vars('adresses', array('nom' => $titre, 'adresseComplete' => $fulladdress, 'urlImageIllustration' => $urlImageIllustration, 'alt' => $nom, 'urlDetailHref' => $addressUrl, 'titresEvenements' => $titreEvenements, 'urlDetailOnClick' => $urlDetailOnClick));
         }
         //End foreach
     }
     //End else (regular display w/ errors)
     //Filling template, getting content, returning it
     ob_start();
     $t->pparse('addressesList');
     $html .= ob_get_contents();
     ob_end_clean();
     return $html;
 }
 /**
  * It Renders content according to Part['Type']
  *
  * @author Fernando Ontiveros Lira <*****@*****.**>
  *
  * @param intPos = 0
  * @return void
  *
  */
 public function RenderContent0($intPos = 0, $showXMLFormName = false)
 {
     global $G_FORM;
     global $G_TABLE;
     global $G_TMP_TARGET;
     global $G_OP_MENU;
     global $G_IMAGE_FILENAME;
     global $G_IMAGE_PARTS;
     global $_SESSION;
     //Changed from $HTTP_SESSION_VARS
     global $G_OBJGRAPH;
     //For graphLayout component
     $this->intPos = $intPos;
     $Part = $this->Parts[$intPos];
     $this->publishType = $Part['Type'];
     switch ($this->publishType) {
         case 'externalContent':
             $G_CONTENT = new Content();
             if ($Part['Content'] != "") {
                 $G_CONTENT = G::LoadContent($Part['Content']);
             }
             G::LoadTemplateExternal($Part['Template']);
             break;
         case 'image':
             $G_IMAGE_FILENAME = $Part['File'];
             $G_IMAGE_PARTS = $Part['Data'];
             break;
         case 'appform':
             global $APP_FORM;
             $G_FORM = $APP_FORM;
             break;
         case 'xmlform':
         case 'dynaform':
             global $G_FORM;
             if ($Part['AbsolutePath']) {
                 $sPath = $Part['AbsolutePath'];
             } else {
                 if ($this->publishType == 'xmlform') {
                     $sPath = PATH_XMLFORM;
                 } else {
                     $sPath = PATH_DYNAFORM;
                 }
             }
             //if the xmlform file doesn't exists, then try with the plugins folders
             if (!is_file($sPath . $Part['File'] . '.xml')) {
                 $aux = explode(PATH_SEP, $Part['File']);
                 //check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
                 if (count($aux) > 2) {
                     //Subfolders
                     $filename = array_pop($aux);
                     $aux0 = implode(PATH_SEP, $aux);
                     $aux = array();
                     $aux[0] = $aux0;
                     $aux[1] = $filename;
                 }
                 if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) {
                     $oPluginRegistry =& PMPluginRegistry::getSingleton();
                     if ($response = $oPluginRegistry->isRegisteredFolder($aux[0])) {
                         if ($response !== true) {
                             $sPath = PATH_PLUGINS . $response . PATH_SEP;
                         } else {
                             $sPath = PATH_PLUGINS;
                         }
                     }
                 }
             }
             if (!class_exists($Part['Template']) || $Part['Template'] === 'xmlform') {
                 $G_FORM = new Form($Part['File'], $sPath, SYS_LANG, false);
             } else {
                 eval('$G_FORM = new ' . $Part['Template'] . ' ( $Part[\'File\'] , "' . $sPath . '");');
             }
             if ($this->publishType == 'dynaform' && ($Part['Template'] == 'xmlform' || $Part['Template'] == 'xmlform_preview')) {
                 $dynaformShow = isset($G_FORM->printdynaform) && $G_FORM->printdynaform ? 'gulliver/dynaforms_OptionsPrint' : 'gulliver/dynaforms_Options';
                 $G_FORM->fields = G::array_merges(array('__DYNAFORM_OPTIONS' => new XmlForm_Field_XmlMenu(new Xml_Node('__DYNAFORM_OPTIONS', 'complete', '', array('type' => 'xmlmenu', 'xmlfile' => $dynaformShow, 'parentFormId' => $G_FORM->id)), SYS_LANG, PATH_XMLFORM, $G_FORM)), $G_FORM->fields);
             }
             //Needed to make ajax calls
             //The action in the form tag.
             if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
                 $G_FORM->action = urlencode(G::encrypt($Part['Target'], URL_KEY));
             } else {
                 $G_FORM->action = $Part['Target'];
             }
             if (!(isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '')) {
                 if ($this->publishType == 'dynaform') {
                     $Part['ajaxServer'] = '../gulliver/defaultAjaxDynaform';
                 } else {
                     $Part['ajaxServer'] = '../gulliver/defaultAjax';
                 }
             }
             if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
                 $G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY));
             } else {
                 $G_FORM->ajaxServer = $Part['ajaxServer'];
             }
             $G_FORM->setValues($Part['Data']);
             $G_FORM->setValues(array('G_FORM_ID' => $G_FORM->id));
             //Asegurese de que no entre cuando $Part['Template']=="grid"
             //de hecho soo deberia usarse cuando $Part['Template']=="xmlform"
             if ($this->publishType == 'dynaform' && $Part['Template'] == "xmlform" || $Part['Template'] == "xmlform") {
                 $G_FORM->values = G::array_merges(array('__DYNAFORM_OPTIONS' => isset($Part['Data']['__DYNAFORM_OPTIONS']) ? $Part['Data']['__DYNAFORM_OPTIONS'] : ''), $G_FORM->values);
                 if (isset($G_FORM->nextstepsave)) {
                     switch ($G_FORM->nextstepsave) {
                         // this condition validates if the next step link is configured to Save and Go the next step or show a prompt
                         case 'save':
                             // Save and Next only if there are no required fields can submit the form.
                             $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {document.getElementById("' . $G_FORM->id . '").submit();}return false;';
                             break;
                         case 'prompt':
                             // Show Prompt only if there are no required fields can submit the form.
                             $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {if(dynaFormChanged(document.getElementsByTagName(\'form\').item(0))) {new leimnud.module.app.confirm().make({label:"@G::LoadTranslation(ID_DYNAFORM_SAVE_CHANGES)", action:function(){document.getElementById("' . $G_FORM->id . '").submit();}.extend(this), cancel:function(){window.location = getField("DYN_FORWARD").href;}.extend(this)});return false;} else {window.location = getField("DYN_FORWARD").href;return false;}}return false;';
                             break;
                     }
                 }
             }
             if (isset($_SESSION)) {
                 $_SESSION[$G_FORM->id] = $G_FORM->values;
             }
             // by default load the core template
             if ($Part['Template'] == 'xmlform_preview') {
                 $Part['Template'] = 'xmlform';
             }
             $template = PATH_CORE . 'templates/' . $Part['Template'] . '.html';
             //erik: new feature, now templates such as xmlform.html can be personalized via skins
             if (defined('SYS_SKIN') && strtolower(SYS_SKIN) != 'classic') {
                 // First, verify if the template exists on Custom skins path
                 if (is_file(PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html')) {
                     $template = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html';
                     //Second, verify if the template exists on base skins path
                 } elseif (is_file(G::ExpandPath("skinEngine") . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html')) {
                     $template = G::ExpandPath("skinEngine") . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html';
                 }
             }
             //end new feature
             if ($Part['Template'] == 'grid') {
                 print '<form class="formDefault">';
             }
             $scriptCode = '';
             if ($this->localMode != '') {
                 // @# las modification by erik in 09/06/2008
                 $G_FORM->mode = $this->localMode;
             }
             print $G_FORM->render($template, $scriptCode);
             if ($Part['Template'] == 'grid') {
                 print '</form>';
             }
             $oHeadPublisher =& headPublisher::getSingleton();
             $oHeadPublisher->addScriptFile($G_FORM->scriptURL);
             $oHeadPublisher->addScriptCode($scriptCode);
             /**
              * We've implemented the conditional show hide fields..
              *
              * @author Erik A. Ortiz <*****@*****.**>
              * @date Fri Feb 19, 2009
              */
             if ($this->publishType == 'dynaform') {
                 if (isset($_SESSION['CURRENT_DYN_UID']) || isset($_SESSION['CONDITION_DYN_UID'])) {
                     require_once "classes/model/FieldCondition.php";
                     $oFieldCondition = new FieldCondition();
                     //This dynaform has show/hide field conditions
                     if (isset($_SESSION['CURRENT_DYN_UID']) && $_SESSION['CURRENT_DYN_UID'] != '') {
                         $ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($_SESSION["CURRENT_DYN_UID"]);
                         //lsl
                     } else {
                         if (isset($_SESSION['CONDITION_DYN_UID']) && $_SESSION['CONDITION_DYN_UID'] != '') {
                             $ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($_SESSION["CONDITION_DYN_UID"]);
                             //lsl
                         }
                     }
                 }
             }
             if (isset($ConditionalShowHideRoutines) && $ConditionalShowHideRoutines) {
                 G::evalJScript($ConditionalShowHideRoutines);
             }
             break;
         case 'pagedtable':
             global $G_FORM;
             //if the xmlform file doesn't exists, then try with the plugins folders
             $sPath = PATH_XMLFORM;
             if (!is_file($sPath . $Part['File'])) {
                 $aux = explode(PATH_SEP, $Part['File']);
                 if (count($aux) == 2) {
                     $oPluginRegistry =& PMPluginRegistry::getSingleton();
                     if ($oPluginRegistry->isRegisteredFolder($aux[0])) {
                         $sPath = PATH_PLUGINS;
                         // . $aux[0] . PATH_SEP ;
                     }
                 }
             }
             $G_FORM = new Form($Part['File'], $sPath, SYS_LANG, true);
             if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
                 $G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY));
             } else {
                 $G_FORM->ajaxServer = $Part['ajaxServer'];
             }
             $G_FORM->setValues($Part['Data']);
             if (isset($_SESSION)) {
                 $_SESSION[$G_FORM->id] = $G_FORM->values;
             }
             G::LoadSystem('pagedTable');
             $oTable = new pagedTable();
             $oTable->template = 'templates/' . $Part['Template'] . '.html';
             $G_FORM->xmlform = '';
             $G_FORM->xmlform->fileXml = $G_FORM->fileName;
             $G_FORM->xmlform->home = $G_FORM->home;
             $G_FORM->xmlform->tree->attribute = $G_FORM->tree->attributes;
             $G_FORM->values = array_merge($G_FORM->values, $Part['Data']);
             $oTable->setupFromXmlform($G_FORM);
             if (isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '') {
                 $oTable->ajaxServer = $Part['ajaxServer'];
             }
             /* Start Block: Load user configuration for the pagedTable */
             G::LoadClass('configuration');
             $objUID = $Part['File'];
             $conf = new Configurations();
             $conf->loadConfig($oTable, 'pagedTable', $objUID, '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '', '');
             $oTable->__OBJ_UID = $objUID;
             /* End Block */
             /* Start Block: PagedTable Right Click */
             G::LoadClass('popupMenu');
             $pm = new popupMenu('gulliver/pagedTable_PopupMenu');
             $pm->name = $oTable->id;
             $fields = array_keys($oTable->fields);
             foreach ($fields as $f) {
                 switch (strtolower($oTable->fields[$f]['Type'])) {
                     case 'javascript':
                     case 'button':
                     case 'private':
                     case 'hidden':
                     case 'cellmark':
                         break;
                     default:
                         $label = $oTable->fields[$f]['Label'] != '' ? $oTable->fields[$f]['Label'] : $f;
                         $label = str_replace("\n", ' ', $label);
                         $pm->fields[$f] = new XmlForm_Field_popupOption(new Xml_Node($f, 'complete', '', array('label' => $label, 'type' => 'popupOption', 'launch' => $oTable->id . '.showHideField("' . $f . '")')));
                         $pm->values[$f] = '';
                 }
             }
             $sc = '';
             $pm->values['PAGED_TABLE_ID'] = $oTable->id;
             print $pm->render(PATH_CORE . 'templates/popupMenu.html', $sc);
             /* End Block */
             $oTable->renderTable();
             /* Start Block: Load PagedTable Right Click */
             print '<script type="text/javascript">';
             print $sc;
             print 'loadPopupMenu_' . $oTable->id . '();';
             print '</script>';
             /* End Block */
             break;
         case 'propeltable':
             global $G_FORM;
             //if the xmlform file doesn't exists, then try with the plugins folders
             if ($Part['AbsolutePath']) {
                 $sPath = '';
             } else {
                 $sPath = PATH_XMLFORM;
             }
             if (!is_file($sPath . $Part['File'])) {
                 $aux = explode(PATH_SEP, $Part['File']);
                 //search in PLUGINS folder, probably the file is in plugin
                 if (count($aux) == 2) {
                     $oPluginRegistry =& PMPluginRegistry::getSingleton();
                     if ($oPluginRegistry->isRegisteredFolder($aux[0])) {
                         $sPath = PATH_PLUGINS;
                         // . $aux[0] . PATH_SEP ;
                     }
                 }
                 //search in PATH_DYNAFORM folder
                 if (!is_file($sPath . PATH_SEP . $Part['File'] . '.xml')) {
                     $sPath = PATH_DYNAFORM;
                 }
             }
             //PATH_DATA_PUBLIC ???
             if (!file_exists($sPath . PATH_SEP . $Part['File'] . '.xml') && defined('PATH_DATA_PUBLIC')) {
                 $sPath = PATH_DATA_PUBLIC;
             }
             $G_FORM = new Form($Part['File'], $sPath, SYS_LANG, true);
             if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
                 $G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY));
             } else {
                 $G_FORM->ajaxServer = $Part['ajaxServer'];
             }
             if (isset($_SESSION)) {
                 $_SESSION[$G_FORM->id] = $G_FORM->values;
             }
             G::LoadClass('propelTable');
             $oTable = new propelTable();
             $oTable->template = $Part['Template'];
             $oTable->criteria = $Part['Content'];
             if (isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '') {
                 $oTable->ajaxServer = $Part['ajaxServer'];
             }
             if (!isset($G_FORM->xmlform)) {
                 $G_FORM->xmlform = new stdclass();
             }
             $G_FORM->xmlform->fileXml = $G_FORM->fileName;
             $G_FORM->xmlform->home = $G_FORM->home;
             if (!isset($G_FORM->xmlform->tree)) {
                 $G_FORM->xmlform->tree = new stdclass();
             }
             $G_FORM->xmlform->tree->attribute = $G_FORM->tree->attributes;
             if (is_array($Part['Data'])) {
                 $G_FORM->values = array_merge($G_FORM->values, $Part['Data']);
             }
             $oTable->setupFromXmlform($G_FORM);
             /* Start Block: Load user configuration for the pagedTable */
             G::LoadClass('configuration');
             $objUID = $Part['File'];
             $conf = new Configurations($oTable);
             $conf->loadConfig($oTable, 'pagedTable', $objUID, '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '', '');
             $oTable->__OBJ_UID = $objUID;
             //$oTable->__OBJ_UID = '';
             /* End Block */
             /* Start Block: PagedTable Right Click */
             G::LoadClass('popupMenu');
             $pm = new popupMenu('gulliver/pagedTable_PopupMenu');
             $sc = $pm->renderPopup($oTable->id, $oTable->fields);
             /* End Block */
             //krumo ( $Part );
             if ($this->ROWS_PER_PAGE) {
                 $oTable->rowsPerPage = $this->ROWS_PER_PAGE;
             }
             try {
                 if (is_array($Part['Data'])) {
                     $oTable->renderTable('', $Part['Data']);
                 } else {
                     $oTable->renderTable();
                 }
                 print $sc;
             } catch (Exception $e) {
                 $aMessage['MESSAGE'] = $e->getMessage();
                 $this->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
             }
             break;
         case 'panel-init':
             global $mainPanelScript;
             global $panelName;
             global $tabCount;
             //G::LoadThirdParty( 'pear/json', 'class.json' );
             //$json = new Services_JSON();
             $tabCount = 0;
             $panelName = $Part['Template'];
             $data = $Part['File'];
             if (!is_array($data)) {
                 $data = array();
             }
             $data = G::array_merges(array('title' => '', 'style' => array(), 'left' => 'getAbsoluteLeft(mycontent)', 'top' => 'getAbsoluteTop(mycontent)', 'width' => 700, 'height' => 600, 'drag' => true, 'close' => true, 'modal' => true, 'roll' => false, 'resize' => false, 'tabWidth' => 120, 'tabStep' => 3, 'blinkToFront' => true, 'tabSpace' => 10), $data);
             $mainPanelScript = 'var ' . $panelName . '={},' . $panelName . 'Tabs=[];' . 'leimnud.event.add(window,"load",function(){' . $panelName . ' = new leimnud.module.panel();' . 'var mycontent=document.getElementById("' . $this->publisherId . '[' . $intPos . ']");' . $panelName . '.options={' . 'size:{w:' . $data['width'] . ',h:' . $data['height'] . '},' . 'position:{x:' . $data['left'] . ',y:' . $data['top'] . '},' . 'title:"' . addcslashes($data['title'], '\\"') . '",' . 'theme:"processmaker",' . 'statusBar:true,' . 'headerBar:true,' . 'control:{' . ' close:' . ($data['close'] ? 'true' : 'false') . ',' . ' roll:' . ($data['roll'] ? 'true' : 'false') . ',' . ' drag:' . ($data['drag'] ? 'true' : 'false') . ',' . ' resize:' . ($data['resize'] ? 'true' : 'false') . '},' . 'fx:{' . ' drag:' . ($data['drag'] ? 'true' : 'false') . ',' . ' modal:' . ($data['modal'] ? 'true' : 'false') . ',' . ' blinkToFront:' . ($data['blinkToFront'] ? 'true' : 'false') . '}' . '};' . $panelName . '.setStyle=' . Bootstrap::json_encode($data['style']) . ';' . $panelName . '.tab={' . 'width:' . ($data['tabWidth'] + $data['tabSpace']) . ',' . 'optWidth:' . $data['tabWidth'] . ',' . 'step :' . $data['tabStep'] . ',' . 'options:[]' . '};';
             print ' ';
             break;
         case 'panel-tab':
             global $tabCount;
             global $mainPanelScript;
             global $panelName;
             $onChange = $Part['Content'];
             $beforeChange = $Part['Data'];
             if (SYS_LANG == 'es') {
                 $mainPanelScript = str_replace("120", "150", $mainPanelScript);
             } else {
                 $mainPanelScript = str_replace("150", "120", $mainPanelScript);
             }
             $mainPanelScript .= $panelName . 'Tabs[' . $tabCount . ']=' . 'document.getElementById("' . $Part['File'] . '");' . $panelName . '.tab.options[' . $panelName . '.tab.options.length]=' . '{' . 'title  :"' . addcslashes($Part['Template'], '\\"') . '",' . 'noClear  :true,' . 'content  :function(){' . ($beforeChange != '' ? 'if (typeof(' . $beforeChange . ')!=="undefined") {' . $beforeChange . '();}' : '') . $panelName . 'Clear();' . $panelName . 'Tabs[' . $tabCount . '].style.display="";' . ($onChange != '' ? 'if (typeof(' . $onChange . ')!=="undefined") {' . $onChange . '();}' : '') . '}.extend(' . $panelName . '),' . 'selected:' . ($tabCount == 0 ? 'true' : 'false') . '};';
             $tabCount++;
             break;
         case 'panel-close':
             global $mainPanelScript;
             global $panelName;
             global $tabCount;
             $mainPanelScript .= $panelName . '.make();';
             $mainPanelScript .= 'for(var r=0;r<' . $tabCount . ';r++)' . 'if (' . $panelName . 'Tabs[r])' . $panelName . '.addContent(' . $panelName . 'Tabs[r]);';
             $mainPanelScript .= '});';
             $mainPanelScript .= 'function ' . $panelName . 'Clear(){';
             $mainPanelScript .= 'for(var r=0;r<' . $tabCount . ';r++)' . 'if (' . $panelName . 'Tabs[r])' . $panelName . 'Tabs[r].style.display="none";}';
             $oHeadPublisher =& headPublisher::getSingleton();
             $oHeadPublisher->addScriptCode($mainPanelScript);
             break;
         case 'blank':
             print ' ';
             break;
         case 'varform':
             global $G_FORM;
             $G_FORM = new Form();
             G::LoadSystem("varform");
             $xml = new varForm();
             //$xml->parseFile (  );
             $xml->renderForm($G_FORM, $Part['File']);
             $G_FORM->Values = $Part['Data'];
             $G_FORM->SetUp($Part['Target']);
             $G_FORM->width = 500;
             break;
         case 'table':
             $G_TMP_TARGET = $Part['Target'];
             $G_TABLE = G::LoadRawTable($Part['File'], $this->dbc, $Part['Data']);
             break;
         case 'menu':
             $G_TMP_TARGET = $Part['Target'];
             $G_OP_MENU = new Menu();
             $G_OP_MENU->Load($Part['File']);
             break;
         case 'smarty':
             //To do: Please check it 26/06/07
             $template = new Smarty();
             $template->compile_dir = PATH_SMARTY_C;
             $template->cache_dir = PATH_SMARTY_CACHE;
             $template->config_dir = PATH_THIRDPARTY . 'smarty/configs';
             $template->caching = false;
             $dataArray = $Part['Data'];
             // verify if there are templates folders registered, template and method folders are the same
             $folderTemplate = explode('/', $Part['Template']);
             $oPluginRegistry =& PMPluginRegistry::getSingleton();
             if ($oPluginRegistry->isRegisteredFolder($folderTemplate[0])) {
                 $template->templateFile = PATH_PLUGINS . $Part['Template'] . '.html';
             } else {
                 $template->templateFile = PATH_TPL . $Part['Template'] . '.html';
             }
             // last change to load the template, maybe absolute path was given
             if (!is_file($template->templateFile)) {
                 $template->templateFile = strpos($Part['Template'], '.html') !== false ? $Part['Template'] : $Part['Template'] . '.html';
             }
             //assign the variables and use the template $template
             $template->assign($dataArray);
             print $template->fetch($template->templateFile);
             break;
         case 'template':
             //To do: Please check it 26/06/07
             if (gettype($Part['Data']) == 'array') {
                 G::LoadSystem('template');
                 //template phpBB
                 $template = new Template();
                 $template->set_filenames(array('body' => $Part['Template'] . '.html'));
                 $dataArray = $Part['Data'];
                 if (is_array($dataArray)) {
                     foreach ($dataArray as $key => $val) {
                         if (is_array($val)) {
                             foreach ($val as $key_val => $val_array) {
                                 $template->assign_block_vars($key, $val_array);
                             }
                         } else {
                             $template->assign_vars(array($key => $val));
                         }
                     }
                 }
                 $template->pparse('body');
             }
             if (gettype($Part['Data']) == 'object' && strtolower(get_class($Part['Data'])) == 'templatepower') {
                 $Part['Data']->printToScreen();
             }
             return;
             break;
         case 'view':
         case 'content':
             //check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
             $aux = explode(PATH_SEP, $Part['Template']);
             if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) {
                 //if the template doesn't exists, then try it with the plugins folders, after the normal Template
                 $userTemplate = G::ExpandPath('templates') . $Part['Template'];
                 $globalTemplate = PATH_TEMPLATE . $Part['Template'];
                 if (!is_file($userTemplate) && !is_file($globalTemplate)) {
                     $oPluginRegistry =& PMPluginRegistry::getSingleton();
                     if ($oPluginRegistry->isRegisteredFolder($aux[0])) {
                         $pluginTemplate = PATH_PLUGINS . $Part['Template'] . '.php';
                         include $pluginTemplate;
                     }
                 }
             }
             break;
         case 'graphLayout':
             //Added by JHL to render GraphLayout component
             $G_OBJGRAPH = $Part['Data'];
             $G_TMP_TARGET = $Part['Target'];
             $G_TMP_FILE = $Part['File'];
             break;
     }
     //krumo( $Part['Template'] );
     //check if this LoadTemplate is used, byOnti 12th Aug 2008
     G::LoadTemplate($Part['Template']);
     $G_TABLE = null;
 }
Example #22
0
     // the "no photo yet" feature
     $template = new Template(PHPWG_ROOT_PATH . 'themes', $user['theme']);
     if (isset($_GET['no_photo_yet'])) {
         if ('browse' == $_GET['no_photo_yet']) {
             $_SESSION['no_photo_yet'] = 'browse';
             redirect(make_index_url());
             exit;
         }
         if ('deactivate' == $_GET['no_photo_yet']) {
             conf_update_param('no_photo_yet', 'false');
             redirect(make_index_url());
             exit;
         }
     }
     header('Content-Type: text/html; charset=' . get_pwg_charset());
     $template->set_filenames(array('no_photo_yet' => 'no_photo_yet.tpl'));
     if (is_admin()) {
         $url = $conf['no_photo_yet_url'];
         if (substr($url, 0, 4) != 'http') {
             $url = get_root_url() . $url;
         }
         $template->assign(array('step' => 2, 'intro' => l10n('Hello %s, your Piwigo photo gallery is empty!', $user['username']), 'next_step_url' => $url, 'deactivate_url' => get_root_url() . '?no_photo_yet=deactivate'));
     } else {
         $template->assign(array('step' => 1, 'U_LOGIN' => 'identification.php', 'deactivate_url' => get_root_url() . '?no_photo_yet=browse'));
     }
     trigger_notify('loc_end_no_photo_yet');
     $template->pparse('no_photo_yet');
     exit;
 } else {
     conf_update_param('no_photo_yet', 'false');
 }
Example #23
0
			if (count($comunicados)>0){
				header("Location: comunicado.lista.aluno.php?filtro=obrigatorio");
				exit;
			}
		}
	}


	include_once "class/Easy_Mail.class.php";


	include_once "class/class.Erro.php"; 
		
	$theme = ".";
	$model = new Template($theme);
	$model->set_filenames(array('cabecalho' => 'cabecalho.htm'));

	$model->assign_block_vars('sub_titulo', array());  
	if (isset($layout)){
		switch ($layout){
				case "inicio": 
						$model->assign_vars(array('SUB_MENU_ATIVO' => "1"));		
//						$model->assign_vars(array('MENU_1' => "current"));								
//						$model->assign_block_vars('sub_titulo.sub_cadastro', array());  
						break;
				case "cadastro": 
						$model->assign_vars(array('SUB_MENU_ATIVO' => "2"));		
//						$model->assign_vars(array('MENU_1' => "current"));								
//						$model->assign_block_vars('sub_titulo.sub_cadastro', array());  
						break;						
				case "movimento": 
Example #24
0
        Authentication::suspendUser($_POST['user']);
        $successAlert = 1;
    }
    // Deal with unban form
    if ($_GET['action'] == 'unban' && isset($_POST['unbanID'])) {
        Authentication::reinstateUser($_POST['unbanID']);
        $successAlert = 1;
    }
    if ($_GET['action'] == 'deactivate' && isset($_POST['uid'])) {
        Authentication::deactivateUser($_POST['uid']);
        $successAlert = 1;
    }
}
$sqlSuspend = "SELECT * FROM `users` WHERE `suspended` = '0'";
$resultSuspend = openRailwayCore::dbQuery($sqlSuspend);
$sqlReinstate = "SELECT * FROM `users` WHERE `suspended` = '1'";
$resultReinstate = openRailwayCore::dbQuery($sqlReinstate);
$main = new Template();
$main->set_custom_template("includes/", 'default');
$main->assign_var('ROOT', ROOT);
while ($accountSuspend = mysql_fetch_assoc($resultSuspend)) {
    $main->assign_block_vars('user_loop', array('UID' => $accountSuspend['user_id'], 'NAME' => $accountSuspend['username'], 'SID' => $accountSuspend['staff_id']));
}
while ($accountReinstate = mysql_fetch_assoc($resultReinstate)) {
    $main->assign_block_vars('user_sus_loop', array('UID' => $accountReinstate['user_id'], 'NAME' => $accountReinstate['username'], 'SID' => $accountReinstate['staff_id']));
}
if (mysql_num_rows($resultReinstate) == 0) {
    $main->assign_block_vars('if_no_results', array());
}
$main->set_filenames(array('main' => "usr_ban.html"));
$main->display('main');
Example #25
0
    header('500 Internal Server Error');
    header('Content-type: text/html; charset=utf-8');
    $template->pparse('root');
    exit(1);
}
// Identification de l'utilisateur
$utilisateur = new Utilisateur();
// Choix du module
if (isset($_GET['mod'])) {
    $mod = $_GET['mod'];
} else {
    $mod = 'index';
}
// Initialisation du moteur de template
$template = new Template('data/templates/' . $utilisateur->template());
$template->set_filenames(array('root' => 'root.tpl', 'index' => 'index.tpl', 'projet' => 'projet.tpl', 'edit_projet' => 'edit_projet.tpl', 'liste_projets' => 'liste_projets.tpl', 'demande' => 'demande.tpl', 'edit_demande' => 'edit_demande.tpl', 'liste_demandes' => 'liste_demandes.tpl', 'versions' => 'versions.tpl', 'connexion' => 'connexion.tpl', 'deconnexion' => 'deconnexion.tpl', 'perso' => 'perso.tpl', 'admin' => 'admin.tpl', 'edit_user' => 'edit_user.tpl'));
$template->set_rootdir('inc');
$template->set_filenames(array('rss' => 'rss.tpl'));
// Fonction d'erreur utilisant le template
$erreur = false;
function erreur_fatale($msg)
{
    global $template;
    $template->assign_block_vars('MSG_ERREUR', array('DESCR' => $msg));
    header('Content-type: text/html; charset=utf-8');
    $template->pparse('root');
    exit(0);
}
// Variables globales, ie communes à tous les modules
$template->assign_var('TITRE', $conf['titre']);
$template->assign_var('TEMPLATE_URL', 'data/templates/' . $utilisateur->template());
 public function getFormComment($type, $idEvenement)
 {
     $t = new Template('modules/archi/templates/');
     $t->set_filenames(array('listeCommentaires' => 'comment/comment.tpl'));
     ob_start();
     $t->pparse('listeCommentaires');
     $html .= ob_get_contents();
     ob_end_clean();
     return $html;
 }
Example #27
0
<?php

// deuxième page
include 'include_dao.php';
session_start();
// on precise le repertoire ou se trouve les fichiers templates et le répèrtoire ou on met les fichiers compilés (cache)
$template = new Template('template', 'cache');
$template->assign_var('LOG', FALSE);
$template->assign_var('LICENCE', FALSE);
// on precise la variable langage
$template->set_language_var($lang);
page_header('Gérer mes licences', 'Gérer mes licences', 'GERERLICENCES');
page_footer();
$template->set_filenames(array('body' => 'gererlicence.html'));
$adherents = new AdherentMySqlDAO();
if (isset($_SESSION['Nom'])) {
    $template->assign_var('LOG', TRUE);
    $adherentsQuery = $adherents->queryByIdDemandeur($_SESSION['idDemandeur']);
    if (is_null($adherentsQuery) == false) {
        $template->assign_var('LICENCE', TRUE);
        $clubs = new ClubMySqlDAO();
        $clubQuery = $clubs->queryAll();
        $ligue = new LigueMySqlDAO();
        $ligueQuery = $ligue->queryAll();
        foreach ($adherentsQuery as $key => $value) {
            $template->assign_block_vars('adherents', array('ID' => $value->idAdherent, 'NOM' => $value->nom, 'PRENOM' => $value->prenom, 'CLUB' => $clubQuery[$value->idCLub - 1]->nom, 'LIGUE' => $ligueQuery[$clubQuery[$value->idCLub - 1]->idLigue - 1]->libelle, 'NUMLICENCE' => $value->numLicence, 'ID' => $value->idAdherent));
        }
    } else {
        $template->assign_var('MESSAGE', "Aucune licence enregistrée, veuillez vous rendre <a href='ajouterlicence.php'>ici</a> afin d'en ajouter une.");
    }
} else {
Example #28
0
            $hosts[] = $file;
        }
    }
}
if (extension_loaded('Reflection') && $debug == 'true') {
    $dbg_msg .= show_info('dummy', 0);
}
/*
*  Finish up the html with the description of the message classifications
*/
if ($legend == 'true') {
    $legend_msg = "<table style=\"font-size:x-small;\" cellpadding=0 border=0 cellspacing=0>\n\t<tr>\n\t\t<td><b><font color=green>Passed CLEAN</font></b>:</td><td>&nbsp;&nbsp;</td><td>clean or '\$tag_level' &lt; '\$tag2_level'</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=green>Passed SPAM</font></b>:</td><td></td><td>classified as SPAM but delivered because '\$tag_level' &lt; '\$kill_level'</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=green>Passed BANNED</font></b>:</td><td></td><td>classified as BANNED but delivered</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=green>Passed BAD-HEADER</font></b>:</td><td></td><td>classified as BAD-HEADER but delivered</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked SPAM</font></b>:</td><td></td><td>not delivered, spam classified with '\$tag_level' &gt;= '\$kill_level' and '\$final_spam_destiny' != 'pass'</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked BANNED</font></b>:</td><td></td><td>not delivered, banned file extension attached.</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked BAD-HEADER</font></b>:</td><td></td><td>not delivered, contains bad headers.</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked INFECTED</font></b>:</td><td></td><td>not delivered, contains virus</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Not Delivered</font></b>:</td><td></td><td>could not be delivered, e.g. destination host refuses to accept delivery.</td>\n\t</tr>\n</table>\n";
}
$template = new Template($as_root_path . $template_path);
$template->assign_vars(array("PAGE_TITLE" => $title));
$template->set_filenames(array('body' => 'index_body.tpl'));
$template->assign_vars(array('S_CONTENT_DIRECTION' => 'ltr', 'S_CONTENT_ENCODING' => 'iso-8859-1', 'RATE' => $rate, 'META_REFRESH' => $refresh && is_numeric($refresh) && $refresh > 0 ? "<meta http-equiv=\"refresh\" content=\"{$refresh}\">" : NULL, 'REFRESH' => $refresh && is_numeric($refresh) && $refresh > 0 ? $refresh : 0, 'LEGEND' => $legend, 'LEGEND_MSG' => $legend_msg, 'SPAN' => $span, 'PGRAPH' => asLoadStats($host) ? asPGraph("{$imgdir}/passed-{$span}.png", $now, $span) : "No statistics available.", 'VGRAPH' => asLoadStats($host) ? asVGraph("{$imgdir}/virus-{$span}.png", $now, $span) : "No statistics available.", 'SBGRAPH' => asLoadStats($host) ? asSBGraph("{$imgdir}/sb-{$span}.png", $now, $span) : "No statistics available.", 'VERSION' => $as_version, 'OUT_MSG' => $out_msg ? $out_msg : '', 'DBG_MSG' => $dbg_msg ? $dbg_msg : '', "PAGE_TITLE" => $title, 'HOST' => $host));
$template->assign_block_vars("time_date_row", array("CURRENT_DATE" => strftime("%A %B %d %H:%M:%S (GMT%z)", time())));
$template->assign_block_vars("button_row", array("BUTTON" => $debug != 'true' ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug=true&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=debug\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug=false&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=nodebug\"></a>"));
$template->assign_block_vars("button_row", array("BUTTON" => $rate != 3600 ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate=3600&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=hour\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate=60&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=min\"></a>"));
$button_text = array('daily', 'weekly', 'monthly', 'yearly');
for ($i = 0; $i < count($button_text); $i++) {
    $template->assign_block_vars("button_row", array("BUTTON" => $span != $button_text[$i] ? "<a href=\"{$me}?host={$host}&span={$button_text[$i]}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=" . $button_text[$i] . "\"></a>" : "<img src=\"{$me}?text=" . $button_text[$i] . "&button={$button_selected}\">"));
}
if (!$host_list) {
    $template->assign_block_vars("button_row", array("BUTTON" => $legend != 'true' ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=true\"><img src=\"{$me}?button={$button_unselected}&text=legend\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=false\"><img src=\"{$me}?button={$button_selected}&text=legend\"></a>"));
} else {
    $template->assign_block_vars('hostlist_row', array());
    $template->assign_block_vars("hostlist_row.button_row2", array("BUTTON" => $legend != 'true' ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=true\"><img src=\"{$me}?button={$button_unselected}&text=legend\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=false\"><img src=\"{$me}?button={$button_unselected}&text=nolegend\"></a>"));
    $template->assign_block_vars("hostlist_row.button_row2", array("BUTTON" => $host ? "<a href=\"{$me}?host=&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=ALL\"></a>" : "<img src=\"{$me}?text=ALL&button={$button_selected}\">"));
    $cnt = 1;
Example #29
0
            }
        }
    }
}
define('PHPWG_URL', 'http://' . PHPWG_DOMAIN);
load_language('common.lang', '', array('language' => $language, 'target_charset' => 'utf-8'));
load_language('admin.lang', '', array('language' => $language, 'target_charset' => 'utf-8'));
load_language('install.lang', '', array('language' => $language, 'target_charset' => 'utf-8'));
header('Content-Type: text/html; charset=UTF-8');
//------------------------------------------------- check php version
if (version_compare(PHP_VERSION, REQUIRED_PHP_VERSION, '<')) {
    include PHPWG_ROOT_PATH . 'install/php5_apache_configuration.php';
}
//----------------------------------------------------- template initialization
$template = new Template(PHPWG_ROOT_PATH . 'admin/themes', 'clear');
$template->set_filenames(array('install' => 'install.tpl'));
if (!isset($step)) {
    $step = 1;
}
//---------------------------------------------------------------- form analyze
include PHPWG_ROOT_PATH . 'include/dblayer/functions_' . $dblayer . '.inc.php';
include PHPWG_ROOT_PATH . 'admin/include/functions_install.inc.php';
include PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php';
if (isset($_POST['install'])) {
    install_db_connect($infos, $errors);
    pwg_db_check_charset();
    $webmaster = trim(preg_replace('/\\s{2,}/', ' ', $admin_name));
    if (empty($webmaster)) {
        $errors[] = l10n('enter a login for webmaster');
    } else {
        if (preg_match('/[\'"]/', $webmaster)) {
Example #30
0
<?php

/**
 *
 *
 * @version $Id$
 * @copyright 2009
 */
require_once 'config.php';
require_once 'common.php';
require_once 'includes/template.php';
require_once 'includes/geshi.php';
connect($DBHost, $DBUser, $DBPass, $DBTable);
$template = new Template('themes/' . $DESIGN . '/templates');
/* Declaration du haut et du bas de page, ainsi que de leurs variables */
$template->set_filenames(array('header' => 'header.tpl', 'footer' => 'footer.tpl'));
$template->assign_vars(array('TITRE' => $SiteName, 'CSS' => 'themes/' . $DESIGN . '/style.css', 'SUBTITRE' => $Slogan, 'COPYRIGHT' => $Copyright));
/* Affichage du haut de page */
$template->pparse('header');
/* Declaration et affichage du menu, ainsi que de ses variables */
$template->set_filenames(array('menu' => 'menu.tpl'));
RecupMenu($template);
$template->pparse('menu');
$template->set_filenames(array('index' => 'index.tpl'));
/* Affichage du contenu de la page */
if (!empty($_GET['page']) and $_GET['page'] != 'index') {
    include 'pages/' . $_GET['page'] . '.php';
} else {
    $template->set_filenames(array('news' => 'news.tpl'));
    RecupNews($template);
    $template->assign_var_from_handle('CONTENU', 'news');