Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html_old /
Delete
Unzip
Name
Size
Permission
Date
Action
asiafood.apps-dev.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
asiafood_v12
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
asiafoodco.com
[ DIR ]
drwxrwxr-x
2023-01-18 07:39
btm2000.apps-dev.fr
[ DIR ]
drwxr-xr-x
2021-10-16 13:26
btm2000.bak
[ DIR ]
drwxr-xr-x
2025-11-25 14:10
btm2000_old
[ DIR ]
drwxr-xr-x
2025-11-25 14:12
ctm-euromeuble.fr
[ DIR ]
drwxrwxr-x
2023-01-18 07:38
ctm.bdcloud.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
esprint.fr
[ DIR ]
drwxrwxr-x
2023-01-08 13:12
foryou-vip.com
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
gf.bdcloud.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
iNetty
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
iSalesWeb
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
iscreen.apps-dev.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
iscreen.bdcloud.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
nft_project.io
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
pigeon
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
speed.bdcloud.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
suivi.ctm-euromeuble.fr
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
tmp
[ DIR ]
drwxrwxr-x
2025-10-25 04:45
.htaccess
202
B
-rw-r--r--
2023-01-09 14:09
.htaccess.bak
777
B
-rw-r-----
2023-01-09 14:08
coca_orders_api.backup.17102022
80
KB
-rw-r--r--
2022-10-17 10:01
wp-blog-header.php
2.73
KB
-r--r--r--
2025-10-25 04:45
wp-cron.php
2.73
KB
-rw-r--r--
2025-10-25 04:45
Save
Rename
coca_orders_api/ 0000775 0000041 0000041 00000000000 14322520076 014225 5 ustar www-data www-data coca_orders_api/orders_vignoble/ 0000777 0000041 0000041 00000000000 14322524117 017412 5 ustar www-data www-data coca_orders_api/orders_vignoble/temps/ 0000777 0000041 0000041 00000000000 14171556262 020552 5 ustar www-data www-data coca_orders_api/orders_vignoble/temps/order_vignobleduchattel_O-13795869_12062021_141342.csv 0000777 0000041 0000041 00000000236 14171543366 031200 0 ustar www-data www-data O-13795869,2021/12/06 14:13,2021/12/08 00:00,GOU045,GOURMAND WOK,1.0,236867,,, O-13795869,2021/12/06 14:13,2021/12/08 00:00,GOU045,GOURMAND WOK,1.0,252595,,, coca_orders_api/orders_vignoble/temps/order_vignobleduchattel_O-14337335_01062022_175605.csv 0000777 0000041 0000041 00000000117 14171543366 031163 0 ustar www-data www-data O-14337335,2022/01/06 17:56,2022/01/10 00:00,GOU045,GOURMAND WOK,1.0,108626,,, coca_orders_api/orders_vignoble/temps/order_vignobleduchattel_O-13224259_11082021_152119.csv 0000777 0000041 0000041 00000000540 14171543366 031157 0 ustar www-data www-data O-13224259,2021/11/08 15:21,2021/11/12 00:00,PAN096,PANDA,1.0,108626,,TEST PRECOMMANDE, O-13224259,2021/11/08 15:21,2021/11/12 00:00,PAN096,PANDA,1.0,402476,,TEST PRECOMMANDE, O-13224259,2021/11/08 15:21,2021/11/12 00:00,PAN096,PANDA,1.0,282116,,TEST PRECOMMANDE, O-13224259,2021/11/08 15:21,2021/11/12 00:00,PAN096,PANDA,1.0,282116,,TEST PRECOMMANDE, coca_orders_api/orders_vignoble/temps/order_vignobleduchattel_O-14533302_01182022_144847.csv 0000777 0000041 0000041 00000001212 14171556254 031157 0 ustar www-data www-data O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200100,,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200115,,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200115,0,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200110,,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200122,,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200138,,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200138,0,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200118,,, O-14533302,2022/01/18 14:48,2022/01/21 00:00,PAN096,PANDA,1.0,200121,,, coca_orders_api/orders_vignoble/temps/order_vignobleduchattel_O-12820747_10262021_111502.csv 0000777 0000041 0000041 00000000110 14171543366 031141 0 ustar www-data www-data O-12820747,2021/10/26 11:15,2021/10/29 00:00,PAN096,PANDA,1.0,108626,,, coca_orders_api/api-zelty/ 0000777 0000041 0000041 00000000000 14317044515 016150 5 ustar www-data www-data coca_orders_api/api-zelty/files/ 0000777 0000041 0000041 00000000000 14317765411 017257 5 ustar www-data www-data coca_orders_api/api-zelty/config.php 0000777 0000041 0000041 00000014711 14305617416 020140 0 ustar www-data www-data <?php //Initials variables const API_URL = "https://api.zelty.fr/2.5/"; const BEARER_KEY = "NDE4MTonbq9YCeIUGqmYexqoJNHcQYoNZw"; $headers = array( 'Content-Type:application/json', 'Authorization: Bearer ' . BEARER_KEY ); $orders = []; $restaurantSelected = []; $cocaProductsData = []; $offset = 0; //$firstDay = date("Y-m-01"); //$lastDay = date("Y-m-31"); $firstDay = date("22-08-01"); $lastDay = date("22-08-31"); $month = date('M'); $year = date("Y"); $stillOrder = true; $restaurantSelection = [ [ 'name' => "Tacos Avenue La Seyne-sur-Mer", "id" => "720", 'selected' => true ], [ 'name' => "Tacos Avenue Montpellier Pompignane", "id" => "911", 'selected' => true ], [ 'name' => "Tacos Avenue Montpellier Justice", "id" => "913", 'selected' => true ], [ 'name' => "Tacos Avenue Le Pontet", "id" => "1190", 'selected' => true ], [ 'name' => "Tacos Avenue Rodez", "id" => "1220", 'selected' => true ], [ 'name' => "Tacos Avenue Puteaux", "id" => "1255", 'selected' => true ], [ 'name' => "Tacos Avenue Pau", "id" => "1627", 'selected' => true ], [ 'name' => "Tacos Avenue Saint Malo", "id" => "1829", 'selected' => true ], [ 'name' => "Tacos Avenue Genève", "id" => "1825", 'selected' => true ], [ 'name' => "Tacos Avenue Albi (SAS BORNARD)", "id" => "2153", 'selected' => true ], [ 'name' => "Tacos Avenue Toulouse Centre", "id" => "2229", 'selected' => true ], [ 'name' => "Tacos Avenue Saint-Étienne", "id" => "2279", 'selected' => true ], [ 'name' => "Tacos Avenue Tarbes", "id" => "1190", 'selected' => true ], [ 'name' => "Tacos Avenue Ales", "id" => "2468", 'selected' => true ], [ 'name' => "Tacos Avenue Millau", "id" => "2621", 'selected' => true ], [ 'name' => "Tacos Avenue Nîmes", "id" => "2723", 'selected' => true ], [ 'name' => "Tacos Avenue Marseille (dark)", "id" => "3280", 'selected' => true ] ]; $restaurantsSelected = array(); foreach ($restaurantSelection as $res) { if($res["selected"] === true){ array_push($restaurantsSelected, $res); } } $restaurantsAdresses = [ [ "id" => "720", "adress" => "CENTRE COMMERCIAL AUCHAN 780 boulevard de l'europe", "ville" => "LA SEYNE SUR MER", "cp" => "83500", "tel" => "", ], [ "id" => "911", "adress" => "1603 Avenue de la Pompignane", "ville" => "Montpellier", "cp" => "34000", "tel" => "", ], [ "id" => "913", "adress" => "457 avenue de la justice de castelnau", "ville" => "Montpellier", "cp" => "34090", "tel" => "", ], [ "id" => "1190", "adress" => "30 Avenue Charles de Gaulle", "ville" => "Le Pontet", "cp" => "84130", "tel" => "", ], [ "id" => "1220", "adress" => "24 ROUTE D ESPALION 12850", "ville" => "Onet le Chateau", "cp" => "12850", "tel" => "", ], [ "id" => "1255", "adress" => "8 rue anatole france 92800", "ville" => "Puteaux", "cp" => "92800", "tel" => "", ], [ "id" => "1627", "adress" => "Tacos Avenue 64, Avenue Lattre de Tassigny Promenade des pyrénées", "ville" => "PAU", "cp" => "64000", "tel" => "05 59 32 14 55", ], [ "id" => "1820", "adress" => "43, Rue de la Croix Désilles", "ville" => "SAINT-MALO", "cp" => "35400", "tel" => "", ], [ "id" => "1825", "adress" => "31 Rue de Lausanne", "ville" => "Geneve", "cp" => "1201", "tel" => "", ], [ "id" => "2153", "adress" => "2-4 Rue Mariès", "ville" => "Albi", "cp" => "81000", "tel" => "", ], [ "id" => "229", "adress" => "42 rue bayard", "ville" => "Toulouse", "cp" => "31000", "tel" => "", ], [ "id" => "2279", "adress" => "Ccial Steel St-Etienne- Rue Emile Zola", "ville" => "St-Jean de Bonnefonds", "cp" => "42650", "tel" => "", ], [ "id" => "2324", "adress" => "15 Rue Brauhauban", "ville" => "Tarbes", "cp" => "65000", "tel" => "", ], [ "id" => "2468", "adress" => "Place des marthys de la résistance", "ville" => "Ales", "cp" => "30100", "tel" => "", ], [ "id" => "2621", "adress" => "Rue du Rajol Centre commercial de la Capelle - Local n°37", "ville" => "Millau", "cp" => "12100", "tel" => "", ], [ "id" => "2723", "adress" => "120 rue Paul Laurent", "ville" => "Nîmes", "cp" => "30900", "tel" => "", ], [ "id" => "3280", "adress" => "55 RUE DE L’AUDIENCE", "ville" => "MARSEILLE", "cp" => "13011", "tel" => "", ] ]; //id of coca product $cocaProduct = [105719, 682388, 105721, 682390, 105720, 682392, 105731, 683909, 683911, 105732, 105733, 105738, 105740, 105739, 105728, 148170, 105722, 520689, 682393, 682396, 134345, 682394, 134347, 682395, 105734, 126378, 105741, 105723, 682398, 683912, 683913, 105735, 105742, 105726, 682406, 126382, 105724, 126383, 195021, 105725, 682405, 105736, 105743, 263090, 460265, 576469, 682401, 682403, 263091, 682402]; ?> coca_orders_api/api-zelty/index.php.bak 0000777 0000041 0000041 00000015653 14175016255 020543 0 ustar www-data www-data <?php require_once("./config.php"); //get data of the restaurants selected $restaurantSelected = array(); foreach ($restaurantsSelected as $res) { $ch = curl_init(); curl_setopt($ch, CURLOPT_GET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL, API_URL . "restaurants/" . $res["id"]); $result = json_decode(curl_exec($ch),true); sleep(1); curl_close($ch); $restaurant = [ "id" => "", "adress" => "", "name" => "", "code" => "", ]; $restaurant["id"] = $result["restaurant"]["id"]; $restaurant["adress"] = str_replace("\r\n", ' ',$result["restaurant"]["address"]); $restaurant["name"] = $result["restaurant"]["name"]; $restaurant["code"] = $result["restaurant"]["country_code"]; array_push($restaurantSelected, $restaurant); } //Get data from Coca Cola product $option = "catalog/dishes"; $ch = curl_init(); curl_setopt($ch, CURLOPT_GET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL, API_URL . $option); $result = json_decode(curl_exec($ch),true); sleep(1); curl_close($ch); foreach ($result["dishes"] as $dish) { $product = [ "id" => "", "name" => "", ]; if(in_array($dish["id"], $cocaProduct)){ $product["id"] = $dish["id"]; $product["name"] = $dish["name"]; array_push($cocaProductsData, $product); } } //Get all orders containaing a Coca product for the month while ($stillOrder === true) { $option = "orders?from=". $firstDay ."&to=" . $lastDay . "&offset=" . $offset . "&limit=200"; $ch = curl_init(); curl_setopt($ch, CURLOPT_GET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL, API_URL . $option); $result = json_decode(curl_exec($ch),true); curl_close($ch); sleep(1); if($result["errno"] === 429){ echo $result["errmsg"] . "<br>"; break; } elseif(empty($result["orders"])){ echo "break: no more orders :/" . "<br>"; $stillOrder = false; break; }else{ foreach ($result["orders"] as $order) { $orderData = array( "idOrder" => "", "idRestaurant" => "", "dateOrder" => "", "content" => array() ); foreach ($order["contents"] as $product) { //check if product is menu to fetch data inside if($product["type"] === "menu"){ foreach ($product["contents"] as $productMenu) { if(in_array($productMenu["id"], $cocaProduct)){ array_push($orderData["content"], $productMenu["id"]); $orderData["idOrder"] = $order["id"]; $orderData["idRestaurant"] = $order["id_restaurant"]; $orderData["dateOrder"] = date('Y-m-d', strtotime($order["created_at"])); } } //get data from product }else{ if(in_array($product["item_id"], $cocaProduct)){ array_push($orderData["content"], $product["item_id"]); $orderData["idOrder"] = $order["id"]; $orderData["idRestaurant"] = $order["id_restaurant"]; $orderData["dateOrder"] = date('Y-m-d', strtotime($order["created_at"])); } } } if($orderData["idRestaurant"] !== ""){ array_push($orders, $orderData); } } $offset = $offset + 200; } } $sortedData = []; foreach ($orders as $order) { $data = array( "Distrib_id" => "", "Distrib_n_TVA" => "", "CodePDV" => "", "RaisonSociale" => "", "Adresse1" => "", "Adresse2" => "", "Adresse3" => "", "CP" => "", "Ville" => "", "Tel" => "", "N_Siret" => "", "N_Siren" => "", "Segement_Activite" => "fast-food", "Code_article" => "", "Description_article" => "", "Code_EAN" => "", "Qty_log" => "", "Qty" => "", "DateLivraison" => "", "Ref_PreCommande" => "", ); $restaurantName = ""; $restaurantCode = ""; $restaurantCP = ""; $restaurantVille = ""; $restaurantTel = ""; foreach ($restaurantSelected as $res) { if($order["idRestaurant"] == $res["id"]){ $restaurantName = $res["name"]; $restaurantAddress = $res["adress"]; // $restaurantCode = $res["code"]; } } foreach ($restaurantsAdresses as $resAdrr) { if($order["idRestaurant"] == $resAdrr["id"]){ $data["CP"] = $resAdrr["cp"]; $data["Ville"] = $resAdrr["ville"]; $data["Tel"] = $resAdrr["tel"]; $data["Adresse1"] = $resAdrr["adress"]; } } $qtyCount = array_count_values($order["content"]); $idsProduct = array_keys($qtyCount); $j = count($qtyCount); for ($i=0; $i < $j ; $i++) { $productName = ""; $productId = $idsProduct[$i]; $productQty = $qtyCount[$productId]; foreach ($cocaProductsData as $product) { if($product["id"] == $productId){ $productName = $product["name"]; } } $data["Ref_PreCommande"] = $order["idOrder"]; $data["DateLivraison"] = $order["dateOrder"]; $data["CodePDV"] = $order["idRestaurant"]; $data["RaisonSociale"] = $restaurantName; $data["countryCode"] = $restaurantCode; $data["Code_article"] = $productId; $data["Description_article"] = $productName; $data["Qty"] = $productQty; if($restaurantName != ""){ array_push($sortedData, $data); } } } //create CSV file $fp = fopen('files/file-' . $month . "-" . $year . '.csv', 'w'); if ($fp === false) { die('Error opening the file ' . $filename); } fputs($fp, (chr(0xEF) . chr(0xBB) . chr(0xBF))); $headerCSV = ["Distrib ID", "Distrib n°TVA", "Code PDV", "Raison sociale", "Adresse 1", "Adresse 2", "Adresse 3", "CP", "Ville","Téléphone", "N°SIRET", "N°SIREN", "Segment d'activité", "Code article", "Description Article", "Code EAN", "Qté en unité logistique", "Qté en Unité Consommateur", "Date de livraison", "Ref PreCommande"]; fputcsv($fp, $headerCSV, ';'); foreach ($sortedData as $line) { fputcsv($fp, $line, ';'); } fclose($fp); echo "File created"; coca_orders_api/api-zelty/stats.php 0000777 0000041 0000041 00000016074 14237141743 020034 0 ustar www-data www-data <?php require_once("./config.php"); //get data of the restaurants selected $restaurantSelected = array(); foreach ($restaurantsSelected as $res) { $ch = curl_init(); curl_setopt($ch, CURLOPT_GET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL, API_URL . "restaurants/" . $res["id"]); $result = json_decode(curl_exec($ch),true); sleep(1); curl_close($ch); $restaurant = [ "id" => "", "adress" => "", "name" => "", "code" => "", ]; $restaurant["id"] = $result["restaurant"]["id"]; $restaurant["adress"] = str_replace("\r\n", ' ',$result["restaurant"]["address"]); $restaurant["name"] = $result["restaurant"]["name"]; $restaurant["code"] = $result["restaurant"]["country_code"]; array_push($restaurantSelected, $restaurant); } //Get data from Coca Cola product $option = "catalog/dishes"; $ch = curl_init(); curl_setopt($ch, CURLOPT_GET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL, API_URL . $option); $result = json_decode(curl_exec($ch),true); sleep(1); curl_close($ch); foreach ($result["dishes"] as $dish) { $product = [ "id" => "", "name" => "", ]; if(in_array($dish["id"], $cocaProduct)){ $product["id"] = $dish["id"]; $product["name"] = $dish["name"]; array_push($cocaProductsData, $product); } } //Get all orders containing a Coca product for the month $fetchData = true; while ($fetchData === true) { $option = "orders?from=". $firstDay ."&to=" . $lastDay . "&offset=" . $offset . "&limit=200"; $ch = curl_init(); curl_setopt($ch, CURLOPT_GET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL, API_URL . $option); $result = json_decode(curl_exec($ch),true); curl_close($ch); sleep(1); if($result["errno"] === 429){ echo $result["errmsg"] . "<br>"; break; } elseif(empty($result["orders"]) && !empty($order)) { echo "break: no more orders :/" . "<br>"; $stillOrder = false; $fetchData = false; break; } elseif(empty($result["orders"])){ $fetchData = true; echo "relaunch fetch"; }else{ foreach ($result["orders"] as $order) { $orderData = array( "idOrder" => "", "idRestaurant" => "", "dateOrder" => "", "content" => array() ); foreach ($order["contents"] as $product) { //check if product is menu to fetch data inside if($product["type"] === "menu"){ foreach ($product["contents"] as $productMenu) { if(in_array($productMenu["id"], $cocaProduct)){ array_push($orderData["content"], $productMenu["id"]); $orderData["idOrder"] = $order["id"]; $orderData["idRestaurant"] = $order["id_restaurant"]; $orderData["dateOrder"] = date('Y-m-d', strtotime($order["created_at"])); } } //get data from product }else{ if(in_array($product["item_id"], $cocaProduct)){ array_push($orderData["content"], $product["item_id"]); $orderData["idOrder"] = $order["id"]; $orderData["idRestaurant"] = $order["id_restaurant"]; $orderData["dateOrder"] = date('Y-m-d', strtotime($order["created_at"])); } } } if($orderData["idRestaurant"] !== ""){ array_push($orders, $orderData); } } $offset = $offset + 200; } } $sortedData = []; foreach ($orders as $order) { $data = array( "Distrib_id" => "", "Distrib_n_TVA" => "", "CodePDV" => "", "RaisonSociale" => "", "Adresse1" => "", "Adresse2" => "", "Adresse3" => "", "CP" => "", "Ville" => "", "Tel" => "", "N_Siret" => "", "N_Siren" => "", "Segement_Activite" => "fast-food", "Code_article" => "", "Description_article" => "", "Code_EAN" => "", "Qty_log" => "", "Qty" => "", "DateLivraison" => "", "Ref_PreCommande" => "", ); $restaurantName = ""; $restaurantCode = ""; $restaurantCP = ""; $restaurantVille = ""; $restaurantTel = ""; foreach ($restaurantSelected as $res) { if($order["idRestaurant"] == $res["id"]){ $restaurantName = $res["name"]; $restaurantAddress = $res["adress"]; // $restaurantCode = $res["code"]; } } foreach ($restaurantsAdresses as $resAdrr) { if($order["idRestaurant"] == $resAdrr["id"]){ $data["CP"] = $resAdrr["cp"]; $data["Ville"] = $resAdrr["ville"]; $data["Tel"] = $resAdrr["tel"]; $data["Adresse1"] = $resAdrr["adress"]; } } $qtyCount = array_count_values($order["content"]); $idsProduct = array_keys($qtyCount); $j = count($qtyCount); for ($i=0; $i < $j ; $i++) { $productName = ""; $productId = $idsProduct[$i]; $productQty = $qtyCount[$productId]; foreach ($cocaProductsData as $product) { if($product["id"] == $productId){ $productName = $product["name"]; } } $data["Ref_PreCommande"] = $order["idOrder"]; $data["DateLivraison"] = $order["dateOrder"]; $data["CodePDV"] = $order["idRestaurant"]; $data["RaisonSociale"] = $restaurantName; $data["countryCode"] = $restaurantCode; $data["Code_article"] = $productId; $data["Description_article"] = $productName; $data["Qty"] = $productQty; if($restaurantName != ""){ array_push($sortedData, $data); } } } //create CSV file $fp = fopen('files/file-' . $month . "-" . $year . '.csv', 'w'); if ($fp === false) { die('Error opening the file ' . $fp); } fputs($fp, (chr(0xEF) . chr(0xBB) . chr(0xBF))); $headerCSV = ["Distrib ID", "Distrib n°TVA", "Code PDV", "Raison sociale", "Adresse 1", "Adresse 2", "Adresse 3", "CP", "Ville","Téléphone", "N°SIRET", "N°SIREN", "Segment d'activité", "Code article", "Description Article", "Code EAN", "Qté en unité logistique", "Qté en Unité Consommateur", "Date de livraison", "Ref PreCommande"]; fputcsv($fp, $headerCSV, ';'); foreach ($sortedData as $line) { fputcsv($fp, $line, ';'); } fclose($fp); echo "File created"; coca_orders_api/orders_ffc.php 0000777 0000041 0000041 00000007647 14316007000 017063 0 ustar www-data www-data <?php $login = 'svc_ic_rtmpull_bigdata'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //$password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', 'X-Wholesaler-APIKey: 9e98be2d-6570-495b-8439-4c0f9b5bd77b' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; // $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_ffc/order_ffc_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; $Comments = $eachorder[$i]['Header']['Comments']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ // $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",,".$Comments.",\n"; if($line['Material_EAN_Code'] == "5449000058744"){$code_produit="200100";} else if($line['Material_EAN_Code'] == "5449000184238"){$code_produit="200110";} else if($line['Material_EAN_Code'] == "5449000136381"){$code_produit="200115";} else if($line['Material_EAN_Code'] == "5449000174567"){$code_produit="200122";} else if($line['Material_EAN_Code'] == "5449000263667"){$code_produit="200138";} else if($line['Material_EAN_Code'] == "5449000274908"){$code_produit="200139";} else if($line['Material_EAN_Code'] == "5449000033376"){$code_produit="200105";} else if($line['Material_EAN_Code'] == "5449000286437"){$code_produit="200121";} else if($line['Material_EAN_Code'] == "5449000281753"){$code_produit="200118";} else{$code_produit="";} if($line['Free_of_Charge'] == "true"){$is_free="0";}else{$is_free="";} $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",".$is_free.",".$Comments.",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); } fclose($f); } $i++; } ?> coca_orders_api/orders_test.php 0000777 0000041 0000041 00000000000 14263554453 017300 0 ustar www-data www-data coca_orders_api/orders_confirmation.php.save 0000777 0000041 0000041 00000005220 14314142551 021744 0 ustar www-data www-data <?php /*============================================================================================== Anexys - Coded by : Amine LABGHALI (02/2022) API (REST) de confirmation des commandes Coca : Utilisations : URL : /orders_confirmation.php?client={Nom du client}&ref={REF de la commande} EX : - Nom du client : piotet ou chatel - REF de la commande : O-150228929 ============================================================================================== FULL URL : /orders_confirmation.php?client=piotet&ref=O-150228929 EX : http://93.113.207.21/coca_orders_api/orders_confirmation.php?client=piotet&ref=O-150228929 ==============================================================================================*/ //API Auth $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders/confirmation'; $user = 'svc_ic_rtmPull_bigdata'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //Clients Token Keys [parameter &client] if($_GET['client'] === "chatel"){$API_KEY="07cd2ed8-d867-4a99-9a0a-134ba0bf97c9";} else if($_GET['client'] === "bircan"){ $API_KEY="6fa614d1-b2c3-4591-9069-543acfad9bec"; $user = 'svc_ic_rtmpull_Pomared'; $password = 'RTM1d53e9fe-3bfc-417a-842a-c7470379f5f3P$ll'; } else if($_GET['client'] === "bircan"){$API_KEY="6fa614d1-b2c3-4591-9069-543acfad9bec";} else if($_GET['client'] === "kezia"){ $API_KEY="35a1b493-83a7-4f47-8ff9-77b5a1d32aa3"; $user = 'svc_ic_rtmPull_bigdata'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; } else if($_GET['client'] === "piotet"){$API_KEY="f9d92735-8b5d-4f48-945f-95f441b9a325";} //Preparing the data array, depending on what API_COCA want to recieve [paramter &ref] $orders = array("Orders" => array()); array_push($orders["Orders"], array ("Order_number" => $_GET['ref'])); $order = json_encode($orders); //Communication with the API $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', 'X-Wholesaler-APIKey: '.$API_KEY ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$order); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$user:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); //Print the returned status in [Orders][0][updated] = 1 or 0 //echo $_GET['ref'].' : '.($result['Orders'][0]['updated'] == 1 ? 'true' : 'false'); //return ex : O-150228929 : true echo $result['Orders'][0]['updated'] == 1 ? 'true' : 'false'; //return ex : O-150228929 : true ?> coca_orders_api/orders_vignoble.php 0000777 0000041 0000041 00000007655 14305652747 020157 0 ustar www-data www-data <?php $login = 'svc_ic_rtmPull_bigdata'; $password = 'RTM5d43d07e-7e2c-4a06-a442-5f99774a0809P$ll'; //$password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', 'X-Wholesaler-APIKey: 07cd2ed8-d867-4a99-9a0a-134ba0bf97c9' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; // $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_vignoble/order_vignobleduchattel_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; $Comments = $eachorder[$i]['Header']['Comments']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ //$line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",,".$Comments.",\n"; if($line['Material_EAN_Code'] == "5449000058744"){$code_produit="200100";} else if($line['Material_EAN_Code'] == "5449000184238"){$code_produit="200110";} else if($line['Material_EAN_Code'] == "5449000136381"){$code_produit="200115";} else if($line['Material_EAN_Code'] == "5449000174567"){$code_produit="200122";} else if($line['Material_EAN_Code'] == "5449000263667"){$code_produit="200138";} else if($line['Material_EAN_Code'] == "5449000274908"){$code_produit="200139";} else if($line['Material_EAN_Code'] == "5449000033376"){$code_produit="200105";} else if($line['Material_EAN_Code'] == "5449000286437"){$code_produit="200121";} else if($line['Material_EAN_Code'] == "5449000281753"){$code_produit="200118";} else{$code_produit="";} if($line['Free_of_Charge'] == "true"){$is_free="0";}else{$is_free="";} $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$code_produit.",".$is_free.",".$Comments.",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); } fclose($f); } $i++; } ?> coca_orders_api/orders_piotet/ 0000777 0000041 0000041 00000000000 14323016165 017111 5 ustar www-data www-data coca_orders_api/orders_piotet/order_piotet_O-24060069_10062022_141727.csv 0000644 0000000 0000000 00000000374 14323205605 023761 0 ustar root root O-24060069,2022/10/06 14:17,2022/10/10 00:00,5080,MAISON JANNEAU,1.0,5449000089120, O-24060069,2022/10/06 14:17,2022/10/10 00:00,5080,MAISON JANNEAU,2.0,5449000217677, O-24060069,2022/10/06 14:17,2022/10/10 00:00,5080,MAISON JANNEAU,1.0,5449000089120, coca_orders_api/orders_piotet/order_piotet_O-23908573_10032022_154948.csv 0000644 0000000 0000000 00000000435 14323205605 023777 0 ustar root root O-23908573,2022/10/03 15:49,2022/10/05 00:00,7025,BOULANGERIE CHAON LAURENT,1.0,5449000089120, O-23908573,2022/10/03 15:49,2022/10/05 00:00,7025,BOULANGERIE CHAON LAURENT,2.0,5449000217677, O-23908573,2022/10/03 15:49,2022/10/05 00:00,7025,BOULANGERIE CHAON LAURENT,1.0,5449000089120, coca_orders_api/orders_piotet/order_piotet_O-24029457_10062022_094628.csv 0000644 0000000 0000000 00000000402 14323205605 023766 0 ustar root root O-24029457,2022/10/06 09:46,2022/10/10 00:00,361,L.ECORCE D.ORANGE,1.0,5449000089120, O-24029457,2022/10/06 09:46,2022/10/10 00:00,361,L.ECORCE D.ORANGE,2.0,5449000217677, O-24029457,2022/10/06 09:46,2022/10/10 00:00,361,L.ECORCE D.ORANGE,1.0,5449000089120, coca_orders_api/orders_piotet/order_piotet_O-24086161_10072022_105244.csv 0000644 0000000 0000000 00000000122 14323205605 023744 0 ustar root root O-24086161,2022/10/07 10:52,2022/10/10 00:00,6460,KHEDIVE (LE),1.0,5060335632319, coca_orders_api/orders_piotet/order_piotet_O-24097665_10072022_124007.csv 0000644 0000000 0000000 00000000377 14323205605 023771 0 ustar root root O-24097665,2022/10/07 12:40,2022/10/17 00:00,6776,LA CLEMENTALICE,2.0,4000177172667, O-24097665,2022/10/07 12:40,2022/10/17 00:00,6776,LA CLEMENTALICE,2.0,5449000232298, O-24097665,2022/10/07 12:40,2022/10/17 00:00,6776,LA CLEMENTALICE,2.0,4000177162323, coca_orders_api/orders_jauffres-clementz/ 0000777 0000041 0000041 00000000000 14115420710 021223 5 ustar www-data www-data coca_orders_api/orders_distribution_service.php 0000777 0000041 0000041 00000004450 14321562244 022565 0 ustar www-data www-data <?php //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders'; $login = 'svc_ic_rtmpull_bigdata'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', 'X-Wholesaler-apikey: 77cc1a2c-12b6-4374-be3f-ada65c623708' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_distribution_service/order_DS_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); } fclose($f); } $i++; } ?> coca_orders_api/orders_kezia.php 0000777 0000041 0000041 00000005200 14322264367 017431 0 ustar www-data www-data <?php //$login = 'svc_ic_rtmPull_bigdata'; //TEST //$password = 'RTM5d43d07e-7e2c-4a06-a442-5f99774a0809P$ll'; //TEST //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; //TEST $login = 'svc_ic_rtmPull_bigdata'; //PROD $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //PROD $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; //PROD $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', // 'X-Wholesaler-APIKey: eaee5c1b-76ed-41ea-bd48-55966e4982d0' //FFC 'X-Wholesaler-APIKey: 35a1b493-83a7-4f47-8ff9-77b5a1d32aa3' //KEZIA //'X-Wholesaler-APIKey: 35a1b493-83a7-4f47-8ff9-77b5a1d32aa3' //KEZIA ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_kezia/order_kezia_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",".$line['Material_Description'].",".$line['Free_of_Charge'].",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); } fclose($f); } $i++; } ?> coca_orders_api/orders_bircan.php 0000777 0000041 0000041 00000004714 14312051603 017557 0 ustar www-data www-data <?php //$login = 'svc_ic_rtmPull_bigdata'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders'; $login = 'svc_ic_rtmPull_bigdata'; //$password = 'RTM5d43d07e-7e2c-4a06-a442-5f99774a0809P$ll'; $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', // 'x-wholesaler-apikey: eaee5c1b-76ed-41ea-bd48-55966e4982d0' 'X-Wholesaler-apikey: 6fa614d1-b2c3-4591-9069-543acfad9bec' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_bircan/order_bircan_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); } fclose($f); } $i++; } ?> coca_orders_api/orders_ffc/ 0000777 0000041 0000041 00000000000 14322267366 016355 5 ustar www-data www-data coca_orders_api/orders_piotet.php 0000777 0000041 0000041 00000004440 14253631052 017627 0 ustar www-data www-data <?php $login = 'svc_ic_rtmPull_bigdata'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders'; $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', 'X-Wholesaler-APIKey: f9d92735-8b5d-4f48-945f-95f441b9a325' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_piotet/order_piotet_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); chmod($f, 775); } fclose($f); } $i++; } ?> coca_orders_api/orders_jauffres.php 0000777 0000041 0000041 00000006006 14321261113 020121 0 ustar www-data www-data <?php $login = 'svc_ic_rtmpull_bigdata'; //$password = 'RTM5d43d07e-7e2c-4a06-a442-5f99774a0809P$ll'; $password = 'RTMc098d2c0-7127-4d92-8e78-dfb25334d60eP$ll'; //$url = 'https://api-gw-qa.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $url = 'https://api-gw.ccep.com/gateway/otc_orders_s_rtm/v1/orders/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_GET, true); $headers = array( 'Content-Type:application/json', 'X-Wholesaler-APIKey: d53519b1-b2b9-4f0c-9448-a71f439c68c4' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $result = json_decode(curl_exec($ch),true); curl_close($ch); print_r($result); echo "<br>----------------<br>File content:<br>"; // $response_data = json_decode($json_data, true); $orders = $result['Orders']; $i=0; foreach ($orders['Order'] as $order){ foreach ($orders as $eachorder){ $f = fopen(__DIR__ .'/orders_jauffres/order_jauffres_'.$eachorder[$i]['Header']['Order_number'].'_'.date('mdY_His', strtotime($eachorder[$i]['Header']['Order_Date'])).'.csv', 'w'); $header = $eachorder[$i]['Header']; $Order_number = $eachorder[$i]['Header']['Order_number']; //$Account_Number = $eachorder[$i]['Header']['Account_Number']; $Account_Number = $eachorder[$i]['Header']['External_Account_Id']; $Order_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Order_Date'])); $Desired_Delivery_Date = date('Y/m/d H:i', strtotime($eachorder[$i]['Header']['Desired_Delivery_Date'])); $Account_Name = $eachorder[$i]['Header']['Account_Name']; $Wholesaler_GLN_Id = $eachorder[$i]['Header']['Wholesaler_GLN_Id']; $Comments = $eachorder[$i]['Header']['Comments']; //fputcsv($f, $header, ";"); $line_details; $lines = $eachorder[$i]['Lines']; foreach ($lines['Line'] as $line){ //$line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",,".$Comments.",\n"; if($line['Free_of_Charge'] == "true"){$is_free="0";}else{$is_free="";} $line_details = $Order_number.",".$Order_Date.",".$Desired_Delivery_Date.",".$Account_Number.",".$Account_Name.",".$line['Quantity'].",".$line['Material_EAN_Code'].",".$is_free.",".$Comments.",\n"; //fputcsv($f, $line_details, ";"); echo $line_details; fwrite($f, $line_details); } fclose($f); } $i++; } ?> coca_orders_api/test/ 0000777 0000041 0000041 00000000000 14266236114 015212 5 ustar www-data www-data coca_orders_api/test/index.php 0000777 0000041 0000041 00000002651 14266237307 017046 0 ustar www-data www-data <!-- PAGE ACCEUIL --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <!-- <link rel="icon" href=".png" /> --> <link rel="stylesheet" href="orders.css" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="theme-color" content="#000000" /> <meta name="description" content="Web site created using create-react-app" /> <title>Coca orders</title> <script type="text/javascript"> </script> </head> <body> <h1>Coca orders</h1> <form action="" method="post"> <div> <h3>Client </h3> </div> <div> <div> <h3>Name</h3> </div> <input type="text" name="name" required> </div> <div> <div> <h3>Key </h3> </div> <input type="text" name="key" required> </div> <div> <div> <h3>Password </h3> </div> <input type="password" name="pswd" required minlength="43"> </div> <div> <div> <h3>URL </h3> </div> <input type="text" name="url" required> </div> <div> <div> <h3>Phone number </h3> </div> <input type="tel" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}" > </div> <div> <input type="submit" name="submit" value="Create"> </div> <p class="error"><?php echo @$error; ?></p> <p class="success"><?php echo @$success; ?></p> </form> </body> </html>