<div class="block50">
<input type="checkbox" name="check1" value="1" class="inputradio" id="input" /> <p>Jestem lekarzem.</p>
</div>
<div class="block83" id="text">
<p1>Wybierz swoją specjalizację:</p1><br />
<input type="radio" value="Chirurg" name="specialty" class="inputradio123"> <p>Chirurg.</p> <br/>
<input type="radio" value="Neurolog" name="specialty" class="inputradio123"> <p>Neurolog.</p> <br/>
<input type="radio" value="Psycholog" name="specialty" class="inputradio123"> <p>Psycholog.</p> <br/>
<input type="radio" value="Terapeuta" name="specialty" class="inputradio123"> <p>Terapeuta.</p> <br/>
</div>
<script>
const checkboxInput = document.getElementById("input");
const textBlock = document.getElementById("text");
checkboxInput.onclick = function() {
if (checkboxInput.checked) {
textBlock.style.display = "block";
} else {
textBlock.style.display = "none";
}
}
</script>
<style>
.block83 {
display: none;
}
</style>
<div class="block50">
<input type="checkbox" name="check1" value="1" class="inputradio" /> <p>Jestem lekarzem.</p>
</div>
<div class="hidden">
<div class="block83">
<p1>Wybierz swoją specjalizację:</p1><br />
<input type="radio" value="Chirurg" name="specialty" class="inputradio123"> <p>Chirurg.</p> <br/>
<input type="radio" value="Neurolog" name="specialty" class="inputradio123"> <p>Neurolog.</p> <br/>
<input type="radio" value="Psycholog" name="specialty" class="inputradio123"> <p>Psycholog.</p> <br/>
<input type="radio" value="Terapeuta" name="specialty" class="inputradio123"> <p>Terapeuta.</p> <br/>
</div>
</div>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
function send()
{
var mess=$("#mess_to_send").val();
var num = $("#id_to").val();
$.ajax({
type: "POST",
url: "add_mess.php",
data:"mess="+mess+"&num=" + num;
success: function(html)
{
load_messes();
$("#mess_to_send").val('');
$("#id_to").val('');
}
});
}
function load_messes()
{
$.ajax({
type: "POST",
url: "load_messes.php",
data: "req=ok",
success: function(html)
{
$("#messages").empty();
$("#messages").append(html);
$("#messages").scrollTop(90000);
}
});
}
</script>
<div class="block13">
<h1>Chat room</h1>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
function send()
{
var mess=$("#mess_to_send").val();
var num=$(".base").val();
$.ajax({
type: "POST",
url: "add_mess.php",
data:{name: mess, id: num}
success: function(html)
{
load_messes(); <------------------------------ 63 строка
$("#mess_to_send").val('');
}
});
}
function load_messes()
{
$.ajax({
type: "POST",
url: "load_messes.php",
data: "req=ok",
success: function(html)
{
$("#messages").empty();
$("#messages").append(html);
$("#messages").scrollTop(90000);
}
});
}
</script>
<table>
<tr>
<td>
<div id="messages">
</div>
</td>
</tr>
<tr>
<td>
<form action="javascript:send();">
<input type="text" id="mess_to_send" class="textmess">
<input class='base' type='text' id='id_to' value= '<?php echo htmlspecialchars($num); ?>' size='7' placeholder='id pacjenta'>
<input type="submit" value="Wyslac" class="dodajos111">
</form>
</td>
</tr>
</table>
<script>
//action="javascript:send();"
load_messes();
setInterval(load_messes,3000); <------------------------------ 119 строка
</script>
<form method="post" action="../../menu/doctor/doctor.php">
<center><input id="submit" type="submit" class="butblock40" value="Powrót"></center>
</form>
<form method="post" action="../../../testform">
<center><input id="submit" type="submit" class="butblock40" value="POMÓC"></center>
</form>
</div>
</body>
session_start();
setcookie('username', $row['username'], time() + (60*60*24*30));
setcookie('user_id', $row['user_id'], time() + (60*60*24*30));
print_r($_COOKIE);
if(isset($_POST['mess']) && $_POST['mess']!="" && $_POST['mess']!=" ")
{
$mess=$_POST['mess'];
$username=$_COOKIE['username'];
$num=$_POST['num'];
include("bd.php");
$res=mysql_query("INSERT INTO `messages` (`login`,`message`,`id_add`,`id_to`) VALUES ('". $_COOKIE['username'] . "','$mess','". $_COOKIE['user_id'] ."','$num' ) ");
// $res=mysql_query("INSERT INTO `messages` (`login`,`message`,`id_add`,`id_to`) VALUES ('". $_COOKIE['username'] . "','$mess','". $_COOKIE['user_id'] . "','$num') ");
}
?>