<?php
require 'connect.php';
$num_doc = $_REQUEST['radio'];
$date = $_REQUEST['date'];
$comments = $_REQUEST['comments'];
$next_date = $_REQUEST['next_date'];
$id_add = $_COOKIE['user_id'];
$username_pac = $_COOKIE['username'];
$mysql_select = "SELECT * FROM `signup` WHERE user_id='$num_doc'";
$result = mysql_query($mysql_select);
$row = mysql_fetch_array($result);
$username = $row['username'];
$specialty = $row['specialty'];
$mysql_insert = "INSERT INTO visits(num_doc,date,comments,id_add_pac,username_doc,username_pac,specialty_doc) VALUES
('{$num_doc}','{$date}','{$comments}','{$id_add}','{$username}','{$username_pac}','{$specialty}')";
mysql_query($mysql_insert) or die ("<p>Blad! ".mysql_error());
echo '<p></p>';
?>
<a href="index.php"></a>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="../../style/style.css" rel="stylesheet">
</head>
<body>
<header>
<title>Dodanie wizyty</title>
<ul id="menu">
<li><a href="index.php">HOME</a></li>
<li><a href="../../kontakt.php">KONTAKT</a></li>
<li><a href="../../myprofil.php">MÓJ PROFIL</a></li>
<li><a href="opinie.php">OPINIE</a></li>
<?php
require 'connect.php';
$num_doc = $_REQUEST['radio'];
$mysql_select = "SELECT * FROM `signup` WHERE user_id='$num_doc'";
$result = mysql_query($mysql_select);
$row = mysql_fetch_array($result);
$username = $row['username'];
$date = $_REQUEST['date'];
?>
<div class="block90">
<h1>Wysłałeś prośbę o zapisanie się na spotkanie z lekarzem - <?php echo $row['username']; ?></h1>
*Jeśli wybrany termin zostanie potwierdzony - natychmiast pojawi się informacja w tym <a href="show_all.php" style="color: red;">miejscu.</a>
</div>
<div class="block44">
<a href="history.php" class="p1"><h2>Powrót</h2> </a>
<a href="index.php" class="p2"><h2>Powrót do głównego menu</h2> </a>
<a href="show_all.php" class="p1"><h2>Przejdź do umówionych wizyt</h2> </a>
<a href="lists.php" class="p1"><h2>Przejdź do listy lekarzy</h2> </a>
</div>
</header>
</body>
</html>
require 'connect.php';
$num_doc = $_REQUEST['radio'];
$date = $_REQUEST['date'];
$comments = $_REQUEST['comments'];
$next_date = $_REQUEST['next_date'];
$id_add = $_COOKIE['user_id'];
$username_pac = $_COOKIE['username'];
$mysql_select = "SELECT * FROM `signup` WHERE user_id='$num_doc'";
$result = mysql_query($mysql_select);
$row = mysql_fetch_array($result);
$username = $row['username'];
$specialty = $row['specialty'];
$get_count = "SELECT COUNT(*) FROM visits WHERE date='$date'";
if ($get_count > 0 ) {
$mysql_insert = "INSERT INTO visits(num_doc,date,comments,id_add_pac,username_doc,username_pac,specialty_doc) VALUES
('{$num_doc}','{$date}','{$comments}','{$id_add}','{$username}','{$username_pac}','{$specialty}')";
} else {
echo 'Выберите другое время';
}
$mysql_insert = "INSERT INTO visits(num_doc,date,comments,id_add_pac,username_doc,username_pac,specialty_doc) VALUES
('{$num_doc}','{$date}','{$comments}','{$id_add}','{$username}','{$username_pac}','{$specialty}')";
$mysql_select = "SELECT * FROM `visits` WHERE `num` = '".$_COOKIE['user_id']."' AND `date` > CURDATE() ORDER BY date";
$mysql_select = "SELECT * FROM `visits` WHERE `num` = '".$_COOKIE['user_id']."' AND `date` < CURDATE() ORDER BY date";
<?php
include("bd.php");
$res=mysql_query("SELECT * FROM `messages` WHERE `id_add` = '". $_COOKIE['doc_id'] . "' AND `id_to` = '". $_COOKIE['user_id'] . "' AND `id_add_pac` = '". $_COOKIE['user_id'] . "' AND `id_to_pac` = '". $_COOKIE['doc_id'] . "' ORDER BY `id`");
while($d=mysql_fetch_array($res))
{
echo "<b><font color='white'>".$d['login'].": </font></b>".$d['message']."<br>";
}
?>
<?php
include '../../doctor/connect.php';
$doc_id = $_GET['doc_id'];
$mysql_select = "SELECT * FROM `signup` WHERE `doctorcheck` = '1' AND user_id='" . mysql_real_escape_string( $doc_id ) . "'";
$result = mysql_query($mysql_select);
$row = mysql_fetch_array($result);
echo '<h1>Chat room ('.$row['username'].')</h1>'; ---- ЗДЕСЬ Я ПРОВЕРЯЮ НАЛИЧИЕ GET ЗАПРОСА - ВСЕ РАБОТАЕТ.
while($row = mysql_fetch_array($result))
?>
<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();
$.ajax({
type: "POST",
url: "add_mess.php",
data:"mess="+mess,
success: function(html)
{
load_messes();
$("#mess_to_send").val('');
}
});
}
function load_messes()
{
$.ajax({
type: "GET",
url: "load_messes.php",
data: "req=ok&doc_id=<?php echo $_GET['doc_id'];?>", ------- ЗДЕСЬ Я ДОБАВЛЯЮ GET ЗАПРОС ДЛЯ ПЕРЕДАЧИ В ФАЙЛ load_messes.php
success: function(html)
{
$("#messages").empty();
$("#messages").append(html);
$("#messages").scrollTop(90000);
}
});
}
</script>
<?php
include("bd.php");
$doc_id = $_GET['doc_id'];
$res=mysql_query("SELECT * FROM `messages` WHERE `id_add` = '". $_COOKIE['user_id'] . "' AND `id_to` = '" . mysql_real_escape_string( $doc_id ) . "' ORDER BY `id`");
while($d=mysql_fetch_array($res))
{
echo "<b><font color='white'>".$d['login'].": </font></b>".$d['message']."<br>";
}
?>
<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();
$.ajax({
type: "POST",
url: "add_mess.php",
data:"mess="+mess,
success: function(html)
{
load_messes();
$("#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>
<?php
include("bd.php");
$doc_id = $_GET['doc_id'];
$res=mysql_query("SELECT * FROM `messages` WHERE `id_add` = '". $_COOKIE['user_id'] . "' AND `id_to` = '" . mysql_real_escape_string( $doc_id ) . "' ORDER BY `id`");
while($d=mysql_fetch_array($res))
{
echo "<b><font color='white'>".$d['login'].": </font></b>".$d['message']."<br>";
}