Create PDF, Word, Excel Documents in Php Generate Reports | EDWARD DANIEL VIDAL GARCIA | Skillshare

Create PDF, Word, Excel Documents in Php Generate Reports

EDWARD DANIEL VIDAL GARCIA, Mobile and web developer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
12 Lessons (56m)
    • 1. Welcome

      0:55
    • 2. Creating the database with MySQL

      1:18
    • 3. Creating the FrontEnd

      5:48
    • 4. List information

      9:03
    • 5. Report in Word

      2:05
    • 6. Report in Excel

      4:44
    • 7. PDF report

      5:28
    • 8. CSS styles to PDFs

      9:43
    • 9. Adding Select filters

      5:39
    • 10. Reports with Filters in Word

      4:23
    • 11. Reports with Filters in Excel

      2:47
    • 12. Reports with Filters in PDF

      3:41

About This Class

Welcome to the course Create PDF, Word, Excel Documents in Php7- Generate Reports in which you will learn to generate files and reports in PDF, WORD, EXCEL in PHP and the DOMPDF library.

We are going to learn to generate a PDF, WORD, EXCEL document from PHP with DOMPDF, a very simple and useful library for this task.

Add more knowledge and skills to your life.

DOMPDF is an HTML to PDF converter. Interprets HTML and CSS for the generation of PDF documents.

The topics that we will cover in this course are:

Install and use DOMPDF
Generate PDFs with DOMPDF and PHP
Create custom named PDF files
CSS styles in PDF documents
Inserting images into PDF documents
Generate EXCEL Documents with PHP
Generate WORD Documents with PHP
Form creation
Database creation

At the end of the course you will be able to Create and generate PDF, WORD, EXCEL documents with PHP7 in a simple and optimal way.

Sign up for the course Create and generate PDF, WORD, EXCEL documents with PHP Generate Reports, Don't let time pass.

I see you inside the course!

0848ced8

Transcripts

1. Welcome: We are going to start this course creating reports with PHP and SQL in Word PDF and Excel. 00:00:11.300 --> 00:00:17.700 This time we are going to create our database, which we will use as an example throughout the course. 00:00:17.900 --> 00:00:26.300 For this I have XAMPP installed, I have the MySql and apache services running, I am going to open 00:00:26.300 --> 00:00:31.600 the database administrator, "localhost / phpmyadmin /" 00:00:31.900 --> 00:00:41.000 I'm going to go to the SQL tab, I already have my script created to make it a little faster. 00:00:41.300 --> 00:00:51.000 Here I have created the "reports" database, using reports, I am creating the users table, they have five 00:00:51.001 --> 00:01:00.100 fields: id, names, mail, IP address, country of birth, and here I have 10 data that I am inserting 00:01:00.101 --> 00:01:03.000 in the database table for our example. 00:01:04.301 --> 00:01:09.300 I'm going to continue and here I'm going to update. 00:01:09.701 --> 00:01:18.000 I'm going to see my reports database, and my users table with the 10 entered records, so let's meet 00:01:18.001 --> 00:01:18.700 in the next class. 2. Creating the database with MySQL: We are going to start this course creating reports with PHP and SQL in Word PDF and Excel. 00:00:11.300 --> 00:00:17.700 This time we are going to create our database, which we will use as an example throughout the course. 00:00:17.900 --> 00:00:26.300 For this I have XAMPP installed, I have the MySql and apache services running, I am going to open 00:00:26.300 --> 00:00:31.600 the database administrator, "localhost / phpmyadmin /" 00:00:31.900 --> 00:00:41.000 I'm going to go to the SQL tab, I already have my script created to make it a little faster. 00:00:41.300 --> 00:00:51.000 Here I have created the "reports" database, using reports, I am creating the users table, they have five 00:00:51.001 --> 00:01:00.100 fields: id, names, mail, IP address, country of birth, and here I have 10 data that I am inserting 00:01:00.101 --> 00:01:03.000 in the database table for our example. 00:01:04.301 --> 00:01:09.300 I'm going to continue and here I'm going to update. 00:01:09.701 --> 00:01:18.000 I'm going to see my reports database, and my users table with the 10 entered records, so let's meet 00:01:18.001 --> 00:01:18.700 in the next class. 3. Creating the FrontEnd: Once we have created our database, we will proceed to create the interface where we will execute 00:00:08.700 --> 00:00:10.700 our inquiries. 00:00:10.700 --> 00:00:19.600 For this I am going to use a Materialize library to make the design a little faster. 00:00:20.500 --> 00:00:21.600 I'm going to download it 00:00:27.900 --> 00:00:40.900 once downloaded, I will proceed to change the name of the folder, I will call it "reports" 00:00:42.300 --> 00:00:49.300 I'm going to add this folder of images where I have some icons. 00:00:50.601 --> 00:01:03.100 That folder I am going to add in the folder "XAMPP / htdocs" 00:01:03.101 --> 00:01:12.900 Here is the folder in sublime, I'm going to create a file, I'm going to call it "index.php" 00:01:13.101 --> 00:01:24.100 I'm going to create my structure, I'm going to take that structure from Matarialize, where it brings me related PHP 00:01:27.201 --> 00:01:39.700 This is the one I need, where it brings me the materialize file related. 00:01:39.701 --> 00:01:43.800 So I'm going to organize my file here. 00:01:44.001 --> 00:01:48.800 Done, then we are going to open this file, we are going to open it from the browser. 00:01:49.001 --> 00:01:58.900 I'm going to open it with "localhost / reports / index.php" 00:01:58.002 --> 00:02:10.500 There it is, empty for the moment, I'm going to create my structure, I'm going to put everything in a container. 00:02:10.502 --> 00:02:22.900 You will create a tag "form", with "action =" index.php "" and with "method = post" " 00:02:23.102 --> 00:02:33.800 I am going to create a table to create the icons where I am going to give 00:02:33.802 --> 00:02:35.000 click to show me our reports. 00:02:35.002 --> 00:02:39.400 In this case I will create the header 00:02:42.702 --> 00:02:45.300 the columns, one will be called Excel, 00:02:48.103 --> 00:03:09.300 Excel, Word, PDF and "view", here I will create a "tbody", where I will create the buttons. 00:03:09.303 --> 00:03:17.400 Then a row, within this row create the column with the buttons. 00:03:17.703 --> 00:03:27.000 this button for the moment is not going to do anything and this one is going to have an image that I have already designed here. 00:03:28.503 --> 00:03:29.400 Saved 00:03:29.403 --> 00:03:30.200 Sorry. 00:03:30.403 --> 00:03:32.500 I'm going to call her here. 00:03:32.503 --> 00:03:34.800 This is the one for Excel, so I'm going to call it "excel.icon" 00:03:34.803 --> 00:03:42.100 I'm going to put a width of 30 00:03:42.303 --> 00:03:51.300 The same I will do in the others I will create the 4 buttons, 00:03:51.303 --> 00:03:53.100 The next is 00:03:56.903 --> 00:03:59.100 Word. 00:03:59.204 --> 00:04:09.200 word.png, this will be PDF, pdf.png, 00:04:09.804 --> 00:04:24.000 In this one of "see" I am going to create a button of type "submit", I am going to name it "btnver" and I am going to put a class "btn" 00:04:24.004 --> 00:04:30.800 Those class is from Matarialize, so I'm going to see how the file is. 00:04:31.304 --> 00:04:32.500 Here I have it. 00:04:33.504 --> 00:04:40.700 Then I will see that here I was missing the folder where the images are saved so that 00:04:40.704 --> 00:04:43.600 I can upload the images. 00:04:43.604 --> 00:04:44.300 so 00:04:44.404 --> 00:04:55.300 There I can see them, Excel, Word, PDF and to this submit I am going to put a value that will be "see more" 00:04:59.005 --> 00:05:10.900 I'm going to give it a title here that has a "center" class that says "Reports in Word" 00:05:14.905 --> 00:05:21.800 Word Excel and PDF. 00:05:21.805 --> 00:05:29.800 Let's look, there it is, the idea is that when I click on excel, the report will be downloaded to me, when I click on Word 00:05:30.105 --> 00:05:38.300 I downloaded the report in Word, in PDF and when I click on "See more", it shows me the list of everything that I 00:05:38.305 --> 00:05:45.400 I have in the table users of the database, so in the next video we will start 00:05:45.405 --> 00:05:47.500 to give all its buttons functionality. 4. List information: Having our interface already finished, we are going to proceed to program the "see more" button. 00:00:08.400 --> 00:00:17.800 The idea is that when I click on "SEE MORE", the information from the user table appears then we go to our 00:00:18.400 --> 00:00:20.300 HTML. 00:00:20.300 --> 00:00:28.500 We are going to create a folder, I am going to call it "config" where I am going to create my connection file to the database 00:00:29.600 --> 00:00:38.100 I'm going to call it "connection.php", I'm going to create my connection, I'm going to create the host 00:00:42.900 --> 00:00:55.800 the user, I am going to create a variable which is the password and I am going to create another variable which is the database. 00:00:58.601 --> 00:01:09.300 then here I am going to create, I am going to put "localhost" where it is going to connect, the user "root" and not 00:01:09.301 --> 00:01:19.200 I have my xampp password, then I am going to put the database called "reports", which 00:01:19.201 --> 00:01:21.700 we believe in the previous video 00:01:24.401 --> 00:01:35.100 here I am going to create a variable that is going to be called "connection", and here I am going to send the parameters to the "mysqli" function 00:01:36.601 --> 00:01:41.500 I'm going to send you the parameters host, user, 00:01:45.701 --> 00:01:54.600 pw and bd, this is my connection file, so I'm going to proceed here to create 00:01:57.902 --> 00:02:07.600 button functionality, I am going to create here a button called "bntver" and I am going to associate it 00:02:07.602 --> 00:02:18.600 with this button here I'm going to call it with the POST method 00:02:18.802 --> 00:02:29.100 The button is called "btnver", so here I am going to say it I will include the connection file first 00:02:31.702 --> 00:02:38.200 I'm going to relate this file to this one, I'm going to tell you that this is inside a folder called config and the file 00:02:38.202 --> 00:02:47.200 It is called "connection.php", so here I am going to tell you that if I click the "btnver" button 00:02:50.902 --> 00:02:58.600 If I click that button, what will happen? , then we are going to do our query to the database, I am going to say 00:02:59.303 --> 00:03:04.900 let me select everything from the table 00:03:04.903 --> 00:03:05.800 Users 00:03:09.503 --> 00:03:13.500 then here I am going to tell you to run 00:03:16.603 --> 00:03:18.500 I'm going to call the connection variable 00:03:22.803 --> 00:03:33.500 and I'm going to pass the "query" method to it and I'm going to send it the queries from my SQL database. 00:03:33.903 --> 00:03:43.600 Here I am going to go through the entire table, then I am going to tell you that while I am going to create a variable I am going to call it "rows" 00:03:44.603 --> 00:03:52.000 while executing it has all the query and the connection to the database. 00:03:52.103 --> 00:03:55.400 I'm going to pass the method "fetch_row" 00:03:58.604 --> 00:04:07.500 that that method gets the columns from my database, so if I click on the database, then 00:04:07.504 --> 00:04:13.300 here I'm going to paint a little board, I'm going to create a table 00:04:16.804 --> 00:04:21.100 here, I'm going to put it in the header, which is going to be this one 00:04:24.204 --> 00:04:26.900 I'm going to put it here 00:04:31.304 --> 00:04:32.000 I'm going to paint that same table 00:04:40.004 --> 00:04:52.300 and here I am going to change it, which here will show, name, email, address 00:04:52.404 --> 00:04:58.400 and country, we are going to put ID, name 00:05:01.505 --> 00:05:06.100 mail, address and 00:05:09.905 --> 00:05:14.700 country. 00:05:15.105 --> 00:05:30.900 So around here I'm also going to put a title, I'm going to put "H3", it's going to put a class "center" and I'm going to call it 00:05:31.005 --> 00:05:36.100 "registered users" 00:05:41.405 --> 00:05:52.400 Ready, so here I am going to go through the tables, the rows, and I am going to say, here I am going to create an "echo" 00:05:58.106 --> 00:06:05.300 I'm going to put an "echo", so that it goes through all the tables, all the rows and I'm going to put it 00:06:12.306 --> 00:06:13.300 I'm going to tell him 00:06:16.706 --> 00:06:27.400 over here I'm going to put a "td", this "tr" I'm going to erase because I have it out here 00:06:29.106 --> 00:06:31.400 I'm going to tell him that in this row he will show 00:06:34.406 --> 00:06:41.900 the row variable, in column zero, ready here I close the column "td" 00:06:47.206 --> 00:06:47.600 one 00:06:50.406 --> 00:06:55.300 two, three, four and five. 00:06:55.406 --> 00:06:59.400 So here I will show column one, two, three, four 00:07:06.307 --> 00:07:08.700 and here I am going to put a semicolon. 00:07:10.707 --> 00:07:18.400 If my code is correct, let's run it ah! Here I need to close the line. 00:07:20.207 --> 00:07:21.900 Let's put an "echo" 00:07:26.607 --> 00:07:27.700 Ready, let's look 00:07:35.107 --> 00:07:36.500 here it is appearing to me 00:07:39.007 --> 00:07:49.300 Ready, we are going to click on "SEE MORE", then what we are going to do is that we are going to change 00:07:49.407 --> 00:07:50.500 let's put this one "tr" 00:07:50.807 --> 00:07:51.100 Here 00:07:54.007 --> 00:07:58.300 We are going to put this "tr" here, so that my ranks seem well organized 00:08:02.408 --> 00:08:12.700 Ready, let's see again, so we can see there, we will update here so that we organize this. 00:08:13.108 --> 00:08:21.800 Here what it tells me is that the variable "btnver" is not correct, but that is not an error but 00:08:22.808 --> 00:08:27.300 It tells me that I have not yet created it and I have created it here. 00:08:27.408 --> 00:08:34.800 So what I'm going to do is put a method called "error_reporting" and send it the parameter 00:08:34.808 --> 00:08:35.700 zero. 00:08:35.808 --> 00:08:46.100 So now we are going to update and there we have, click on button "See more", will show the information 00:08:46.108 --> 00:08:47.800 from my database. 00:08:47.808 --> 00:08:54.400 Those are all the records that I have from my database, here we can see them the same as my 10 records 00:08:55.108 --> 00:08:59.100 and here they appear to me the same, in the next video. 00:08:59.109 --> 00:08:01.500 We continue with the Excel button 5. Report in Word: We continue to give functionality to the report in Word. 00:00:05.500 --> 00:00:08.800 In this case we already have the Excel one, the "see more" 00:00:08.900 --> 00:00:12.100 Let's continue with Word. 00:00:12.200 --> 00:00:18.400 Once the Excel one is done, it will be very easy for us to do the Word one since you have to do a few small 00:00:18.400 --> 00:00:19.900 changes. 00:00:19.000 --> 00:00:24.400 I'm going to create a new file and, I'm going to copy this one, I'm going to create a new file. 00:00:24.600 --> 00:00:28.000 It will call it "report_word.php" 00:00:28.300 --> 00:00:31.300 PHP point. 00:00:31.400 --> 00:00:43.800 I am going to copy everything here, we are going to change it to Word and here the extension that is going to download that file is 00:00:43.800 --> 00:00:47.900 .doc, it's that easy to do with Word. 00:00:47.000 --> 00:00:56.000 You just have to change the word here to Word and here the file extension is .doc, let's look 00:00:56.600 --> 00:00:58.600 Let's give it in Word 00:01:05.201 --> 00:01:13.000 we are going to save that it was not saved, we updated and we missed something very important that is 00:01:16.601 --> 00:01:30.400 In the index.html, we must say "report_word.php", so that we can activate that button. 00:01:30.501 --> 00:01:34.200 Let's update, let's tell Word. 00:01:34.401 --> 00:01:40.200 There we can see that our file was downloaded, we are going to open it. 00:01:40.301 --> 00:01:47.100 There we can see our table of users and our data that we have in the database in a small table 00:01:47.201 --> 00:01:48.300 organized. 00:01:48.701 --> 00:01:50.800 It's that easy to do it with Word 00:01:53.702 --> 00:02:01.700 In the next video we will continue with one that is a little longer, which is the PDF, but it is very easy and practical. 6. Report in Excel: In the previous video we saw how to program the button "SEE MORE", so that when I click it, the 00:00:08.100 --> 00:00:15.100 information that I have stored in my database, this time we are going to program the button 00:00:15.100 --> 00:00:23.300 excel, so that when I click it, I will download the report of these registered users in a sheet 00:00:23.300 --> 00:00:23.900 Excel. 00:00:24.900 --> 00:00:33.700 So I'm going to create a new file, I'm going to call it "report_excel.php" 00:00:33.000 --> 00:00:41.900 So to optimize times I am going to copy all the code of the Index and we are going to modify some things 00:00:42.800 --> 00:00:47.900 we are going to put it here PHP so that we can see it better. 00:00:47.901 --> 00:01:00.400 So in this report we don't need this "form", which is the table layout, let's delete this, that's it, then 00:01:00.401 --> 00:01:11.600 here I am going to import at the beginning, I am going to import the connection and I am going to add these two lines of code 00:01:12.501 --> 00:01:22.700 its two PHP methods, this one first tells me that the type of content that we are going to open is a sheet of 00:01:22.701 --> 00:01:31.100 Excel and here I am going to tell you the file as I want it to be called when I am going to download it 00:01:31.101 --> 00:01:38.300 I want it to be called "user_report.xls", this is the extension that we must put so that we 00:01:38.301 --> 00:01:48.800 works with Excel, then we are going to continue modifying here, it will no longer be when I click 00:01:48.801 --> 00:01:49.700 this button 00:01:54.501 --> 00:01:57.000 but when I click the button 00:01:59.902 --> 00:02:08.700 of Excel that would be this, when I click on this button "report_excel.php" 00:02:08.702 --> 00:02:16.200 When I click this button, it will execute what I have in Excel report, so here I have 00:02:16.202 --> 00:02:29.800 to consult the database, to execute the connection, this from here I am going to pass before the 00:02:29.802 --> 00:02:32.700 script, I'm going to put it here 00:02:36.402 --> 00:02:39.300 I leave this the same and this one "echo" 00:02:43.302 --> 00:02:47.800 It will no longer be here, but it will stay that way. 00:02:48.102 --> 00:02:49.600 Ready. 00:02:49.902 --> 00:02:51.300 I pass this over here 00:02:57.902 --> 00:02:59.300 okay. 00:02:59.703 --> 00:03:00.400 So here. 00:03:00.503 --> 00:03:04.000 This is how the code will be, I import the connection at the beginning. 00:03:04.003 --> 00:03:11.800 Then these two lines of code are to be able to name the file and to be able to execute files 00:03:12.903 --> 00:03:18.500 Excel, for us to work these two lines must be, and here. 00:03:18.603 --> 00:03:24.100 I have the design of how our Excel file is going to be, so there is going to be a title that is going to 00:03:24.103 --> 00:03:33.800 say registered users we are going to create a table, we are going to consult the database to execute it at 00:03:33.803 --> 00:03:39.700 go through the database so that it shows us all the columns and here we close. 00:03:39.803 --> 00:03:43.500 So to see it working, let's see how it turned out 00:03:47.603 --> 00:03:50.600 So if I click on "SEE MORE" it shows all the information. 00:03:50.903 --> 00:03:59.700 If I click on the Excel icon, it will download an Excel file, we will open it to see what data 00:03:59.704 --> 00:04:00.300 contains 00:04:04.204 --> 00:04:10.400 so here we can see that I have my little table in Excel with the title that I put on it. 00:04:11.104 --> 00:04:17.100 If I want it to appear with the borders, I will put it here border 00:04:20.104 --> 00:04:28.200 1, ready, we are going to run it again so you can download it again. 00:04:28.404 --> 00:04:37.800 So let's reopen it, then there it is, there is my report in Excel using PHP with 00:04:37.804 --> 00:04:43.700 MySql databases, in the next video we will continue with a word. 7. PDF report: We are going to proceed to continue with the PDF c, with our pdf report, here it still does not show us anything. 00:00:11.300 --> 00:00:21.700 Here, I already said that when I click on the Index, it will take me to "report_pdf.php", I will create it first, I will call it "report_pdf.php" 00:00:21.900 --> 00:00:30.600 but for this I must download this library called a PDF called "Dompdf" 00:00:30.600 --> 00:00:37.700 This is the one we are going to use, I am going to copy everything I have in Word. 00:00:37.700 --> 00:00:49.800 I pass it to PDF while we download the file, I don't need this here, our file has already been downloaded. 00:00:50.101 --> 00:01:03.500 We are going to unzip it, we paste this folder into the "XAMPP / htdoc" file in reports and there it is 00:01:03.501 --> 00:01:06.100 I have stuck. 00:01:07.401 --> 00:01:10.400 So all this I am going to enclose inside PHP 00:01:15.301 --> 00:01:19.500 I must import these libraries so that it can work for me 00:01:22.101 --> 00:01:30.500 here I am importing the connection and I must import these libraries, it is in the documentation of "Dompdf" so that 00:01:30.501 --> 00:01:32.500 can work. 00:01:32.501 --> 00:01:39.300 So I'm going to save this in a variable, I'm going to call it "codigoHTML" 00:01:45.301 --> 00:01:53.000 I'm going to remove the stylesheet and this one from materialize, this is removed from here because it closes at the end, this too. 00:01:56.902 --> 00:02:05.200 I'm going to save this here, instead of saying "echo", I'm going to save this inside the variable HTML code and then I'm going to 00:02:05.302 --> 00:02:06.200 concatenate 00:02:10.202 --> 00:02:16.700 I'm going to concatenate it up to here, I also concatenate this, I'm going to put it like this so that it looks more structural. 00:02:22.302 --> 00:02:30.100 zero, one, two, three and four. 00:02:30.302 --> 00:02:34.300 We must also refer to the document. 00:02:34.402 --> 00:02:38.200 I'm going to do it over here at the end. 00:02:39.302 --> 00:02:47.200 I'm going to finish concatenating all this in the variable "codigoHTML" 00:02:49.903 --> 00:03:03.500 up to here, then all this is in the library, you have to refer to the Dompdf, to the class, after 00:03:03.603 --> 00:03:12.300 having loaded it and after having loaded all the libraries here we encode our HTML file to 00:03:12.303 --> 00:03:14.400 that works for us. 00:03:14.403 --> 00:03:23.600 Here we make an instance of the dompdf, here we load our PDF file and pass the variable as a parameter 00:03:23.603 --> 00:03:26.600 where all the HTML has been saved. 00:03:26.603 --> 00:03:32.200 Here we can see that we saved the HTML, here we just saved. 00:03:32.303 --> 00:03:44.100 the "tr # and here since we have just concatenated the completion of the file, this method to organize 00:03:44.103 --> 00:03:51.900 our sheet size in pdf, here we can change the font, this is for rendering and converting 00:03:52.004 --> 00:03:00.600 from HTML to PDF and this method is to show me the name of my PDF file. 00:04:00.604 --> 00:04:05.500 When I give it to download 00:04:05.604 --> 00:04:14.300 I already told you that when I click the button I will run the report and my file will be called 00:04:14.404 --> 00:04:17.300 "user_report.pdf" 00:04:17.504 --> 00:04:31.100 We are going to update, we are going to click on PDF, ok, in line 36 we have an error, we are going to look here! 00:04:37.904 --> 00:04:39.100 We will correct this 00:04:43.704 --> 00:04:51.500 we are going to give it back we update, we are going to click on PDF, then there we can see what our file downloaded to us 00:04:51.505 --> 00:05:02.200 let's open it then there it is in our pdf here I have a border for it, I can remove it 00:05:05.705 --> 00:05:14.400 and I have to download it again, let's look there is our HTML 00:05:15.205 --> 00:05:26.900 in a PDF, done, in the next one and we will see how we can style a PDF from HTML and CSS. 8. CSS styles to PDFs: my mother had come upon moves. That list Stephen was troop, if you please. And those phases and just watch it there mainly. But as one without Premarin with low pay were gone, This is always throw a very facing Cee Lo's Jackie Borgetti godly. If they get that, the better being cool. But I am no low as it gets a major adieu to name I keep mine was better. You too. I was a little bit less cut of God. What you looking? A lord? I know Therapist Sonia, You more blank. Our bodies are these Cagamas. The moon was far too. But most click in the target lost ones, you know. You know mamas are cape where most implemented This still owes record. There must get the name of materialize as he could, you know, important that by important is our highest kilos materialize pronto. Hey says there is a killer open. You're not classy. Some are a bit they Any Your weapon in both on the road. When was that? Bodies are well, but I think I got ones too. Are too Musburger common with? Start on our Come here. Come on. Let's throw it on Jim Pizarro. This is monstrous city located in Moscow. Materialize Point was battling Pokemons organiser. Yes, it's in materialized. Seen a sailor's Cadalora Bhutan majora due to chickens are dumb polka Mother materialized. Remember me? Corso getting going? Materialize completo and no DiMarzio A much appointments and said Boy, most included Lee a cold one for him It almost upon anyone cooler there fundo Well, one size car Garlow. But most I mean, come on. There's like one was barking me talaq Ambu I mean think local deterrence is in trial for its altitude temperatures is in trial My one semi does lt Palanka in my classes in there What is only detours that Concentra was called before a gentleman lip open in my class and Fowler stays intra sterling For months you was all but police are There's gotta garments is I put most Birkin with through that resistance Intra keep limos. Birkin With guys that are It's as interest intra communal animals. Que son ah can most appointment. I say we must come back Deport when temporize appoint muscles are meto get your name a dump Every occupier must bear lives by Most ballots went escape where most come here. A kid. Your jungle times italic. Dilip Oh, come here. Like deep way of 20. What a him flow. What is the courier? Almost on me. Marquee ball. But ice got a guard. This is my most were multiple when they come. You and Analisa Castillo cambio for case that the mandalas went is the material life you Kira Cumbia in Dhaka. Karma propio high ceilings. You can barely last last winter yet I mean well, no czar might realize, you know, autumn in poker. Mi propio I say lows. But I say, Did you know somebody said I want to see it. You see? You know, after I had gone ahead of the materialized commune has dealers. There's part of him low and your boilers. He'd live. What's up? I need a doctor. One was a conflict. Let's isn't there pulling it in background? Latorre? But most as he look a galore or don't what is her? But come on a scale The hijab or mitali Perkins Appropriately Zillow's. You forget I got a little. Is it still a schedule? A say like I sell button. Did you through Do them in Aleppo. Gregory Meeks, Propia CSC lows but letting monocle azeem and right upon it Let's close it, read, quartered Everyone, though. Rojo, you know people trump blank. It is boredom attacked Police out the Muslims car gorilla to I, then emotional button. Just most case you tourism will materialize. Boiling moves Our Realmuto pro Jackie materialized in a lawless classes Jennifer Senior class. But once I mean tries corn materialize Type one with medicaments. Some want your minds A organism We must Glad. Oh, she was almost 80 friend Gordon Materialize. Keep it. But it was like I got a liquid kid a c looking through this Amos and we stripped out up with regard. Locate is a most that meaning must obey fit Bharara force Well, most powerful guys put the latter What? I got part of him. But these are says Mr Arrival. Hockey girl No, I just got a leg. Thank you, SC Looking also through There's a most for most of these are and materialize, but muscles are you know, Mr Ross Perot pieces sailors. But most police that meant for him. Jokey Sierra Most partisan one Stop A. My most activities are both the Messiah's car government store to there's like most better instrument. Okay, Kim wavy garland tanto product is inspired in you. Nor can easily the kids alone is a partisan Mr Logo. I was, um I keep that less. They will Nike LePen with bullet monster logo. Or almost, for your report. These throws get that list. They? Yeah, I was told that Nice got a guide. They said that most companies are most of my stuff. Now. That was a godly All of the Steelers comes up with is a most care about tone. But what was our boat owners? Muslims are looking for three days a month. Mom wants all right, But I am process call. It's Uranus, you see? Is the oldest boils? Yes, I'm working organism or detonations? Appropriate issue those poor kids Summer shoes and almost really ready. I materialize. But as a pocho knows, these seniors want you, Merab you. But I'm for Carlos. In local realmente there's a famous case. Givens uni There's bombing a meter, our community, Charlie A boy almost better staying. It's the canaries, John. Okay, are going to have a poquito mas. There's blame. Better come up with. Most implement are quite care when kids see looking through this Amos. It was so Jericho's doesn t talk a term in in complete mental Corso losing Beat work A a terminal courts will materialize. Pocket poem bear a toilet functionally a when career conflict time in the finals With this , they said, Oh, you mean divisive? Yeah, yes, but also readiness A. It was Preguntas, but I have leveraged with Salomon's pronto opposite telegram is for tomorrow in court. 9. Adding Select filters: This time we are going to create filters to make our reports, me in the database. 00:00:06.300 --> 00:00:11.300 I have a new field called country of birth 00:00:11.500 --> 00:00:17.300 Here are all my records with the countries of birth. 00:00:17.500 --> 00:00:19.100 The filter that we are going to make. 00:00:19.200 --> 00:00:25.700 If I say "SEE MORE", it will load all the records from all the countries. 00:00:25.700 --> 00:00:33.500 The filter that we are going to use is selecting the country of birth and we are going to give you the registration to 00:00:33.500 --> 00:00:38.900 that only shows us the records of the selected country of birth. 00:00:38.900 --> 00:00:43.800 That is a form of filter. Let's first create our filter. 00:00:43.900 --> 00:00:54.200 We are going to create a select here, I am going to say "select country" 00:00:57.001 --> 00:01:01.100 I will create the column with the select 00:01:01.101 --> 00:01:09.700 I am going to save to see how it appears, then here I am going to select the country and if I click on excel then it will show me the 00:01:09.701 --> 00:01:14.800 records of the selected country, if I click on word, then it will show me the records 00:01:14.801 --> 00:01:22.800 The same with PDF, the same as in the "SEE MORE", so here I am going to create a "select" so that it brings me all the 00:01:22.801 --> 00:01:30.700 records, right now we put the names I'll create PHP. 00:01:31.001 --> 00:01:38.500 The connection must be once, but how I am going to query data from the database must be first 00:01:38.601 --> 00:01:42.700 over here, I'm going to create my SQL query. 00:01:42.701 --> 00:01:50.300 The query that I am going to make, I will try it here first, then I will tell you select 00:01:53.801 --> 00:01:55.000 country of birth of users 00:01:59.702 --> 00:02:00.100 here 00:02:03.502 --> 00:02:04.300 I will delete this 00:02:07.602 --> 00:02:12.000 Ready, I'm going to copy this query, ready then. 00:02:12.102 --> 00:02:19.700 The idea is that a select appears with these data but here we see that the country of 00:02:19.702 --> 00:02:28.500 Colombia that is there twice, so for that I am going to put a "DISTINCT" this what it is going to do is 00:02:28.502 --> 00:02:33.200 that it is not going to repeat the data, but it brings it only once. 00:02:33.602 --> 00:02:38.300 We are going to copy this query, we are going to give it to continue. 00:02:38.502 --> 00:02:47.200 There it is, there she brought me the data only once, Colombia, which was repeated, only brought it to me once, to the consultation. 00:02:47.202 --> 00:02:48.100 what are we going to use 00:02:50.803 --> 00:03:07.500 we are going to execute it, we are going to tell it to execute, connection, query and I am going to send the SQL, here I am going to create a "while" to go through 00:03:07.503 --> 00:03:10.200 the rows. 00:03:10.203 --> 00:03:17.800 I'm going to call "rows" equal to the execute variable that my query has and the "fetch_row" method. 00:03:17.803 --> 00:03:23.400 to do is assign the columns of the query to the variable rows. 00:03:23.503 --> 00:03:32.000 Here I am going to print with an option to show the values, here I am going to put the row in 00:03:32.403 --> 00:03:42.900 The zero position, which is what I am going to consult, here again rows in the zero position 00:03:45.603 --> 00:03:52.400 I close, I save. 00:03:52.704 --> 00:04:00.800 Here we are going to update, then here it is brought me the "Select" 00:04:00.804 --> 00:04:07.800 The idea is that when I select Colombia or select France, I click on "SEE MORE" 00:04:07.804 --> 00:04:17.700 and bring only the records that are registered in that country if I tell you Chile, you will bring me the records 00:04:18.604 --> 00:04:20.000 we can do that. 00:04:20.004 --> 00:04:24.000 Let's first execute that button. 00:04:24.004 --> 00:04:31.300 We can do that by creating the variable, I'm going to put "ddlpais" 00:04:34.204 --> 00:04:46.500 and here I am going to create the variable "country" that will be equal to POST and I am going to tell it to select all the 00:04:46.505 --> 00:05:01.900 users where country of birth is equal to, in quotes, the country variable. 00:05:02.405 --> 00:05:07.000 Save, update, then here it is. 00:05:07.105 --> 00:05:14.400 We are going to look at France, I am going to click on "see more", then here it brought me the records that are in France. 00:05:14.405 --> 00:05:19.800 Here Colombia is selected if I say "See more" it should bring me two records. 00:05:20.405 --> 00:05:30.600 If I say Chile, then it brings me only the records that I have in the specific country. 00:05:30.705 --> 00:05:39.500 Here, then we can see that we can see records from the database by performing our filters. 10. Reports with Filters in Word: We are going to make our filters with Word. 00:00:02.700 --> 00:00:08.400 If I give it a Word at this time it will bring me all the data that I have in the table. 00:00:08.600 --> 00:00:10.700 Here we can see them. 00:00:10.900 --> 00:00:16.500 I have that data, it is fetching all the data that I have from the table. 00:00:16.600 --> 00:00:21.100 I just want you to bring me the data. 00:00:21.100 --> 00:00:29.100 When I select a country, for example if I tell Colombia to bring me only these two data, the 00:00:29.100 --> 00:00:35.600 that I have registered in Colombia then here in Word. 00:00:35.600 --> 00:00:42.700 we are going to execute this same query but first we are going to change that to a variable 00:00:42.700 --> 00:00:49.400 session "session_start", I will call this session variables 00:00:49.400 --> 00:00:55.500 We already know that they are saved for us and we can use them in any part of our project. 00:00:55.501 --> 00:01:05.900 Here I am going to call the session "country" and here I am going to use the session variable 00:01:09.101 --> 00:01:16.900 I'm going to take this same query here. 00:01:17.001 --> 00:01:19.200 And there we have my query 00:01:22.901 --> 00:01:25.500 here we are going to modify something. 00:01:25.501 --> 00:01:32.600 Here I am no longer going to call it with a "href", because if I call it with the "href", it will not create my variable from 00:01:32.601 --> 00:01:33.100 session 00:01:33.101 --> 00:01:43.600 When I select the data, then here what I am going to do is delete this I am going to create a button of type "submit" 00:01:44.401 --> 00:01:51.100 and I'm going to give it a name "btnword", I'm going to close it with the button 00:01:55.102 --> 00:02:07.500 I am going to create my variable and I am going to call it "btnword", which will be equal to POST 00:02:07.602 --> 00:02:20.500 So here I am going to tell you that when you click the Word button it will call the "header" function 00:02:21.502 --> 00:02:30.500 so that I open that form, that file 00:02:30.602 --> 00:02:31.800 Done, that was it. 00:02:31.802 --> 00:02:42.700 We are going to save and here we are going to update, then I am going to select for example India and I am going to click on word 00:02:42.702 --> 00:02:49.300 well, we lacked .php, sorry. 00:02:49.303 --> 00:03:00.400 There we are going to give India, Word again, so our file was downloaded there, but I think it is empty 00:03:01.203 --> 00:03:11.600 Now here we just missed one thing, which is to start our session variables with "session_start". 00:03:11.603 --> 00:03:23.800 then, we are going to update and if everything is functional, we are going to click on Italy, there it already brought us 00:03:23.803 --> 00:03:26.800 the data, let's open it. 00:03:26.803 --> 00:03:28.100 Hopefully open 00:03:28.203 --> 00:03:34.900 There we can see that those from Italy brought us, only those from Italy, we are going to select Colombia. 00:03:34.903 --> 00:03:43.900 Let's click on word again, it should bring us two records, there it is, it brought us only the 00:03:43.903 --> 00:03:46.200 from Colombia, there we can see them 00:03:49.803 --> 00:03:57.500 then we can see them, this image that I have was a test that I was making of previous videos, the 00:03:57.603 --> 00:03:58.300 I'm going to remove 00:04:02.804 --> 00:04:08.200 Chile, we are going to select Chile, we are going to generate a report. 00:04:08.504 --> 00:04:18.300 There it is, there is the report with the country of Chile, ready, there we can see how to generate reports 00:04:18.404 --> 00:04:22.400 in Word by making filters. 00:04:22.704 --> 00:04:23.500 Independent. 11. Reports with Filters in Excel: The same but already with Excel. 00:00:02.500 --> 00:00:04.000 We are going to do the same steps. 00:00:05.200 --> 00:00:14.400 We are going to open excel, first we are going to copy these two lines from "session_start", we are going to put them 00:00:14.400 --> 00:00:17.500 in Excel, we will do the same. 00:00:18.400 --> 00:00:19.900 Let's paste the query 00:00:23.100 --> 00:00:26.900 and in index, we are going to do the same procedure. 00:00:27.200 --> 00:00:30.900 Let's change this for a button 00:00:33.700 --> 00:00:45.500 A button of type "submit", name "btnexcel", let's save 00:00:45.500 --> 00:00:51.100 We are going to close with Button and we are going to do the same. 00:00:51.100 --> 00:00:54.600 We are going to call it "btnexcel" 00:00:57.801 --> 00:01:08.600 There it is, we are going to do the same thing but with Excel, we are going to say "btnexcel" and we no longer 00:01:08.601 --> 00:01:11.800 it will lead to Word but to Excel. 00:01:11.801 --> 00:01:14.900 Let's save. 00:01:14.901 --> 00:01:25.600 We are going to say "Close this, we are going to update, we are going to select for example Italy, we are going to click on 00:01:25.601 --> 00:01:29.600 Excel, there it was downloaded, let's open 00:01:34.701 --> 00:01:36.200 let's wait for it to open us 00:01:42.301 --> 00:01:42.000 Mmm! 00:01:48.201 --> 00:01:48.600 already 00:01:48.701 --> 00:01:51.300 Here it is, let's open it 00:02:01.402 --> 00:02:07.600 there it is, there we can see the record, with a filter. 00:02:07.602 --> 00:02:16.100 We are going to select Colombia that has two records, we are going to download it, we are going to open it 00:02:24.002 --> 00:02:32.200 Let's say yes; This is an alert that does not interfere with us, so there it is and we can see that I have two 00:02:32.202 --> 00:02:37.200 Colombian records. 00:02:37.302 --> 00:02:44.600 That was all we did the same steps that we did with word and we already have our records with a 00:02:44.602 --> 00:02:47.400 Word, with Excel and with Word. 12. Reports with Filters in PDF: We are going to apply filters to our PDF documents. 00:00:04.700 --> 00:00:12.800 First we will see how our report is generating us, what the report should be generating for us 00:00:12.800 --> 00:00:15.600 of all registered users. 00:00:16.000 --> 00:00:24.100 Now what we are going to do is apply what we did to Excel and Word, which was to generate 00:00:24.100 --> 00:00:30.300 a report depending on the user in the country where he is registered. 00:00:30.700 --> 00:00:45.700 We are going to go to our code, we are going to go to Index.php, sorry we are going to go to "report_excel.php", we are going to copy 00:00:47.300 --> 00:00:49.300 this query, these two 00:00:51.800 --> 00:00:54.700 let's go to our PDF report. 00:00:55.101 --> 00:01:04.500 We are going to put this here which is the "session_start", we are going to put it here at the beginning and in the query if we go 00:01:04.501 --> 00:01:11.400 to put the query that the users will select depending on the country with our variable 00:01:11.401 --> 00:01:27.300 session, we save and here we are going to change in the report, we are going to change the button we are going to create a button of type 00:01:28.101 --> 00:01:39.800 "submit", we are going to remove this part, we are going to give it a name we are going to call it "btnpdf" 00:01:41.201 --> 00:01:54.000 we are going to close our button, we are going to create the button here, "btnpdf", we are going to encapsulate the variable, we are going 00:01:54.002 --> 00:02:02.400 to say "btnpdf" and we are going to give it the same treatment, if we click the button 00:02:04.702 --> 00:02:13.100 What PDF will do is open the file "report_pdf.php" 00:02:13.202 --> 00:02:23.500 We save, we save here again, we open our document, we update, we are going to select for example 00:02:24.702 --> 00:02:35.200 Peru, we are going to click on PDF, here we have already been downloaded, we are going to open our PDF and here we can see what we generated 00:02:35.202 --> 00:02:41.600 our report depending on the country where the user is registered. 00:02:41.802 --> 00:02:45.900 We are going to select all the users who are in Colombia, we are going to click on PDF 00:02:49.102 --> 00:02:57.900 We are going to open our report and here we got two records of two users who are registered 00:02:57.903 --> 00:03:10.200 in Colombia and so we can practice with our consultations, in the country Cuba I can generate filters depending 00:03:11.103 --> 00:03:14.500 of the country or the filter that I want to add. 00:03:14.503 --> 00:03:20.200 By dates, then the one in the country Cuba I just closed. 00:03:21.003 --> 00:03:28.500 Now we can see what will generate my report, depending on the users who are registered in 00:03:28.503 --> 00:03:40.700 Cuba, that was all so we can make our reports in PDF, selecting our query and with variables 00:03:40.703 --> 00:03:41.300 session.