| 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/exemple/ |
Upload File : |
<?php
require_once '../consumuri/api/api/conectare.php';
require_once 'fisier_dia.php';
$xml=simplexml_load_string($myXMLData) or die("Error: Cannot create object");
$json = json_encode($xml);
$array = json_decode($json,TRUE);
foreach($array['HDs']['HD'] as $hd){
$cnp = $hd['@attributes']['pid'];
$cid = $hd['@attributes']['cid'];
$AppID = $hd['@attributes']['AppID'];
$mode = 'new';
$a="SELECT * FROM dia_pacienti WHERE cnp=$cnp LIMIT 1";
$aa=mysql_query($a)or die(mysql_error());
if (mysql_num_rows($aa) > 0) {
$mode = 'update';
WHILE ($rw=mysql_fetch_assoc($aa)){
// $id = $rw['id'];
}
}
if($mode === 'new'){
$sql = "INSERT INTO dia_pacienti (cnp,cid,definitiv,appid)
VALUES ('$cnp','$cid','$fisa','1', $AppID)";
}elseif($mode === 'update'){
$sql = "UPDATE dia_pacienti SET cid='$cid',definitiv='1', appid = $AppID
WHERE cnp=$cnp";
}
mysql_query($sql);
}
?>