View file modules/padmin/mail.php

File size: 2.28Kb
<?php
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
if($user['level'] < 6 || !isset($user)) { header('Location: /'); exit;}
$locate	= 'in_padmin';
// if(isset($_POST['send']) && $_GET['act'] == 'send') {
// $message = input($_POST['text']);
// if(!empty($message)) { $text = substr($message, 0, 5000); } else { $err = 'Message is empty'; }
// if(!isset($err)) {
// $title = $lang->word('padmin_mail');
// require_once(SYS.'/view/header.php');
// $tpl->div('title', $lang->word('padmin_mail'));
// $umq = $db->query("SELECT * FROM `users` WHERE `id` != '". $user['id'] ."'");
// while($um = $umq->fetch()) {
// if ($db->query("SELECT * FROM `mail_chat` WHERE (`user_id` = '$user[id]' OR `who_id` = '$user[id]') AND (`who_id` = '". abs(intval($_GET['user_id'])) ."' OR `user_id` = '". abs(intval($_GET['user_id'])) ."')")->rowCount() == 0) {
// $db->query("INSERT INTO `mail_chat` SET `user_id` = '$user[id]', `who_id` = '". $um['id'] ."', `time_last_message` = '". time() ."'");
// }
// $db->query("INSERT INTO `mail_chat` SET `user_id` = '$user[id]', `who_id` = '". $um['id'] ."', `time_last_message` = '". time() ."'");
// $db->query("INSERT INTO `mail` SET `user_id` = '". $user['id'] ."', `who_id` = '". $um['id'] ."', `text` = '$text', `time` = '". time() ."', `read` = '0'");
// }
// $tpl->div('menu', 'Succefuly sended!');
// $tpl->div('block', img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
// require_once(SYS.'/view/footer.php');
// exit;
// }
// }
$title = $lang->word('padmin_mail');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('padmin_mail'));
$tpl->div('error', 'Tempotary unvailable!');
$tpl->div('menu', '<b>'.$lang->word('message') .'</b><br/>
					<form action="/padmin/mail/?act=send" method="post">
					<textarea name="text" rows="5" cols="26"></textarea><br/>
					<input name="send" type="submit" value="'. $lang->word('send').'"/>
					</form>');
$tpl->div('block', img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
?>