public function salleattente($id_attente, $origin)
 {
     $mes_infos = requetemysql::mes_infos();
     if (empty($mes_infos)) {
         throw new Exception("Vous êtes introuvables dans la bdd identification!");
     }
     $mes_infos = json_decode($mes_infos, true);
     $tva = $mes_infos[0]['tva'];
     $marge_medic = $mes_infos[0]['marge'];
     $mes_infos2 = requetemysql::mes_infos2();
     if (empty($mes_infos2)) {
         throw new Exception("Vous êtes introuvables dans la bdd identification!");
     }
     $mes_infos2 = json_decode($mes_infos2, true);
     $afficher_facture = $mes_infos2[0]['facture'];
     $afficher_resume = $mes_infos2[0]['resume'];
     $salle_attente = requetemysql::salle_attente($id_attente);
     if (empty($salle_attente)) {
         throw new Exception("Aucun animal dans la salle d'attente !");
     }
     $salle_attente2 = json_decode($salle_attente, true);
     $id_pro = $salle_attente2[0]['id_pro'];
     $id_ani = $salle_attente2[0]['id_ani'];
     $nom_a = $salle_attente2[0]['nom_a'];
     $nom_p = $salle_attente2[0]['nom_p'];
     $animal = requetemysql::findunanimal(array('id_pro' => $id_pro, 'id_ani' => $id_ani));
     if (json_decode($animal) == '') {
         $quiadelete = requetemysql::findwhodelete(array('id_s' => $id_attente));
         if (count(json_decode($quiadelete)) == 0) {
             header('HTTP/1.1 403 Forbidden');
             exit(utf8_decode("Cet animal n'est plus en salle d'attente. La fiche a été validée ou les données ont été perdues lors d'un changement de page."));
             //throw new Exception("Aucun animal de cet id dans la base de donnée !");
         } else {
             $quiadelete2 = json_decode($quiadelete, true);
             header('HTTP/1.1 403 Forbidden');
             exit(utf8_decode("Cet animal n'est plus en salle d'attente. La fiche a été validée ou supprimée par " . $quiadelete2[0]['login'] . " le " . $quiadelete2[0]['ma_date']));
         }
     }
     $historique = requetemysql::historique(array('id' => $id_ani));
     if (empty($historique)) {
         throw new Exception("Erreur dans la recherche des antécédents de l animal");
     }
     $client = requetemysql::findunclient(array('id' => $id_pro));
     if (empty($client)) {
         throw new Exception("Aucun client dans la base de donnée !");
     }
     $animal2 = json_decode($animal, true);
     $datenais = $animal2[0]['datenais'];
     $tarif = requetemysql::info_tarif();
     if (empty($tarif)) {
         throw new Exception("Aucun tarif dans la base de donnée !");
     }
     // recherche dans la base de donnee les differents règlements pour le client
     $restedu = requetemysql::restedu(array('id_pro' => $id_pro));
     if (empty($restedu)) {
         throw new Exception("Pas de règlement dans la base");
     }
     $vetos = requetemysql::listevetos();
     if (empty($vetos)) {
         throw new Exception("Pas de vetos dans la base");
     }
     $liste_resume = array(array(nom => "Vaccin", valeur => 5), array(nom => "Gastrite", valeur => 3), array(nom => "Enterite", valeur => 4), array(nom => "Abattement", valeur => 2), array(nom => "boiterie", valeur => 4), array(nom => "Certificat", valeur => 1), array(nom => "Anorexie", valeur => 3), array(nom => "Otite", valeur => 2), array(nom => "Piroplasmose", valeur => 2), array(nom => "Epillet oreille", valeur => 3), array(nom => "Ovarioectomie", valeur => 1), array(nom => "Castration", valeur => 1), array(nom => "Difficultés respiratoires", valeur => 1), array(nom => "Cardiaque", valeur => 3), array(nom => "Achat", valeur => 5), array(nom => "Arthrose", valeur => 3));
     $liste_motif_relance = array(array(nom => "Vaccin", valeur => 1), array(nom => "Anovulatoire", valeur => 2), array(nom => "Vermifuge", valeur => 3));
     $liste_analyse = array(array(nom => "Urée", unite => "g/l", base => "< 0.7g/l", methode => "reflotron"), array(nom => "Glucose", unite => "g/l", base => "< 1.3g/l", methode => "reflotron"), array(nom => "PAL", unite => "UI/l", base => "< 200UI/l", methode => "reflotron"), array(nom => "Globules Blancs", unite => "m/l", base => "< 15000m/l", methode => "MS4"), array(nom => "Hémathocrite", unite => "g/l", base => "> 8g/l", methode => "MS4"));
     $liste_radio = array(array(nom => "thorax profil petit chien", kV => "70", mAS => "5", sec => "5"), array(nom => "abdomen face petit chien", kV => "80", mAS => "10", sec => "6"), array(nom => "Carpe gros chien", kV => "20", mAS => "3", sec => "7"), array(nom => "bassin petit chat", kV => "60", mAS => "7", sec => "8"));
     $efface_salle_attente = requetemysql::supr_salle_attente($id_attente, $nom_a, $nom_p);
     if (empty($efface_salle_attente)) {
         throw new Exception("Effaçage de la salle d attente impossible !");
     }
     render('_nouvelleconsultation', array('title' => 'Fiche Animal', 'id_pro' => $id_pro, 'id_ani' => $id_ani, 'animal' => $animal, 'client' => $client, 'origin' => $origin, 'liste_resume' => $liste_resume, 'liste_motif_relance' => $liste_motif_relance, 'liste_analyse' => $liste_analyse, 'liste_radio' => $liste_radio, 'liste_vetos' => $vetos, 'veto' => $_SESSION['login'], 'historique' => $historique, 'datenaissance' => $datenais, 'tarif' => $tarif, 'tva' => $tva, 'restedu' => $restedu, 'marge_medic' => $marge_medic, 'afficher_facture' => $afficher_facture, 'afficher_resume' => $afficher_resume, 'salle_attente_donnee' => $salle_attente, 'themechargement' => 'b', 'cas' => 'salle_attente', 'consult' => 0, 'veto_repartition' => 0, 'liste_tournures' => ordo_settings_tourn(), 'liste_cat_delivre' => ordo_settings_cat(), 'info_veto' => info_clini(), 'textechargement' => 'enregistrement en cours'));
 }
Ejemplo n.º 2
0
     $data3 = $_GET['choix'];
     $data4 = $_GET['choix2'];
     if ($_SESSION['droit'] == 0 && $_SESSION['login'] != $_SESSION['login2']) {
         $st = $db->prepare("select animal.id_p, client.nom, client.prenom, client.id2, client.adresse, client.code, client.ville, client.variable, animal.id, animal.nom_a, animal.espece, animal.sexe, animal.race, animal.variable2, animal.mort, animal.datenais FROM animal inner JOIN client ON client.id2=animal.id_p where (client.permission2='" . $_SESSION['login'] . "' and animal.permission='" . $_SESSION['login'] . "' and client.ref='" . $_SESSION['id'] . "' and {$data3} LIKE '{$data4}{$data2}%') order by client.nom asc");
     } else {
         $st = $db->prepare("select animal.id_p, client.nom, client.prenom, client.id2, client.adresse, client.code, client.ville, client.variable, animal.id, animal.nom_a, animal.espece, animal.sexe, animal.race, animal.variable2, animal.mort, animal.datenais FROM animal inner JOIN client ON client.id2=animal.id_p where (client.permission2='" . $_SESSION['login'] . "' and animal.permission='" . $_SESSION['login'] . "' and {$data3} LIKE '{$data4}{$data2}%') order by client.nom asc");
     }
     $st->execute($arr);
     // Returns an array of Category objects:
     if ($data3 == "client.nom") {
         echo json_encode($st->fetchAll(PDO::FETCH_ASSOC | PDO::FETCH_GROUP));
     } elseif ($data3 == "animal.nom_a") {
         echo json_encode($st->fetchAll());
     }
 } elseif ($_GET['action'] == 'suppression') {
     requetemysql::supr_salle_attente($_POST['id'], $_POST['nom_a'], $_POST['nom_p']);
     $salle_attente = requetemysql::salle_attente("general");
     if (empty($salle_attente)) {
         throw new Exception("Aucun animal dans la salle d'attente !");
     }
     echo $salle_attente;
 } elseif ($_GET['action'] == 'suppression2') {
     requetemysql::supr_rapport_refere($_POST['id']);
     $rapport_refere = requetemysql::rapport_refere("general");
     if (empty($rapport_refere)) {
         throw new Exception("Vous n'avez pas recu de cas référé !");
     }
     echo $rapport_refere;
 } elseif ($_GET['action'] == 'suppression3') {
     requetemysql::supr_mur($_POST['id_mur']);
     $liste_mur = requetemysql::liste_mur();