php require_once conf dbc php require_once conf session_start php requ

  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
<?php
require_once( 'conf/dbc.php' );
require_once( 'conf/session_start.php' );
require_once( 'conf/ban.php' );
if ((!isset( $_SESSION ['id' ])) or (!isset
( $_SESSION [ 'nick' ]))) {
?>
<script type="text/javascript">
document.location.href = "reg.php?err_login=1";
</script>
<?php
}
$page_title = 'Чат отряда' ;
require_once( 'conf/head.php' );
require_once( 'conf/top.php' );
$log_id =$_SESSION [ 'id' ];
$query_out = "Select clan, clan_rang, nick from u
$result_out = mysqli_query
( $dbc , $query_out ) or die ( 'Ошибка передачи за
$row_out = mysqli_fetch_array ( $result_out );
if ( $row_out [ 'clan' ] == 0) {
?>
<script type="text/javascript">
document.location.href = "index.php";
</script>
<?php
exit();
}
////////////////////////////ЧАТ!!!!
$query_ch = "Select clan, clan_rang from users
$result_ch = mysqli_query
( $dbc , $query_ch ) or die ( 'Ошибка передачи за
$row_ch = mysqli_fetch_array ( $result_ch );
$clan_ch = $row_ch ['clan' ];
$clan_rang_ch = $row_ch [ 'clan_rang' ];
$query_user = "Select gruppa, nick from users w
$result_user = mysqli_query
( $dbc , $query_user ) or die ( 'Ошибка передачи з
$row_user = mysqli_fetch_array ( $result_user );
if (!empty( $clan_ch )) {
$say_err =$_GET ['say_err' ];
if(!empty( $say_err )) {
if ( $say_err == 1) { ?>
<span id="error">Длина сообщения должна
быть не больше 64 символов</span>
<?php }
if ( $say_err == 2) { ?>
<span id="error">Длина сообщения должна
быть не больше 64 символов</span>
<?php }
}
?>
<div class="stats"><p class="podmenu">Чат
отряда</p></div>
<p><img src="img/ico/point.png" width="12"
height="12"/> <a
href="chatcompany.php">Обновить</a></p>
<div class="stats">
<form enctype="multipart/form-data"
method="post" action="addchat.php">
<input type="text" style="width:50%;
height:18px;" class="input" name="say" />
<input type="submit" style="width:35px;"
class="input" value="+" name="addchat"/>
</form>
<?php
$query_chat = "SELECT * FROM `clan_chat` wh
() - 300 ORDER BY `time` DESC limit 60" ;
$result_chat = mysqli_query
( $dbc , $query_chat ) or die ( 'Ошибка передачи з
$count_chat = mysqli_num_rows ( $result_chat );
if (!empty( $count_chat )) {
while ( $row_chat = mysqli_fetch_array
( $result_chat )) {
$id_chat = $row_chat ['user_id' ];
$query_ch = "Select nick from users where id
$result_ch = mysqli_query
( $dbc , $query_ch ) or die ( 'Ошибка передачи за
$row_ch =mysqli_fetch_array ( $result_ch );
$say = $row_chat [ 'say' ];
?>
<p><a href="profile.php?id=
<?php echo $row_chat ['user_id' ];?>
">
<?php echo $row_ch [ 'nick' ];?>
</a>: <span class="white">
<?php echo " $say " ; ?>
</span></p>
<?php
}
}
?>
</div>
<?php
}
else {
require_once( 'conf/notfound.php' );
}
////////////////////////////////
///////////////////////////
require_once( 'conf/navig.php' );
require_once( 'conf/foot.php' );
mysqli_close ( $dbc );
?>
</body>
</html>