DOCTYPE html PUBLIC W3C DTD XHTML Transitional EN http www w3 org TR x

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="scripts/main.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Написание нового сообщения</title>
<link href="styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form name="sendmsg" method="post">
<div align="center" style="padding-top:70px;" class="textClassSearch">
<?php
if (isset($_POST['send_x'])) {
$body = strip_tags(MySQL::SQLValue($_POST['body'], MYSQL::SQLVALUE_TEXT));
if ($_POST['subject']=="") {
$subj = (MySQL::SQLValue("тема сообщения не указана", MYSQL::SQLVALUE_TEXT));
}
else $subj = strip_tags(MySQL::SQLValue($_POST['subject'], MYSQL::SQLVALUE_TEXT));
$ins = array();
$ins['to_id'] = $_POST['to_id'];
$ins['order_id'] = $_POST['order_id'];
$ins['from_id'] = $_SESSION['id'];
$ins['status'] = 2;
$ins['subject'] = $subj;
$ins['body'] = $body;
if ($db->InsertRow("sdo_msg", $ins)) {
$db->Query("UPDATE `sdo_msg` SET `date`=NOW() WHERE `msg_id`=".$db->GetLastInsertID());
?>
<p>Ваше сообщение было успешно отправлено!</p>
<script language="javascript">
setTimeout("window.close()", 2000);
</script>
<?php }
else {
?>
<p>Возникла ошибка при отправке сообщения</p>
<script language="javascript">
setTimeout("window.close()", 2000);
</script>
<?php
}
} else {
?>
</div>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="196" height="30" align="right" class="textClassSelect">Причина (заявка): </td>
<td colspan="2">
<?php
if (isset($_GET['id'])):
?>
<input type="hidden" name="order_id" value="<?=$_GET['id'];?>" />
Заявка номер <?=$_GET['id'];?>
<?php elseif (empty($_GET['id'])):
?>
<select name="order_id" style="width: 300px;"><?php
$db->Query($reasonStr);
while (!$db->EndOfSeek()):
$row = $db->Row();
?>
<option value="<?=$row->id;?>"><? echo "(".$row->id.") ".substr($row->item, 0, 65);?></option>
<?php
endwhile;
?>
</select>
<? endif;?> </td>
</tr>
<tr>
<td height="30" align="right" class="textClassSelect">Адресат:</td>
<td colspan="2">
<select name="to_id" style="width: 300px;">
<?php
$db->Query($toStr);
while (!$db->EndOfSeek()):
$row = $db->Row();
?>
<option value="<?=$row->id;?>"><?=@$row->division." | ".@$row->fio." | ".@$row->name;?></option>
<?
endwhile;
?>
</select> </td>
</tr>
<tr>
<td height="30" align="right" class="textClassSelect">Тема сообщения: </td>
<td colspan="2"><input type="text" name="subject" maxlength="255" style="width: 295px;"></td>
</tr>
<tr>
<td height="30" colspan="3" align="center" valign="middle" class="textClassSelect">Текст сообщения: </td>
</tr>
<tr>
<td height="200" colspan="3" align="right" valign="top" style="padding-right: 95px; padding-top: 5px;">
<textarea name="body" style="height: 150px; width: 295px;" wrap="hard"></textarea></td>
</tr>
<tr>
<td height="30" align="right">&nbsp;</td>
<td width="11" align="left">&nbsp;</td>
<td width="393" align="left"><input type="image" name="send" src="images/icons/msg_send.gif" />
<a href="#"><img src="images/icons/msg_close.gif" width="142" height="42" border="0" onclick="window.close();" /></a></td>
</tr>
</table>
<?php } ?>
</form>
</body>
</html>