Example #1
0
function displayTemplate($title, $template, $vars)
{
    $t = new Template($title);
    $t->display('header');
    if (is_array($vars)) {
        foreach ($vars as $var => $val) {
            $t->assignVar($var, $val);
        }
    }
    $t->display($template);
    $t->display('footer');
}
Example #2
0
function index()
{
    include "header.php";
    global $db, $lang, $prefix;
    $tpl = new Template();
    $tpl->modTemplate("package");
    $continent = intval($_GET["continent"]);
    if (!empty($continent)) {
        $cond = " AND package_continent={$continent}";
    }
    $result = $db->query("SELECT *  FROM " . $prefix . "_package  WHERE  package_active=1 {$cond}");
    $num_record = $db->row_count($result);
    if ($num_record < 1) {
        $tpl->display("no_package.tpl");
        include "footer.php";
        exit;
    }
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 20;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package", $page, $pages);
    } else {
        $page_link = "";
    }
    $result2 = $db->query("SELECT * FROM " . $prefix . "_package  WHERE package_active=1 {$cond} ORDER BY package_id DESC limit {$start},{$perpage}");
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result2)) {
        $package[] = $row;
    }
    $tpl->assign("lang", $lang);
    $tpl->assign("package", $package);
    $tpl->display("package.tpl");
    include "footer.php";
}
Example #3
0
 public function detail($targetid, $display = true)
 {
     $this->targetid = $targetid;
     $sparams = array('id' => $this->targetid, 'block' => $this->module, 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
     $lmod = $GLOBALS["sclient"]->call('get_details', $sparams);
     //echo '<h2>request</h2><pre>' . htmlspecialchars($GLOBALS["sclient"]->response, ENT_QUOTES) . '</pre>';
     foreach ($lmod[0][$this->module] as $ticketfield) {
         $fieldlabel = $ticketfield['fieldlabel'];
         $fieldvalue = $ticketfield['fieldvalue'];
         $blockname = $ticketfield['blockname'];
         if (!isset($mod_infos[$blockname])) {
             $mod_infos[$blockname] = array();
         }
         $mod_infos[$blockname][] = array("label" => $fieldlabel, "value" => $fieldvalue);
     }
     $docs = $this->get_documents();
     if (isset($docs) && count($docs) > 0) {
         $mod_infos = array_merge($mod_infos, $docs);
     }
     $data['recordinfo'] = $mod_infos;
     if ($display) {
         Template::display($this->module, $data, 'detail');
     } else {
         return $mod_infos;
     }
 }
Example #4
0
 public function detail($targetid)
 {
     $this->targetid = $targetid;
     $sparams2 = array('id' => $this->targetid, 'module' => $this->module, 'customerid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
     $lmod2 = $GLOBALS["sclient"]->call('get_project_tickets', $sparams2);
     if (isset($lmod2) && count($lmod2) > 0 && $lmod2 != "") {
         $data['relatedticketlist'] = $lmod2[1][$this->module]['data'];
         $data['relatedtickettableheader'] = $lmod2[0][$this->module]['head'][0];
     }
     $sparams3 = array('id' => $this->targetid, 'block' => "ProjectTask", 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
     $lmod3 = $GLOBALS["sclient"]->call('get_project_components', $sparams3);
     if (isset($lmod3) && count($lmod3) > 0 && $lmod3 != "") {
         $data['relatedtaskslist'] = $lmod3[1]['ProjectTask']['data'];
         $data['relatedtaskstableheader'] = $lmod3[0]['ProjectTask']['head'][0];
     }
     $sparams4 = array('id' => $this->targetid, 'block' => "ProjectMilestone", 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
     $lmod4 = $GLOBALS["sclient"]->call('get_project_components', $sparams4);
     if (isset($lmod4) && count($lmod4) > 0 && $lmod4 != "") {
         $data['relatedmilestoneslist'] = $lmod4[1]['ProjectMilestone']['data'];
         $data['relatedmilestonestableheader'] = $lmod4[0]['ProjectMilestone']['head'][0];
     }
     $data['recordinfo'] = parent::detail($this->targetid, false);
     $data['recordid'] = $this->targetid;
     Template::display($this->module, $data, 'detail');
 }
Example #5
0
 public static function main($tmplData)
 {
     //echo "Render::main()";
     global $ini;
     $tmplData['{{content}}'] = Template::render($ini['mainTemplate'], $tmplData);
     Template::display($ini['layoutTemplate'], $tmplData);
 }
Example #6
0
 /**
  * Handle form action
  */
 protected function formAction()
 {
     switch ($this->s->action) {
         case 'reload':
             // element: submenu
             $this->s->resetParams('form');
             $module = $this->s->loadModule($this->s->controller);
             $tpl = new Template('system');
             $tpl->assign('subnav', $this->generateNav($module->getSection()));
             $tpl->display('submenu.html');
             return true;
             break;
         case 'submenu':
             if ($this->s->element == '') {
                 Error::addWarning('Fehler: ID des Untermenüs ist nicht definiert!');
                 return false;
             }
             $section = str_replace('nav_', '', $this->s->element);
             $this->s->resetParams();
             $tpl = new Template('system');
             $tpl->assign('subnav', $this->generateNav($section));
             $tpl->display('submenu.html');
             return true;
             break;
         case 'cleanlog':
             if ($this->s->element == 'error') {
                 $file = fopen("logs/error.log", "w+");
                 fclose($file);
             }
             return true;
             break;
     }
 }
Example #7
0
 public function get_list()
 {
     $params = array('id' => $_SESSION["loggeduser"]['id'], 'type' => $GLOBALS["summary_widgets"]);
     $result = $GLOBALS["sclient"]->call('get_summary_widgets', $params);
     //echo '<h2>request</h2><pre>' . htmlspecialchars($GLOBALS["sclient"]->response, ENT_QUOTES) . '</pre>';
     $data['widgets'] = $result != false && $result[0] != '' ? $result[0] : array();
     Template::display($this->module, $data, 'index');
 }
 public function index()
 {
     $user = System::getUser();
     $form = new Form('form-profile');
     $form->setAttribute('data-noajax', 'true');
     $form->binding = $user;
     $fieldset = new Fieldset(System::getLanguage()->_('General'));
     $firstname = new Text('firstname', System::getLanguage()->_('Firstname'));
     $firstname->binding = new Databinding('firstname');
     $lastname = new Text('lastname', System::getLanguage()->_('Lastname'));
     $lastname->binding = new Databinding('lastname');
     $email = new Text('email', System::getLanguage()->_('EMail'), true);
     $email->binding = new Databinding('email');
     $email->blacklist = $this->getListOfMailAdresses($user);
     $email->error_msg[4] = System::getLanguage()->_('ErrorMailAdressAlreadyExists');
     $language = new Radiobox('lang', System::getLanguage()->_('Language'), L10N::getLanguages());
     $language->binding = new Databinding('lang');
     $fieldset->addElements($firstname, $lastname, $email, $language);
     $form->addElements($fieldset);
     $fieldset = new Fieldset(System::getLanguage()->_('Password'));
     $password = new Password('password', System::getLanguage()->_('Password'));
     $password->minlength = PASSWORD_MIN_LENGTH;
     $password->binding = new Databinding('password');
     $password2 = new Password('password2', System::getLanguage()->_('ReenterPassword'));
     $fieldset->addElements($password, $password2);
     $form->addElements($fieldset);
     $fieldset = new Fieldset(System::getLanguage()->_('Settings'));
     $quota = new Text('quota', System::getLanguage()->_('Quota'));
     if ($user->quota > 0) {
         $quota->value = System::getLanguage()->_('QuotaAvailabe', Utils::formatBytes($user->getFreeSpace()), Utils::formatBytes($user->quota));
     } else {
         $quota->value = System::getLanguage()->_('Unlimited');
     }
     $quota->readonly = true;
     $fieldset->addElements($quota);
     $form->addElements($fieldset);
     if (Utils::getPOST('submit', false) !== false) {
         if (!empty($password->value) && $password->value != $password2->value) {
             $password2->error = System::getLanguage()->_('ErrorInvalidPasswords');
         } else {
             if ($form->validate()) {
                 $form->save();
                 System::getUser()->save();
                 System::getSession()->setData('successMsg', System::getLanguage()->_('ProfileUpdated'));
                 System::forwardToRoute(Router::getInstance()->build('ProfileController', 'index'));
                 exit;
             }
         }
     } else {
         $form->fill();
     }
     $form->setSubmit(new Button(System::getLanguage()->_('Save'), 'floppy-disk'));
     $smarty = new Template();
     $smarty->assign('title', System::getLanguage()->_('MyProfile'));
     $smarty->assign('heading', System::getLanguage()->_('MyProfile'));
     $smarty->assign('form', $form->__toString());
     $smarty->display('form.tpl');
 }
function index()
{
    global $site_path, $db, $prefix, $site_host, $config, $lang;
    include "header.php";
    $id = intval($_GET["id"]);
    $tpl = new Template();
    $tpl->modTemplate("package");
    $result = $db->query("SELECT * FROM travel_package WHERE package_id={$id} AND package_active=1");
    $row = $db->fetch_array($result);
    $content = explode("<break>", "{$row['package_desc']}");
    $num_record = count($content);
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 1;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package&file=packagedetails&id={$id}", $page, $pages);
    } else {
        $page_link = "";
    }
    $arrayelement = (int) $page;
    $arrayelement--;
    if (is_admin()) {
        $link = "<a href=index.php?file=admin&op=editpackage&id={$row['package_id']}>Edit</a>";
    } else {
        $link = "";
    }
    $contentx = nl2br($content[$arrayelement]);
    $q = $_SERVER["QUERY_STRING"];
    $url = "{$config['site_url']}/index.php?{$q}";
    $tpl->assign("phone", $config[site_phone]);
    $tpl->assign("lang", $lang);
    $tpl->assign("id", $id);
    $tpl->assign("link", $url);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    $tpl->assign("package", $row);
    $tpl->assign("content", $contentx);
    $tpl->display("package_details.tpl");
    include "footer.php";
}
Example #10
0
 public function render($template, $_vars = array(), $fetch = false)
 {
     $tpl = new Template($template);
     $this->addVars($_vars);
     foreach ($this->vars as $key => $var) {
         $tpl->assign($key, $var);
     }
     if ($fetch === true) {
         return $tpl->fetch($tpl->getTemplate());
     }
     $tpl->display($tpl->getTemplate());
     return true;
 }
Example #11
0
 protected function defaultRender($responseObject)
 {
     $ref = new \ReflectionClass(get_class($responseObject));
     $path = str_replace('.php', '/' . $this->request->getResponseMethod() . '.php', $ref->getFileName());
     if (file_exists($path)) {
         $content = new Template($path, $responseObject);
         $layout = new Template($this->layout ?: $this->getDefaultLayout());
         $layout->content = $content;
         $layout->display();
         return true;
     }
     return false;
 }
Example #12
0
function index()
{
    global $db, $lang, $prefix;
    include "header.php";
    $result = $db->query("SELECT *\tFROM  " . $prefix . "_fares WHERE  fare_special=1 AND fare_active=1 ORDER BY fare_id");
    $tpl = new Template();
    $tpl->modTemplate("special");
    $num_record = $db->row_count($result);
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 20;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=special", $page, $pages);
    } else {
        $page_link = "";
    }
    // Fix the problem
    $result = $db->query("SELECT *\tFROM  " . $prefix . "_fares WHERE  fare_special=1 AND fare_active=1  ORDER BY fare_id DESC\n\n\tLIMIT {$start},{$perpage}");
    $found = $db->row_count($result);
    $tpl->assign("found", $found);
    $tpl->assign("lang", $lang);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $found);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result)) {
        $special[] = $row;
        $tpl->assign("date", "" . todate($row[fare_purchaseby]) . "");
        $q = $db->query("SELECT * from travel_airline WHERE airline_id={$row['fare_airline']}");
        $airline = $db->fetch_array($q);
        $tpl->assign("airline", $airline);
        $tpl->assign("special", $special);
    }
    $tpl->display("specialindex.tpl");
    include "footer.php";
}
Example #13
0
 public function render($tpl, array $vars = array(), $folder = '')
 {
     if (empty($folder)) {
         $folder = $this->folder_tpl;
         if (!empty($folder)) {
             $folder = explode('\\', $folder);
             $folder = end($folder);
             $folder = str_replace('Controller', '', $folder);
             $folder = strtolower($folder);
         }
     }
     $smarty = new Template($this->path_tpl, $folder);
     foreach ($vars as $key => $value) {
         $smarty->assign($key, $value);
     }
     $smarty->display($tpl . '.tpl');
 }
Example #14
0
 /**
  * The display method that including caching.
  *
  * @return string
  * @author Justin Palmer
  **/
 public function display()
 {
     //var_dump($this->Controller);
     //If the cache type is null just return the template.
     //Or, if the cache_type is not one of the supported cache_types
     if ($this->view_path === null || !$this->Controller->pr_do_cache || !$this->isValidCacheType()) {
         return parent::display();
     }
     //If it is a valid cache type then call the method and return the template view.
     $cached = $this->Cache->isCached();
     if ($cached !== false) {
         return $this->Cache->get();
     } else {
         $content = parent::display();
         $this->Cache->value = $content;
         $this->Cache->cache();
         return $content;
     }
 }
 public function php()
 {
     parent::checkAuthentification();
     parent::checkIfAdmin();
     $entries = LogEntry::find('log', 'php');
     if ($entries == NULL) {
         $entries = array();
     } else {
         if ($entries instanceof LogEntry) {
             $entries = array($entries);
         }
     }
     usort($entries, array('LogEntry', 'compare'));
     $smarty = new Template();
     $smarty->assign('entries', $entries);
     $smarty->assign('title', System::getLanguage()->_('Log'));
     $smarty->assign('heading', System::getLanguage()->_('PHPEntries'));
     $smarty->assign('showPHPEntries', true);
     $smarty->display('log/log.tpl');
 }
Example #16
0
 function get_list()
 {
     $allow_all = $GLOBALS["sclient"]->call('show_all', array('module' => $this->module));
     if ($allow_all != 'true') {
         $onlymine = "true";
     }
     $params = array(array('id' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']));
     $result = $GLOBALS["sclient"]->call('get_KBase_details', $params);
     $data['faqcategories'] = array();
     $data['faqcategories'] = $result[0];
     $data['faqproducts'] = $result[1];
     $data['faqs'] = $result[2];
     $faqspercat = array();
     if (isset($data['faqs']) && count($data['faqs']) > 0 && $data['faqs'] != "") {
         foreach ($data['faqs'] as $faq) {
             if (!isset($faqspercat[$faq["category"]])) {
                 $faqspercat[$faq["category"]] = array();
             }
             $params = array('id' => $faq["id"], 'module' => "Documents", 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
             $resultb = $GLOBALS["sclient"]->call('get_documents', $params);
             if (isset($resultb) && count($resultb) > 0 && $resultb != "") {
                 foreach ($resultb[1]['Documents']['data'] as $doc) {
                     $faq["attachments"][] = $doc;
                 }
             }
             $faqspercat[$faq["category"]][] = $faq;
         }
     }
     $faqpr = array();
     if (isset($data['faqproducts']) && count($data['faqproducts']) > 0 && $data['faqproducts'] != "") {
         foreach ($data['faqproducts'] as $faqprod) {
             if (!isset($faqpr[$faqprod["productid"]])) {
                 $faqpr[$faqprod["productid"]] = array();
             }
             $faqpr[$faqprod["productid"]] = $faqprod;
         }
     }
     $data['faqs'] = $faqspercat;
     $data['faqproducts'] = $faqpr;
     Template::display($this->module, $data, 'list');
 }
Example #17
0
 /**
  * Send formatted error data
  */
 public function error()
 {
     $error = $this->out;
     // send HTTP header
     if (!headers_sent()) {
         header($_SERVER['SERVER_PROTOCOL'] . ' ' . $error->getCode());
         header('Content-Type: text/html');
     }
     // display error
     $template = new Template(Configuration::get('base_dir') . DS . 'templates' . DS . 'base.html');
     $template->replace('base_url', Configuration::get('base_url'));
     // make title
     $title = $error->getCode() . ' Error';
     $template->replace('title', $title);
     // make body
     $body = '<p><i>Message</i>: ' . $error->getMessage() . '</p>';
     $body .= '<p><i>Code</i>: ' . $error->getCode() . '</p>';
     $template->replace('content', $body);
     // display
     $template->display();
 }
 function detail($targetid)
 {
     $this->targetid = $targetid;
     $sparams = array('id' => "{$targetid}", 'block' => $this->module, 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
     $lmod = $GLOBALS["sclient"]->call('get_invoice_detail', $sparams);
     foreach ($lmod[0][$this->module] as $ticketfield) {
         $fieldlabel = $ticketfield['fieldlabel'];
         $fieldvalue = $ticketfield['fieldvalue'];
         $blockname = $ticketfield['blockname'];
         if (!isset($mod_infos[$blockname])) {
             $mod_infos[$blockname] = array();
         }
         $mod_infos[$blockname][] = array("label" => $fieldlabel, "value" => $fieldvalue);
     }
     $docs = $this->get_documents();
     if (isset($docs) && count($docs) > 0) {
         $mod_infos = array_merge($mod_infos, $docs);
     }
     $data['recordinfo'] = $mod_infos;
     $data['targetid'] = $targetid;
     Template::display($this->module, $data, 'detail');
 }
Example #19
0
 function get_list()
 {
     $allow_all = $GLOBALS["sclient"]->call('show_all', array('module' => $this->module));
     if ($allow_all != 'true') {
         $onlymine = "true";
     }
     $sparams = array('id' => $_SESSION["loggeduser"]['id'], 'block' => "{$this->module}", 'sessionid' => $_SESSION["loggeduser"]['sessionid'], 'onlymine' => $onlymine);
     $lmod = $GLOBALS["sclient"]->call('get_service_list_values', $sparams);
     if (isset($lmod) && count($lmod) > 0 && $lmod != "") {
         $tablenames[0] = "LBL_SERVICES_RELATED_SERVICES";
         $tablenames[1] = "LBL_SERVICES_RELATED_QUOTES";
         $tablenames[2] = "LBL_SERVICES_RELATED_INVOICES";
         $count = 0;
         foreach ($lmod as $table) {
             $datas[$count]['tablename'] = $tablenames[$count];
             $datas[$count]['recordlist'] = $table[$this->module]['data'];
             $datas[$count]['tableheader'] = $table[$this->module]['head'][0];
             $count++;
         }
     }
     Template::display($this->module, $datas, 'list');
 }
Example #20
0
 public function get_list()
 {
     $allow_all = $GLOBALS["sclient"]->call('show_all', array('module' => $this->module));
     if ($allow_all != 'true') {
         $onlymine = "true";
     }
     $sparams = array('id' => $_SESSION["loggeduser"]['id'], 'block' => $this->module, 'sessionid' => $_SESSION["loggeduser"]['sessionid'], 'onlymine' => $onlymine);
     $lmod = $GLOBALS["sclient"]->call('get_product_list_values', $sparams);
     //echo '<h2>request</h2><pre>' . htmlspecialchars($GLOBALS["sclient"]->response, ENT_QUOTES) . '</pre>';
     if (isset($lmod) && count($lmod) > 0 && $lmod != "") {
         $tablenames[0] = "LBL_PRODUCTS_RELATED_PRODUCTS";
         $tablenames[1] = "LBL_PRODUCTS_RELATED_QUOTES";
         $tablenames[2] = "LBL_PRODUCTS_RELATED_INVOICES";
         $count = 0;
         foreach ($lmod as $table) {
             $datas[$count]['tablename'] = $tablenames[$count];
             $datas[$count]['recordlist'] = $table[$this->module]['data'];
             $datas[$count]['tableheader'] = $table[$this->module]['head'][0];
             $count++;
         }
     }
     Template::display($this->module, $datas, 'list');
 }
Example #21
0
function index()
{
    global $db, $site_path;
    include "header.php";
    $tpl = new Template();
    $tpl->modTemplate("currency");
    $handle = fopen("{$site_path}/currency.xml", "r");
    $data = "";
    while (!feof($handle)) {
        $buffer = fgets($handle, 4096);
        $data .= "{$buffer}";
    }
    fclose($handle);
    for ($i = 0; $i < 10; $i++) {
        $items = explode("</item>", $data);
        $indexx = $i;
        $country = ereg_replace(".*<country>", "", $items[$i]);
        $country = ereg_replace("</country>.*", "", $country);
        $currency = ereg_replace(".*<currency>", "", $items[$i]);
        $currency = ereg_replace("</currency>.*", "", $currency);
        $lastupdate = ereg_replace(".*<lastupdate>", "", $items[$i]);
        $lastupdate = ereg_replace("</lastupdate>.*", "", $lastupdate);
        $rate = ereg_replace(".*<rate>", "", $items[$i]);
        $rate = ereg_replace("</rate>.*", "", $rate);
        $currency_array[$indexx]["country"] = $country;
        $currency_array[$indexx]["currency"] = $currency;
        $currency_array[$indexx]["rate"] = $rate;
        $option[] = "{$rate}";
    }
    $option = implode(",", $option);
    $tpl->assign("option", $option);
    $tpl->assign("lastupdate", $lastupdate);
    $tpl->assign("currency", $currency_array);
    $tpl->display("currency.tpl");
    include "footer.php";
}
Example #22
0
    Common::exitWithError(ErrorMessage::MODULE_NOT_EXIST, "panel/modules.php");
}
if (Common::isPost()) {
    if (empty($module) || empty($menu_ids)) {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        if ($module != 1) {
            foreach ($menu_ids as $menu_id) {
                if ($menu_id <= 100) {
                    Common::exitWithError('系统菜单不能转移到其它模块', 'panel/modules.php');
                }
            }
        }
        $menu_ids = implode(',', $menu_ids);
        $update_data = array('module_id' => $module);
        $result = MenuUrl::batchUpdateMenus($menu_ids, $update_data);
        if ($result >= 0) {
            SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'MenuUrl', $menu_ids, json_encode($update_data));
            Common::exitWithSuccess('更新完成', 'panel/modules.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$menus = MenuUrl::getListByModuleId($module_id);
$module_options_list = Module::getModuleForOptions();
Template::assign('module_options_list', $module_options_list);
Template::assign('menus', $menus);
Template::assign('module_id', $module_id);
Template::display('panel/module.tpl');
Example #23
0
<?php

if (!eregi("index.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
require_once "mainfile.php";
$index = 2;
global $db, $prefix;
$tpl = new Template();
$tpl->modTemplate("news");
include "header.php";
$id = intval($_GET["id"]);
$result = $db->query("SELECT * FROM travel_news WHERE news_id={$id} ORDER BY news_id DESC");
$row = $db->fetch_array($result);
$tpl->assign('news', $row);
$tpl->display("readnews.tpl");
include "footer.php";
Example #24
0
    $group_id
);
$social_menu_block = SocialManager::show_social_menu('member_list', $group_id);

if (!empty($show_message)) {
    $social_right_content .= Display::return_message(
        $show_message,
        'confirmation'
    );
}
$social_right_content .= MessageManager::display_message_for_group(
    $group_id,
    $topic_id,
    $is_member,
    $message_id
);


$social_right_content = '<div class="span9">' . $social_right_content . '</div>';

$tpl = new Template($tool_name);
$tpl->set_help('Groups');
$tpl->assign('social_avatar_block', $social_avatar_block);
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);
Example #25
0
    //为bar添加默认值
    if (empty($roomData)) {
        $roomData = array("name" => array(''), 'avalue' => array(0), 'bvalue' => array(0));
    }
    $aRoomData = json_encode($aRoomData);
    $bRoomData = json_encode($bRoomData);
    $roomData = json_encode($roomData);
    $mapName = json_encode($mapName);
    //导出功能
    if ($command == 'exportMroomRateCompareCsv') {
        $csv = new LibExportCsv($tableHead, $tableList);
        $csv->export();
        exit;
    }
    Template::assign('ndroom', $ndroom);
    Template::assign('aRoomData', $aRoomData);
    Template::assign('bRoomData', $bRoomData);
    Template::assign('roomData', $roomData);
    Template::assign('nameMap', $mapName);
    Template::assign('tableHead', $tableHead);
    Template::assign('tableList', $tableList);
    Template::assign('start_date', $start_date);
    Template::assign('end_date', $end_date);
    Template::assign('b_start_date', $b_start_date);
    Template::assign('b_end_date', $b_end_date);
    Template::assign('a_roomname', $a_roomname);
    Template::assign('b_roomname', $b_roomname);
    Template::assign('contrastIndex', $contrastIndex);
    Template::assign('showType', $showType);
    Template::display('netshow/mroomrate/mroomRateGBCompare.tpl');
}
Example #26
0
			$ab->create();
		}
	}
	
	if ($filtered['leader1'] and $filtered['leader1'] != $t->alliance->leaderId1) {
		$t->alliance->leaderId1 = $filtered['leader1'];
	}
	
	if ($filtered['leader2'] and $filtered['leader2'] != $t->alliance->leaderId2) {
		$t->alliance->leaderId2 = $filtered['leader2'];
	}
	
	if ($filtered['leader3'] and $filtered['leader3'] != $t->alliance->leaderId3) {
		$t->alliance->leaderId3 = $filtered['leader3'];
	}
	$t->alliance->save();
}
if ($filteredG['aid']) {
	$t->alliance->get($filteredG['aid']);
	if (!$t->alliance->id) {
		header('Location: alliance-list.php');
		exit;
	}
}

$t->allianceMembers = $t->alliance->getMembers();

$t->pageTitle = 'Alliance Members';
$t->display();
?>
Example #27
0
 /**
  * Print a fatal error and die.
  *
  * @param string error message
  * @return void
  */
 protected function fatal($error)
 {
     $template = new Template();
     $template->assign('errorMessage', $error);
     $template->display('./Error.tpl');
     die;
 }
Example #28
0
        $oSmarty->assign('product_info', $product_info);
        $oSmarty->assign('oosDate', date('Y-m-d H:i:s'));
        $oSmarty->assign('oos_base', (($request_type == 'SSL') ? OOS_HTTPS_SERVER : OOS_HTTP_SERVER) . OOS_SHOP);

        $oSmarty->assign(
              array(
                  'request_type'                    => $request_type,

                  'theme_set'                       => $sTheme,
                  'theme_image'                     => 'themes/' . $sTheme . '/images',
                  'theme_css'                       => 'themes/' . $sTheme,

                  'lang'                            => $aLang,

                  'info_product_price'              => $info_product_price,
                  'info_special_price'              => $info_special_price,
                  'info_product_special_price'      => $info_product_special_price,
                  'info_max_product_discount'       => $info_product_discount,
                  'info_product_discount_price'     => $info_product_discount_price,
                  'info_base_product_price'         => $info_base_product_price,
                  'info_base_product_special_price' => $info_base_product_special_price
              )
        );
    }
}

// display the template
$oSmarty->display($aOption['popup_print'], $popup_cache_id);

    $downloadStr = array_to_string($data);
    //var_dump($data);exit;
    Common::exportExcel($downloadStr, 'black_list');
    exit;
}
$page_html = Pagination::showPager("custom_analyze.php?class_name={$class_name}&user_name={$user_name}&start_date={$start_date}&end_date={$end_date}", $page_no, PAGE_SIZE, $row_count);
$export_excel = "custom_analyze.php?download=1&class_name={$class_name}&user_name={$user_name}&start_date={$start_date}&end_date={$end_date}";
Template::assign("error", $error);
Template::assign("_POST", $_POST);
Template::assign('_GET', $_GET);
Template::assign("data", $data);
Template::assign("param", $param);
Template::assign('page_html', $page_html);
Template::assign('export_excel', $export_excel);
// Template::assign("output" ,$output);
Template::display('complaint/complaints_analyze.tpl');
//列表数据转化为字符串
function array_to_string($data)
{
    if (empty($data) || !isset($data['result']) || empty($data['result'])) {
        $dataStr = "没有符合您要求的数据!^_^";
    } else {
        $dataStr = "省市\t统计月份\t月工信部投诉量\t环比增长量\t环比增长率\t不规范定制/业务收入(百万)\n ";
        $size_result = count($data['result']);
        for ($i = 0; $i < $size_result; $i++) {
            $dataStr .= $data['provinceMap'][$data['result'][$i]['corp_area']] . "\t";
            $dataStr .= date('Y-m', $data['result'][$i]['month']) . "\t";
            $dataStr .= $data['result'][$i]['num'] . "\t";
            $dataStr .= $data['result'][$i]['increase'] . "\t";
            $dataStr .= sprintf("%.2f", $data['result'][$i]['increasePercent']) . "\t";
            $dataStr .= sprintf("%.2f", $data['result'][$i]['cos']) . "\n";
Example #30
0
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 {
    $template->assign_var('MESSAGE', "Vous devez être connecté pour accéder à cette partie du site !");
}
$template->display('body');