Example #1
1
 public function edit_post($post_id)
 {
     if (!$post_id) {
         redirect("blog/post/");
     }
     $data['title'] = "Afyadata Blog";
     $this->form_validation->set_rules("title", "Title", "required");
     $this->form_validation->set_rules("content", "Content", "");
     $this->form_validation->set_rules("status", "Status", "");
     if ($this->form_validation->run() === FALSE) {
         $data['post'] = $this->Post_model->find_by_id($post_id);
         $this->load->view("blog/blog_header", $data);
         $this->load->view("blog/edit_post", $data);
         $this->load->view("blog/blog_footer");
     } else {
         $post_details = array("user_id" => $this->session->userdata("user_id"), "title" => $this->input->post("title"), "alias" => str_replace(array(" ", "&", "."), "-", $this->input->post("title")), "content" => $this->input->post("content"), "status" => $this->input->post("status"), "date_modified" => date("c"));
         if ($this->Post_model->update($post_id, $post_details)) {
             $this->session->set_flashdata("message", display_message("Posted was updated"));
         } else {
             $this->session->set_flashdata("message", display_message("Failed to update post"), "danger");
         }
         redirect("blog/post/edit_post/" . $post_id, "refresh");
     }
 }
<div class="panel">
	<h1 class="panel-heading"><?php 
echo HEADING_TITLE;
?>
</h1>
	<div class="panel-body page-content">
		<form id="contact_us" name="contact_us" class="form-horizontal" method="post" action="<?php 
echo zen_href_link(FILENAME_CONTACT_US, 'action=send');
?>
">
			<?php 
echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
?>
			<?php 
display_message('contact');
?>
			<?php 
if (CONTACT_US_STORE_NAME_ADDRESS == '1') {
    ?>
			
			<?php 
}
?>
			<?php 
if (isset($_GET['action']) && $_GET['action'] == 'success') {
    ?>
				<div class="bg-success mainContent success"><?php 
    echo TEXT_SUCCESS;
    ?>
</div>
				<a class="btn btn-default" href="<?php 
Example #3
0
 case 'select-account':
 case 'view-mailbox':
     // if mailbox just chosen, or view mailbox chosen, show mailbox
     if (isset($selected_account)) {
         display_list($_SESSION['auth_user'], $_SESSION['selected_account']);
     } else {
         display_list($_SESSION['auth_user']);
     }
     break;
 case 'show-headers':
 case 'hide-headers':
 case 'view-message':
     // if we have just picked a message from the list, or were looking at
     // a message and chose to hide or view headers, load a message
     $fullheaders = $action == 'show-headers';
     display_message($_SESSION['auth_user'], $_SESSION['selected_account'], $messageid, $fullheaders);
     break;
 case 'reply-all':
     //set cc as old cc line
     if (!$imap) {
         $imap = open_mailbox($_SESSION['auth_user'], $_SESSION['selected_account']);
     }
     if ($imap) {
         $header = imap_header($imap, $messageid);
         if ($header->reply_toaddress) {
             $to = $header->reply_toaddress;
         } else {
             $to = $header->fromaddress;
         }
         $cc = $header->ccaddress;
         $subject = 'Re: ' . $header->subject;
Example #4
0
// CHECK gettext extension
if (extension_loaded("gettext")) {
    $message = 'The <em>gettext</em> extension is loaded.';
    display_message('info_nocross', $message);
} else {
    $message = "The <em>gettext</em> extension is <strong>NOT</strong> loaded.\n            <a href='https://github.com/elabftw/elabftw/wiki/Troubleshooting#the-gd-extension-is-not-loaded'>Click here to read how to fix this.</a>";
    display_message('error_nocross', $message);
    custom_die();
}
// CHECK curl extension
if (extension_loaded("curl")) {
    $message = 'The <em>curl</em> extension is loaded.';
    display_message('info_nocross', $message);
} else {
    $message = "The <em>curl</em> extension is <strong>NOT</strong> loaded.\n            <a href='https://github.com/elabftw/elabftw/wiki/Troubleshooting#the-gd-extension-is-not-loaded'>Click here to read how to fix this.</a>";
    display_message('error_nocross', $message);
    custom_die();
}
?>

<br />
<br />
<h4>Configuration</h4>
<br />
<br />

<!-- MYSQL -->
<form action='install.php' method='post'>
<fieldset>
<legend><strong>MySQL</strong></legend>
<p>MySQL is the database that will store everything. eLabFTW need to connect to it with a username/password. This is <strong>NOT</strong> your account with which you'll use eLabFTW. If you followed the README you should have created a database <em>elabftw</em> with a user <em>elabftw</em> that have all the rights on it.</p>
Example #5
0
<?php

include "./config";
include "./func.php";
try {
    $conn = connect();
} catch (Exception $error) {
    display_message($error->getMessage(), "", "error");
    exit;
}
$nickname = get_nickname($conn);
$count = get_rows($conn);
$select = "select * from article;";
$result = $conn->query($select);
?>
<!DOCTYPE html>
<html>
<head>
    <title>归档</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-combined.min.css">
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style type="text/css">
        body {
            background-image:url("image/theme.png");
            background-size: cover;
            background-repeat:no-repeat;
Example #6
0
    $req = $pdo->prepare($sql);
    $req->bindParam(':teamid', $_SESSION['team_id'], PDO::PARAM_INT);
    $req->execute();
    while ($get_id = $req->fetch()) {
        $results_arr[] = $get_id['id'];
    }
    $search_type = 'none';
}
$total_time = get_total_time();
// filter out duplicate ids
$results_arr = array_unique($results_arr);
// show number of results found
if (count($results_arr) === 0 && $search_type != 'none') {
    display_message('error_nocross', _("Sorry. I couldn't find anything :("));
} elseif (count($results_arr) === 0 && $search_type === 'none') {
    display_message('info', _('<strong>Welcome to eLabFTW.</strong> Select an item in the «Create new» list to begin filling your database.'));
} else {
    ?>
    <div class='align_right'>
        <a name='anchor'></a>
        <p class='inline'><?php 
    echo _('Export this result:');
    ?>
 </p>
        <a href='make.php?what=zip&id=<?php 
    echo Tools::buildStringFromArray($results_arr);
    ?>
&type=items'>
            <img src='img/zip.png' title='make a zip archive' alt='zip' />
        </a>
<div class="panel">
	<h1 class="panel-heading">
		<?php 
if (isset($_GET['edit'])) {
    echo HEADING_TITLE_MODIFY_ENTRY;
} elseif (isset($_GET['delete'])) {
    echo HEADING_TITLE_DELETE_ENTRY;
} else {
    echo HEADING_TITLE_ADD_ENTRY;
}
?>
	</h1>
	<div class="panel-body page-content">
		<?php 
display_message('addressbook');
?>
		<form id="addressbook" name="addressbook" method="post" class="form-horizontal" onsubmit="return check_form(addressbook);" action="<?php 
echo zlink(FILENAME_ADDRESS_BOOK_PROCESS, isset($_GET['edit']) ? 'edit=' . $_GET['edit'] : '', 'SSL');
?>
">
			<?php 
echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
?>
			<?php 
if (isset($_GET['delete'])) {
    ?>
			
				<h6><?php 
    echo DELETE_ADDRESS_DESCRIPTION;
    ?>
</h6>
?>
" onsubmit="submitonce();">
			<?php 
display_message('redemptions');
?>
			<?php 
display_message('checkout_confirmation');
?>
			<?php 
display_message('checkout');
?>
			<?php 
display_message('checkout_address');
?>
			<?php 
display_message('checkout_payment');
?>
			<?php 
echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
?>
			<?php 
if ($COWOA) {
    ?>
		    <div id="order_steps">
		
				<div class="order_steps_line_2">
					<span class="progressbar_active_COWOA">&nbsp;</span><span
						class="progressbar_active_COWOA">&nbsp;</span><span
						class="progressbar_active_COWOA">&nbsp;</span><span
						class="progressbar_active_COWOA">&nbsp;</span><span
						class="progressbar_inactive_COWOA">&nbsp;</span>
Example #9
0
    /*
    $validate = true;
    
    if ($validate) {
        $message_type = 'info_nocross';
        $validation_note = "<img class='align_right' src='img/check.png' alt='Valid Timestamp' title='Valid Timestamp' />";
    } else {
        $message_type = 'error_nocross';
        $validation_note = "<img class='align_right' src='img/cross-red.png' alt='Invalid Timestamp' title='Invalid Timestamp' />";
    }
    */
    // Until a button is implemented, don't fool the user to think the timestamp is valid
    $message_type = 'info_nocross';
    $validation_note = "<img class='align_right' src='img/stamp.png' alt='Unchecked timestamp' title='" . _('Unchecked timestamp') . "' />";
    $date = new DateTime($data['timestampedwhen']);
    display_message($message_type, _('Experiment was timestamped by') . " " . $timestamper['firstname'] . " " . $timestamper['lastname'] . " " . _('on') . " " . $date->format('Y-m-d') . " " . _('at') . " " . $date->format('H:i:s') . " " . $date->getTimezone()->getName() . " <a href='uploads/" . $uploads['long_name'] . "'><img src='img/pdf.png' class='bot5px' title='" . _('Download timestamped pdf') . "' alt='pdf' /></a>" . $validation_note);
    unset($timestamper);
    unset($uploads);
    unset($ts);
}
// Display experiment
?>
    <section class="item" style='padding:15px;border-left: 6px solid #<?php 
echo $data['color'];
?>
'>
    <span class='top_right_status'><img src='img/status.png'><?php 
echo $data['name'];
?>
<img src='img/eye.png' alt='eye' /><?php 
echo $data['visibility'];
Example #10
0
<div class="container">
    <div class="row">
        <div class="col-sm-12 col-md-12 col-lg-12 main">

            <h3><?php 
echo $this->lang->line("create_user_heading");
?>
 </h3>

            <?php 
if ($this->session->flashdata('message') != '') {
    echo display_message($this->session->flashdata('message'));
} else {
    if (isset($error_in)) {
        echo display_message($error_in, "danger");
    }
}
?>

            <div class="col-sm-8">
                <form action="<?php 
echo site_url('auth/create_user');
?>
" class="form-horizontal" role="form"
                      method="post"
                      accept-charset="utf-8">

                    <div class="form-group">
                        <label for="first_name"><?php 
echo $this->lang->line("create_user_fname_label");
?>
Example #11
0
    ?>
<style>
	#message_box a {
		color:#888;
	}
</style>
<div id="message_box_container" style="position:relative;z-index:1000;position:absolute;left:0px;top:0px;width:100%;height:100%;font-size:14px;background-color:rgba(255,255,255,0.5);">
	<div id="message_box" style="width:350px;font-family:Arial,sans-serif;background-color:#fdfdfd;border-width:1px;border-style:solid;border-color:#ddd;padding:5px;margin:auto;margin-top:20%;">
		<h1 style="font-size:20pt;margin:0px;"><?php 
    echo $message_title;
    ?>
</h1>
		<p style="margin-bottom:10px;"><?php 
    echo $message_description;
    ?>
</p>
		<a href="http://unify.lukebarnard.co.uk">Home</a> -
		<a id="close_link" href="javascript:return false;" onclick="c = document.getElementById('message_box_container');c.parentNode.removeChild(c);event.preventDefault();">Close this message box</a>
		<script>
			document.getElementById("close_link").focus();
		</script>
	</div>
</div>
<?php 
}
// var_dump($_SERVER["REQUEST_URI"]);
// var_dump($_GET);
if (isset($_GET["m"])) {
    $m = $_GET["m"];
    display_message($m);
}
    display_message(get_string('error'), get_string('errorwhenconfirming'));
}
$dataelements = explode('/', $data, 2);
// Stop after 1st slash. Rest is username. MDL-7647
$usersecret = $dataelements[0];
$username = $dataelements[1];
$confirmed = application_user_confirm($username, $usersecret);
if ($confirmed == AUTH_CONFIRM_ALREADY) {
    if (!($user = get_complete_user_data('username', $username))) {
        display_message(get_string('error'), get_string('cannotfinduser') . ' ' . $username);
    }
    display_message(get_string('thanks') . ', ' . fullname($user), get_string('alreadyconfirmed'));
} else {
    if ($confirmed == AUTH_CONFIRM_OK) {
        // The user has confirmed successfully, let's log them in
        if (!($user = get_complete_user_data('username', $username))) {
            display_message(get_string('error'), get_string('cannotfinduser') . ' ' . $username);
        }
        complete_user_login($user);
        if (!empty($SESSION->wantsurl)) {
            // Send them where they were going
            $goto = $SESSION->wantsurl;
            unset($SESSION->wantsurl);
            redirect($goto);
        }
        display_message(get_string('thanks') . ', ' . fullname($user), get_string('confirmed'));
    } else {
        display_message(get_string('error'), get_string('invalidconfirmdata'));
    }
}
redirect($CFG->wwwroot . '/local/obu_application/');
Example #13
0
function display_system($message, $file = '', $line = '')
{
    display_message('SYSTEM: ' . $message, $file, $line, 'system');
}
Example #14
0
?>
</li>
<li class='tabhandle' id='tab3'><?php 
echo _('Tools');
?>
</li>
<li class='tabhandle' id='tab4'><?php 
echo _('Help');
?>
</li>
</ul>
</menu>
<!-- *********************** -->
<div class='divhandle' id='tab1div'>
<?php 
display_message('info_nocross', sprintf(_('You belong to the %s team.'), get_team_config('team_name')));
?>
<table id='teamtable' class='table'>
    <tr>
        <th><?php 
echo _('Name');
?>
</th>
        <th><?php 
echo _('Phone');
?>
</th>
        <th><?php 
echo _('Mobile');
?>
</th>
Example #15
0
 * @copyright 2012 Nicolas CARPi
 * @see http://www.elabftw.net Official website
 * @license AGPL-3.0
 * @package elabftw
 */
/**
 * Create an account
 *
 */
require_once 'inc/common.php';
$page_title = _('Register');
$selected_menu = null;
require_once 'inc/head.php';
// Check if we're logged in
if (isset($_SESSION['auth']) && $_SESSION['auth'] == 1) {
    display_message('error', sprintf(_('Please %slogout%s before you register another account.'), "<a style='alert-link' href='app/logout.php'>", "</a>"));
    require_once 'inc/footer.php';
    exit;
}
?>

<menu class='border'><a href='login.php'><img src='img/arrow-left-blue.png' alt='' /> <?php 
echo _('go back to login page');
?>
</a></menu>
<section class='center'>
    <h2><?php 
echo _('Create your account');
?>
</h2><br><br>
    <!-- Register form -->
Example #16
0
}
// Check for required php extensions
$extensionArr = array('curl', 'gettext', 'gd', 'openssl', 'mbstring');
foreach ($extensionArr as $ext) {
    if (!extension_loaded($ext)) {
        $message = "The <em>" . $ext . "</em> extension is <strong>NOT</strong> loaded.\n                <a href='../doc/_build/html/common-errors.html#extension-is-not-loaded'>Click here to read how to fix this.</a>";
        display_message('error_nocross', $message);
        $errflag = true;
    }
}
// we die here and not before so we have display of several errors
if ($errflag) {
    custom_die();
} else {
    $message = 'Everything is good on your server. You can install eLabFTW :)';
    display_message('info_nocross', $message);
}
?>
<h3>Configuration</h3>

<!-- MYSQL -->
<form action='install.php' method='post'>
<fieldset>
<legend><strong>MySQL</strong></legend>
<p>MySQL is the database that will store everything. eLabFTW need to connect to it with a username/password. This is <strong>NOT</strong> your account with which you'll use eLabFTW. If you followed the installation instructions, you should have created a database <em>elabftw</em> with a user <em>elabftw</em> that have all the rights on it.</p>

<p>
<label for='db_host'>Host for mysql database:</label><br />
<input id='db_host' name='db_host' type='text' value='localhost' />
<span class='install_hint'>(you can safely leave 'localhost' here)</span>
</p>
Example #17
0
<h1 class="page-header">
    <i class="fa fa-fw fa-table"></i>すべての商品
</h1>
<h4 class="bg-success"><?php 
display_message();
?>
</h4>

<table class="table table-hover">
    <thead>
        <tr>
            <th>商品ID</th>
            <th>商品名</th>
            <th>イメージ</th>
            <th>カテゴリー</th>
            <th>価格</th>
            <th>在庫数量</th>
        </tr>
    </thead>
    <tbody>
        <?php 
display_products();
?>
    </tbody>
</table>

Example #18
0
    $timestamper = $req_stamper->fetch();
    // display timestamped pdf download link
    $sql = "SELECT * FROM uploads WHERE type = 'exp-pdf-timestamp' AND item_id = :item_id LIMIT 1";
    $req_stamper = $pdo->prepare($sql);
    $req_stamper->bindParam(':item_id', $id);
    $req_stamper->execute();
    $uploads = $req_stamper->fetch();
    // display a link to download the .asn1 token also
    $sql = "SELECT * FROM uploads WHERE type = 'timestamp-token' AND item_id = :item_id LIMIT 1";
    $req_stamper = $pdo->prepare($sql);
    $req_stamper->bindParam(':item_id', $id);
    $req_stamper->execute();
    $token = $req_stamper->fetch();
    $date = new DateTime($data['timestampedwhen']);
    // there is a \" in title attribute of img to prevent ' (apostrophe) cutting the string for french translation
    display_message('info_nocross', _('Experiment was timestamped by') . " " . $timestamper['firstname'] . " " . $timestamper['lastname'] . " " . _('on') . " " . $date->format('Y-m-d') . " " . _('at') . " " . $date->format('H:i:s') . " " . $date->getTimezone()->getName() . " <a href='uploads/" . $uploads['long_name'] . "'><img src='img/pdf.png' class='bot5px' title='" . _('Download timestamped pdf') . "' alt='pdf' /></a> <a href='uploads/" . $token['long_name'] . "'><img src='img/download.png' title=\"" . _('Download token') . "\" alt='token' class='bot5px' /></a>");
    unset($timestamper);
    unset($uploads);
}
// Display experiment
?>
    <section class="item" style='padding:15px;border-left: 6px solid #<?php 
echo $data['color'];
?>
'>
    <span class='top_right_status'><img src='img/status.png'><?php 
echo $data['name'];
?>
<img src='img/eye.png' alt='eye' /><?php 
echo $visibility;
?>
Example #19
0
File: login.php Project: Ognj3n/cms
            $msg = 'Login failed.';
        }
    }
}
if (isset($_GET['logout']) && $_GET['logout'] == 1) {
    $msg2 = 'You are logged out.';
}
// echo password_hash('admin',PASSWORD_DEFAULT);
?>
<h2>Login Area</h2>
<?php 
if (isset($msg)) {
    echo display_message($msg, 'danger');
}
if (isset($msg2)) {
    echo display_message($msg2, 'info');
}
if (!empty($errors)) {
    echo display_errors($errors);
}
?>
<form action="" method="post">
	<div class="form-group">
    <label for="username">Username</label>
    <input type="text" class="form-control" name="username">
	</div>
	
	<div class="form-group">
    <label for="password">Password</label>
    <input type="password" class="form-control" name="password">
	</div>
Example #20
0
templates_page_setup();
cleanup_messages(time() - 86400 * 30);
$title = run("profile:display:name") . " :: " . __gettext("Recent activity");
// If we haven't specified a start time, start time = 1 day ago
$starttime = optional_param('starttime', time() - 86400, PARAM_INT);
$body = "<p>" . __gettext("Currently viewing recent activity since ") . gmstrftime("%B %d, %Y", $starttime) . ".</p>";
$body .= "<p>" . __gettext("You may view recent activity during the following time-frames:") . "</p>";
$body .= "<ul><li><a href=\"index.php?starttime=" . (time() - 86400) . "\">" . __gettext("The last 24 hours") . "</a></li>";
$body .= "<li><a href=\"index.php?starttime=" . (time() - 86400 * 2) . "\">" . __gettext("The last 48 hours") . "</a></li>";
$body .= "<li><a href=\"index.php?starttime=" . (time() - 86400 * 7) . "\">" . __gettext("The last week") . "</a></li>";
$body .= "<li><a href=\"index.php?starttime=" . (time() - 86400 * 30) . "\">" . __gettext("The last month") . "</a></li></ul>";
$body .= "<h2>" . __gettext("Your recent messages") . "</h2>";
$user_messages = get_messages($page_owner, null, time() - $starttime);
if (is_array($user_messages) && !empty($user_messages)) {
    foreach ($user_messages as $user_message) {
        $body .= "<div class=\"user_message\">" . display_message($user_message) . "</div>";
    }
}
$body .= "<h2>" . __gettext("Activity on weblog posts you have marked as interesting") . "</h2>";
if ($activities = get_records_sql('SELECT wc.*, u.username, u.name as weblogname, wp.weblog, wp.ident AS weblogpost, wp.title AS weblogtitle, wp.weblog AS weblog 
                                    FROM ' . $CFG->prefix . 'weblog_comments wc 
                                    LEFT JOIN ' . $CFG->prefix . 'weblog_watchlist wl ON wl.weblog_post = wc.post_id 
                                    LEFT JOIN ' . $CFG->prefix . 'weblog_posts wp ON wp.ident = wc.post_id 
                                    LEFT JOIN ' . $CFG->prefix . 'users u ON u.ident = wp.weblog 
                                    WHERE wc.posted > ? AND wl.owner = ?
                                    ORDER BY wc.posted DESC', array($starttime, $page_owner))) {
    foreach ($activities as $activity) {
        $commentbody = stripslashes($activity->body);
        $commentbody .= "<br /><br /><a href=\"" . url . $activity->username . "/weblog/" . $activity->weblogpost . ".html\">" . __gettext("Read more") . "</a>";
        $activity->postedname = stripslashes($activity->postedname);
        $activity->weblogname = stripslashes($activity->weblogname);
Example #21
0
}
// SQL for editXP
$sql = "SELECT experiments.*, status.color FROM experiments LEFT JOIN status ON experiments.status = status.id\n    WHERE experiments.id = :id ";
$req = $pdo->prepare($sql);
$req->bindParam(':id', $id, PDO::PARAM_INT);
$req->execute();
$experiment = $req->fetch();
// Check id is owned by connected user
if ($experiment['userid'] != $_SESSION['userid']) {
    display_message('error', _('<strong>Cannot edit:</strong> this experiment is not yours!'));
    require_once 'inc/footer.php';
    exit;
}
// Check for lock
if ($experiment['locked'] == 1) {
    display_message('error', _('<strong>This item is locked.</strong> You cannot edit it.'));
    require_once 'inc/footer.php';
    exit;
}
// BEGIN CONTENT
?>
<link rel="stylesheet" media="all" href="css/autocomplete.css" />
<script src="js/tinymce/tinymce.min.js"></script>
<menu class='border'><a href='experiments.php?mode=show'><img src='img/arrow-left-blue.png' class='bot5px' alt='' /> <?php 
echo _('Back to experiments listing');
?>
</a></menu>

<section class='box' id='main_section' style='border-left: 6px solid #<?php 
echo $experiment['color'];
?>
Example #22
0
    <style style="text/css">
        body {
            background-image:url("../image/theme.png");
            background-size: cover;
            background-repeat:no-repeat;
            background-attachment:fixed;
        }
    </style>
</head>
<body>
<?php 
if (isset($_GET['success'])) {
    display_message("update success", "", "success");
} else {
    if (isset($_GET['failed'])) {
        display_message("update failed", "", "error");
    }
}
?>
    <div class="container-fluid">
        <div class="row-fluid">
                <h4><a href="./admin.php">Admin page</a></h4>
        </div>
        <div class="row-fluid" style="margin-top:10%">
            <div class="span2"></div>
            <div class="span6" style="color:#FFFFFF">
                <h3>个人信息修改</h3>
                <form class="form-horizontal" action="../core.php" method="POST">
                    <input type="hidden" name="action" value="updateSetting"> 
                    <div class="control-group">
                        <label class="control-label">nickname</label>
Example #23
0
<?php 
                if ($count == 1) {
                    echo "<div id='search_count'>" . $count . " result</div>";
                } else {
                    echo "<div id='search_count'>" . $count . " results</div>";
                }
                echo "<div class='search_results_div'>";
                // Display results
                echo "<hr>";
                foreach ($results_id as $id) {
                    showDB($id, $_SESSION['prefs']['display']);
                }
            } else {
                // no results
                $message = "Sorry, I couldn't find anything :(";
                echo display_message('error', $message);
            }
        }
    }
}
?>

<script>
$(document).ready(function(){
    // DATEPICKER
    $( ".datepicker" ).datepicker({dateFormat: 'yy-mm-dd'});
});


</script>
Example #24
0
    mail($f_jonathan_email, $l_subject, $l_message2, $l_headers);
}
mail("*****@*****.**", $l_subject, $l_message, $l_headers, "-f {$f_email}");
if (!empty($comments)) {
    mail("*****@*****.**", $l_subject, $l_message, $l_headers, "-f {$f_email}");
}
//mail ("*****@*****.**", $l_subject, $l_message, $l_headers, "-f $f_email");
//tylerD test
//mail ("*****@*****.**", $l_subject, $l_message, $l_headers, "-f $f_email");
//(9) successfully
$f_message .= "<p>" . _EMAILED_TO . " " . $f_locemail . ".</p>";
if (isset($f_sponsor_email) and $f_sponsor_email != "") {
    $f_message .= "<p>" . _ALSO_EMAILED_TO . " " . $f_sponsor_email . " (" . _SPONSOR . ").</p>";
}
//$f_message .= "Successfully done.";
echo display_message($f_message, $f_language);
die;
// start of basic function ------------------------------------------------------------------------------
function get_sponsor_email($f_sponsor_id)
{
    global $dbi;
    if ($f_sponsor_id > 0) {
        $l_sql = " select email  from sponsor where sponsor_id = " . $f_sponsor_id . " ";
        $result = sql_query($l_sql, $dbi);
        list($l_email) = sql_fetch_array($result);
        return $l_email;
    } else {
        return "";
    }
}
function check_prerequisite($f_student_id, $lid)
Example #25
0
    ?>
' /></a>
    </div>
    <?php 
}
?>
<noscript><!-- show warning if javascript is disabled -->
<div class='alert alert-danger'>
    <p><strong>Javascript is disabled.</strong> Please enable Javascript to view this site in all its glory. Thank You.</p>
</div>
</noscript>
<!-- TITLE -->
<h2><?php 
echo $page_title;
?>
</h2>

<?php 
// INFO BOX
if (isset($_SESSION['errors']) && is_array($_SESSION['errors']) && count($_SESSION['errors']) > 0) {
    foreach ($_SESSION['errors'] as $msg) {
        display_message('error', $msg);
    }
    unset($_SESSION['errors']);
}
if (isset($_SESSION['infos']) && is_array($_SESSION['infos']) && count($_SESSION['infos']) > 0) {
    foreach ($_SESSION['infos'] as $msg) {
        display_message('info', $msg);
    }
    unset($_SESSION['infos']);
}
Example #26
0
                $sqlFirst = "SELECT i.* FROM items as i LEFT JOIN items_tags as itag ON 1=1 WHERE i.id > 0";
            } else {
                $sqlFirst = "SELECT i.* FROM items as i LEFT JOIN  items_tags as itag ON 1=1 WHERE type = :type";
            }
            $sql = $sqlFirst . $sqlTeam . $sqlTitle . $sqlBody . $sqlTag . $sqlRating . $sqlDate . $sqlGroup;
            $req = $pdo->prepare($sql);
            if ($_GET['type'] === 'database') {
                $req->execute();
            } else {
                $req->execute(array('type' => $_GET['type']));
            }
            $search_type = 'items';
        }
        // BEGIN DISPLAY RESULTS
        if ($req->rowCount() === 0) {
            display_message('error_nocross', _("Sorry. I couldn't find anything :("));
        } else {
            while ($get_id = $req->fetch()) {
                $results_arr[] = $get_id['id'];
            }
            // sort by id, biggest (newer item) comes first
            $results_arr = array_reverse($results_arr);
            $total_time = get_total_time();
            ?>
            <!-- Export CSV/ZIP -->
            <div class='align_right'>
                <a name='anchor'></a>
                <p class='inline'><?php 
            echo _('Export this result:');
            ?>
 </p>
Example #27
0
// show message if there is a failed_attempt
if (isset($_SESSION['failed_attempt']) && $_SESSION['failed_attempt'] < get_config('login_tries')) {
    $number_of_tries_left = get_config('login_tries') - $_SESSION['failed_attempt'];
    $message = _('Number of login attempt left before being banned for') . ' ' . get_config('ban_time') . ' ' . _('minutes:') . ' ' . $number_of_tries_left;
    display_message('error', $message);
}
// disable login if too much failed_attempts
if (isset($_SESSION['failed_attempt']) && $_SESSION['failed_attempt'] >= get_config('login_tries')) {
    // get user infos
    $user_infos = md5($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']);
    // add the user to the banned list
    $sql = "INSERT INTO banned_users (user_infos) VALUES (:user_infos)";
    $req = $pdo->prepare($sql);
    $req->execute(array('user_infos' => $user_infos));
    unset($_SESSION['failed_attempt']);
    display_message('error', _('You cannot login now because of too many failed login attempts.'));
    require_once 'inc/footer.php';
    exit;
}
?>

<script>
// Check for cookies
function checkCookiesEnabled() {
    var cookieEnabled = (navigator.cookieEnabled) ? true : false;
    if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) {
        document.cookie="testcookie";
        cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
    }
return (cookieEnabled);
}
Example #28
0
    $version = $inviter->getVersion();
    if (!$inviter->checkVersion($server_version)) {
        display_message("You are using OpenInviter <b>{$version}</b> but version <b>{$server_version}</b> is available for download - <a href='http://openinviter.com/download.php'>Download newer version</a><br>\n");
    } else {
        display_message("Your OpenInviter software is up-to-date<br>\n");
    }
}
//Check plugins
if ($openinviter_settings['hosted']) {
    display_message("Running in `Hosted` mode...");
    display_message("Checking OpenInviter Hosted Solution server...");
    if ($checker->check('http://hosted.openinviter.com')) {
        display_message("*OK*<br>\n");
    } else {
        display_message("*NOT OK* - You might not be able to use the OpenInviter Hosted Solution");
    }
} else {
    $plugins = $inviter->getPlugins();
    foreach ($plugins as $type => $dummy) {
        foreach ($dummy as $plugin => $details) {
            display_message("Checking {$details['name']}... ");
            if ($checker->check($details['check_url'])) {
                display_message("*OK*<br>\n");
            } else {
                display_message("*NOT OK* - This plugin might not work correctly on your system<br>\n");
            }
        }
    }
}
display_message("<br><b>WARNING:</b> Delete postinstall.php before running OpenInviter. Also please note that you cannot run postinstall.php again for 2 minutes.");
file_put_contents('postinstall_results.res', $contents);
Example #29
0
    // loop the results array and display results
    foreach ($results_arr as $result_id) {
        showDB($result_id, $display);
    }
    // end if there is a search
} else {
    // there is no search
    // we show the last 10 uploads
    // get the last id
    $sql = "SELECT * FROM items ORDER BY id DESC LIMIT 10";
    $req = $bdd->prepare($sql);
    $req->execute();
    $count = $req->rowCount();
    if ($count == 0) {
        $message = "<strong>Welcome to eLabFTW.</strong> \n            Select an item in the «Create new» list to begin filling your database.";
        echo display_message('info', $message);
    } else {
        $results_arr = array();
        while ($final_query = $req->fetch()) {
            $results_arr[] = $final_query['id'];
        }
        // loop the results array and display results
        echo "<p>Showing last 10 uploads :</p>";
        foreach ($results_arr as $result_id) {
            showDB($result_id, $display);
        }
    }
}
?>

<script>
Example #30
-1
File: view.php Project: artre/study
function display_messages($success_msg = NULL, $error_msg = NULL)
{
    echo "<div id='messages'>\n";
    if (!is_null($success_msg) && strlen($error_msg) > 0) {
        display_message($success_msg, SUCCESS_MESSAGE);
    }
    if (!is_null($error_msg) && strlen($error_msg) > 0) {
        display_message($error_msg, ERROR_MESSAGE);
    }
    echo "</div>\n\n";
}