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 » Customizing Header and Footer in Websites that Generated by PHP Report Maker 6.0.0
Customizing Login Page 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

December 4, 2012

Customizing Header and Footer in Websites that Generated by PHP Report Maker 6.0.0

Now we are going to customize the look of the Header and Footer of your web applications that generated by PHP Report Maker 6. This customization is similar to the earlier one I made for PHP Maker. There are some constants that were added into the configuration file that aims to support the change of your Header and Footer view. Most of information that we will add to the Header and Footer is the common functionality that usually exists in a web application. They are controlled by the usage of the related constants. In other words, you are able to change the default value of the constants that suits with your needs.

Some of these constants are for:

  1. Displaying or hiding the entire header
  2. Displaying or hiding the entire footer
  3. Displaying or hiding site title in header
  4. Displaying or hiding current Username in header
  5. Displaying or hiding the Languages Selector (whether "in the header", "below the header", or "hide them all")
  6. Text-alignment for Site Title, current Username, and Languages Selector
  7. Displaying the style of Site Title (whether "normal", "capitalize", or "uppercase")
  8. Logo width setting (this will adjust the space between logo image and Site Title, current Username, and Languages Selector)
  9. The Language Selector alignment (whether “autoadjust”, "left", "center", or "right")
  10. Displaying or hiding the copyright text on Footer
  11. Displaying or hiding the "Back to Top" link on Footer
  12. Displaying or hiding the "Terms and Conditions" link on footer

All we have to do is customizing PHP Report Maker template files. In other words, we will not modify the generated script files. After implementing this modifications, now you can customize your Header and Footer and the related items by simply changing the value of the related constants in the configuration file.

[hidepost]

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

    // General
    

    before that line, please insert the following code:

    // Begin of modification Customize Header and Footer, by Masino Sinaga, December 4, 2012
    define("MSR_LANGUAGE_SELECTOR_VISIBILITY", "inheader", TRUE); // Whether "inheader", "belowheader", or "hidethemall"
    define("MSR_LANGUAGE_SELECTOR_ALIGN", "autoadjust", TRUE); // Language selector align: "autoadjust", "left", "center", or "right"
    define("MSR_SHOW_SITE_TITLE_IN_HEADER", TRUE, TRUE); // Show Site title in header
    define("MSR_SHOW_CURRENT_USER_IN_HEADER", TRUE, TRUE); // Show current User status in header
    define("MSR_SHOW_ENTIRE_HEADER", TRUE, TRUE); // Show entire header block
    define("MSR_SHOW_ENTIRE_FOOTER", TRUE, TRUE); // Show entire footer block
    define("MSR_SHOW_TEXT_IN_FOOTER", TRUE, TRUE); // Show text in footer block
    define("MSR_TEXT_ALIGN_IN_HEADER", "left", TRUE); // Text align in header, left, center, or right
    define("MSR_SITE_TITLE_TEXT_STYLE", "normal", TRUE); // Whether "normal", "capitalize", or "uppercase"
    define("MSR_LOGO_WIDTH", 170, TRUE); // Logo width
    define("MSR_SHOW_BACKTOTOP_ON_FOOTER", TRUE, TRUE); // Back to Top link
    define("MSR_SHOW_TOC_ON_FOOTER", TRUE, TRUE); // Terms of Condition
    // End of modification Customize Header and Footer, by Masino Sinaga, December 4, 2012
    
  2. Open your C:\Program Files\PHP Report Maker 6\languages\english.xml file, and find this code:

    </global>
    

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

        <phrase id="Welcome" value="Welcome"/>
        <phrase id="AskToLogout" value="Are you sure you want to logout now?"/>
        <phrase id="BackToTop" value="Back to Top"/>   
        <phrase id="UserID" value="User ID"/>
        <phrase id="TaCTitle" value="Terms and Conditions"/>
    

    Do the same way to your another .xml language file, for example, I am using Indonesian language too, so I add this following code into my indonesian.xml file:

        <phrase id="Welcome" value="Selamat Datang"/>
        <phrase id="AskToLogout" value="Anda yakin ingin logout sekarang?"/>
        <phrase id="BackToTop" value="Kembali ke Atas"/>   
        <phrase id="UserID" value="ID Pengguna"/>
        <phrase id="TaCTitle" value="Syarat dan Ketentuan"/>
    
  3. Download scroll.zip file, and then extract it. There is one file inside named scroll.js. Put this scroll.js file into your C:\Documents and Settings\{YourName}\My Documents\PHPReportMaker\Templates\phprpt60.zip\Script directory. Afterwards, re-generate your script files using PHP Report Maker as usual.
  4. Open your \Script\control.xml file, and find this code:

    	<!-- copy all js -->
    	<control id="ewr.js" type="copy" ofolderid="_js" ofile="ewr6" oext="js" ifiles="ewr.js" />
    

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

        <!--
            Added by Masino Sinaga, for Scroll to Top, December 4, 2012
        -->
        <control id="scroll.js" type="copy" remark="Copy scroll.js" ofolderid="_js" ifiles="scroll.js" />
    
  5. Open your \Script\rpt-template.php file, and find this code:

    <script type="text/javascript">if (!window.jQuery) ewr_GetScript("<?php echo ewr_jQueryFile("jquery-%v.min.js") ?>");</script>
    

    after that line, please insert the following code:

    <?php // Begin of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
    <script type="text/javascript" src="<!--##=ew_GetFileNameByCtrlID("scroll.js")##-->"></script>
    <?php // End of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
    
  6. Still in your \Script\rpt-template.php file, find again this code:

    	<div class="ewHeaderRow"><!--##=SYSTEMFUNCTIONS.HeaderLogo()##--></div>
    

    then replace it with the following code:

    <?php // Begin of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
    <?php if (MSR_SHOW_ENTIRE_HEADER) { // begin of show header block ?>
        <!-- header (begin) --> 
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr class="ewHeaderRow">
            <td width="<?php echo (MSR_LOGO_WIDTH); ?>px" rowspan="3">
    <?php
        echo '<a href="." title="'.$ReportLanguage->ProjectPhrase("BodyTitle").'"><!--##=SYSTEMFUNCTIONS.HeaderLogo()##--></a>';
    ?>   
          &nbsp;
          </td>
            <td>
            <?php if (MSR_SHOW_SITE_TITLE_IN_HEADER) { ?>
              <font class="ewFooterText"><strong><div align="<?php echo MSR_TEXT_ALIGN_IN_HEADER; ?>" style="text-transform:<?php echo MSR_SITE_TITLE_TEXT_STYLE; ?>"><?php echo $ReportLanguage->ProjectPhrase("BodyTitle") ?>&nbsp;&nbsp;</div></strong></font>
            <?php } ?>
            </td>
      </tr>
    
        <tr class="ewHeaderRow">
          <td >
            <?php if (MSR_SHOW_CURRENT_USER_IN_HEADER) { ?>
            <font class="ewFooterText"><div align="<?php echo MSR_TEXT_ALIGN_IN_HEADER; ?>"><?php if ($Security->IsLoggedIn()=="login") { echo "". $ReportLanguage->Phrase("UserID").": <strong>" . $Security->CurrentUserName() . "</strong>,  [ <a id=\"logout\" href=# onclick=\"MGJS.goTop();return false;\">Logout</a> ]"; } ?>&nbsp;&nbsp;</div></font>
            <?php } ?>
            </td>
        </tr>
       
        <tr class="ewHeaderRow">
            <td>
                <!--## if (bMultiLanguage && arLanguageFile.length > 1) { ##-->
                <?php if (MSR_LANGUAGE_SELECTOR_VISIBILITY=="inheader") { ?>
                <div align="<?php if (MSR_LANGUAGE_SELECTOR_ALIGN=="autoadjust") { echo MSR_TEXT_ALIGN_IN_HEADER; } else { echo MSR_LANGUAGE_SELECTOR_ALIGN; } ?>"><form class="ewForm">
                <span class="phpmaker"><?php echo $ReportLanguage->Phrase("Language") ?></span>
                <select id="language" name="language" onchange="ewr_SubmitLanguageForm(this.form);">
                <?php foreach ($EWR_LANGUAGE_FILE as $langfile) { ?>
                <option value="<?php echo $langfile&#91;0&#93; ?>"<?php if ($gsLanguage == $langfile&#91;0&#93;) echo " selected=\"selected\"" ?>><?php echo $langfile&#91;1&#93; ?></option>
                <?php } ?>
                </select>
                </form></div>
                <?php } ?>
                <!--## } ##-->     
            </td>
        </tr>
        </table>
    
        <!-- header (end) -->
       
    <?php } else { // else of show entire header ?>
    
    <div class="ewHeaderRow">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr class="ewHeaderRow">
            <td rowspan="2">
          </td>
            <td>
    </td>
        </tr>
        <tr class="ewHeaderRow">
          <td >
            </td>
        </tr>
      </table>
    </div>
    
    <?php } // end of show entire header ?>
    <?php // End of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
    
  7. Still in that \Script\rpt-template.php file, find again this code:

    	<!--## if (bMultiLanguage) { ##-->
    <div class="ewLangForm"><form class="ewForm">
    <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Language") ?></span>
    <select id="language" name="language" class="phpreportmaker" onchange="ewr_SubmitLanguageForm(this.form);">
    <?php foreach ($EWR_LANGUAGE_FILE as $langfile) { ?>
    <option value="<?php echo $langfile&#91;0&#93; ?>"<?php if ($gsLanguage == $langfile&#91;0&#93;) echo " selected=\"selected\"" ?>><?php echo $langfile&#91;1&#93; ?></option>
    <?php } ?>
    </select>
    </form></div>
    	<!--## } ##-->
    

    then replace it with the following code:

    <?php // Begin of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
                <!--## if (bMultiLanguage && arLanguageFile.length > 1) { ##-->
                <?php if (MSR_LANGUAGE_SELECTOR_VISIBILITY=="belowheader") { ?>         
                <div class="ewLangForm" align="<?php if (MSR_LANGUAGE_SELECTOR_ALIGN=="autoadjust") { echo MSR_TEXT_ALIGN_IN_HEADER; } else { echo MSR_LANGUAGE_SELECTOR_ALIGN; } ?>"><form class="ewForm">
                <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Language") ?></span>
                <select id="language" name="language" onchange="ewr_SubmitLanguageForm(this.form);">
                <?php foreach ($EWR_LANGUAGE_FILE as $langfile) { ?>
                <option value="<?php echo $langfile&#91;0&#93; ?>"<?php if ($gsLanguage == $langfile&#91;0&#93;) echo " selected=\"selected\"" ?>><?php echo $langfile&#91;1&#93; ?></option>
                <?php } ?>
                </select>
                </form></div>
                <?php } ?>         
                <!--## } ##-->         
    
    			<?php if (!MSR_SHOW_SITE_TITLE_IN_HEADER) { ?>
    				<p class="phpreportmaker ewTitle"><b><?php echo $ReportLanguage->ProjectPhrase("BodyTitle") ?></b></p>
    			<?php } ?>	
    <?php // End of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
    
  8. Still in that \Script\rpt-template.php file, find again this code:

    		<div class="ewFooterText">&nbsp;<?php echo $ReportLanguage->ProjectPhrase("FooterText"); ?></div>
    		<!-- Place other links, for example, disclaimer, here -->
    

    then replace it with the following code:

    <?php // Begin of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>	
            <div class="ewFooterText">&nbsp;
            <?php if (MSR_SHOW_TEXT_IN_FOOTER) { ?>
            <?php echo $ReportLanguage->ProjectPhrase("FooterText") ?>
            <?php } ?>
            <?php if (MSR_SHOW_BACKTOTOP_ON_FOOTER) { ?>
            | <a id="gotop" href="#" onclick="MGJS.goTop();return false;"><?php echo $ReportLanguage->Phrase("BackToTop"); ?></a>
            <?php } ?>
            <?php if (MSR_SHOW_TOC_ON_FOOTER) { ?>
            | <a href="#" id="tac" onclick="MGJS.goTop();return false;"><?php echo $ReportLanguage->Phrase("TaCTitle"); ?></a>
            <?php } ?>
            </div>
            <!-- Place other links, for example, disclaimer, here -->
    <?php // End of modification Header and Footer, by Masino Sinaga, December 4, 2012 ?>
    
  9. Finally, re-generate your script files using PHP Report Maker as always.

[/hidepost]

Article by Masino Sinaga / PHP Report Maker / footer, footer text, header, header text, PHP Report Maker 6.0.0 Leave a Comment

Customizing Login Page 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

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 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!
  • A New PHPMaker 2022 Project File Is Released
  • PHPMaker 2022 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2022 Is Released!

Search

Recent Comments

  • Masino Extensions untuk PHPMaker 2024 Sudah Dirilis, Silahkan Download! – Masino Sinaga on Membership Options
  • Masino Sinaga on Masino Extensions for PHPMaker 2022 (All-In-One)
  • Filipe Vercesi on Masino Extensions for PHPMaker 2022 (All-In-One)
  • Mandwa on Masino Extensions for PHPMaker 2023 Is Released!
  • Masino Sinaga on Masino Extensions for PHPMaker 2023 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2024 (MasinoExtensions).
  • Stock Inventory Management for PHPMaker 2024.
  • Stock Inventory Management for PHPMaker 2023.
  • Stock Inventory Management for PHPMaker 2022.
  • Stock Inventory Management for PHPMaker 2021.

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 (83)
  • PHPMaker Projects (5)
  • Tips and Trick (72)

Articles based on version

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