I Love PHPMaker

... because it gets even more powerful and flexible!!

  • About
  • Terms and Conditions
  • Membership Options
  • Sitemap
  • Downloads
    • PHPMaker Extensions Download
    • PHPMaker Projects Download
    • PHP Report Maker Extensions Download
I Love PHPMaker » PHP Report Maker » How to Display Breadcrumb Links in Websites that Generated by PHP Report Maker 5.1
How to Customize Pagination Style in Websites that Generated by PHP Report Maker 5.1
How to Add jQuery slideDown and slideUp Effects into the Filter Panel in Websites that Created with PHP Report Maker 5.1

June 24, 2012

How to Display Breadcrumb Links in Websites that Generated by PHP Report Maker 5.1

This following customization will display Breadcrumb Links in websites that generated by PHP Report Maker 5.1, as well as the similar customization in PHPMaker 9. Please always refer to that article if you want to implement the Breadcrumb Links in your report pages, since there is some important things that you should know regarding how to create breadcrumblinks table in order to store your Breadcrumb Links records.

This customization is very useful if you are integrating your reports that generated by PHP Report Maker 5.1 with web applications that generated by PHPMaker 9, and you want to synchronize the look and view of your web applications. Just like the customization in PHPMaker, we will also customize PHP Report Maker template files. In other words, we will not modify any generated web files.

[hidepost]

  1. Open your \Script\rpt-summary.php file, and find this code:

    <!-- top slot -->
    <a name="top"></a>
    <!--##=sChartExpEnd##-->
    

    after the last line of that code, please insert the following code:

    <?php // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, May 4, 2012 ?>
    <?php if (MS_SHOW_BREADCRUMB_IN_ALL_PAGES) { ?>
    <span>
    <div id="ewContainer">
    <ul id="breadcrumb">
    <?php
        if (isset($_GET&#91;"showmaster"&#93;)) {
          $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".$_GET&#91;"showmaster"&#93;."')
                ORDER BY C.Lft"; // showmaster, in order to get the full path of the master record!, modified by Masino Sinaga, January 27, 2012
        } else {
          $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".ew_CurrentPage()."')
                ORDER BY C.Lft";  
        }
        $rs = $conn->Execute($sSql);
        $recCount = $rs->RecordCount();
        $rs->MoveFirst();
        $i = 1;
        while (!$rs->EOF) {
            if ($i < $recCount) {
                if ($i==1) {
                    echo "<li><a href='". $rs->fields("Page_URL")."' title='".$ReportLanguage->BreadcrumbPhrase("Home")."'><img src='./phpimages/home.png' alt='".$ReportLanguage->BreadcrumbPhrase("Home")."' class='home' /></a></li>";
                } else {
                    echo "<li><a href='". $rs->fields("Page_URL")."'>".$ReportLanguage->BreadcrumbPhrase($rs->fields("Page_Title"))."</a></li>";
                }
            } else {
                echo "<li>".$ReportLanguage->BreadcrumbPhrase($rs->fields("Page_Title"))."</li>";          
            }
            $i++;
            $rs->MoveNext();
        }
        $rs->Close();
    ?>
    </ul>
    </div>
    </span>
    <?php } ?>
    <?php // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, May 4, 2012 ?>
    
  2. Open your \Script\rpt-crosstab.php file, and find this code:

    <!-- Top container (begin) -->
    <tr><td colspan="3"><div id="ewTop" class="phpreportmaker">
    <!-- top slot -->
    <a name="top"></a>
    <!--##=sChartExpEnd##-->
    

    after the last line of that code, please insert the following code:

    <?php // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, May 4, 2012 ?>
    <?php if (MS_SHOW_BREADCRUMB_IN_ALL_PAGES) { ?>
    <span>
    <div id="ewContainer">
    <ul id="breadcrumb">
    <?php
        if (isset($_GET&#91;"showmaster"&#93;)) {
          $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".$_GET&#91;"showmaster"&#93;."')
                ORDER BY C.Lft"; // showmaster, in order to get the full path of the master record!, modified by Masino Sinaga, January 27, 2012
        } else {
          $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".ewrpt_CurrentPage()."')
                ORDER BY C.Lft";  
        }
        $rs = $conn->Execute($sSql);
        $recCount = $rs->RecordCount();
        $rs->MoveFirst();
        $i = 1;
        while (!$rs->EOF) {
            if ($i < $recCount) {
                if ($i==1) {
                    echo "<li><a href='". $rs->fields("Page_URL")."' title='".$ReportLanguage->BreadcrumbPhrase("Home")."'><img src='./phpimages/home.png' alt='".$ReportLanguage->BreadcrumbPhrase("Home")."' class='home' /></a></li>";
                } else {
                    echo "<li><a href='". $rs->fields("Page_URL")."'>".$ReportLanguage->BreadcrumbPhrase($rs->fields("Page_Title"))."</a></li>";
                }
            } else {
                echo "<li>".$ReportLanguage->BreadcrumbPhrase($rs->fields("Page_Title"))."</li>";          
            }
            $i++;
            $rs->MoveNext();
        }
        $rs->Close();
    ?>
    </ul>
    </div>
    </span>
    <?php } ?>
    <?php // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, May 4, 2012 ?>
    
  3. Open your \Script\phprptfn.php file, and find this code:

    	// Get menu phrase
    	function MenuPhrase($MenuId, $Id) {
    

    before the first line of that code, please insert the following code:

    // Begin of modification Displaying Breadcrumbs in All Pages, by Masino Sinaga, May 25, 2012	
    	// Get breadcrumb phrase
    	function BreadcrumbPhrase($Id) {
    		if (is_object($this->Phrases)) {
    			return $this->GetNodeAtt($this->Phrases->SelectSingleNode("//breadcrumb/phrase[@id='" . ($Id) . "']"), "value");
    		} elseif (is_array($this->Phrases)) {
    			return ewrpt_ConvertFromUtf8(@$this->Phrases['ew-language']['breadcrumb']['phrase'][($Id)]['attr']['value']);
    		}
    	}
    	
    	// Set breadcrumb phrase
    	function setBreadcrumbPhrase($Id, $Value) {
    		if (is_array($this->Phrases)) {
    			$this->Phrases['ew-language']['breadcrumb']['phrase'][($Id)]['attr']['value'] = $Value;
    		}
    	}	
    // End of modification Displaying Breadcrumbs in All Pages, by Masino Sinaga, May 25, 2012	
    
  4. Open your \Script\rpt-userfn.php file, and find this code:

    ?>
    <!--##/session##-->
    

    before the first line of that code, please insert the following code:

    // Begin of modification Displaying Breadcrumbs in All Pages, by Masino Sinaga, May 25, 2012
    function getCurrentReportPageTitle($pt) {
        global $CurrentPageTitle, $conn, $ReportLanguage;
        $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".$pt."')
                ORDER BY C.Lft";
        $rs = $conn->Execute($sSql);
        $recCount = $rs->RecordCount();
        if ($recCount>0) {
            $rs->MoveFirst();
            $i = 1;
            while (!$rs->EOF) {
                if ($i < $recCount) {
                    if ($i==1) {
    
                        // $CurrentPageTitle = 'Home'; // skip this!
                    } else {
       
                        // $CurrentPageTitle .= " &raquo; ". $Language->Phrase($rs->fields("Page_Title")).""; // skip this!
                    }
                } else {
    
                    // this is the current page, just display this, no need to display its parent!
                    $CurrentPageTitle .= $ReportLanguage->BreadcrumbPhrase($rs->fields("Page_Title"))."". " &laquo; " . $ReportLanguage->ProjectPhrase("BodyTitle");
                    return;
                }
                $i++;
                $rs->MoveNext();
            }
            $rs->Close();
        } else {
            $CurrentPageTitle = $ReportLanguage->ProjectPhrase("BodyTitle");
        }
    }
    // End of modification Displaying Breadcrumbs in All Pages, by Masino Sinaga, May 25, 2012
    
  5. Open your \Script\rpt-phpcommon-scripts.php file, and find this code:

    // Page main
    $<!--##=sPageObj##-->->Page_Main();
    ?>
    

    after the last line of that code, please insert the following code:

    <?php
    // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, May 4, 2012
    getCurrentReportPageTitle(ewrpt_CurrentPage());
    // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, May 4, 2012
    ?>
    
  6. In order to support for multi language, you have to define/add all phrases that you had in your Page_Title field of breadcrumblinks table into your .xml language files that located in C:\Program Files\PHP Report Maker 5\languages\ folder.
    Define all of your breadcrumb links phrases after the following line in your .xml language files:

    <ew-language date="2011/7/4" version="5.0.0" id="en" name="English" desc="English" author="e.World Technology Ltd.">
    

    For example, one of your phrases in Page_Title field of the breadcrumblinks table is “Customers Report”, so define it into the english.xml file as following (just make the values in id and value are same for the simplicity):

    <breadcrumb>
        <phrase id="Customers List" value="Customer Lists"/>
    </breadcrumb>
    

    Please note that if you want to add the new phrase, then you have to insert it between

    <breadcrumb>
    

    and

    </breadcrumb>
    

    tags.

  7. Another important thing that you should know is you have to insert your Breadcrumb Links record into breadcrumblinks table, just like we did for PHPMaker customization. See the first step in that article above.
  8. Finally, re-generate your script files using PHP Report Maker as always.

[/hidepost]

Article by Masino Sinaga / PHP Report Maker / breadcrumb, breadcrumb links, breadcrumbs, PHP Report Maker 5.1.0, PHPMaker 9.0.2, PHPMaker 9.0.3, PHPMaker 9.0.4 Leave a Comment

How to Customize Pagination Style in Websites that Generated by PHP Report Maker 5.1
How to Add jQuery slideDown and slideUp Effects into the Filter Panel in Websites that Created with PHP Report Maker 5.1

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • A New PHPMaker 2025 Project File Is Released
  • PHPMaker 2025 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2025 Is Released!
  • A New PHPMaker 2024 Project File Is Released
  • PHPMaker 2024 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2024 Is Released!
  • PHPMakerProjects.com, For Those Who Need PHPMaker Project Sample
  • A New PHPMaker 2023 Project File Is Released
  • PHPMaker 2023 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2023 Is Released!

Search

Recent Comments

  • Masino Sinaga on Masino Extensions for PHPMaker 2024 Is Released!
  • Masino Sinaga on A New PHPMaker 2024 Project File Is Released
  • Masino Sinaga on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on Masino Extensions for PHPMaker 2024 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2025 (MasinoExtensions).
  • Stock Inventory Management for PHPMaker 2025.

Another Demo

The following template are not available in this site (must be purchased separately)

  • PHPMaker v2018 Horizontal Vertical Template.
  • PHPMaker v2017 Horizontal Vertical Template.

Demo Explanation

Stock Inventory Management is the good project for your reference, since it uses the real example in the real world. Many useful features you can use from this project, such as how to add the Thousand and Decimal separator character, and also how to calculate multiple row in Grid-Add when End-Users are entering data into the Grid-Add mode.

Categories

  • Customize Template (103)
  • General (4)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (84)
  • PHPMaker Projects (7)
  • Tips and Trick (72)

Articles based on version

  • PHPMaker 2025
  • PHPMaker 2024
  • PHPMaker 2023
  • PHPMaker 2022
  • PHPMaker 2021
  • PHPMaker 2020
  • PHPMaker 2019
  • PHPMaker 2018
  • PHPMaker 2017.0.7
  • PHPMaker 12.0.7
  • PHPMaker 11.0.6
  • PHPMaker 10.0.5
  • PHPMaker 9.2.0
  • PHPMaker 8.0.3
  • PHP Report Maker 12

(c) I Love PHPMaker 2010 - 2025 by Masino Sinaga | WordPress | Log in | Back to top