Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lionel VEST
societe.ninja
Commits
cf61cee6
Commit
cf61cee6
authored
Apr 27, 2021
by
Lionel VEST
Browse files
Chambre des Métiers et de l'artisanat
parent
dd922fc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
rm.php
rm.php
+32
-0
No files found.
rm.php
0 → 100644
View file @
cf61cee6
<?php
basename
(
$_SERVER
[
'PHP_SELF'
])
==
basename
(
__FILE__
)
&&
exit
;
if
(
$_GET
[
'siren'
]
&&
!
preg_match
(
'/^[0-9]{9}+$/'
,
$_GET
[
'siren'
]))
die
(
'Invalid siren : '
.
$_GET
[
'siren'
]);
if
(
file_exists
(
'rm/'
.
$_GET
[
'siren'
]
.
'.json'
))
{
if
(
time
()
>
filemtime
(
'rm/'
.
$_GET
[
'siren'
]
.
'.json'
)
+
86400
)
unlink
(
'rm/'
.
$_GET
[
'siren'
]
.
'.json'
);
else
$rm_data
=
file_get_contents
(
'rm/'
.
$_GET
[
'siren'
]
.
'.json'
);
}
//ETABLISSEMENTS
if
(
!
$rm
)
{
curl_setopt
(
$curl
,
CURLOPT_URL
,
"https://api-rnm.artisanat.fr/v2/entreprises/"
.
$_GET
[
'siren'
]);
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
true
);
$json
=
curl_exec
(
$curl
);
$rm_data
=
json_decode
(
$json
);
file_put_contents
(
'rm/'
.
$_GET
[
'siren'
]
.
'.json'
,
$json
);
}
else
$rm_data
=
json_decode
(
$rm
);
if
(
$rm_data
->
id
)
{
$rm
[
'Chambre'
]
=
$rm_data
->
gest_dept
.
' ('
.
$rm_data
->
gest_reg
.
')'
;
$rm
[
'N° de Gestion'
]
=
$rm_data
->
ent_id_num_gestion
;
$rm
[
'Immatriculation'
]
=
date
(
'd/m/Y'
,
strtotime
(
$rm_data
->
ent_act_date_immat_rm
));
$rm
[
'Qualification Dirigeant'
]
=
$rm_data
->
dir_qa_qualification
;
}
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment