function iroffer($bot) { global $_CONFIG; try { $conn = new IROFFER($bot->host(), $bot->port(), $bot->password(), $_CONFIG['iroffer_timeout']); } catch (IROFFER_ERROR $error) { messages()->error($error->getMessage()); header("Location: " . view('main')); exit(0); } return $conn; }
function display($page) { global $tpl, $_PARAMS, $_ACTION, $_CONFIG; $tpl->assign('action', $_ACTION); $tpl->assign('ROOT', ROOT); $tpl->assign('subpage', ''); $tpl->assign('params', $_PARAMS); $tpl->assign('config', $_CONFIG); $tpl->assign('messages', messages()); $tpl->assign('user', user()); $tpl->inheritance_merge_compiled_includes = false; $tpl->display($page); }
public static function create($name, $host, $port, $password, $user_id) { if (db()->query("INSERT INTO bots (name, host, port, password) VALUES (" . db()->quote($name) . "," . db()->quote($host) . "," . db()->quote($port) . "," . db()->quote($password) . ")")) { $id = db()->lastInsertId(); db()->query("INSERT INTO `bot_user` (`bot_id`, `user_id`) VALUES (" . db()->quote($id) . "," . db()->quote($user_id) . ")") or die(dberror()); } else { $query = db()->query("SELECT id FROM bots WHERE " . "host=" . db()->quote($host) . " AND " . "port=" . db()->quote($port) . " AND " . "password="******"INSERT INTO `bot_user` (`bot_id`, `user_id`) VALUES (" . db()->quote($data['id']) . "," . db()->quote($user_id) . ")") or die(dberror()); } else { messages()->error(_('couple (host, port) already used and wrong password')); } } }
/** * @param $request * @param $response * * @return View */ protected function prepareViewResponse($request, $response) { $controllerClassName = $request->route()->getAction()['controller']; $controllerClassName = substr($controllerClassName, 0, strpos($controllerClassName, '@')); $controller = app()->make($controllerClassName); $layout = $controller->getLayout(); /** @var View $response */ list($response, $sections) = $response->render(function ($view, $contents) use($layout) { return [view($layout, ['html' => $contents, '_originalTemplateName' => $view->getName()], $view->getData()), $view->getFactory()->getSections()]; }); if (is_array($sections)) { foreach ($sections as $sectionId => $sectionContent) { $response->getFactory()->startSection($sectionId, $sectionContent); } } if ($request instanceof Request && ($request->wantsJson() || $request->has('callback'))) { $response = ['messages' => messages()->all(), 'title' => !empty($response['title']) ? $response['title'] : null, 'data' => array_except($response->getData(), 'html'), 'response' => ['html' => $response['html'], 'sections' => array_except(array_merge((array) $sections, $response->renderSections()), '__content')]]; if ($request->has('callback')) { $response = $request->get('callback') . '(' . json_encode($response) . ')'; } } return $response; }
/** * @param $message * @param $title * @param string $class * * @return \PortOneFive\Essentials\Messaging\MessageManager */ function overlay($message, $title, $class = 'info') { return messages()->overlay($message, $title, $class); }
$('#point_select').show(); $('#route_select').hide(); }; } function changed_location() { $('#route1').load('ajax/ajax_routes.php?lid='+$('#location_id').val()); $('#sp1').load('ajax/ajax_points.php?type=sp&lid='+$('#location_id').val()); $('#ep1').load('ajax/ajax_points.php?type=ep&lid='+$('#location_id').val()); } </script> <h1>{t t='Request a Ride'}</h1> <?php messages($msgs, $errors); ?> <form action="request.php" method="get"> <fieldset> <legend>{t t='Main Info'}</legend> <ol> <li> <label for="user_number_id">{t t='Phone number'}</label> <?php global $user; echo c2r_getHmtlSelectUserNumbers($user->id); ?>
<?php /* * This file is part of phpIrofferAdmin. * * (c) 2013 Valentin Samir * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require "includes/controler.php"; if ($_PARAMS['bot'] !== false) { $conn = iroffer($_PARAMS['bot']); $tpl->assign('groups', $conn->xdl($group_only = true)); $files = $conn->listul($_PARAMS['path']); if (is_array($files)) { $tpl->assign('files', $files); } else { if (preg_match('/Can\'t Access Directory: (.*) Not a directory/', $files, $match)) { messages()->error(sprintf(_('%s is not a directory'), str_replace('//', '/', $match[1]))); } else { messages()->error($files); } $_PARAMS['path'] = dirname($_PARAMS['path']); header('Location: ' . view('files_listing', $_PARAMS)); die; } display("templates/bot_listul.tpl"); } else { header("Location: " . view('main')); }
<?php if ($_SESSION['uid']) { $user = user_load($_SESSION['uid']); messages('Hello ' . $user->name); }
require 'config/db.php'; require 'model/user.php'; require 'model/message.php'; $app = new Slim\App(); $app->get('/', function ($request, $response, $args) { $response->write("Welcome to Slim!"); return $response; }); $app->get('/hello[/{name}]', function ($request, $response, $args) { $response->write("Hello, " . $args['name']); return $response; })->setArgument('name', 'World!'); $app->get('/user/{id}', function ($request, $response, $args) { $newResponse = $response->withHeader('Content-type', 'application/json'); $newResponse->write(json_encode(getUser(getDbConnection(), $args['id']))); return $newResponse; }); $app->get('/messages', function ($request, $response, $args) { $newResponse = $response->withHeader('Content-type', 'application/json'); $queryParams = $request->getQueryParams(); if (isset($queryParams['lat']) || isset($queryParams['lng'])) { $lat = $queryParams['lat']; $lng = $queryParams['lng']; $messages = messagesWithLatLng(getDbConnection(), $lat, $lng); } else { $messages = messages(getDbConnection()); } $newResponse->write(json_encode($messages)); return $newResponse; }); $app->run();
<li><?php echo " UserID: " . $userID . ""; ?> </li> <li><?php echo "Logged in as: " . $username . ""; ?> </ul> </div> <!-- END NAV --> <div id="content"> <?php //show any messages if there are any. messages(); ?> <h1>Manage Events</h1> <table> <tr> <th><strong>Title</strong></th> <th><strong>Action</strong></th> </tr> <?php // Query här: Matcha pages på user inloggad. $sql = mysqli_query($conn, "SELECT * FROM pages WHERE userID='{$userID}' ORDER BY pageID"); while ($row = mysqli_fetch_object($sql)) { echo "<tr>";
// -------------------------- BODY HEADER INCLUDED HERE -------------------------- skin_include('_body_header.inc.php'); // Note: You can customize the default BODY header by copying the generic // /skins/_body_header.inc.php file into the current skin folder. // -------------------------------- END OF BODY HEADER --------------------------- // -------------------------- LEFT NAVIGATION BAR INCLUDED HERE ------------------ skin_include('_left_navigation_bar.inc.php'); // -------------------------------- END OF LEFT NAVIGATION BAR ------------------- ?> <!-- =================================== START OF MAIN AREA =================================== --> <div class="bPosts"> <?php // ------------------------- MESSAGES GENERATED FROM ACTIONS ------------------------- messages(array('block_start' => '<div class="action_messages">', 'block_end' => '</div>')); // --------------------------------- END OF MESSAGES --------------------------------- ?> <?php // ------------------------ TITLE FOR THE CURRENT REQUEST ------------------------ request_title(array('title_before' => '<h1 class="page_title">', 'title_after' => '</h1>', 'title_single_disp' => false, 'title_page_disp' => false, 'format' => 'htmlbody', 'edit_text_create' => T_('Post a new topic'), 'edit_text_update' => T_('Edit post'), 'category_text' => '', 'categories_text' => '', 'catdir_text' => '')); // ----------------------------- END OF REQUEST TITLE ---------------------------- ?> <?php // Display message if no post: display_if_empty(); echo '<div id="styled_content_block">'; // Beginning of posts display if ($Item =& mainlist_get_item()) {
/** * Response when content deletion has succeed. * * @param \Orchestra\Story\Model\Content $content * * @return mixed */ public function deletionHasSucceed(Content $content) { messages('success', 'Post has been deleted.'); return redirect(handles('orchestra::storycms/posts')); }
/** * Response to user has logged out successfully. * * @return mixed */ public function userHasLoggedOut() { messages('success', trans('orchestra/foundation::response.credential.logged-out')); return Redirect::intended(handles(Input::get('redirect', 'orchestra::login'))); }
function admin_messages_admin_main($var) { $op = pnVarCleanFromInput('op'); if (!pnSecAuthAction(0, 'Messages::', '::', ACCESS_EDIT)) { include 'header.php'; echo _MESSAGESNOAUTH; include 'footer.php'; } else { switch ($op) { case "messages": messages(); break; case "editmsg": editmsg(); break; case "addmsg": addmsg(); break; case "deletemsg": deletemsg(); break; case "savemsg": savemsg(); break; default: messages(); break; } } }
include_once('ressources/class.ldap.inc'); include_once('ressources/class.users.menus.inc'); include_once('ressources/class.artica.inc'); include_once('ressources/class.ini.inc'); include_once('ressources/class.spamassassin.inc'); include_once('ressources/class.mime.parser.inc'); include_once(dirname(__FILE__).'/ressources/class.rfc822.addresses.inc'); $user=new usersMenus(); if($user->AsPostfixAdministrator==false){ $tpl=new templates(); echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');"; die();exit(); } if(isset($_GET["tabs"])){tabs();exit;} if(isset($_GET["messages"])){messages();exit;} if(isset($_GET["add"])){messages_add();exit;} if(isset($_POST["upload-message"])){message_upload();exit;} if(isset($_GET["messages-list"])){messages_list();exit;} if(isset($_GET["show-results"])){message_results();exit;} if(isset($_GET["analyze-message"])){message_analyze();exit;} if(isset($_GET["delete-message"])){message_delete();exit;} js(); function js(){ $tpl=new templates(); $page=CurrentPageName();
<?php /* * This file is part of Infoschool - a web based school intranet. * Copyright (C) 2004 Maikel Linke */ include 'var.php'; $output->secure(); $max_days =& $_SESSION['messages_max_days']; $max_number =& $_SESSION['messages_max_number']; if (isset($_POST['max_days'])) { $max_days = (int) $_POST['max_days']; } if (isset($_POST['max_number'])) { $max_number = (int) $_POST['max_number']; } if (!isset($max_days)) { $max_days = 0; } if (!isset($max_number)) { $max_number = 5; } $v['max_days'] = $max_days; $v['max_number'] = $max_number; $v['destination'] = 'sent.php'; $v['messages'] = messages($max_days, $max_number, 'sent'); $content = new tmpl('index.html', $v); $output->out($content);
} function messagesWithLatLng($conn, $lat, $lng) { $sql = "CALL GetMessagesByMyLocation({$lat},{$lng})"; $result = $conn->query($sql); $arr = array(); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $one = null; $one['id'] = $row["id"]; $one['message'] = $row["message"]; $one['lat'] = $row["lat"]; $one['lng'] = $row["lng"]; $one['distance_from_my_location'] = $row["distance_from_my_location"]; $one['created_at'] = $row["created_at"]; $one['user']['name'] = $row["name"]; $one['user']['facebook_id'] = $row["facebook_id"]; $arr[] = $one; } // $json_result['messages'] = $arr; } return $arr; } // main if (isset($_GET['lat']) && isset($_GET['lng'])) { $arr = messagesWithLatLng($conn, $_GET['lat'], $_GET['lng']); } else { $arr = messages($conn); } $conn->close(); echo json_encode($arr);
<?php $this->load->view('admin/templates/header'); ?> <div class="container"> <div class="row"> <?php if (isset($messages['type'])) { messages($messages); } if (!$validation['message'] == '') { validate($validation); } ?> </div> <div class="row"> <div class="col-md-12"> <h1>Crud: <small>Create</small></h1> <?php echo form_open('', array('class' => 'form-horizontal')); ?> <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <?php $data = array('type' => 'email', 'name' => 'email', 'value' => set_value('email', @$form_data['email']), 'maxlength' => '255', 'class' => 'form-control', 'placeholder' => 'Email'); echo form_input($data); ?> </div> <div class="form-group"> <label for="exampleInputPassword1">Password</label> <?php
public function update($name = false, $email = false, $password = false, $right = false) { $succs = array(); $erros = array(); $SET = ''; if ($right) { $SET .= ', `right`=' . db()->quote($right); } if ($name) { $SET .= ', name=' . db()->quote($name); } if ($email) { $SET .= ', email=' . db()->quote($email); } if ($password) { $SET .= ', password='******'UPDATE users SET id=id' . $SET . ' WHERE id=' . db()->quote($this->id))) { return true; } else { messages()->error(sprintf(_('Update error: %s'), dberror() . ' ' . 'UPDATE users SET id=id' . $SET . ' WHERE id=' . db()->quote($this->id))); return false; } }
<?php $id = addslashes(strip_tags(trim($_GET['id']))); if (!$id) { statistic(); } if ($id == 1) { change_password(); } if ($id == 2) { tails($id); } if ($id == 3) { articles($id); } if ($id == 4) { messages($id); } if ($id == 9) { images($id); } } ?> <br /><br /> <div class="push"></div> </center> </div> <div class="stopka"><?php stopka(); ?>
<?php include "includes/initialize.php"; include DIR_CLASSES . "order.php"; require DIR_CLASSES . "search.php"; require DIR_CLASSES . "splitresults.php"; $perm = array('access_admin', 'add_order', 'update_order_status'); checkpermission($perm); $tpl = new template(); $order = new Order(); $tpl->Load(TEMPLATE_PATH . "list_orders.tpl"); if (isset($_GET['action']) and $_GET['action'] == 1) { messages(ORDER_DELETE_SUCCESS); } if (isset($_SESSION['message'])) { $tpl->AssignValue("message", $_SESSION['message']); } // Delete Order if (isset($_POST['mode']) and $_POST['mode'] == '_delete_order') { header('Content-type: application/json'); Query("DELETE FROM `order` WHERE id = '" . $_POST['id'] . "'"); Query("DELETE FROM order_status WHERE order_id = '" . $_POST['id'] . "'"); Query("DELETE FROM product_order WHERE order_id = '" . $_POST['id'] . "'"); $data = array('success' => 'yes'); $output = json_encode($data); echo $output; exit; } //hide business associate name $bavisibility = ''; if ($_SESSION['utype'] != 'BA') {
/* * This file is part of Infoschool - a web based school intranet. * Copyright (C) 2004 Maikel Linke */ include 'var.php'; $output->secure(); $max_days =& $_SESSION['messages_max_days']; $max_number =& $_SESSION['messages_max_number']; if (isset($_POST['max_days'])) { $max_days = (int) $_POST['max_days']; } if (isset($_POST['max_number'])) { $max_number = (int) $_POST['max_number']; } if (!isset($max_days)) { $max_days = 0; } if (!isset($max_number)) { $max_number = 5; } $filter_read = 0; if (isset($_GET['new'])) { $filter_read = (int) $_GET['new']; } $v['max_days'] = $max_days; $v['max_number'] = $max_number; $v['destination'] = 'index.php?new=' . $filter_read; $v['messages'] = messages($max_days, $max_number, 'received', $filter_read); $v['view_new'] = $filter_read; $content = new tmpl('index.html', $v); $output->out($content);
?> <div id="main"> <div id="content"> <?php // ------------------------- TITLE FOR THE CURRENT REQUEST ------------------------- request_title(array('title_before' => '<h2 class="sectionhead">', 'title_after' => '</h2>', 'title_none' => '', 'glue' => ' - ', 'title_single_disp' => true, 'format' => 'htmlbody')); // ------------------------------ END OF REQUEST TITLE ----------------------------- ?> <?php // ------------------------- MESSAGES GENERATED FROM ACTIONS ------------------------- messages(array('block_start' => '<div class="action_messages">', 'block_end' => '</div> <!-- end of class="action_messanges" -->')); // --------------------------------- END OF MESSAGES --------------------------------- ?> <?php // -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) -------------- skin_include('$disp$', array()); // Note: you can customize any of the sub templates included here by // copying the matching php file into your skin directory. // ------------------------- END OF MAIN CONTENT TEMPLATE --------------------------- ?> </div> <!-- end of id="content" -->
/** * Response to user has logged out successfully. * * @return mixed */ public function userHasLoggedOut() { messages('success', trans('orchestra/foundation::response.credential.logged-out')); return Redirect::intended($this->getRedirectToLoginPath(Input::get('redirect'))); }
skin_container(NT_('Menu'), array('block_start' => '', 'block_end' => '', 'block_display_title' => false, 'list_start' => '', 'list_end' => '', 'item_start' => '<li class="evo_widget $wi_class$">', 'item_end' => '</li>', 'item_selected_start' => '<li class="active evo_widget $wi_class$">', 'item_selected_end' => '</li>', 'item_title_before' => '', 'item_title_after' => '')); // ----------------------------- END OF "Menu" CONTAINER ----------------------------- ?> </ul> </div><!-- .col --> </nav><!-- .row --> <main><!-- This is were a link like "Jump to main content" would land --> <!-- ================================= START OF MAIN AREA ================================== --> <?php // ------------------------- MESSAGES GENERATED FROM ACTIONS ------------------------- messages(array('block_start' => '<div class="row"><div class="col-xs-12 action_messages">', 'block_end' => '</div></div>')); // --------------------------------- END OF MESSAGES --------------------------------- ?> <?php // ------------------------- TITLE FOR THE CURRENT REQUEST ------------------------- request_title(array('title_before' => '<div class="row"><div class="col-xs-12><h2>', 'title_after' => '</h2></div></div>', 'title_none' => '', 'glue' => ' - ', 'title_single_disp' => false, 'format' => 'htmlbody', 'arcdir_text' => T_('Index'), 'catdir_text' => '', 'category_text' => T_('Gallery') . ': ', 'categories_text' => T_('Galleries') . ': ', 'user_text' => '', 'display_edit_links' => false)); // ------------------------------ END OF REQUEST TITLE ----------------------------- ?> <div class="row"> <div class="col-xs-12"> <?php // -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------
/** * Response when create a user succeed with notification. * * @return mixed */ public function profileCreated() { messages('success', trans('orchestra/foundation::response.users.create')); messages('success', trans('orchestra/foundation::response.credential.register.email-send')); return Redirect::intended($this->getRedirectToLoginPath()); }
function action_get_delete_user($params) { if (user()->right() == 'ADMIN') { try { $user = USER::byID($params['values'][0]); if ($user->delete()) { messages()->success(sprintf(_('User %s deleted'), $user->name())); } else { messages()->error(sprintf(_('Deletion error: %s'), dberror())); } } catch (Exception $e) { messages()->error(sprintf(_('Deletion error: %s'), $e)); } header('Location: ' . view('users')); die; } }
</div> <div class="pageSubTitle"><!-- InstanceBeginEditable name="SubTitle" --><?php echo T_('This demo displays a form to contact the site admin.'); ?> <!-- InstanceEndEditable --></div> <div class="main"><!-- InstanceBeginEditable name="Main" --> <?php // ------------------------- MESSAGES GENERATED FROM ACTIONS ------------------------- $has_errors = 'false'; messages(array('block_start' => '<div class="action_messages">', 'block_end' => '</div>', 'has_errors' => &$has_errors)); // --------------------------------- END OF MESSAGES --------------------------------- ?> <?php // ----------------------------- MESSAGE FORM ---------------------------- if (empty($return) || $has_errors) { // We are *not* coming back after sending a message: if ($has_errors) { // There was some error, the message was not sent echo '<p>' . T_('Your message was not sent. You may try again.') . '</p>'; } if (empty($redirect_to)) { // We haven't asked for a specific return URL, so we'll come back to here with a param. $redirect_to = empty($return) ? url_add_param($ReqURI, 'return=1', '&') : $ReqURI;
<div class="modal" style="position: relative; top: auto; right: auto; bottom: auto; left: auto; z-index: 1; display: block; margin: 100px auto;"> <div class="modal-dialog" style="width: 450px; margin-right: auto; margin-left: auto;"> <div class="modal-content"> <form class="form-horizontal" method="post" style="margin: 0"> <div class="modal-header"> <h3 class="modal-title"><?php echo lang('login'); ?> </h3> </div> <div class="modal-body"> <?php echo messages(); ?> <div class="form-group"> <label for="username" class="control-label col-sm-2"><?php echo lang('username'); ?> </label> <div class="col-sm-10"> <input type="text" name="username" id="username" value="<?php echo isset($username) ? $username : ''; ?> " class="form-control"/> </div> </div> <div class="form-group"> <label for="password" class="control-label col-sm-2"><?php echo lang('password'); ?> </label>
<div class="menu_center"> <a href="index.php" title="Home" class="menu_txt">Home</a> <a href="index.php?id=1" title="Settings" class="menu_txt">Settings</a> <a href="index.php?id=2" title="Tiles" class="menu_txt">Tiles</a> <a href="index.php?id=3" title="Articles" class="menu_txt">Articles</a> <a href="index.php?id=4" title="Message to Users" class="menu_txt">Messages to Users</a> </div> <a href="index.php?logout_admin=1" title="Logout" class="logout"></a> </div> <? $id = addslashes(strip_tags(trim($_GET['id']))); if(!$id){statistic();} if($id==1){change_password();} if($id==2){tails($id);} if($id==3){articles($id);} if($id==4){messages($id);} if($id==9){images($id);} } ?> <br /><br /> <div class="push"></div> </center> </div> <div class="stopka"><? stopka(); ?></div> </body> </html>