re - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of re.php

  1. <?php
  2. $json='[{
  3.     "codeAnomalie": "00200",
  4.     "libelleCourt": "En attente document(s) importation",
  5.     "libelleLong": "En attente document(s) importation",
  6.     "apms": false,
  7.     "forImportation": true,
  8.     "createCourrierCloture": false,
  9.     "code": "00200",
  10.     "visible": true,
  11.     "libelle": "En attente document(s) importation"
  12. },
  13. {
  14.     "codeAnomalie": "00025",
  15.     "libelleCourt": "Importation/échange UE animal moins de 15 semaines",
  16.     "libelleLong": "Importation/échange UE animal moins de 15 semaines",
  17.     "apms": true,
  18.     "forImportation": true,
  19.     "createCourrierCloture": true,
  20.     "code": "00025",
  21.     "visible": true,
  22.     "libelle": "Importation/échange UE animal moins de 15 semaines"
  23. },
  24. {
  25.     "codeAnomalie": "00030",
  26.     "libelleCourt": "Echange com.:Examen clinique absent ou non valide",
  27.     "libelleLong": "Echange commercial UE : examen clinique absent ou non valide",
  28.     "apms": true,
  29.     "forImportation": true,
  30.     "createCourrierCloture": false,
  31.     "code": "00030",
  32.     "visible": true,
  33.     "libelle": "Echange commercial UE : examen clinique absent ou non valide"
  34. },
  35. {
  36.     "codeAnomalie": "00005",
  37.     "libelleCourt": "Titrage antirabique absent ou non valide",
  38.     "libelleLong": "Titrage antirabique absent ou non valide",
  39.     "apms": true,
  40.     "forImportation": true,
  41.     "createCourrierCloture": true,
  42.     "code": "00005",
  43.     "visible": true,
  44.     "libelle": "Titrage antirabique absent ou non valide"
  45. },
  46. {
  47.     "codeAnomalie": "00010",
  48.     "libelleCourt": "Vaccination antirabique absente ou non valide",
  49.     "libelleLong": "Vaccination antirabique absente ou non valide",
  50.     "apms": true,
  51.     "forImportation": true,
  52.     "createCourrierCloture": true,
  53.     "code": "00010",
  54.     "visible": true,
  55.     "libelle": "Vaccination antirabique absente ou non valide"
  56. },
  57. {
  58.     "codeAnomalie": "00015",
  59.     "libelleCourt": "Vac. antirab. non valide, date inconnue sur sol fr",
  60.     "libelleLong": "Vacinnation antirabique non valide et date arrivée sur le sol français inconnue",
  61.     "apms": true,
  62.     "forImportation": true,
  63.     "createCourrierCloture": true,
  64.     "code": "00015",
  65.     "visible": true,
  66.     "libelle": "Vacinnation antirabique non valide et date arrivée sur le sol français inconnue"
  67. },
  68. {
  69.     "codeAnomalie": "00020",
  70.     "libelleCourt": "Sans document sanitaire officiel",
  71.     "libelleLong": "Sans document sanitaire officiel",
  72.     "apms": true,
  73.     "forImportation": true,
  74.     "createCourrierCloture": true,
  75.     "code": "00020",
  76.     "visible": true,
  77.     "libelle": "Sans document sanitaire officiel"
  78. },
  79. {
  80.     "codeAnomalie": "00105",
  81.     "libelleCourt": "Titrage antirabique absent ou non valide",
  82.     "libelleLong": "Titrage antirabique absent ou non valide",
  83.     "apms": false,
  84.     "forImportation": true,
  85.     "createCourrierCloture": false,
  86.     "code": "00105",
  87.     "visible": true,
  88.     "libelle": "Titrage antirabique absent ou non valide"
  89. },
  90. {
  91.     "codeAnomalie": "00110",
  92.     "libelleCourt": "Vaccination antirabique absente ou non valide",
  93.     "libelleLong": "Vaccination antirabique absente ou non valide",
  94.     "apms": false,
  95.     "forImportation": true,
  96.     "createCourrierCloture": false,
  97.     "code": "00110",
  98.     "visible": true,
  99.     "libelle": "Vaccination antirabique absente ou non valide"
  100. },
  101. {
  102.     "codeAnomalie": "00115",
  103.     "libelleCourt": "Aucun doc. animal sol français +6mois",
  104.     "libelleLong": "Aucun document animal sol français +6mois",
  105.     "apms": false,
  106.     "forImportation": true,
  107.     "createCourrierCloture": false,
  108.     "code": "00115",
  109.     "visible": true,
  110.     "libelle": "Aucun document animal sol français +6mois"
  111. },
  112. {
  113.     "codeAnomalie": "00130",
  114.     "libelleCourt": "Echange: examen clinique absent ou non valide",
  115.     "libelleLong": "Echange: examen clinique absent ou non valide",
  116.     "apms": false,
  117.     "forImportation": true,
  118.     "createCourrierCloture": false,
  119.     "code": "00130",
  120.     "visible": true,
  121.     "libelle": "Echange: examen clinique absent ou non valide"
  122. },
  123. {
  124.     "codeAnomalie": "00035",
  125.     "libelleCourt": "Animal introduit sur le sol français sans identif.",
  126.     "libelleLong": "Animal introduit sur le sol français sans identification",
  127.     "apms": true,
  128.     "forImportation": false,
  129.     "createCourrierCloture": true,
  130.     "code": "00035",
  131.     "visible": true,
  132.     "libelle": "Animal introduit sur le sol français sans identification"
  133. },
  134. {
  135.     "codeAnomalie": "00002",
  136.     "libelleCourt": "Document sanitaire officiel non valide",
  137.     "libelleLong": "Document sanitaire officiel non valide",
  138.     "apms": true,
  139.     "forImportation": true,
  140.     "createCourrierCloture": true,
  141.     "code": "00002",
  142.     "visible": true,
  143.     "libelle": "Document sanitaire officiel non valide"
  144. },
  145. {
  146.     "codeAnomalie": "00102",
  147.     "libelleCourt": "Document sanitaire officiel non valide",
  148.     "libelleLong": "Document sanitaire officiel non valide",
  149.     "apms": false,
  150.     "forImportation": true,
  151.     "createCourrierCloture": false,
  152.     "code": "00102",
  153.     "visible": true,
  154.     "libelle": "Document sanitaire officiel non valide"
  155. },
  156. {
  157.     "codeAnomalie": "00040",
  158.     "libelleCourt": "Animal en présence d\'un animal sous APMS",
  159.     "libelleLong": "Animal en présence d\'un animal sous APMS",
  160.     "apms": true,
  161.     "forImportation": false,
  162.     "createCourrierCloture": true,
  163.     "code": "00040",
  164.     "visible": true,
  165.     "libelle": "Animal en présence d\'un animal sous APMS"
  166. },
  167. {
  168.     "codeAnomalie": "00045",
  169.     "libelleCourt": "Pas de docu. sanitaire officiel envoyé sous 15 jrs",
  170.     "libelleLong": "Pas de document sanitaire officiel envoyé sous 15 jrs (pays tiers)",
  171.     "apms": true,
  172.     "forImportation": true,
  173.     "createCourrierCloture": true,
  174.     "code": "00045",
  175.     "visible": true,
  176.     "libelle": "Pas de document sanitaire officiel envoyé sous 15 jrs (pays tiers)"
  177. },
  178. {
  179.     "codeAnomalie": "00050",
  180.     "libelleCourt": "Importation : DVCE absent",
  181.     "libelleLong": "Importation : DVCE absent",
  182.     "apms": false,
  183.     "forImportation": true,
  184.     "createCourrierCloture": false,
  185.     "code": "00050",
  186.     "visible": true,
  187.     "libelle": "Importation : DVCE absent"
  188. },
  189. {
  190.     "codeAnomalie": "00055",
  191.     "libelleCourt": "DVCE NC, animaux enregistrés > nbre inscrit DVCE",
  192.     "libelleLong": "DVCE NC, animaux enregistrés > nbre inscrit DVCE",
  193.     "apms": false,
  194.     "forImportation": true,
  195.     "createCourrierCloture": false,
  196.     "code": "00055",
  197.     "visible": true,
  198.     "libelle": "DVCE NC, animaux enregistrés > nbre inscrit DVCE"
  199. },
  200. {
  201.     "codeAnomalie": "00125",
  202.     "libelleCourt": "Importation/échange UE animal moins de 15 semaines",
  203.     "libelleLong": "Importation/échange UE animal moins de 15 semaines",
  204.     "apms": false,
  205.     "forImportation": true,
  206.     "createCourrierCloture": false,
  207.     "code": "00125",
  208.     "visible": true,
  209.     "libelle": "Importation/échange UE animal moins de 15 semaines"
  210. },
  211. {
  212.     "codeAnomalie": "00060",
  213.     "libelleCourt": "Vaccination antirabique réalisée avant 12 semaines",
  214.     "libelleLong": "Vaccination antirabique réalisée avant 12 semaines",
  215.     "apms": true,
  216.     "forImportation": true,
  217.     "createCourrierCloture": true,
  218.     "code": "00060",
  219.     "visible": true,
  220.     "libelle": "Vaccination antirabique réalisée avant 12 semaines"
  221. },
  222. {
  223.     "codeAnomalie": "00065",
  224.     "libelleCourt": "Vaccination non valide: délai de 21jr non respecté",
  225.     "libelleLong": "Vaccination non valide: délai de 21jr non respecté",
  226.     "apms": true,
  227.     "forImportation": true,
  228.     "createCourrierCloture": true,
  229.     "code": "00065",
  230.     "visible": true,
  231.     "libelle": "Vaccination non valide: délai de 21jr non respecté"
  232. },
  233. {
  234.     "codeAnomalie": "00160",
  235.     "libelleCourt": "Vaccination antirabique réalisée avant 12 semaines",
  236.     "libelleLong": "Vaccination antirabique réalisée avant 12 semaines",
  237.     "apms": false,
  238.     "forImportation": true,
  239.     "createCourrierCloture": false,
  240.     "code": "00160",
  241.     "visible": true,
  242.     "libelle": "Vaccination antirabique réalisée avant 12 semaines"
  243. },
  244. {
  245.     "codeAnomalie": "00165",
  246.     "libelleCourt": "Vaccination non valide: délai de 21jr non respecté",
  247.     "libelleLong": "Vaccination non valide: délai de 21jr non respecté",
  248.     "apms": false,
  249.     "forImportation": true,
  250.     "createCourrierCloture": false,
  251.     "code": "00165",
  252.     "visible": true,
  253.     "libelle": "Vaccination non valide: délai de 21jr non respecté"
  254. },
  255. {
  256.     "codeAnomalie": "00046",
  257.     "libelleCourt": "Pas de passeport envoyé sous 1 mois (UE)",
  258.     "libelleLong": "Pas de passeport envoyé sous 1 mois (UE)",
  259.     "apms": true,
  260.     "forImportation": true,
  261.     "createCourrierCloture": true,
  262.     "code": "00046",
  263.     "visible": true,
  264.     "libelle": "Pas de passeport envoyé sous 1 mois (UE)"
  265. },
  266. {
  267.     "codeAnomalie": "00300",
  268.     "libelleCourt": "Symptômes de rage",
  269.     "libelleLong": "Animal avec des symptômes de la rage",
  270.     "apms": true,
  271.     "forImportation": true,
  272.     "createCourrierCloture": true,
  273.     "code": "00300",
  274.     "visible": true,
  275.     "libelle": "Animal avec des symptômes de la rage"
  276. },
  277. {
  278.     "codeAnomalie": "00042",
  279.     "libelleCourt": "Animal retour en France en sit. sanit. non valide",
  280.     "libelleLong": "Animal de retour en France en situation sanitaire non valide",
  281.     "apms": true,
  282.     "forImportation": false,
  283.     "createCourrierCloture": true,
  284.     "code": "00042",
  285.     "visible": true,
  286.     "libelle": "Animal de retour en France en situation sanitaire non valide"
  287. }]';
  288.  
  289. $a=json_decode($json);
  290. foreach($a as $b){
  291.     echo "INSERT INTO anomaly_parameter (shortlabel,label,code)VALUES('".$b['libelleCourt']."','".$b['libelle']."','".$b['code']."');";
  292.     }
  293. }
  294. }
File Description
  • re
  • PHP Code
  • 22 Feb-2021
  • 9.36 Kb
You can Share it: