Previously I had made a report in pdf
where I brought everything that belonged to a folio
, I had no problem in that, since identifying the number already came with their respective information.
On this occasion I want to do another pdf
, but this is not linked to any page or id
, simply, by pressing the button generate report, will bring the data. and I'm confused on how to do that, that shows everything in pdf
without being dependent on an identifier.
This code is the first pdf
that was made:
if(isset($_GET['folio']))
{
$folio = $_GET["folio"];
$connection = new MySqlServerConnection();
//consulta fea
$query = 'SELECT folio, totalQty, totalPrice as precio, a.author as elaborado, authorizateBy, assignmentDate, ep.employeeNumber, ep.name as solicitante, ep.position as posicion, ei.employeeNumber,
ei.name as cargo, ei.position, d.id, d.name,c.id , c.name as company, ad.supplies_id, ad.supplies_price, ad.supplies_name as nomarti, ad.qtySupply as cant, s.image as imageeen,
s.brand as marca, s.model as modelo, s.id as sid, s.quantity, s.price as price
FROM Assignments as a
INNER JOIN Employees as ep ON ep.employeeNumber = a.employee_Petitioner
INNER JOIN Employees as ei ON ei.employeeNumber = a.employee_InCharge
INNER JOIN Departaments as d ON d.id = a.department_id
INNER JOIN Companies as c ON c.id = d.company_id
INNER JOIN AssigmentsDetail as ad ON ad.assignments_folio = a.folio
INNER JOIN Supplies as s ON s.id = ad.supplies_id
WHERE folio = ? AND ad.status = 1';
$result = $connection->executeQuery($query, array($folio));
// $arraySupplies = array();
if ($result >0)
{...}
As you can see it identifies the folio
and simply generated the pdf
with the requested data.
This is the code of the current pdf:
if(isset($_GET['x']))
{
$x = $_GET["x"];
//Trae todos los item que esten por debajo de su minimo en stock.
$connection = new MySqlServerConnection();
$query = 'SELECT i.description_item,i.quantity,u.name_unit,i.reorder_Level,i.target_Stock,l.name_location,i.commentt
FROM inventory_list AS i
INNER JOIN unit_mesurement AS u ON id_unit = fkUnit
INNER JOIN locatiON AS l on id_location = fkLocation
WHERE i.quantity <= reorder_Level AND i.status = 1';
$result = $connection->executeQuery($query,array($x));
if ($result > 0) {...}
My problem is that I do not know how to only generate it without being linked to a id
, I would like to remove the if(isset($_GET['x']))
since that will not be necessary and in my where
I do not say that in case of being any id
, show me the data.
I hope you have explained me, and you can help me.