コード例 #1
0
<?php

include "../../../framework/framework.php";
// Define page specific text for template
$module = "contact";
template_init(4);
template_define_elements();
ob_start();
//Include Form
//	print "SELECT SUM(spese_imponibili) as simp, SUM(spese_non_imponibili) as snimp, SUM(diritti) as dir, SUM(onorari) as onor, SUM(on_onorari) as onor_or, SUM(on_utente) as onor_ut, SUM(acconti) as acco, SUM(anticipazioni) as anti FROM prestazioni m, pratiche p WHERE m.ref_id=p.id AND p.pr_ref_idcliente=".$_GET[id];
$rs = $DB->Execute("SELECT COUNT(DISTINCT m.ref_id) as tot_prats, COUNT(m.id) as tot_prests, SUM(spese_imponibili) as simp, SUM(spese_non_imponibili) as snimp, SUM(diritti) as dir, SUM(onorari) as onor, SUM(on_onorari) as onor_or, SUM(on_utente) as onor_ut, SUM(acconti) as acco, SUM(anticipazioni) as anti FROM prestazioni m, pratiche p WHERE m.ref_id=p.id AND p.pr_ref_idcliente=" . $_GET[id]);
$tot = $rs->FetchRow();
//Search for billing done
$cnt = 0;
$rs3 = $DB->Execute("SELECT DISTINCT nota1,nota2 FROM prestazioni m, pratiche p WHERE m.ref_id=p.id AND p.pr_ref_idcliente=" . $_GET[id] . " AND nota1 <> '' AND nota2 <> ''");
while (!$rs3->EOF) {
    if ($cnt > 0) {
        $billem .= ", ";
    }
    $nota_emessa = $rs3->FetchRow();
    $billem .= $nota_emessa[nota1] . '/' . $nota_emessa[nota2];
    $cnt++;
}
//Search for fatture done
$cnt = 0;
$rs2 = $DB->Execute("SELECT * FROM contact WHERE id=" . $_GET[id]);
$cont = $rs2->FetchRow();
$tot[billem] = $billem;
$tot[fattem] = $fattem;
$tot[codice] = $cont[codice];
$tot[nome] = $cont[nome];
コード例 #2
0
        }
        if (!function_exists('nav')) {
            function nav()
            {
            }
        }
        if (!function_exists('page_footer')) {
            function page_footer()
            {
            }
        }
        if (!function_exists('document_close')) {
            function document_close()
            {
            }
        }
        //now we load the execute the page
        template_init();
    }
} elseif ($ajax) {
    /* ajax request, we're just going to be responding with a json string */
    page();
} elseif ($post) {
    /* this is a POST */
    page();
} elseif ($template == '') {
    print "No template or page function defined for this url.";
} else {
    die("Not sure how you got here.");
}
page_cleanup();
コード例 #3
0
ファイル: main.php プロジェクト: HadoDokis/knomos-plus
$fltInCorso = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_filter.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=0&type[]=&type_app[]=&note=&send=Cerca&fltr=incorso";
$fltRiserva = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_filter.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=1&type[]=&type_app[]=&note=&send=Cerca&fltr=inriserva";
$fltCompletato = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_filter.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=2&type[]=&type_app[]=&note=&send=Cerca&fltr=completati";
$fltDaAggiornare = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_filter.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=3&type[]=&type_app[]=&note=&send=Cerca&fltr=daaggiornare";
$fltProvvedimenti = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_filter.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=&type[]=2&type_app[]=&note=&send=Cerca&fltr=provvedimenti";
$fltNote = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_filter.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=&type[]=3&type_app[]=&note=&send=Cerca&fltr=note";
$PAGE[PAGE_PICTITLE] = "ico_home_med.gif";
$PAGE_ELEMENT[PAGE][1][0][func] = "pratiche_element_1";
$PAGE_ELEMENT[PAGE][2][0][func] = "calendar_element_2";
$PAGE_ELEMENT[PAGE][3][0][func] = "contact_element_1";
$Select = ' |&nbsp;&nbsp;<span > Filtra gli impegni per: ' . "<select name='SelZoho' id='SelZoho' size='1' onchange='location.href=value'  onFocus=(this.className='campo-focus-02') onBlur=(this.className='null') >\r\n\t\t<option selected='selected' value=''>Selezionare il filtro</option>\r\n\t\t<option value='{$fltInCorso}'>Dinamica: In corso</option>\r\n\t\t<option value='{$fltRiserva}'>Dinamica: Riserva / In attesa</option>\r\n\t\t<option value='{$fltCompletato}'>Dinamica: Completato</option>\r\n\t\t<option value='{$fltDaAggiornare}'>Dinamica: Da aggiornare</option>\r\n\t\t<option value='{$fltProvvedimenti}'>Tipo: Provvedimenti</option>\r\n\t\t<option value='{$fltNote}'>Tipo: Note</option>\r\n\t\t<option value='{$flt0gg}'>Planning: giornaliero (oggi)</option>\r\n\t\t<option value='{$flt1gg}'>Planning: domani</option>\r\n\t\t<option value='{$flt2gg}'>Planning: oggi e domani</option>\r\n\t\t<option value='{$flt7gg}'>Planning: settimanale</option>\r\n\t\t<option value='{$flt30gg}'>Planning: mensile</option>\r\n\t\t</option>\r\n\t\t</select></span >";
//URLS FOR SCADENZE
$url1 = make_url(array("scad_type" => 1), 1);
$url2 = make_url(array("scad_type" => 2), 1);
$url3 = make_url(array("scad_type" => 3), 1);
if ($_GET[scad_type] == 1) {
    $PAGE[TXT_SCADLINK] = CALENDAR_APPS . ' | <a href="' . $url2 . '">' . CALENDAR_SCADS . '</a> | <a href="' . $url3 . '">' . FW_ALL . '</a>' . $Select;
} elseif ($_GET[scad_type] == 2) {
    $PAGE[TXT_SCADLINK] = '<a href="' . $url1 . '">' . CALENDAR_APPS . '</a> | ' . CALENDAR_SCADS . ' | <a href="' . $url3 . '">' . FW_ALL . '</a>' . $Select;
} else {
    $PAGE[TXT_SCADLINK] = '<a href="' . $url1 . '">' . CALENDAR_APPS . '</a> | <a href="' . $url2 . '">' . CALENDAR_SCADS . '</a> | ' . FW_ALL . $Select;
}
if ($_SESSION[mobile] == true) {
    template_init(5);
    //mobile=5 - normale=2
} else {
    template_init(2);
    //mobile=5 - normale=2
}
template_define_elements();
final_render();
コード例 #4
0
ファイル: Load.php プロジェクト: KeiroD/Elkarte
/**
 * Load a theme, by ID.
 *
 * What it does:
 * - identify the theme to be loaded.
 * - validate that the theme is valid and that the user has permission to use it
 * - load the users theme settings and site setttings into $options.
 * - prepares the list of folders to search for template loading.
 * - identify what smiley set to use.
 * - sets up $context['user']
 * - detects the users browser and sets a mobile friendly enviroment if needed
 * - loads default JS variables for use in every theme
 * - loads default JS scripts for use in every theme
 *
 * @param int $id_theme = 0
 * @param bool $initialize = true
 */
function loadTheme($id_theme = 0, $initialize = true)
{
    global $user_info, $user_settings, $board_info;
    global $txt, $boardurl, $scripturl, $mbname, $modSettings;
    global $context, $settings, $options, $ssi_theme;
    $db = database();
    // The theme was specified by parameter.
    if (!empty($id_theme)) {
        $id_theme = (int) $id_theme;
    } elseif (!empty($_REQUEST['theme']) && (!empty($modSettings['theme_allow']) || allowedTo('admin_forum'))) {
        $id_theme = (int) $_REQUEST['theme'];
        $_SESSION['id_theme'] = $id_theme;
    } elseif (!empty($_SESSION['id_theme']) && (!empty($modSettings['theme_allow']) || allowedTo('admin_forum'))) {
        $id_theme = (int) $_SESSION['id_theme'];
    } elseif (!empty($user_info['theme']) && !isset($_REQUEST['theme']) && (!empty($modSettings['theme_allow']) || allowedTo('admin_forum'))) {
        $id_theme = $user_info['theme'];
    } elseif (!empty($board_info['theme'])) {
        $id_theme = $board_info['theme'];
    } else {
        $id_theme = $modSettings['theme_guests'];
    }
    // Verify the id_theme... no foul play.
    // Always allow the board specific theme, if they are overriding.
    if (!empty($board_info['theme']) && $board_info['override_theme']) {
        $id_theme = $board_info['theme'];
    } elseif (!empty($ssi_theme) && $id_theme == $ssi_theme) {
        $id_theme = (int) $id_theme;
    } elseif (!empty($modSettings['knownThemes']) && !allowedTo('admin_forum')) {
        $themes = explode(',', $modSettings['knownThemes']);
        if (!in_array($id_theme, $themes)) {
            $id_theme = $modSettings['theme_guests'];
        } else {
            $id_theme = (int) $id_theme;
        }
    } else {
        $id_theme = (int) $id_theme;
    }
    $member = empty($user_info['id']) ? -1 : $user_info['id'];
    // Do we already have this members theme data and specific options loaded (for agressive cache settings)
    if (!empty($modSettings['cache_enable']) && $modSettings['cache_enable'] >= 2 && ($temp = cache_get_data('theme_settings-' . $id_theme . ':' . $member, 60)) != null && time() - 60 > $modSettings['settings_updated']) {
        $themeData = $temp;
        $flag = true;
    } elseif (($temp = cache_get_data('theme_settings-' . $id_theme, 90)) != null && time() - 60 > $modSettings['settings_updated']) {
        $themeData = $temp + array($member => array());
    } else {
        $themeData = array(-1 => array(), 0 => array(), $member => array());
    }
    if (empty($flag)) {
        // Load variables from the current or default theme, global or this user's.
        $result = $db->query('', '
			SELECT variable, value, id_member, id_theme
			FROM {db_prefix}themes
			WHERE id_member' . (empty($themeData[0]) ? ' IN (-1, 0, {int:id_member})' : ' = {int:id_member}') . '
				AND id_theme' . ($id_theme == 1 ? ' = {int:id_theme}' : ' IN ({int:id_theme}, 1)'), array('id_theme' => $id_theme, 'id_member' => $member));
        // Pick between $settings and $options depending on whose data it is.
        while ($row = $db->fetch_assoc($result)) {
            // There are just things we shouldn't be able to change as members.
            if ($row['id_member'] != 0 && in_array($row['variable'], array('actual_theme_url', 'actual_images_url', 'base_theme_dir', 'base_theme_url', 'default_images_url', 'default_theme_dir', 'default_theme_url', 'default_template', 'images_url', 'number_recent_posts', 'smiley_sets_default', 'theme_dir', 'theme_id', 'theme_layers', 'theme_templates', 'theme_url'))) {
                continue;
            }
            // If this is the theme_dir of the default theme, store it.
            if (in_array($row['variable'], array('theme_dir', 'theme_url', 'images_url')) && $row['id_theme'] == '1' && empty($row['id_member'])) {
                $themeData[0]['default_' . $row['variable']] = $row['value'];
            }
            // If this isn't set yet, is a theme option, or is not the default theme..
            if (!isset($themeData[$row['id_member']][$row['variable']]) || $row['id_theme'] != '1') {
                $themeData[$row['id_member']][$row['variable']] = substr($row['variable'], 0, 5) == 'show_' ? $row['value'] == '1' : $row['value'];
            }
        }
        $db->free_result($result);
        // Set the defaults if the user has not chosen on their own
        if (!empty($themeData[-1])) {
            foreach ($themeData[-1] as $k => $v) {
                if (!isset($themeData[$member][$k])) {
                    $themeData[$member][$k] = $v;
                }
            }
        }
        // If being aggressive we save the site wide and member theme settings
        if (!empty($modSettings['cache_enable']) && $modSettings['cache_enable'] >= 2) {
            cache_put_data('theme_settings-' . $id_theme . ':' . $member, $themeData, 60);
        } elseif (!isset($temp)) {
            cache_put_data('theme_settings-' . $id_theme, array(-1 => $themeData[-1], 0 => $themeData[0]), 90);
        }
    }
    $settings = $themeData[0];
    $options = $themeData[$member];
    $settings['theme_id'] = $id_theme;
    $settings['actual_theme_url'] = $settings['theme_url'];
    $settings['actual_images_url'] = $settings['images_url'];
    $settings['actual_theme_dir'] = $settings['theme_dir'];
    $settings['template_dirs'] = array();
    // This theme first.
    $settings['template_dirs'][] = $settings['theme_dir'];
    // Based on theme (if there is one).
    if (!empty($settings['base_theme_dir'])) {
        $settings['template_dirs'][] = $settings['base_theme_dir'];
    }
    // Lastly the default theme.
    if ($settings['theme_dir'] != $settings['default_theme_dir']) {
        $settings['template_dirs'][] = $settings['default_theme_dir'];
    }
    if (!$initialize) {
        return;
    }
    // Check to see if they're accessing it from the wrong place.
    if (isset($_SERVER['HTTP_HOST']) || isset($_SERVER['SERVER_NAME'])) {
        $detected_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https://' : 'http://';
        $detected_url .= empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST'];
        $temp = preg_replace('~/' . basename($scripturl) . '(/.+)?$~', '', strtr(dirname($_SERVER['PHP_SELF']), '\\', '/'));
        if ($temp != '/') {
            $detected_url .= $temp;
        }
    }
    if (isset($detected_url) && $detected_url != $boardurl) {
        // Try #1 - check if it's in a list of alias addresses.
        if (!empty($modSettings['forum_alias_urls'])) {
            $aliases = explode(',', $modSettings['forum_alias_urls']);
            foreach ($aliases as $alias) {
                // Rip off all the boring parts, spaces, etc.
                if ($detected_url == trim($alias) || strtr($detected_url, array('http://' => '', 'https://' => '')) == trim($alias)) {
                    $do_fix = true;
                }
            }
        }
        // Hmm... check #2 - is it just different by a www?  Send them to the correct place!!
        if (empty($do_fix) && strtr($detected_url, array('://' => '://www.')) == $boardurl && (empty($_GET) || count($_GET) == 1) && ELK != 'SSI') {
            // Okay, this seems weird, but we don't want an endless loop - this will make $_GET not empty ;).
            if (empty($_GET)) {
                redirectexit('wwwRedirect');
            } else {
                list($k, $v) = each($_GET);
                if ($k != 'wwwRedirect') {
                    redirectexit('wwwRedirect;' . $k . '=' . $v);
                }
            }
        }
        // #3 is just a check for SSL...
        if (strtr($detected_url, array('https://' => 'http://')) == $boardurl) {
            $do_fix = true;
        }
        // Okay, #4 - perhaps it's an IP address?  We're gonna want to use that one, then. (assuming it's the IP or something...)
        if (!empty($do_fix) || preg_match('~^http[s]?://(?:[\\d\\.:]+|\\[[\\d:]+\\](?::\\d+)?)(?:$|/)~', $detected_url) == 1) {
            // Caching is good ;).
            $oldurl = $boardurl;
            // Fix $boardurl and $scripturl.
            $boardurl = $detected_url;
            $scripturl = strtr($scripturl, array($oldurl => $boardurl));
            $_SERVER['REQUEST_URL'] = strtr($_SERVER['REQUEST_URL'], array($oldurl => $boardurl));
            // Fix the theme urls...
            $settings['theme_url'] = strtr($settings['theme_url'], array($oldurl => $boardurl));
            $settings['default_theme_url'] = strtr($settings['default_theme_url'], array($oldurl => $boardurl));
            $settings['actual_theme_url'] = strtr($settings['actual_theme_url'], array($oldurl => $boardurl));
            $settings['images_url'] = strtr($settings['images_url'], array($oldurl => $boardurl));
            $settings['default_images_url'] = strtr($settings['default_images_url'], array($oldurl => $boardurl));
            $settings['actual_images_url'] = strtr($settings['actual_images_url'], array($oldurl => $boardurl));
            // And just a few mod settings :).
            $modSettings['smileys_url'] = strtr($modSettings['smileys_url'], array($oldurl => $boardurl));
            $modSettings['avatar_url'] = strtr($modSettings['avatar_url'], array($oldurl => $boardurl));
            // Clean up after loadBoard().
            if (isset($board_info['moderators'])) {
                foreach ($board_info['moderators'] as $k => $dummy) {
                    $board_info['moderators'][$k]['href'] = strtr($dummy['href'], array($oldurl => $boardurl));
                    $board_info['moderators'][$k]['link'] = strtr($dummy['link'], array('"' . $oldurl => '"' . $boardurl));
                }
            }
            foreach ($context['linktree'] as $k => $dummy) {
                $context['linktree'][$k]['url'] = strtr($dummy['url'], array($oldurl => $boardurl));
            }
        }
    }
    // Set up the contextual user array.
    $context['user'] = array('id' => $user_info['id'], 'is_logged' => !$user_info['is_guest'], 'is_guest' => &$user_info['is_guest'], 'is_admin' => &$user_info['is_admin'], 'is_mod' => &$user_info['is_mod'], 'is_moderator' => &$user_info['is_moderator'], 'can_mod' => allowedTo('access_mod_center') || !$user_info['is_guest'] && ($user_info['mod_cache']['gq'] != '0=1' || $user_info['mod_cache']['bq'] != '0=1' || $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap'])), 'username' => $user_info['username'], 'language' => $user_info['language'], 'email' => $user_info['email'], 'ignoreusers' => $user_info['ignoreusers']);
    // Something for the guests
    if (!$context['user']['is_guest']) {
        $context['user']['name'] = $user_info['name'];
    } elseif ($context['user']['is_guest'] && !empty($txt['guest_title'])) {
        $context['user']['name'] = $txt['guest_title'];
    }
    // Set up some additional interface preference context
    $context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
    if (!$user_info['is_guest']) {
        $context['minmax_preferences'] = !empty($options['minmax_preferences']) ? unserialize($options['minmax_preferences']) : array();
    } elseif ($user_info['is_guest'] && isset($_COOKIE['upshrink'])) {
        $context['minmax_preferences'] = array('upshrink' => $_COOKIE['upshrink']);
    }
    // Determine the current smiley set.
    $user_info['smiley_set'] = !in_array($user_info['smiley_set'], explode(',', $modSettings['smiley_sets_known'])) && $user_info['smiley_set'] != 'none' || empty($modSettings['smiley_sets_enable']) ? !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'] : $user_info['smiley_set'];
    $context['user']['smiley_set'] = $user_info['smiley_set'];
    // Some basic information...
    if (!isset($context['html_headers'])) {
        $context['html_headers'] = '';
    }
    if (!isset($context['links'])) {
        $context['links'] = array();
    }
    if (!isset($context['javascript_files'])) {
        $context['javascript_files'] = array();
    }
    if (!isset($context['css_files'])) {
        $context['css_files'] = array();
    }
    if (!isset($context['javascript_inline'])) {
        $context['javascript_inline'] = array('standard' => array(), 'defer' => array());
    }
    if (!isset($context['javascript_vars'])) {
        $context['javascript_vars'] = array();
    }
    $context['menu_separator'] = !empty($settings['use_image_buttons']) ? ' ' : ' | ';
    $context['session_var'] = $_SESSION['session_var'];
    $context['session_id'] = $_SESSION['session_value'];
    $context['forum_name'] = $mbname;
    $context['forum_name_html_safe'] = $context['forum_name'];
    $context['current_action'] = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
    $context['current_subaction'] = isset($_REQUEST['sa']) ? $_REQUEST['sa'] : null;
    $context['can_register'] = empty($modSettings['registration_method']) || $modSettings['registration_method'] != 3;
    foreach (array('theme_header', 'upper_content') as $call) {
        if (!isset($context[$call . '_callbacks'])) {
            $context[$call . '_callbacks'] = array();
        }
    }
    // Set some permission related settings.
    if ($user_info['is_guest'] && !empty($modSettings['enableVBStyleLogin'])) {
        $context['show_login_bar'] = true;
        $context['theme_header_callbacks'][] = 'login_bar';
        loadJavascriptFile('sha256.js', array('defer' => true));
    }
    // This determines the server... not used in many places, except for login fixing.
    detectServer();
    // Detect the browser. This is separated out because it's also used in attachment downloads
    detectBrowser();
    // Set the top level linktree up.
    array_unshift($context['linktree'], array('url' => $scripturl, 'name' => $context['forum_name']));
    // This allows sticking some HTML on the page output - useful for controls.
    $context['insert_after_template'] = '';
    // Just some mobile-friendly settings
    if ($context['browser_body_id'] == 'mobile') {
        // Disable the preview text.
        $modSettings['message_index_preview'] = 0;
        // Force the usage of click menu instead of a hover menu.
        $options['use_click_menu'] = 1;
        // No space left for a sidebar
        $options['use_sidebar_menu'] = false;
        // Disable the search dropdown.
        $modSettings['search_dropdown'] = false;
    }
    if (!isset($txt)) {
        $txt = array();
    }
    $simpleActions = array('findmember', 'quickhelp', 'printpage', 'quotefast', 'spellcheck');
    call_integration_hook('integrate_simple_actions', array(&$simpleActions));
    // Output is fully XML, so no need for the index template.
    if (isset($_REQUEST['xml'])) {
        loadLanguage('index+Addons');
        // @todo added because some $settings in template_init are necessary even in xml mode. Maybe move template_init to a settings file?
        loadTemplate('index');
        loadTemplate('Xml');
        Template_Layers::getInstance()->removeAll();
    } elseif (!empty($_REQUEST['action']) && in_array($_REQUEST['action'], $simpleActions)) {
        loadLanguage('index+Addons');
        Template_Layers::getInstance()->removeAll();
    } else {
        // Custom templates to load, or just default?
        if (isset($settings['theme_templates'])) {
            $templates = explode(',', $settings['theme_templates']);
        } else {
            $templates = array('index');
        }
        // Load each template...
        foreach ($templates as $template) {
            loadTemplate($template);
        }
        // ...and attempt to load their associated language files.
        $required_files = implode('+', array_merge($templates, array('Addons')));
        loadLanguage($required_files, '', false);
        // Custom template layers?
        if (isset($settings['theme_layers'])) {
            $layers = explode(',', $settings['theme_layers']);
        } else {
            $layers = array('html', 'body');
        }
        $template_layers = Template_Layers::getInstance(true);
        foreach ($layers as $layer) {
            $template_layers->addBegin($layer);
        }
    }
    // Initialize the theme.
    if (function_exists('template_init')) {
        $settings = array_merge($settings, template_init());
    }
    // Call initialization theme integration functions.
    call_integration_hook('integrate_init_theme', array($id_theme, &$settings));
    // Guests may still need a name.
    if ($context['user']['is_guest'] && empty($context['user']['name'])) {
        $context['user']['name'] = $txt['guest_title'];
    }
    // Any theme-related strings that need to be loaded?
    if (!empty($settings['require_theme_strings'])) {
        loadLanguage('ThemeStrings', '', false);
    }
    // Load font Awesome fonts
    loadCSSFile('font-awesome.min.css');
    // We allow theme variants, because we're cool.
    $context['theme_variant'] = '';
    $context['theme_variant_url'] = '';
    if (!empty($settings['theme_variants'])) {
        // Overriding - for previews and that ilk.
        if (!empty($_REQUEST['variant'])) {
            $_SESSION['id_variant'] = $_REQUEST['variant'];
        }
        // User selection?
        if (empty($settings['disable_user_variant']) || allowedTo('admin_forum')) {
            $context['theme_variant'] = !empty($_SESSION['id_variant']) ? $_SESSION['id_variant'] : (!empty($options['theme_variant']) ? $options['theme_variant'] : '');
        }
        // If not a user variant, select the default.
        if ($context['theme_variant'] == '' || !in_array($context['theme_variant'], $settings['theme_variants'])) {
            $context['theme_variant'] = !empty($settings['default_variant']) && in_array($settings['default_variant'], $settings['theme_variants']) ? $settings['default_variant'] : $settings['theme_variants'][0];
        }
        // Do this to keep things easier in the templates.
        $context['theme_variant'] = '_' . $context['theme_variant'];
        $context['theme_variant_url'] = $context['theme_variant'] . '/';
        // The most efficient way of writing multi themes is to use a master index.css plus variant.css files.
        if (!empty($context['theme_variant'])) {
            loadCSSFile($context['theme_variant'] . '/index' . $context['theme_variant'] . '.css');
        }
    }
    // A bit lonely maybe, though I think it should be set up *after* teh theme variants detection
    $context['header_logo_url_html_safe'] = empty($settings['header_logo_url']) ? $settings['images_url'] . '/' . $context['theme_variant_url'] . 'logo_elk.png' : Util::htmlspecialchars($settings['header_logo_url']);
    // Allow overriding the board wide time/number formats.
    if (empty($user_settings['time_format']) && !empty($txt['time_format'])) {
        $user_info['time_format'] = $txt['time_format'];
    }
    if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'always') {
        $settings['theme_url'] = $settings['default_theme_url'];
        $settings['images_url'] = $settings['default_images_url'];
        $settings['theme_dir'] = $settings['default_theme_dir'];
    }
    // Make a special URL for the language.
    $settings['lang_images_url'] = $settings['images_url'] . '/' . (!empty($txt['image_lang']) ? $txt['image_lang'] : $user_info['language']);
    // Set a couple of bits for the template.
    $context['right_to_left'] = !empty($txt['lang_rtl']);
    $context['tabindex'] = 1;
    // RTL languages require an additional stylesheet.
    if ($context['right_to_left']) {
        loadCSSFile('rtl.css');
    }
    if (!empty($context['theme_variant']) && $context['right_to_left']) {
        loadCSSFile($context['theme_variant'] . '/rtl' . $context['theme_variant'] . '.css');
    }
    // Compatibility.
    if (!isset($settings['theme_version'])) {
        $modSettings['memberCount'] = $modSettings['totalMembers'];
    }
    // This allows us to change the way things look for the admin.
    $context['admin_features'] = isset($modSettings['admin_features']) ? explode(',', $modSettings['admin_features']) : array('cd,cp,k,w,rg,ml,pm');
    if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) {
        $context['newsfeed_urls'] = array('rss' => $scripturl . '?action=.xml;type=rss2;limit=' . (!empty($modSettings['xmlnews_limit']) ? $modSettings['xmlnews_limit'] : 5), 'atom' => $scripturl . '?action=.xml;type=atom;limit=' . (!empty($modSettings['xmlnews_limit']) ? $modSettings['xmlnews_limit'] : 5));
    }
    // Default JS variables for use in every theme
    addJavascriptVar(array('elk_theme_url' => JavaScriptEscape($settings['theme_url']), 'elk_default_theme_url' => JavaScriptEscape($settings['default_theme_url']), 'elk_images_url' => JavaScriptEscape($settings['images_url']), 'elk_smiley_url' => JavaScriptEscape($modSettings['smileys_url']), 'elk_scripturl' => '\'' . $scripturl . '\'', 'elk_iso_case_folding' => $context['server']['iso_case_folding'] ? 'true' : 'false', 'elk_charset' => '"UTF-8"', 'elk_session_id' => JavaScriptEscape($context['session_id']), 'elk_session_var' => JavaScriptEscape($context['session_var']), 'elk_member_id' => $context['user']['id'], 'ajax_notification_text' => JavaScriptEscape($txt['ajax_in_progress']), 'ajax_notification_cancel_text' => JavaScriptEscape($txt['modify_cancel']), 'help_popup_heading_text' => JavaScriptEscape($txt['help_popup']), 'use_click_menu' => !empty($options['use_click_menu']) ? 'true' : 'false', 'todayMod' => !empty($modSettings['todayMod']) ? (int) $modSettings['todayMod'] : 0));
    // Auto video embeding enabled, then load the needed JS
    if (!empty($modSettings['enableVideoEmbeding'])) {
        addInlineJavascript('
		var oEmbedtext = ({
			preview_image : ' . JavaScriptEscape($txt['preview_image']) . ',
			ctp_video : ' . JavaScriptEscape($txt['ctp_video']) . ',
			hide_video : ' . JavaScriptEscape($txt['hide_video']) . ',
			youtube : ' . JavaScriptEscape($txt['youtube']) . ',
			vimeo : ' . JavaScriptEscape($txt['vimeo']) . ',
			dailymotion : ' . JavaScriptEscape($txt['dailymotion']) . '
		});', true);
        loadJavascriptFile('elk_jquery_embed.js', array('defer' => true));
    }
    // Prettify code tags? Load the needed JS and CSS.
    if (!empty($modSettings['enableCodePrettify'])) {
        loadCSSFile('prettify.css');
        loadJavascriptFile('prettify.min.js', array('defer' => true));
        addInlineJavascript('
		$(document).ready(function(){
			prettyPrint();
		});', true);
    }
    // Relative times?
    if (!empty($modSettings['todayMod']) && $modSettings['todayMod'] > 2) {
        addInlineJavascript('
		var oRttime = ({
			referenceTime : ' . forum_time() * 1000 . ',
			now : ' . JavaScriptEscape($txt['rt_now']) . ',
			minute : ' . JavaScriptEscape($txt['rt_minute']) . ',
			minutes : ' . JavaScriptEscape($txt['rt_minutes']) . ',
			hour : ' . JavaScriptEscape($txt['rt_hour']) . ',
			hours : ' . JavaScriptEscape($txt['rt_hours']) . ',
			day : ' . JavaScriptEscape($txt['rt_day']) . ',
			days : ' . JavaScriptEscape($txt['rt_days']) . ',
			week : ' . JavaScriptEscape($txt['rt_week']) . ',
			weeks : ' . JavaScriptEscape($txt['rt_weeks']) . ',
			month : ' . JavaScriptEscape($txt['rt_month']) . ',
			months : ' . JavaScriptEscape($txt['rt_months']) . ',
			year : ' . JavaScriptEscape($txt['rt_year']) . ',
			years : ' . JavaScriptEscape($txt['rt_years']) . ',
		});
		updateRelativeTime();', true);
        $context['using_relative_time'] = true;
    }
    // Queue our Javascript
    loadJavascriptFile(array('elk_jquery_plugins.js', 'script.js', 'script_elk.js', 'theme.js'));
    // If we think we have mail to send, let's offer up some possibilities... robots get pain (Now with scheduled task support!)
    if (!empty($modSettings['mail_next_send']) && $modSettings['mail_next_send'] < time() && empty($modSettings['mail_queue_use_cron']) || empty($modSettings['next_task_time']) || $modSettings['next_task_time'] < time()) {
        if (isBrowser('possibly_robot')) {
            // @todo Maybe move this somewhere better?!
            require_once CONTROLLERDIR . '/ScheduledTasks.controller.php';
            $controller = new ScheduledTasks_Controller();
            // What to do, what to do?!
            if (empty($modSettings['next_task_time']) || $modSettings['next_task_time'] < time()) {
                $controller->action_autotask();
            } else {
                $controller->action_reducemailqueue();
            }
        } else {
            $type = empty($modSettings['next_task_time']) || $modSettings['next_task_time'] < time() ? 'task' : 'mailq';
            $ts = $type == 'mailq' ? $modSettings['mail_next_send'] : $modSettings['next_task_time'];
            addInlineJavascript('
		function elkAutoTask()
		{
			var tempImage = new Image();
			tempImage.src = elk_scripturl + "?scheduled=' . $type . ';ts=' . $ts . '";
		}
		window.setTimeout("elkAutoTask();", 1);', true);
        }
    }
    // Any files to include at this point?
    call_integration_include_hook('integrate_theme_include');
    // Call load theme integration functions.
    call_integration_hook('integrate_load_theme');
    // We are ready to go.
    $context['theme_loaded'] = true;
}
コード例 #5
0
ファイル: app_search.php プロジェクト: HadoDokis/knomos-plus
<?php

include "../../../framework/framework.php";
include "../functions.php";
$fltInCorso = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_search.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=0&type[]=&type_app[]=&note=&send=Cerca&fltr=incorso";
$fltRiserva = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_search.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=1&type[]=&type_app[]=&note=&send=Cerca&fltr=inriserva";
$fltCompletato = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_search.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=2&type[]=&type_app[]=&note=&send=Cerca&fltr=completati";
$fltDaAggiornare = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_search.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=3&type[]=&type_app[]=&note=&send=Cerca&fltr=daaggiornare";
$fltProvvedimenti = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_search.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=&type[]=2&type_app[]=&note=&send=Cerca&fltr=provvedimenti";
$fltNote = $CONF[url_base] . $CONF[dir_modules] . "calendar/pages/app_search.php?form_id=listcont&form_page=1&title=&day_from[day]=&day_from[month]=&day_from[year]=&day_to[day]=&day_to[month]=&day_to[year]=&codice[text]=&codice[realval]=&ref_prat[text]=&ref_prat[realval]=&operatore[text]=avv1&operatore[realval]=&done[]=&type[]=3&type_app[]=&note=&send=Cerca&fltr=note";
$Select = ' <span > Filtra gli impegni per: ' . "<select name='SelZoho' id='SelZoho' size='1' onchange='location.href=value'  onFocus=(this.className='campo-focus-02') onBlur=(this.className='null') >\n\t\t<option selected='selected' value=''>Selezionare il filtro</option>\n\t\t<option value='{$fltInCorso}'>Dinamica: In corso</option>\n\t\t<option value='{$fltRiserva}'>Dinamica: Riserva / In attesa</option>\n\t\t<option value='{$fltCompletato}'>Dinamica: Completato</option>\n\t\t<option value='{$fltDaAggiornare}'>Dinamica: Da aggiornare</option>\n\t\t<option value='{$fltProvvedimenti}'>Tipo: Provvedimenti</option>\n\t\t<option value='{$fltNote}'>Tipo: Note</option>\n\t\t</option>\n\t\t</select></span >";
$module = "calendar";
template_init(10);
print $Select;
ob_start();
//Include Form
if (check_perm_mod($module, "r") == 1) {
    $thissearch = load_fwobject("search", $module, 0);
    if ($_GET[form_id] == $thissearch[form][name]) {
        $error = check_form($thissearch[form], $_GET, $page);
        if ($error == 1) {
            print menage_search($thissearch[search]);
            //menage_search1 in: FRAMEWORK/SEARCH.PHP
        } else {
            print draw_form($thissearch[form], $module, $error, $_GET);
        }
    } else {
        print draw_form($thissearch[form], $module);
    }
} else {
    $response[title] = FW_ERROR_NO_PERM;
コード例 #6
0
<?php

include "../../../framework/framework.php";
include "../../../config/config.php";
include "../../../config/config_plus.php";
// Define page specific text for template
$module = "pratiche";
template_init(14);
template_define_elements();
ob_start();
?>

<table width="100%" height="35%" border="0" cellspacing="1" class="form-01-table">

<?php 
//Include Form
$sql = "SELECT id, pr_codice FROM pratiche ORDER BY pr_codice";
$esegui_query = mysql_query($sql) or die("Errore di autenticazione. ");
$num_righe = mysql_num_rows($esegui_query);
if ($num_righe > 0) {
    while ($campo = mysql_fetch_array($esegui_query)) {
        $rs = $DB->Execute("SELECT SUM(spese_imponibili) as simp, SUM(spese_non_imponibili) as snimp, SUM(diritti) as dir, SUM(onorari) as onor, SUM(on_onorari) as onor_or, SUM(on_utente) as onor_ut, SUM(acconti) as acco, SUM(anticipazioni) as anti FROM prestazioni WHERE ref_id=" . $campo[id]);
        $tot = $rs->FetchRow();
        $rs2 = $DB->Execute("SELECT * FROM pratiche WHERE id=" . $campo[id]);
        $prat = $rs2->FetchRow();
        //Search for billing done
        $cnt = 0;
        $rs3 = $DB->Execute("SELECT DISTINCT nota1,nota2 FROM prestazioni WHERE ref_id=" . $campo[id] . " AND nota1 <> '0'");
        while (!$rs3->EOF) {
            if ($cnt > 0) {
                $billem .= ", ";
コード例 #7
0
 /**
  * Administrative global settings.
  *
  * What it does:
  * - Saves and requests global theme settings. ($settings)
  * - Loads the Admin language file.
  * - Calls action_admin() if no theme is specified. (the theme center.)
  * - Requires admin_forum permission.
  * - Accessed with ?action=admin;area=theme;sa=list&th=xx.
  */
 public function action_setthemesettings()
 {
     global $txt, $context, $settings, $modSettings;
     require_once SUBSDIR . '/Themes.subs.php';
     // Nothing chosen, back to the start you go
     if (empty($_GET['th']) && empty($_GET['id'])) {
         return $this->action_admin();
     }
     // The theme's ID is needed
     $theme = isset($_GET['th']) ? (int) $_GET['th'] : (int) $_GET['id'];
     // Validate inputs/user.
     if (empty($theme)) {
         fatal_lang_error('no_theme', false);
     }
     // Select the best fitting tab.
     $context[$context['admin_menu_name']]['current_subsection'] = 'list';
     loadLanguage('Admin');
     // Fetch the smiley sets...
     $sets = explode(',', 'none,' . $modSettings['smiley_sets_known']);
     $set_names = explode("\n", $txt['smileys_none'] . "\n" . $modSettings['smiley_sets_names']);
     $context['smiley_sets'] = array('' => $txt['smileys_no_default']);
     foreach ($sets as $i => $set) {
         $context['smiley_sets'][$set] = htmlspecialchars($set_names[$i], ENT_COMPAT, 'UTF-8');
     }
     $old_id = $settings['theme_id'];
     $old_settings = $settings;
     loadTheme($theme, false);
     // Also load the actual themes language file - in case of special settings.
     loadLanguage('Settings', '', true, true);
     // And the custom language strings...
     loadLanguage('ThemeStrings', '', false, true);
     // Let the theme take care of the settings.
     loadTemplate('Settings');
     loadSubTemplate('settings');
     // Load the variants separately...
     $settings['theme_variants'] = array();
     if (file_exists($settings['theme_dir'] . '/index.template.php')) {
         $file_contents = implode("\n", file($settings['theme_dir'] . '/index.template.php'));
         if (preg_match('~\'theme_variants\'\\s*=>(.+?\\)),$~sm', $file_contents, $matches)) {
             eval('global $settings; $settings[\'theme_variants\'] = ' . $matches[1] . ';');
         }
         call_integration_hook('integrate_init_theme', array($theme, &$settings));
     }
     // Submitting!
     if (isset($_POST['save'])) {
         // Allowed?
         checkSession();
         validateToken('admin-sts');
         if (empty($_POST['options'])) {
             $_POST['options'] = array();
         }
         if (empty($_POST['default_options'])) {
             $_POST['default_options'] = array();
         }
         // Make sure items are cast correctly.
         foreach ($context['theme_settings'] as $item) {
             // Unwatch this item if this is just a separator.
             if (!is_array($item)) {
                 continue;
             }
             // Clean them up for the database
             foreach (array('options', 'default_options') as $option) {
                 if (!isset($_POST[$option][$item['id']])) {
                     continue;
                 } elseif (empty($item['type'])) {
                     $_POST[$option][$item['id']] = $_POST[$option][$item['id']] ? 1 : 0;
                 } elseif ($item['type'] == 'number') {
                     $_POST[$option][$item['id']] = (int) $_POST[$option][$item['id']];
                 }
             }
         }
         // Set up the sql query.
         $inserts = array();
         foreach ($_POST['options'] as $opt => $val) {
             $inserts[] = array($theme, 0, $opt, is_array($val) ? implode(',', $val) : $val);
         }
         foreach ($_POST['default_options'] as $opt => $val) {
             $inserts[] = array(1, 0, $opt, is_array($val) ? implode(',', $val) : $val);
         }
         // If we're actually inserting something..
         if (!empty($inserts)) {
             updateThemeOptions($inserts);
         }
         // Clear and Invalidate the cache.
         cache_put_data('theme_settings-' . $theme, null, 90);
         cache_put_data('theme_settings-1', null, 90);
         updateSettings(array('settings_updated' => time()));
         redirectexit('action=admin;area=theme;sa=list;th=' . $theme . ';' . $context['session_var'] . '=' . $context['session_id']);
     }
     $context['sub_template'] = 'set_settings';
     $context['page_title'] = $txt['theme_settings'];
     foreach ($settings as $setting => $dummy) {
         if (!in_array($setting, array('theme_url', 'theme_dir', 'images_url', 'template_dirs'))) {
             $settings[$setting] = htmlspecialchars__recursive($settings[$setting]);
         }
     }
     $context['settings'] = $context['theme_settings'];
     $context['theme_settings'] = $settings;
     foreach ($context['settings'] as $i => $setting) {
         // Separators are dummies, so leave them alone.
         if (!is_array($setting)) {
             continue;
         }
         // Create the right input fields for the data
         if (!isset($setting['type']) || $setting['type'] == 'bool') {
             $context['settings'][$i]['type'] = 'checkbox';
         } elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
             $context['settings'][$i]['type'] = 'number';
         } elseif ($setting['type'] == 'string') {
             $context['settings'][$i]['type'] = 'text';
         }
         if (isset($setting['options'])) {
             $context['settings'][$i]['type'] = 'list';
         }
         $context['settings'][$i]['value'] = !isset($settings[$setting['id']]) ? '' : $settings[$setting['id']];
     }
     // Do we support variants?
     if (!empty($settings['theme_variants'])) {
         $context['theme_variants'] = array();
         foreach ($settings['theme_variants'] as $variant) {
             // Have any text, old chap?
             $context['theme_variants'][$variant] = array('label' => isset($txt['variant_' . $variant]) ? $txt['variant_' . $variant] : $variant, 'thumbnail' => !file_exists($settings['theme_dir'] . '/images/thumbnail.png') || file_exists($settings['theme_dir'] . '/images/thumbnail_' . $variant . '.png') ? $settings['images_url'] . '/thumbnail_' . $variant . '.png' : $settings['images_url'] . '/thumbnail.png');
         }
         $context['default_variant'] = !empty($settings['default_variant']) && isset($context['theme_variants'][$settings['default_variant']]) ? $settings['default_variant'] : $settings['theme_variants'][0];
     }
     // Restore the current theme.
     loadTheme($old_id, false);
     $settings = $old_settings;
     // Reinit just incase.
     if (function_exists('template_init')) {
         $settings += template_init();
     }
     loadTemplate('ManageThemes');
     // We like Kenny better than Token.
     createToken('admin-sts');
 }