<meta http-equiv="content-type" content="text/html; charset=windows-1254">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-9">

<!-- Add jQuery library -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>

<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox -->
<link rel="stylesheet" href="fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

<!-- Optionally add helpers - button, thumbnail and/or media -->
<link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>

<link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>

<?php
include("../baglan.php");
include("../css.php");
  if(isset($_GET['HASTA_ID'])) $HASTA_ID = $_GET['HASTA_ID'];
$baglan = mysql_query("select * from hastalar where HASTA_ID='$HASTA_ID'"); 

 



$yaz = mysql_fetch_assoc($baglan); // while dongsu icine almadim tek veri cekecegimiz icin. burda get methodunu da kullandık

 
?>
<?php
include("baglan.php");
 if(isset($_GET['HASTA_ID'])) $HASTA_ID = $_GET['HASTA_ID'];

$baglan2 = mysql_query("select * from hasta where HASTA_ID='$HASTA_ID'"); 

 



$yaz2 = mysql_fetch_assoc($baglan2); // while dongsu icine almadim tek veri cekecegimiz icin. burda get methodunu da kullandık

 
?>



<?php
include("baglan.php");
 
if(isset($_GET['HASTA_ID'])) $HASTA_ID = $_GET['HASTA_ID'];

$baglan3 = mysql_query("select count(*)  as toplam_islem from hasta where HASTA_ID='$HASTA_ID'"); 
 
$yaz3 = mysql_fetch_assoc($baglan3); // while dongsu icine almadim tek veri cekecegimiz icin. burda get methodunu da kullandık


?>


<?php
 include("baglan.php");
 
if(isset($_GET['HASTA_ID'])) $HASTA_ID = $_GET['HASTA_ID'];

$baglan2 = mysql_query("select * from hasta where HASTA_ID='$HASTA_ID' order by ISLEM_ID desc limit 0, 1"); 

 



$yaz2 = mysql_fetch_assoc($baglan2); // while dongsu icine almadim tek veri cekecegimiz icin. burda get methodunu da kullandık
 
function fark_bul ($tarih1,$tarih2)
{
/*
* İki Tarih Arasındaki Gün Sayısını Bulur
* Author: Raiden
*/

if (!preg_match("@\.@",$tarih1) || !preg_match("@\.@",$tarih2)) exit('Yapılan İşlem Yok...');

list($gun1,$ay1,$yil1) = explode('.',$tarih1);
list($gun2,$ay2,$yil2) = explode('.',$tarih2);

$tarih1_timestamp = mktime('0','0','0',$ay1,$gun1,$yil1);
$tarih2_timestamp = mktime('0','0','0',$ay2,$gun2,$yil2);

if ($tarih1_timestamp > $tarih2_timestamp)
{
$fark = ($tarih1_timestamp - $tarih2_timestamp) / 86400;

}

if ($tarih2_timestamp > $tarih1_timestamp)
{
$fark = ($tarih2_timestamp - $tarih1_timestamp) / 86400;
}

return $fark;
}


$mesut=$yaz2["HASTA_ISLEM_TARIHI"];


$simdi=date('d.m.Y');


?>
 


<div id="example2" >
       <section class="content">

      <div class="row">
        <div class="col-md-3">

          <!-- Profile Image -->
          <div class="box box-primary">
 


<img src="<? echo $yaz["HASTA_FOTO"];?>" style="width:150px; float:left; margin-top:60px;">
<div style="float:right; width:80%;">
              <h3 class="profile-username text-center"><? echo $yaz["HASTA_ADI"];?></h3>

             

              <ul class="list-group list-group-unbordered">
                <li class="list-group-item">
                  <b>TC KİMLİK NO:</b> <a class="pull-right"><? echo $yaz["HASTA_KURUM"];?></a>
                </li>
                <li class="list-group-item">
                  <b>TELEFON</b> <a class="pull-right"><? echo $yaz["HASTA_TELEFON"];?></a>
                </li>
                <li class="list-group-item">
                  <b>DOĞUM TARİHİ</b> <a class="pull-right"><? echo $yaz["HASTA_DOGUM_TARIHI"];?></a>
                </li>



 <li class="list-group-item">
                  <b>EN SON YAPILAN İŞLEM TARİH</b> <a class="pull-right"><? echo $yaz2["HASTA_ISLEM_TARIHI"];?></a>
                </li>

 <li class="list-group-item">
                  <b>EN SON İŞLEM</b> <a class="pull-right"><? 

$f = fark_bul($simdi,$mesut);


echo $f;

 ?> GÜN ÖNCE</a>
 <?php
if ($f > '15') {
    echo "ARA";
}else {
    echo "ARAMA";
}
 
 ?>
 
                </li>


              </ul>
 

 
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

        

        <!-- /.col -->
 
     </div></div></section>
    </div>

 <script type="text/javascript">
        $(document).ready(function() {
            $.fancybox("#example2");

        });
    </script>
 
 