| Server IP : 31.14.161.123 / Your IP : 216.73.216.229 Web Server : Apache System : Linux cpanel.classit.ro 4.18.0-553.144.1.el8_10.x86_64 #1 SMP Tue Jul 14 09:26:58 EDT 2026 x86_64 User : diamedic ( 1014) PHP Version : 8.2.32 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/diamedic/public_html/pacienti/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><?php
include "conectare.php";
include "functii_v2.php";
?>
<head>
<title>jQuery plugin: Tablesorter 2.0 - Initializing tablesorter on a empty table</title>
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
<link rel="stylesheet" href="themes/blue/style.css" type="text/css" id="" media="print, projection, screen" />
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="dragtable.js"></script>
<script type="text/javascript" src="sorttable.js"></script>
<script type="text/javascript" src="jquery.thfloat-0.7.2.min.js"></script>
<script type="text/javascript" id="js">
var chID =0;
var style = 0;
var element;
var pacient;
var luna;
var an;
var retID;
var allow = 'no';
$(document).ready(function() {
$("#tabel td:first-child").click(function() {
$(this).parent().toggleClass("main");
});
//$('table').floatThead();
$("table").thfloat({
noprint : false
});
});
function inchide() {
if( !style){ chID.attr('style',''); }else{
chID.attr('style',style); }
$('#schimba').hide();
chID.attr("sel","");
chID = 0;
}
function slvare(e) {
var svr = $(e).parent().parent().children('.editfield').children('input');
salvare (svr);
}
function salvare($this) {
var newv = $this.val();
var newID =$this.parent().parent().attr('id');
var lunade =$this.parent().parent().attr('luna');
var ande =$this.parent().parent().attr('an');
var nade =$this.parent().parent().attr('denumire');
var CeNePe =$this.parent().parent().parent().children('.pac').attr('cnp');
if(newv !== ' - ' && newv !==$this.parent().parent().children('p').html()){
$.ajax({
type: "POST",
url: 'salvare.php',
data: ({ val:newv,
id:newID,
cnp:CeNePe,
an:ande,
luna:lunade,
name:nade,
}),
success: function(data) {
if(newID <1){
$this.parent().parent().attr('id',data);}
$this.parent().hide();
$this.parent().parent().children('p').show();
$this.parent().parent().children('p').text(newv);
$this.parent().parent().children('.butoane').children('.sve').hide();
$this.parent().parent().children('.butoane').children('.anulare').hide();
$this.parent().parent().children('.butoane').children('.edtre').show();
}
});
}
if(newv==$('#initial').html()) {
if( !style){ chID.html(newv).attr('initial',$('#initial').html()).attr('style',''); }else{
chID.html(newv).attr('initial',$('#initial').html()).attr('style',style); }
}else{
chID.html(newv).attr('initial',$('#initial').html()).css("background","#CCFFCD").css("font-weight","bold");
}
$('#schimba').hide();
chID.attr("sel","");
chID = 0;
}
function anulare(e) {
var oldVal = $(e).parent().parent().children('p').html();
$(e).parent().parent().children('.editfield').hide();
$(e).parent().parent().children('.editfield').children('input').val(oldVal);
$(e).hide();
$(e).parent().children('.sve').hide();
$(e).parent().children('.edtre').show();
$(e).parent().parent().children('p').show();
}
function listare(e) {
if($(e).parent().parent().children('.sustine').css("display") == 'block') {$(e).parent().parent().children('.sustine').hide(); }else{
// actiune pentru 1 singur click
$(e).parent().parent().children('.sustine').show();
}
$(e).parent().parent().removeClass('clicked');
}
function edtre(e) {
$(e).parent().parent().children('.editfield').show();
$(e).parent().children('.sve').show();
$(e).parent().children('.anulare').show();
$(e).parent().parent().children('p').hide();
$(e).hide();
}
$(document).ready(function() {
//salvare noile valori la apasare de enter
$("input").keypress(function (e) {
if (e.which == 13) {
salvare($(this));
return false; //<---- Add this line
}
});
});
</script>
<style>
#activ {
position:fixed;
right:0;
bottom:0;
margin-bottom:10px;
margin-right:10px;
}
.butoane {display:none; }
td:hover .butoane {display:block; }
.butoane div {cursor:pointer; }
.butoane div:hover {padding-top:6px; }
.editfield{ display:none; }
#istr .img {display:none;}
#istr .istoric {width:100%;margin-left:0;position:inherit;}
#schimba {
background:#ccc;
width:300px;
height:160px;
position: fixed;
top: 50%;
left: 50%;
margin-left: -150px;
margin-top: -80px;
z-index:999;
display:none;
}
.pac {cursor:pointer;}
table.tablesorter .par td { background-color:#eee;border:1px solid #fff;}
table.tablesorter tr { height:43px;}
table.tablesorter tbody .main td { background-color:#fca;font-weight:bold;}
.crestere { background-image:url("img/crestere.png");background-repeat:no-repeat;background-position:right center;}
.descrestere { background-image:url("img/descrestere.png");background-repeat:no-repeat;background-position:right center;}
.sustine { display: none; float: left; margin-left: 50%; position: relative; text-transform:uppercase;}
.istoric { color:#fff; background: none repeat scroll 0 0 #E74C3C;padding:0 1px 1px 1px; border:1px solid #fff;border-top:0; margin-left: -70px; margin-top: 18px; position: absolute; width: 130px;}
.istoric p{ margin:3px 1px;}
.istoric .bb { padding:2px 5px;border:1px solid #fff;}
.sustine .img { position:absolute;margin-top:6px;margin-left:-14px;}
#istr{margin:3px 1px;}
.butoane {float:right; }
.butoane div {float:left; padding:0 3px; }
.butoane .sve {display:none; }
.butoane .anulare {display:none; }
</style>
</head>
<body><div id="rezultate"></div>
<?
$viz = $_GET["v"];
//$edd = $_GET["editare"];
?>
<table class="sortable draggable tablesorter" id="tabel" cellspacing="1">
<?php
$vize = explode(',', $viz);
$titluri = array();
$rand = array();
foreach($vize as $vi){
$caut = 0;
$caut = explode('-', $vi);
$q="SELECT * FROM dia_factori WHERE id=$caut[0] LIMIT 1";
$rs=mysql_query($q);
if (mysql_num_rows($rs) > 0) {
WHILE ($row=mysql_fetch_array($rs)){
$denu = $row['cautare'];
$min = $row['min'];
$max = $row['max'];
$titluri[] = '<th el="'.$denu.'" luna="'.$caut[1].'" an="20'.$caut[2].'" >'.$denu.' '.luna($caut[1]).'/'.$caut[2].'</th>';
}
}
// list cu analizele si prescriptiile solicitiate
if($caut[1]){ $rand[] = array( "nid"=>$caut[0],"name"=>$denu, "luna"=>$caut[1], "abb"=>$caut[2],"an"=>'20'.$caut[2],"min"=>$min,"max"=>$max ); }
}
function incr_m($str){
for( $i=2; $i>0; $i-- )
{
$j =0;
$nd ='';
foreach ($str as $s){
if($j ==0){
$j =1;
}else{
$nd = $nd.',';
}
$nm = $s['nid'];
$ln = $s['luna'];
$ann = $s['abb'];
$vll = dec_by($nm,$ln,$ann,$i);
$nd = $nd.''.$vll;
$lna = $ln-$i;
if($lna<1){ $anna = $ann - 1;$lna=12+$lna;}else {$anna = $ann;}
}
echo '<div style="background:#eee;padding:5px 15px;float:left;"><a href="/pacienti/comparatii_v2.php?v='.$nd.'">Luna '.luna($lna).'.'.$anna.' </a></div>';
}
}
echo incr_m($rand);
function i_m($str){
for( $i=1; $i<3; $i++ )
{
$j =0;
$nd ='';
foreach ($str as $s){
if($j ==0){
$j =1;
}else{
$nd = $nd.',';
}
$nm = $s['nid'];
$ln = $s['luna'];
$ann = $s['abb'];
$vll = inc_by($nm,$ln,$ann,$i);
$nd = $nd.''.$vll;
$lna = $ln+$i;
if($lna >= 13){ $anna = $ann + 1;$lna=1;}else {$anna = $ann;}
}
echo $lna;
echo '<div style="background:#eee;padding:5px 15px;float:left;"><a href="/pacienti/comparatii.php?v='.$nd.'">Luna '.luna($lna).'.'.$anna.' </a></div>';
}
}
$luna_asta = $rand[0][luna];
$an_asta = $rand[0][an];
echo '<div style="background:#ffcccc;padding:5px 15px;float:left;"><b>Luna '.luna($luna_asta).'.'.$an_asta.'</b> </div>';
echo i_m($rand);
//print_r($rand);
?>
<div style="clear:both"></div>
<thead>
<tr>
<th>Nume</th>
<?php
foreach ($titluri as $titlu){
echo $titlu;
}
?>
</tr>
</thead>
<tbody>
<?php
$users = array();
$query="SELECT cnp,nume FROM dia_pacienti ORDER BY nume ASC";
$res=mysql_query($query);
if (mysql_num_rows($res) > 0) {
WHILE ($row=mysql_fetch_array($res)){
// pregatire lista pacienti cu analize
$users[] = array('cnp'=>$row['cnp'], 'nume'=>$row['nume'] );
}
}
// print_r($rand);
$unr = 2;
foreach($users as $user){
if ($unr ==1){
$tr = 'class=par';
$unr = 2;
}else{ $unr = 1; $tr = '';}
$username = $user['nume'];
$cnpu = $user['cnp'];
if($cnpu!=='0'){
echo "<tr $tr> <td cnp=\"$cnpu\" class='pac'>$username</td>";
foreach($rand as $cell){
prod($cnpu,$cell['name'],$cell['luna'],$cell['an'],$cell['min'],$cell['max']);
}
echo '</tr> '; }
}
?>
</tbody>
</table>
<div id="ascuns"></div>
</body>