-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin_chatlog.php
executable file
·112 lines (88 loc) · 2.58 KB
/
admin_chatlog.php
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
107
108
109
110
111
112
<?php
/* I codici qui inseriti sono proprietà di
* Francesco Stasi, pertanto ne è vietata la
* vendita e la cessione a terzi senza previa
* autorizzazione dell' autore.
*/
require_once("config.php");
require_once("libs/common.php");
require_once("libs/character_lib.php");
require_once("libs/chat_lib.php");
if(!isset($_SESSION))
{
session_start();
}
logged();
$MyChar_obj=new Character(null,$_SESSION['char_name']);
$MyChar_obj->parseFromDb();
if(!($MyChar_obj->exists())){
echo "Personaggio inesistente.";
exit();
}
$_SESSION['modlevel']=$MyChar_obj->Account()->getModLevel();
if ($admin_view_chat_required>$_SESSION['modlevel']){
echo "Accesso negato, permessi insufficienti.";
exit();
}
if (isset($_REQUEST['chat']) && $_REQUEST['chat']!='' && isset($_REQUEST['logday']) && $_REQUEST['logday']!=''){
echo "Log di chat per il giorno: {$_REQUEST['logday']} , ID Stanza: {$_REQUEST['chat']}";
$room_id=$_REQUEST['chat'];
$logday=$_REQUEST['logday'];
$room_obj= new Room($room_id,null,null,null,$logday,-1);
if (is_null($room_obj->getId())){
echo "Stanza inesistente.";
exit();
}
if ($room_obj->getPrivate()==1 && $room_obj->getUser_rights()==0){
echo "Accesso alla stanza negato.";
exit();
}
$room_obj->showChat(true);
exit();
}
$ChatL=new ChatList();
$ChatL->readFromDb();
foreach ($ChatL->getRooms() as $k=>$v){
$optL.="<option value=\"{$v->getId()}\">{$v->getName()}</option>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="Francesco Stasi"/>
<title><?php echo $nome_land;?></title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<script>
function doDatePicker(){
$( ".logday" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
}
$(function() {
$("#view_chatlog").live('submit', function() {
rowArr = $(this).serializeArray();
$.post($(this).attr("action"),rowArr,function(data2){
$('.result').html(data2);
});
return false;
});
doDatePicker();
});
</script>
<h2>Visione dei Log di Chat</h2>
<form id="view_chatlog" class="special" name="view_chatlog" action="admin_chatlog.php" method="post">
<div>Stanza: <select name="chat" id="chat"><?php echo $optL; ?></select></div>
<div>Giorno: <input type="text" name="logday" class="logday" value="" /></div>
<input type="submit" value="Continua" />
</form>
<div class="result">
</div>
</body>
</html>