Example #1
0
/**
 * Handle POST submission
 *
 * @param array $options
 * @return void
 */
function process_unit_import($options)
{
    if (empty($_FILES['unit_import']['tmp_name'])) {
        $error = 'No file uploaded, aborting.';
        print_messages($error);
        return;
    }
    if (!current_user_can('import')) {
        $error = 'You don\'t have the permissions to import. Please contact the blog\'s administrator.';
        print_messages($error);
        return;
    }
    check_admin_referer('brave_blank_unit_import_verify');
    require_once 'DataSource.php';
    $time_start = microtime(true);
    $csv = new File_CSV_DataSource();
    $file = $_FILES['unit_import']['tmp_name'];
    stripBOM($file);
    if (!$csv->load($file)) {
        $error = 'Failed to load file, aborting.';
        print_messages($error);
        return;
    }
    // pad shorter rows with empty values
    // $csv->symmetrize();
    $skipped = 0;
    $imported = 0;
    foreach ($csv->connect() as $csv_data) {
        $id = create_unit($csv_data);
        if (is_numeric($id)) {
            $imported++;
        } else {
            print_messages($id);
            return;
        }
    }
    if (file_exists($file)) {
        @unlink($file);
    }
    $exec_time = microtime(true) - $time_start;
    $notice = "";
    if ($skipped) {
        $notice += "<b>Skipped {$skipped} posts (most likely due to empty title, body and excerpt).</b></br>";
    }
    $notice += sprintf("<b>Imported {$imported} posts %.2f seconds.</b>", $exec_time);
    print_messages($notice);
}
Example #2
0
if (isset($_GET['killmsg']) && $admin_powers == 1) {
    if ($forum_id == -50) {
        //deleting from central forum
        dbn("delete from se_central_messages where message_id = '" . (int) $_GET['killmsg'] . "' && forum_id = '{$forum_id}'");
    } elseif ($forum_id > -50) {
        //deleting from regular forum
        dbn("delete from {$db_name}_messages where message_id = '" . (int) $_GET['killmsg'] . "' && login_id = '{$forum_id}'");
    }
    $out .= "Message Deleted";
}
//delete all messages in a forum. can't be done for central forums
if (isset($_REQUEST['killallmsg']) && $admin_powers == 1 && $forum_id > -50) {
    if (!isset($_POST['sure'])) {
        get_var('Delete Messages', 'forum.php', "Are you sure you want to delete all {$header} messages?", 'sure', 'yes');
    } else {
        if ($forum_id == -5) {
            $clan_text_sql = " && clan_id = '{$clan_id}'";
        }
        dbn("delete from {$db_name}_messages where login_id = '{$forum_id}'" . $clan_text_sql);
        $out .= mysql_affected_rows() . " Messages Deleted.<p />";
    }
}
if ($forum_id == -5 && $clan_id != 0 || $forum_id != -5) {
    $out .= $rs . "<a href='message.php?target_id={$forum_id}{$forum_type_url_str}'>Participer sur la {$header}</a><p />";
}
$out .= print_messages($forum_id, $admin_powers, $clan_id, $col_arr);
//can't kill all messages in central forum.
if ($admin_powers == 1 && ($forum_id == -5 && $clan_id != 0 || $forum_id != -5 && $forum_id > -50)) {
    $out .= "<p /><a href='forum.php?target_id={$forum_id}&killallmsg=1{$forum_type_url_str}'>Delete All Forum Messages</a>";
}
print_page($header, $out);
Example #3
0
		<h3 class="page-title">Αίτησης Ανανέωσης</h3>
	</div>
</div>
 <?php 
// For Debug..
// print_r($_SESSION['gsis_user']);
// print_r($_SESSION['gsis_user_id']);
if (isset($_POST['num_leaves'])) {
    ?>
		<div  class="alert alert-success">
			<p>Η αίτησή σας έχει υποβληθεί επιτυχώς. Λάβατε αριθμό πρωτοκόλλου 1283209232-12121.</p>
			<p>Θα ενημερωθείτε με ηλεκτρονικό μήνυμα για την πορεία της αίτησής σας.</p>
		</div>
<?php 
} else {
    print_messages();
    ?>
<div class="row"><div class="col-sm-12"><div id="errorer" class="alert alert-danger" style="display:none;">Επιβεβαιώστε την ορθότητα των πεδίων</div></div></div>
<div class="row">
	<div class="col-lg-12">
		<div class="">
		<form name="leaveform" id="leaveform" method="post" action="<?php 
    echo URL;
    ?>
/?p=planodioi|new">
			<div class="row">
				<div class="col-md-4">
					<div class="panel panel-success">
						<div class="panel-heading">
							Προσωπικά Στοιχεία
						</div>
Example #4
0
function send_choose_messages()
{
    global $H, $I, $U;
    print_start('choose_messages');
    frmadm('clean');
    echo hidden('what', 'selected') . submit($I['delselmes'], 'class="delbutton"') . '<br><br>';
    print_messages($U['status']);
    echo "</form><br>{$H['backtochat']}";
    print_end();
}
?")){return true;}
		else{return false;}
	}
</script>
</head>
<body>
<div align="center">
  <div class="container">
    <?php 
$pg_active['pdt'] = 'active';
require_once 'include/header.php';
?>
    <div class="content">
    <!-- error and success msg start here -->
      <div style="margin-top: 20px;"> <?php 
echo print_messages($flag, $error_message, $success_message);
?>
 </div>
      <!-- error and success msg end here -->
      <div class="down_category" style="margin-top:30px">
        <div class="head"> <span class="head_text"><?php 
echo $item;
?>
</span>
          <div class="add"> <a href="<?php 
echo $page_child;
?>
"> <span class="add1"> <span class="head_text1" style="font-size:14px;"> <?php 
echo $item;
?>
</span> </span> </a></div>
Example #6
0
/**
 * This function generates the standard HTML footer
 */
function displayFooter()
{
    global $config;
    // add a <div> region with messages to the page.
    print_messages();
    // see lib/messages.lib.php
    ?>
				</div>
			</body>
		</html>
	<?php 
}
Example #7
0
    $message_string = "";
    foreach ($_POST['del_mess'] as $mess_id) {
        $message_string .= "message_id = '" . (int) $mess_id . "' || ";
    }
    $message_string = preg_replace("/\\|\\| \$/", "", $message_string);
    dbn("delete from {$db_name}_messages where login_id = '{$user['login_id']}' && ({$message_string})");
    $error_str .= mysql_affected_rows() . " " . $cw['message_deleted'] . ".<p />";
}
//get number of messages, to determine what to show the user.
db("select count(message_id) from {$db_name}_messages where login_id = '{$user['login_id']}'");
$counted = dbr();
$error_str .= "<br /><a href='message.php'>" . $cw['send_message'] . "</a><br /><br />";
//print stuff to allow deletion of many messages.
if ($counted[0] > 1) {
    $error_str .= "<FORM method=POST action={$_SERVER['PHP_SELF']} name=message_form>";
    $error_str .= "<a href=javascript:TickAll(\"message_form\")>" . $cw['invert_message_selection'] . "</a><p />";
}
if ($counted[0] == 0) {
    //no messages
    $error_str .= $st[76];
} else {
    $col_arr = array('#330000', '#432100', '#332000', '#996666');
    $error_str .= print_messages($user['login_id'], 1, 0, $col_arr);
    if ($counted[0] > 1) {
        $error_str .= "<a href=javascript:TickAll(\"message_form\")>" . $cw['invert_message_selection'] . "</a>";
        $error_str .= " - <input type='submit' value='" . $cw['delete_selected'] . "' /></form>";
    }
    dbn("update {$db_name}_users set last_access_msg='" . time() . "' where login_id = '{$user['login_id']}'");
    $user['last_access_msg'] = time();
}
print_page($cw['messages'], $error_str);