EMDI provides the ability to download and set data using the http protocol. This is possible through the communication/maintenance program (tcpdevices.exe), that must be running.
To enable the option (Settings–>Communication/Maintenance):
Reports called via http are easily created using SQL language and saved with the .sql suffix in the reports folder (e.g. C:\Program Files (x86)\SBZ systems\EMDI\reports).
Variables that you can include in the code:
(used on the where of sql, only when we call a report)
:apo Date from
:ews Date to
:param1 General use
:param2 General use
:search For search
Fields that we can send:
querysql Here we write the file name of the report without the suffix .sql. If the file is prefixed with ‘html_’ then the result does not include any delimiter characters or line feeds. Alternatively, we can put sql code directly.
key Security code, must be the same as the one set in the settings.
searchtext For search corresponding to :search
param1 General use corresponding to :param1
param2 General use corresponding to :param2
from Date corresponding to :apo
to Date corresponding to :ews
Results – Data download
When we call sql code, we take as a result simple utf8 encoding text in csv format and separator “|”. Also in the first row are all the fields as in the database.
1 2 3 4 5 6 7 8 9 |
Aa|Kvdikos|Kvdikos_s|Perigrafh|Shmeivseis|Lianikh|Monada|Omada|Url|Hmeromhnia|Eggrafh|Fvtografia|Timh_s|Pvlhseis|Diauesimothta|Esoda|Ejoda|Y|P|B|Embado|Ogkos|Baros|Xrhsths|order|fpaT|posostokerdoys|posokerdoys|minquantity|modified|color|measureunit1|measureunit2|quantity1|quantity2|scale|active|internet|custom1|custom2|custom3|custom4|custom5|custom6|custom7|custom8|custom9|custom10|custom11|custom12|custom13|custom14|custom15|custom16|custom17|custom18|custom19|custom20|sync|supplier| 14184|C19242||GOLDEN ROSE LONGSTAY MATTE FACE POWDER 04 12.7G||7,58064516129032|1|21670|https://www.yoursite.com/index.php?route=product/product&product_id=8642|31/07/18|04/10/16|https://www.yoursite.com/image/data/kalluntika/Golden rose/longstay/04.jpg|4,23|6|9|37,9032258064516|48,1451612903226|0|0|0|0|0|0,3|||24|0|0|9|01/08/18 01:16:21||||0|0|0|1|1|ΕΝΕΡΓΟ|||9,40|8691190005849|||18|9,40|69897|0|9|0|9||||||||| 5082|C11060||BOUCHERON INITIAL ΕAU DE ΤOILETTE 100ML||33,8709677419355|1|17170|https://www.yoursite.com/index.php?route=product/product&product_id=76|17/07/18|25/01/16|https://www.yoursite.com/image/data/virtuemart/boucheron-initial-eau-de-toilette-100ml.png|0|0|0|0|0|0|0|0|0|0|0,3|||24|0|0|3|01/08/18 01:16:21||||0|0|0|1|1|ΑΝΕΝΕΡΓΟ|||77,00|3577589030805|||0||0|0|0|0|0||||||||| 5087|C11065||BURBERRY FOR WOMEN EAU DE PARFUM 100ML||25,76612903|1|28758|https://www.yoursite.com/index.php?route=product/product&product_id=81|25/07/18|25/01/16|https://www.yoursite.com/image/data/virtuemart/burberry-women-eau-de-parfume-100ml.png|21,81|129|2|3286,67258064516|1709,81451612903|0|0|0|0|0|0,3|-1||24|0|0|50|01/08/18 01:16:22|15256308|||0|0|0|1|1|ΕΝΕΡΓΟ|||86,00|5045252667309|||52|465,00|67827|5|2|45|0||||||||| 5088|C11066||VAN CLEEF ARPELS TSAR EAU DE TOILETTE 50ML||17,3387096774194|1|16711|https://www.yoursite.com/index.php?route=product/product&product_id=89|17/07/18|25/01/16|https://www.yoursite.com/image/data/TSAR.jpg|11,97|7|0|122,177419354839|79,5403225806452|0|0|0|0|0|0,3|-1||24|0|0|25|01/08/18 01:16:22|12689779|||0|0|0|1|1|ΕΝΕΡΓΟ|||48,00|3386460005302|||0||0|0|0|0|0||||||||| 5092|C11070||BVLGARI OMNIA CORAL EAU DE TOILETTE 65ML||28,5483870967742|1|11690|https://www.yoursite.com/index.php?route=product/product&product_id=99|25/07/18|25/01/16|https://www.yoursite.com/image/data/virtuemart/bvlgari-omnia-coral.png|24|49|5|1354,85483870967|954,870967741936|0|0|0|0|0|0,3|-1||24|0|0|7|01/08/18 01:16:22|15256308|||0|0|0|1|1|ΕΝΕΡΓΟ|||76,00|783320442506|||8|36,50|67889|2|5|0|1||||||||| 5093|C11071||CHANEL COCO MADEMOISELLE EAU DE PARFUM SPRAY 35ML||50|1|1892|www.yoursite.com/index.php?route=product/product&pr|12/11/16|25/01/16||50|0|0|0|0|0|0|0|0|0|0,3|||24|0|0|3|01/08/18 01:16:22||||0|0|0|0|0||||62,00||||-6||||||||||||||| 5095|C11073||CAROLINA HERRERA 212 SEXY EAU DE PARFUM 100ML||43,5483870967742|1|11653|https://www.yoursite.com/index.php?route=product/product&product_id=6967|25/07/18|25/01/16|https://www.yoursite.com/image/data/virtuemart/carolina-herrera-212-sexy-edt-100ml.png|34,75|18|0|757,984677419355|478,021612903226|0|0|0|0|0|0,3|-1||24|0|0|9|01/08/18 01:16:22|15256308|||0|0|0|1|1|ΕΝΕΡΓΟ|||90,00|8411061545904|8411061865439||0|985,00|61917|0|0|0|0||||||||| 5098|C11076||CACHAREL EDEN EAU DE PARFUM 50ML||23,9516129032258|1|28824|https://www.yoursite.com/index.php?route=product/product&product_id=108|25/07/18|25/01/16|https://www.yoursite.com/image/data/virtuemart/cacharel-eden.png|17,5|50|3|1056,72580645161|763,604838709677|0|0|0|0|0|0,3|-1||24|0|0|5|01/08/18 01:16:23|15256308|||0|0|0|1|1|ΕΝΕΡΓΟ|||77,00|3360373048878|||4|32,00|67929|0|3|1|0||||||||| |
Examples
To call the “04.All customers” report via http:
1 |
http://127.0.0.1/?querysql=04.All customers&from=7/1/2018 |
To execute sql code directly through http:
1 |
http://127.0.0.1/?querysql=select * from "pelates" |
We can also change data directly using the update command:
1 |
http://127.0.0.1/?querysql=update "pelates" set "pelates"."Shmeivseis"='okw' where "pelates"."Kvdikos"='IC9815' |
In this case we take the “ok” response when the code is successful.
Also the call can be made from anywhere on the internet using the EMDI cloud option:
1 |
http://emdi.sbzsystems.com/sync.php?user=LICENSE&dbid=DATABASEID&querysql=select first 10 * from "pvlhseis" |
Where LICENSE is your license and DATABASEID the unique database id found in tcpdevices: