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 » Displaying Breadcrumb Links in Websites that Generated by PHP Report Maker 6.0.0
Customizing Pagination Style in Websites that Generated by PHP Report Maker 6.0.0
Adding jQuery slideDown and slideUp Effects into Filter Panel in Websites that Generated by PHP Report Maker 6.0.0

December 3, 2012

Displaying Breadcrumb Links in Websites that Generated by PHP Report Maker 6.0.0

This following customization will display the Breadcrumb Links in websites that generated by PHP Report Maker 6, 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 are 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 want to provide your web application users the information about the page location they are visitting. In addition, this is also useful if you want to integrate your report pages that generated by PHP Report Maker 6 into your web applications that generated by PHPMaker 9 and you want to synchronize the look and view of your web applications between one to another. 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.

Please note that in some part of the customization below is related to the customization in article Customizing Page Title Style in Websites that Generated by PHP Report Maker 6.0.0. So, please implement the customization in that article above before doing the customization below.

[hidepost]

  1. First of all, please follow this article or this article in order to create the breadcrumblinks table structure including the three Stored Procedures (SP) that you will need to populate the Breadcrumb Links records. Afterwards, insert your Breadcrumb Links record by using the addnewbreadcrumb SP.
  2. Open your \Script\rpt-config.php file, and find this code:

    // General
    

    before that line, please insert the following code:

    // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012
    define("MSR_SHOW_BREADCRUMB_IN_ALL_PAGES", TRUE, TRUE);
    // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012
    
  3. Open your \Script\rpt-summary.php file, and find this code:

    <?php // Begin of modification Customize Page Title Style, by Masino Sinaga, December 3, 2012 ?>
    

    before that line, please insert the following code:

    <?php // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012 ?>
    <?php if (MSR_SHOW_BREADCRUMB_IN_ALL_PAGES) { ?>
    <span>
    <div id="ewBreadcrumbContainer">
    <ul id="breadcrumb">
    <?php
        $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".ewr_CurrentPage()."')
                ORDER BY C.Lft";  
        $rsBreadcrumb = $conn->Execute($sSql);
        $recCount = $rsBreadcrumb->RecordCount();
        $rsBreadcrumb->MoveFirst();
        $i = 1;
        while (!$rsBreadcrumb->EOF) {
            if ($i < $recCount) {
                if ($i==1) {
                    echo "<li><a href='". $rsBreadcrumb->fields("Page_URL")."' title='".$ReportLanguage->BreadcrumbPhrase("Home")."'><img src='./phprptimages/home.png' alt='".$ReportLanguage->BreadcrumbPhrase("Home")."' class='home'></a></li>";
                } else {
                    echo "<li><a href='". $rsBreadcrumb->fields("Page_URL")."'>".$ReportLanguage->BreadcrumbPhrase($rsBreadcrumb->fields("Page_Title"))."</a></li>";
                }
            } else {
                echo "<li>".$ReportLanguage->BreadcrumbPhrase($rsBreadcrumb->fields("Page_Title"))."</li>";          
            }
            $i++;
            $rsBreadcrumb->MoveNext();
        }
        $rsBreadcrumb->Close();
    ?>
    </ul>
    </div>
    </span>
    <?php } ?>
    <?php // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012 ?>
    
  4. Open your \Script\rpt-crosstab.php file, and find this code:

    <?php // Begin of modification Customize Page Title Style, by Masino Sinaga, December 3, 2012 ?>
    

    before that line, please insert the following code:

    <?php // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012 ?>
    <?php if (MSR_SHOW_BREADCRUMB_IN_ALL_PAGES) { ?>
    <span>
    <div id="ewBreadcrumbContainer">
    <ul id="breadcrumb">
    <?php
        $sSql = "SELECT C.*
                FROM breadcrumblinks AS B, breadcrumblinks AS C
                WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
                AND (B.Page_URL LIKE '".ewr_CurrentPage()."')
                ORDER BY C.Lft";  
        $rsBreadcrumb = $conn->Execute($sSql);
        $recCount = $rsBreadcrumb->RecordCount();
        $rsBreadcrumb->MoveFirst();
        $i = 1;
        while (!$rsBreadcrumb->EOF) {
            if ($i < $recCount) {
                if ($i==1) {
                    echo "<li><a href='". $rsBreadcrumb->fields("Page_URL")."' title='".$ReportLanguage->BreadcrumbPhrase("Home")."'><img src='./phprptimages/home.png' alt='".$ReportLanguage->BreadcrumbPhrase("Home")."' class='home'></a></li>";
                } else {
                    echo "<li><a href='". $rsBreadcrumb->fields("Page_URL")."'>".$ReportLanguage->BreadcrumbPhrase($rsBreadcrumb->fields("Page_Title"))."</a></li>";
                }
            } else {
                echo "<li>".$ReportLanguage->BreadcrumbPhrase($rsBreadcrumb->fields("Page_Title"))."</li>";          
            }
            $i++;
            $rsBreadcrumb->MoveNext();
        }
        $rsBreadcrumb->Close();
    ?>
    </ul>
    </div>
    </span>
    <?php } ?>
    <?php // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012 ?>
    
  5. 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, December 3, 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 ewr_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, December 3, 2012
    
  6. 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, December 3, 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";
        $rsBreadcrumb = $conn->Execute($sSql);
        $recCount = $rsBreadcrumb->RecordCount();
        if ($recCount>0) {
            $rsBreadcrumb->MoveFirst();
            $i = 1;
            while (!$rsBreadcrumb->EOF) {
                if ($i < $recCount) {
                    if ($i==1) {
    
                        // $CurrentPageTitle = 'Home'; // skip this!
                    } else {
       
                        // $CurrentPageTitle .= " &raquo; ". $Language->Phrase($rsBreadcrumb->fields("Page_Title")).""; // skip this!
                    }
                } else {
    
                    // this is the current page, just display this, no need to display its parent!
                    $CurrentPageTitle .= $ReportLanguage->BreadcrumbPhrase($rsBreadcrumb->fields("Page_Title"))."". " &laquo; " . $ReportLanguage->ProjectPhrase("BodyTitle");
                    return;
                }
                $i++;
                $rsBreadcrumb->MoveNext();
            }
            $rsBreadcrumb->Close();
        } else {
            $CurrentPageTitle = $ReportLanguage->ProjectPhrase("BodyTitle");
        }
    }
    // End of modification Displaying Breadcrumbs in All Pages, by Masino Sinaga, December 3, 2012
    
  7. Open your \Script\rpt-template.php file, and find this code:

        <title><?php echo $ReportLanguage->ProjectPhrase("BodyTitle") ?></title>
    

    then replace it with the following code:

        <?php // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012 ?>
        <title><?php global $CurrentPageTitle; echo $CurrentPageTitle; ?></title>
        <?php // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012 ?>
    
  8. Open your \Script\rpt-phpcommon-scripts.php file, and find this code:

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

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

    // Begin of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012
    getCurrentReportPageTitle(ewr_CurrentPage());
    // End of modification Displaying Breadcrumb Links in All Pages, by Masino Sinaga, December 3, 2012
    
  9. Open your C:\Program Files\PHPMaker 9\themes\ew.css file, and find this code:

    /*END_SYSTEM_STYLES*/
    

    before that line, please insert the following code:

    /* Begin of Customizing Breadcrumb Links, by Masino Sinaga, December 3, 2012 */
    #breadcrumb
    {
       font: 8pt Tahoma, Helvetica, sans-serif;
       background-image:url(../phprptimages/bc_bg.png);
       background-repeat:repeat-x;
       height:22px;
       line-height:22px;
       color:#9b9b9b;
       border-left: 1px solid #cacaca;
       border-right: 1px solid #cacaca;
       border-top: 1px solid #cacaca;
       overflow:hidden;
       margin:0px;
       padding:0px;
    }
    #breadcrumb li
    {
       list-style-type:none;
       float:left;
       padding-left:1px;
    }
    #breadcrumb a
    {
       height:22px;
       display:block;
       background-image:url(../phprptimages/bc_separator.png);
       background-repeat:no-repeat;
       background-position:right;
       padding-right: 10px;
       text-decoration: none;
       color:#454545;
    }
    .home
    {
       border:none;
       margin: 3px 0px;
    }
    
    #breadcrumb a:hover
    {
       color:#35acc5;
    }
    /* End of Customizing Breadcrumb Links, by Masino Sinaga, December 3, 2012 */
    
  10. Download this file (there are three files inside; they are: bc_bg.png, bc_separator.png, and home.png). Extract them to your \Script\images\ sub-directory of your current PHP Report Maker template. These three files are needed in order to display the Breadcrumb Links style more beautiful and professional. Make sure you do not miss this step in order to display the Breadcrumb Links properly.
  11. 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 6\languages\ folder.
    Define all of your breadcrumb links phrases after the following line in your .xml language files:

    <ew-language date="2012/11/7" version="6.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 Report" value="Customers Report"/>
    </breadcrumb>
    

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

    <breadcrumb>
    

    and

    </breadcrumb>
    

    tags.

  12. 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.
  13. Finally, re-generate your script files using PHP Report Maker as always.

[/hidepost]

Article by Masino Sinaga / PHP Report Maker / breadcrumb links, PHP Report Maker 6.0.0 Leave a Comment

Customizing Pagination Style in Websites that Generated by PHP Report Maker 6.0.0
Adding jQuery slideDown and slideUp Effects into Filter Panel in Websites that Generated by PHP Report Maker 6.0.0

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 2020 Project File Is Released
  • PHPMaker 2020 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2020 Is Released!
  • Inventory Stock Management Project, Why Should You Have It?
  • A New PHPMaker 2019 Project File Is Released!
  • PHPMaker 2019 Demo Project File Is Released!
  • Masino Extensions for PHPMaker 2019 Is Released!
  • A New PHPMaker 2018 Project File Is Released!
  • PHPMaker 2018 Demo Project File Is Released!
  • Masino Extensions for PHPMaker 2018 Is Released!

Search

Recent Comments

  • Masino Sinaga on Masino Extensions for PHPMaker 2019 Is Released!
  • Masino Sinaga on Masino Extensions for PHPMaker 2019 Is Released!
  • Brien Devine on Masino Extensions for PHPMaker 2019 Is Released!
  • Brien Devine on Masino Extensions for PHPMaker 2019 Is Released!
  • Masino Sinaga on Masino Extensions for PHPMaker 2019 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2020 (MasinoExtensions).
  • Indonesia Post Offices.
  • Stock Inventory Management.
  • Demo of PHPMaker + PHP Report Maker

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 (3)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (76)
  • Tips and Trick (72)

Articles based on version

  • 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 - 2019 by Masino Sinaga | WordPress | Log in | Back to top