Updating older low stock reporting report

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Updating older low stock reporting report

Post by 14Steve14 »

I am updating an older admin report that shows low product stocks. I cannot make any sense of the error. I am getting an error that stops the page loading which is

Code: Select all

[13-Jun-2024 11:00:36 UTC] PHP Parse error:  syntax error, unexpected single-quoted string "<i class="fas fa-check-circle ..." in /home/####/public_html/####/stats_low_stock.php on line 170
Here is the offending line of code

Code: Select all

        echo '<i class="fas fa-check-circle text-success"></i> <a href="' . Href::redirect($Linker->build('stats_low_stock.php', 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . ($cPath ?? null)) . '"><i class="fas fa-times-circle text-muted"></i></a>';
and here is the code block in its entirety.

Code: Select all

<tr onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo($url_newproduct); ?>'">
		<td align="left"><?php echo $rows; ?>.</td>
		<td><?php echo $prodmodel; ?></td>
		<td><?php echo '<a href="' . $url_product . '" class="blacklink">' . $products['products_name'] . '</a>'; ?></td>
		<td><?php echo $productsQty; ?></td>
		<td>
		<?php		
		if ($products['products_status'] == '1') {
        echo '<i class="fas fa-check-circle text-success"></i> <a href="' . Href::redirect($Linker->build('stats_low_stock.php', 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . ($cPath ?? null)) . '"><i class="fas fa-times-circle text-muted"></i></a>';
      } else {
        echo '<a href="' . Href::redirect($Linker->build('stats_low_stock.php', 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . ($cPath ?? null) . '&page=' .$_GET['page'])) . '"><i class="fas fa-check-circle text-muted"></i></a>  <i class="fas fa-times-circle text-danger"></i>';

      }
?>


	</td></tr>
Is there anyone that can help decipher the error to get the page working.


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Updating older low stock reporting report

Post by heatherbell »

14Steve14 wrote: Thu Jun 13, 2024 11:06 am Here is the offending line of code

Code: Select all

        echo '<i class="fas fa-check-circle text-success"></i> <a href="' . Href::redirect($Linker->build('stats_low_stock.php', 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . ($cPath ?? null)) . '"><i class="fas fa-times-circle text-muted"></i></a>';
Don't know but count 3 opening brackets in that but only 2 closing so maybe try:

Code: Select all

        echo '<i class="fas fa-check-circle text-success"></i> <a href="' . Href::redirect($Linker->build('stats_low_stock.php', 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . ($cPath ?? null))) . '"><i class="fas fa-times-circle text-muted"></i></a>';
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Updating older low stock reporting report

Post by ecartz »

Code: Select all

        echo '<i class="fas fa-check-circle text-success"></i> <a href="' . Href::redirect($Linker->build('stats_low_stock.php', ['action' => 'setflag', 'flag' => '0', 'pID' => $products['products_id'], 'cPath' => ($cPath ?? null)])) . '"><i class="fas fa-times-circle text-muted"></i></a>';
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Updating older low stock reporting report

Post by 14Steve14 »

heatherbell wrote: Thu Jun 13, 2024 11:48 am Don't know but count 3 opening brackets in that but only 2 closing so maybe try:

Code: Select all

        echo '<i class="fas fa-check-circle text-success"></i> <a href="' . Href::redirect($Linker->build('stats_low_stock.php', 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . ($cPath ?? null))) . '"><i class="fas fa-times-circle text-muted"></i></a>';
I have been looking at that for ages and I couldnt see that. Thanks. Now on to the next section that needs updating.
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Updating older low stock reporting report

Post by raiwa »

The low stock attributes report included in QtPro should work also without QtPro installed.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Updating older low stock reporting report

Post by 14Steve14 »

raiwa wrote: Thu Jun 13, 2024 4:21 pm The low stock attributes report included in QtPro should work also without QtPro installed.
Thanks for the suggestion.

It may need a bit more work that just those files as I get lots of missing files errors and things like that. When I get time I will have a look at the code if I may and try to adapt your code to fit with just a report tool. Might be above my pay grade but could be worth tyring just to see.
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Updating older low stock reporting report

Post by Omar_one »

Hello @14Steve14 the module Zipur Reporting Tool app.php/addons/paid_addon/zipur_reporting_tool/ created by @zipurman have Inventory Low Report with filtering
reports.JPG
and a lot more
Customer No Orders Report – allowing you to search and remove old customers
Customer to Products Detail Report
Customer to Product Report
Inventory Low Report
Payment Method to Sales Report
Quantity Detail Report
Quantity Report (Product Sales)
Sales by Country Report
Sales by Currency
Sales Report (Gross)
Sales Report (Net)
Customer Abandoned Basket
Products Viewed Report
You can also:
Print text reports
Export to CSV
Run Graphical Reports
Write your own reports
You do not have the required permissions to view the files attached to this post.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Updating older low stock reporting report

Post by 14Steve14 »

@Omar_one

I have those modules but I am trying to learn how to update things myself.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply