Importing EXCEL data into PHP!

Asked

Viewed 2,198 times

0

Hello, I come to ask for help regarding EXCEL and PHP; A little while I joined a company, where has a Dashboard made in VBA in EXCEL, however, I realized that it gives much problem. So I decided to develop a new Dashboard, remove from VBA and go to Browser(HTML5, PHP and Mysql because it has login and password system).

Dashboard in excel does the following:

  • By pressing the green arrow he starts to do his functions
  • With the SELENIUM extension, it automatically accesses the site, does the dowload of the spreadsheets in Excel and places the values on Dashboard
  • Every 4 minutes it deletes everything that is in the dowload folder (where the files are downloaded) and does this whole procedure again, always updating the data;

Here is the image of Dashboard: https://prnt.sc/fhdemt

He prints the values on the screen everything cute, climbs the bar there where is the "Planned x Produced", calculates the percentage, etc...

I want to migrate all this to Browser, to PHP. I want it to do the same of his features. But how?! How to make PHP also access the site automatically, dowload and play everything on screen?

NOTE: I will use the same model of excel Dashboard, in the browser... Save the image in PNG and put in the browser and then play the information above? Or do the same Dashboard of 0?

I heartily thank those who help me!!! I’m picking up lots of fragments of codes of this type on the internet, but nothing concrete.

2 answers

2

0


There were several questions in just one question, so let’s go by part:

  1. You should develop a Dashboard from scratch, so it will be easier to provide maintenance in the future.
  2. About accessing the site file, you can make a copy of it to the /tmp of your project, using the Copy. So, if you need to handle the file again you will not need to make a new request to the site. Follow an example using Copy:

    $url = "http://site.com/arquivos/nome.csv";
    if (copy($url, '/tmp/' . urldecode(basename($url)))) {
        echo 'Arquivo copiado com sucesso!';
    } else {
        echo 'Erro ao copiar arquivo!';
    }
    
  3. To manipulate files .csv in php, follows a reply in Stack on the subject;

  4. To manipulate information on html. It is not the best way, but as you are at the beginning, it already helps;

I believe I answered all the information I had described. If you have more questions, divide it into questions in Stack. The more description the better it will help.

  • The site has login and password. How to put for himself the login and password and press the button?

  • Selenium. Start "Chrome", "about:Blank" Selenium.Window.Setposition 0, -1100 On Error Goto Error Selenium.Get "https://siteaqui/" Selenium.Findelementbyid("user_login"). Sendkeys cUsername Selenium.Findelementbyid("user_password"). Sendkeys cPassword Selenium.Findelementbyid("sign_in_button"). Click In VBA I use so.

  • @Alexandreamado your question refers to excel and php, but your comment is containing the error is about Selenium. I don’t have the knowledge to help you with web interaction automation. I recommend you create a new post so that people who understand the subject can help you.

  • No, it was just an example @Djalmamanfrin. I want to know how I can get him to automatically log in and password, access the site and download. Up there you taught just how to enter the site and download, but the site I want to access asks login and password( I have the login and password ).

  • Can you tell me if the server is ftp?

  • This is the website: https://packmanager.nulogy.net/sign_in

  • Contact hosting support and see if they work with ftp

  • I am away from the company at this time, but I left a message for the Production Manager. Why do I need to know if it is FTP?! Can you just tell me the code so I have a basis of what this access would be? For me to test here, instead of waiting for the Manager’s response.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.