本文整理汇总了PHP中Main::message方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::message方法的具体用法?PHP Main::message怎么用?PHP Main::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::message方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: todolists
function todolists()
{
if (isset($_POST['create'])) {
$this->createList($_POST['title'], $_POST['project']);
}
if (isset($_POST['delete'])) {
$tdid = $this->db->clean($_POST['delete'], '', '');
$this->db->del("todo_main", "`id`='{$tdid}'", 1);
$this->db->del("todo_list", "`tid`='{$tdid}'");
Main::message("To-do deleted.");
}
?>
<table width="90%" id="list" class="tablesorter" border="0" align="center" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td><div id="headings">Список необходимых нововведений</div></td>
</tr>
</thead>
<tbody>
<tr class="L2">
<td>
<h3>
<?php
if (REGISTERED == 0 || $this->user->getUID() > 0) {
?>
<form name="" method="POST" action="">Создать список:
<input name="title" /> <select name="project">
<?php
$tpr = $this->db->query("SELECT * FROM projects ORDER BY `name` ASC");
while ($r = mysql_fetch_array($tpr)) {
echo '<option value="' . $r['id'] . '">' . $r['name'] . '</option>';
}
?>
</select><input type="submit" name="create" value="Создать" />
</form></h3>
<script>
function addTo(id){
<?php
$addthis = "<div id='item_" . $r["id"] . "'> <input type='checkbox' name='' onclick='finish(" . $r["id"] . ");''> ";
?>
var itemvalue = document.getElementById('title'+id).value;
$.post('ajax.php', { addtodo: '1', id: id, item: document.getElementById('title'+id).value, username: '<?php
echo $_SESSION["userName"];
?>
', password: '<?php
echo $_SESSION["passWord"];
?>
' }, function(data){ $('#project'+id).append("<div id='item_"+data+"'><input type='checkbox' name='' onclick='finish("+data+");'> " + itemvalue + '</div>'); } );
document.getElementById('title'+id).value='';
}
function finish(id){
$('#item_'+id).fadeOut();
$.post('ajax.php', { markfinish: '1', id: id, username: '<?php
echo $_SESSION["userName"];
?>
', password: '<?php
echo $_SESSION["passWord"];
?>
' } );
}
function deletetd(id){
var c = confirm("Удалить этот список?");
if(c)
document.getElementById('delete'+id).submit();
}
</script>
<?php
}
?>
<br><br>
<div id="todo">
<?php
$todos = $this->db->query("SELECT * FROM todo_main ORDER BY id DESC");
while ($r = mysql_fetch_array($todos)) {
echo '<h3>' . $r['title'];
// check to see if they're admin
if ($this->user->adminCheck()) {
echo "<form name='' style='margin: 0; padding: 0; float: left; ' method='post' action='' id='delete{$r['id']}'><input type='hidden' name='delete' value='{$r['id']}' /></form><input type='image' src='images/bin_closed.png' onclick='deletetd({$r['id']});' name='delete' />";
}
echo '</h3>';
?>
<?php
if (REGISTERED == 0 || $this->user->getUID() > 0) {
?>
<div id="itemadd">
<input name="title" id="title<?php
echo $r['id'];
?>
" class="quick" style="width: 300px;" />
<input type="hidden" name="project" value="<?php
echo $r['id'];
?>
" />
<input type="submit" name="add" style="width: 90px;" onclick="addTo(<?php
echo $r['id'];
//.........这里部分代码省略.........
示例2: bblist
function bblist($type = -1)
{
if (isset($_POST['deleterer'])) {
$tdid = $this->db->clean($_POST['deleterer'], '', '');
$this->db->del("list", "`id`='{$tdid}'", 1);
Main::message("Report deleted.");
}
if (isset($_GET["page"])) {
$page = $_GET["page"];
} else {
$page = "";
}
if (isset($_GET['specialrefiner'])) {
$_SESSION['esql'] = "";
$srf = $_GET['specialrefiner'];
if ($srf == "open") {
$_SESSION['esql'] = "AND `status`='1'";
} elseif ($srf == "closed") {
$_SESSION['esql'] = "AND `status`='0'";
} elseif ($srf == "all") {
$_SESSION['esql'] = "";
} elseif (is_numeric($srf)) {
$_SESSION['esql'] = "AND `project`='" . $this->db->clean($srf, '', 'num') . "'";
}
}
if (!isset($_SESSION['esql'])) {
$_SESSION['esql'] = "";
}
/* Handle paging */
/* if( isset($_GET["page"]) )
$_GET["page"]=$_GET["page"];
else
$_GET["page"] = 1; */
if (isset($_GET["page"])) {
$page = $_GET["page"];
$lower = $page * $this->db->pagenums - $this->db->pagenums;
$limit = "LIMIT {$lower}," . $this->db->pagenums;
} else {
$limit = "LIMIT 0," . $this->db->pagenums;
}
if ($page == 1) {
$limit = "LIMIT 0," . $this->db->pagenums;
}
if ($type == 0) {
$this->db->query("SELECT * FROM list WHERE `type`='0' AND `parent`='0' " . $_SESSION['esql'] . " ORDER BY `id` DESC {$limit};");
}
if ($type == 1) {
$this->db->query("SELECT * FROM list WHERE `type`='1' AND `parent`='0' " . $_SESSION['esql'] . " ORDER BY `id` DESC {$limit};");
}
if ($type == -1) {
$this->db->query("SELECT * FROM list WHERE `parent`='0' " . $_SESSION['esql'] . " ORDER BY `id` DESC {$limit};");
}
$cssclass = "L1";
while ($r = $this->db->fetch_array()) {
if ($cssclass == "L1") {
$cssclass = "L2";
} elseif ($cssclass == "L2") {
$cssclass = "L1";
}
?>
<script>
function deletetd(id){
var c = confirm("Удалить этот список?");
if(c)
document.getElementById('delete'+id).submit();
}
</script>
<tr class="<?php
echo $cssclass;
?>
">
<td align="center"><?php
echo $r["id"];
?>
</td>
<td width="16" align="center"><div style='position: relative;'><img src="<?php
echo $this->img($r["type"]);
?>
" style='' />
<?php
if ($r["status"] == 0) {
?>
<img id=cansel src="images/cancel.png"/><?php
}
?>
</div></td>
<td><a href="?cmd=view&id=<?php
echo $r["id"];
?>
&open=<?php
echo $r["status"];
?>
"><?php
if ($r["title"] == "") {
echo "[Без Названия]";
} else {
echo $r["title"];
}
?>
</a>
//.........这里部分代码省略.........
示例3: array
<script type="text/javascript" src="js/jq-sort.js"></script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div class="clear"></div>
<div align="center">
<div id="contentArea" width="91%">
<h1>Installing BlueBug...</h1>
<?php
if ($_POST) {
$mydb->query_insert("users", array('id' => null, 'username' => $_POST[username], 'password' => md5($_POST[password]), 'email' => $_POST[email], 'acl' => 0));
$main->message("Admin user account created");
echo "<h2 style='color: red;'>Make sure you delete this file or anyone can create another admin user.</h2>";
} else {
$listSQL = "CREATE TABLE `list` (\r\n `id` int(11) NOT NULL auto_increment,\r\n `project` int(11) NOT NULL default '0',\r\n `parent` int(11) NOT NULL default '0',\r\n `title` varchar(200) NOT NULL default '',\r\n `report` longtext NOT NULL,\r\n `status` tinyint(1) NOT NULL default '0',\r\n `by` int(11) NOT NULL default '0',\r\n `priority` tinyint(1) NOT NULL default '0',\r\n `type` tinyint(1) NOT NULL default '0',\r\n `started` int(11) NOT NULL default '0',\r\n `finished` int(11) NOT NULL default '0',\r\n `due` int(11) NOT NULL default '0',\r\n `assigned` int(11) NOT NULL default '0',\r\n KEY `id` (`id`,`title`),\r\n KEY `priority` (`priority`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=latin1; ";
$mydb->query($listSQL);
if (strlen($mydb->errorno) == 0) {
echo "<b>Bug table created....</b><br/>";
}
$projectSQL = "\r\nCREATE TABLE `projects` (\r\n `id` int(11) NOT NULL auto_increment,\r\n `name` varchar(255) NOT NULL default '',\r\n `mini` varchar(255) NOT NULL default '',\r\n `description` longtext NOT NULL,\r\n UNIQUE KEY `id` (`id`),\r\n KEY `subname` (`mini`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=latin1; ";
$mydb->query($projectSQL);
if (strlen($mydb->errorno) == 0) {
echo "<b>Project table created....</b><br/>";
}
$userSQL = "\r\nCREATE TABLE `users` (\r\n `id` int(11) NOT NULL auto_increment,\r\n `username` varchar(100) NOT NULL default '',\r\n `password` varchar(100) NOT NULL default '',\r\n `email` varchar(100) NOT NULL default '',\r\n `acl` tinyint(2) NOT NULL default '0',\r\n UNIQUE KEY `id` (`id`),\r\n KEY `username` (`username`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\r\n";
$mydb->query($userSQL);
if (strlen($mydb->errorno) == 0) {
示例4: INT
<?php
$todoSQL = "CREATE TABLE `todo_main` (\n`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,\n`title` VARCHAR( 100 ) NOT NULL ,\n`project` INT( 11 ) NOT NULL ,\nINDEX ( `id` )\n) ENGINE = MYISAM; ";
$mydb->query($todoSQL);
if (strlen($mydb->errorno) == 0) {
echo "<b>ToDo_main table created....</b><br/>";
}
$todoLSQL = " CREATE TABLE `todo_list` (\n`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,\n`content` TEXT NOT NULL ,\n`status` INT( 2 ) NOT NULL ,\nINDEX ( `id` )\n) ENGINE = MYISAM;";
$mydb->query($todoLSQL);
if (strlen($mydb->errorno) == 0) {
echo "<b>ToDo_List table created....</b><br/>";
}
$projModSQL = "ALTER TABLE `projects` ADD `client_exec` VARCHAR( 255 ) NOT NULL ;";
$mydb->query($projModSQL);
$mydb->query("ALTER TABLE `projects` ADD `github` VARCHAR( 255 ) NOT NULL ;");
$mydb->query("ALTER TABLE `list` ADD `attachment` VARCHAR( 100 ) NOT NULL ;");
$main->message("BlueBug tables updated.");
?>
<?php
?>
<div style="clear: both; height: 100px;"></div>
</div>
<div id="bottomContent" width="90%">
<img src="/images/index_15.gif" id="cLeft" />
<img src="/images/index_18.gif" id="cRight" />
示例5: array
echo "Ваше сообщение было опубликовано, но вложение не было загружено. Запрещенный тип файла.";
$file_name = "";
$target = "";
}
} else {
}
$bugData = array('id' => 'null', 'project' => $this->db->first("SELECT `project` FROM list WHERE `id`='{$bugid}'", 0, 0), 'parent' => $bugid, 'title' => $_POST["subject"], 'report' => nl2br(strip_tags($_POST["report"])), 'status' => '0', 'by' => $reportedby, 'priority' => 0, 'type' => 0, 'started' => time(), 'finished' => '0', 'due' => '0', 'assigned' => '0', 'character' => $_POST["character"], 'attachment' => $target . $file_name);
$this->db->query_insert('list', $bugData);
$this->message("<center><h3>Комментарий добавлен.</h3></center>");
unset($_POST);
}
} elseif (isset($_POST['deletecomm'])) {
//check if its parent ticket
$commentidid = $this->db->clean($_POST["deletecomm"], '', '');
$this->db->del("list", "id='{$commentidid}'", '1');
Main::message("Запись удалена.");
}
?>
<script>
function deletetd(id){
var c = confirm("Удалить этот список?");
if(c)
document.getElementById('delete'+id).submit();
}
</script>
<?php
// view original ticket
if ($bugid > 0) {
$bugView->original($bugid);
$bugView->responses($bugid);