<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/external/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.mouse.min.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.draggable.min.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.resizable.min.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.dialog.min.js"></script>
<script type="text/javascript" src="../libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
    $(document).ready(function ()
    {
<?php if ($_REQUEST['action'] == 'edit' && $_REQUEST['p'] == 'uman') { ?>
            showdescription();
<?php } ?>
    });
</script>
<script type="text/javascript">

    function showdescription()
    {
        if (document.getElementById('chr_maintenance').checked == true)
        {
            document.getElementById('ckeditordiv').style.display = '';
            document.getElementById('ckeditormaindiv').style.display = '';

        }
        else
        {
            document.getElementById('ckeditordiv').style.display = 'none';
            document.getElementById('ckeditormaindiv').style.display = 'none';
        }
    }

    function getNewBackup()
    {
        $.ajax({
            type: "GET",
            url: "index.php",
            data: "module=settings&view=system&action=getNewBackup&p=htaccess&ajax=Y",
            async: false,
            success: function (data)
            {

                document.getElementById('gridbody').innerHTML = data;
                alert("Congrats, .Htaccess backup is successfully generated.");

            }

        });
    }


    function delHtaccessFile(filename)
    {
        var m = confirm('Caution! Are you sure you want to delete this .htaccess backup?');

        if (m == true)
        {
            var response;
            $.ajax({
                type: "GET",
                url: "index.php",
                data: "module=settings&view=system&action=delFile&p=htaccess&ajax=Y&filename=" + filename,
                async: false,
                success: function (data)
                {

                    document.getElementById('gridbody').innerHTML = data;
                    alert('The .htaccess backup file is deleted successfully.');

                }

            });
        }
        else
        {
            return false;
        }
    }


    function openLinksModel(id)
    {
        //alert(id);
        var response;
        $.ajax({
            type: "GET",
            url: "index.php",
            data: "module=settings&action=videopopup&view=system&videoid=" + id,
            async: false,
            success: function (data)
            {
                response = data;
            }

        });
        //alert(response);
        $('#links-modal').html(response);

        $('#links-modal').dialog({
            autoOpen: false,
            height: 470,
            width: 580,
            modal: true
        });

        $('#links-modal').dialog('open');

    }
</script>
<script language="javascript">
    function validate()
    {
        if (document.getElementById('p').value == 'gen') {
            if (document.getElementById('var_sitename').value == '') {
                alert("Please specify your site name..");
                document.getElementById('var_sitename').focus();
                return false;
            }
            else if (document.getElementById('var_sitepath').value == '') {
                alert("Please specify your site name..");
                document.getElementById('var_sitepath').focus();
                return false;
            }
            else if (document.getElementById('var_sitepath').value != '') {
                var val = document.getElementById('var_sitepath').value;
                var fisrtchar = val.substr(0, 7);
                var fisrtchar1 = val.substr(0, 8);
                if (fisrtchar != 'http://' && fisrtchar1 != 'https://') {
                    alert("Please specify valid site name..(i.e http://....)");
                    document.getElementById('var_sitepath').focus();
                    return false;
                }
            }
            if (trim(document.getElementById('var_pagesize').value) == '') {
                alert("Please enter page size..");
                document.getElementById('var_pagesize').focus();
                return false;
            }
            else if (document.getElementById('var_pagesize').value != '') {
                if (document.getElementById('var_pagesize').value > 50 || document.getElementById('var_pagesize').value < 10) {
                    alert("Page size should be between 10 and 50");
                    document.getElementById('var_pagesize').focus();
                    return false;
                }
            }
            if (document.getElementById('var_facebook_link').value != '') {
                var val = document.getElementById('var_facebook_link').value;
                var fisrtchar = val.substr(0, 7);
                var fisrtchar1 = val.substr(0, 8);
                if (fisrtchar != 'http://' && fisrtchar1 != 'https://') {
                    alert("Please specify valid facebook Link..(i.e http://....)");
                    document.getElementById('var_facebook_link').focus();
                    return false;
                }
            }
            //if(document.getElementById('var_twitter_link').value !=''){
            //  var val = document.getElementById('var_twitter_link').value;
            //var fisrtchar = val.substr(0, 7);
            //var fisrtchar1 = val.substr(0, 8);
            //if(fisrtchar!='http://' && fisrtchar1!='https://'){
            //  alert("Please specify valid twitter link..(i.e http://....)");
            // document.getElementById('var_twitter_link').focus();
            //return false;
            //}

            //}

            if (document.getElementById('var_tripadvisor_link').value != '') {

                var val = document.getElementById('var_tripadvisor_link').value;
                var fisrtchar = val.substr(0, 7);
                var fisrtchar1 = val.substr(0, 8);
                if (fisrtchar != 'http://' && fisrtchar1 != 'https://') {
                    alert("Please specify valid trip advisor link..(i.e http://....)");
                    document.getElementById('var_tripadvisor_link').focus();
                    return false;
                }
                document.getElementById('h_save').value = 'T';


            }

            if (document.getElementById('var_passengerpicks').value != '') {

                var val = document.getElementById('var_passengerpicks').value;
                var fisrtchar = val.substr(0, 7);
                var fisrtchar1 = val.substr(0, 8);
                if (fisrtchar != 'http://' && fisrtchar1 != 'https://') {
                    alert("Please specify valid passengerpicks link..(i.e http://....)");
                    document.getElementById('var_passengerpicks').focus();
                    return false;
                }
                document.getElementById('h_save').value = 'T';


            }

        }

        if (document.getElementById('p').value == 'ser') {

            var emailID = document.getElementById('var_smtpusername').value;
            var emailID1 = document.getElementById('var_adminmailid').value;

            if (document.getElementById('var_mailer').value == '') {
                alert("Please select mailer type");
                document.getElementById('var_mailer').focus();
                return false;
            }
            else if (document.getElementById('var_smtpserver').value == '') {
                alert("Please enter SMTP serevr name");
                document.getElementById('var_smtpserver').focus();
                return false;
            }

            else if (echeck(emailID) == false) {
                document.getElementById('var_smtpusername').value = "";
                document.getElementById('var_smtpusername').focus();
                return false;
            }
            else if (echeck(emailID1) == false) {
                document.getElementById('var_adminmailid').value = "";
                document.getElementById('var_adminmailid').focus();
                return false;
            }

        }
        // alert('called');
        if (document.getElementById('p').value == 'seo') {
            var x = document.getElementsByName("seoprefix_array2[]");
            for (i = 0; i < x.length; i++)
            {
                //	    alert(x[i].value);
                if (x[i].value == '') {
                    alert('Please enter seoprefix value');
                    return false;
                }

            }
        }
        if (document.getElementById('p').value == 'htaccess')
        {
            if (confirm('Are you want to save the changes and take the backup.Press OK to confirm.'))
            {
                document.getElementById('backup').value = 'Y';
            }
            else
            {
                document.getElementById('backup').value = 'N';
            }
        }
        document.getElementById('h_save').value = 'T';

        return true;
    }

    function echeck(str) {
        var at = "@";
        var dot = ".";
        var lat = str.indexOf(at);
        var lstr = str.length;
        var ldot = str.indexOf(dot);
        if (str.indexOf(at) == -1) {
            alert("Invalid E-mail ID");
            return false;
        }

        if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
            alert("Invalid E-mail ID");
            return false;
        }

        if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
            alert("Invalid E-mail ID");
            return false;
        }

        if (str.indexOf(at, (lat + 1)) != -1) {
            alert("Invalid E-mail ID");
            return false;
        }

        if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
            alert("Invalid E-mail ID");
            return false;
        }

        if (str.indexOf(dot, (lat + 2)) == -1) {
            alert("Invalid E-mail ID");
            return false;
        }

        if (str.indexOf(" ") != -1) {
            alert("Invalid E-mail ID");
            return false;
        }

        return true;
    }
    function setmailsettings()
    {
        if (document.getElementById('var_mailer').value != 'smtp')
        {
            document.getElementById('smtpfields').style.display = 'none';
        }
        else
        {
            document.getElementById('smtpfields').style.display = 'block';
        }
    }

    function convertmesg()
    {
        document.getElementById('varyoutublink').value = document.getElementById("varyoutublink").value.replace(/&nbsp;/, '').replace(/<br>/, '\n');
        return false;
    }

    function LimitAttach_Pdf(file, id)
    {
        var imgpath = document.getElementById(id).value;
        if (imgpath != "")
        {
            // code to get File Extension..
            var arr1 = new Array;
            arr1 = imgpath.split("\\");
            var len = arr1.length;
            var img1 = arr1[len - 1];
            var filext = img1.substring(img1.lastIndexOf(".") + 1);
            // Checking Extension

            //if(filext == "jpg" || filext == "jpeg" || filext == "gif" || filext == "bmp")
            if (filext == "pdf")
            {
                return true;
            }
            else
            {
                document.getElementById(id).value = "";
                return false;
            }
        }
    }

    function hidetxtbox(chkid, txtid)
    {
        if (document.getElementById(chkid).checked == true)
        {
            document.getElementById(txtid).style.display = '';

        }
        else
        {
            document.getElementById(txtid).style.display = 'none';
        }
    }

</script>

<div id="links-modal" title="Video"></div>
<? if ($ajax != 'Y') { ?>
    <div class="web-booking-main">
        <div class="clear"></div>
        <!-- This is the for the page header and searchpanel -->
        <div id="gridbody">
        <? } ?>
        <div class="add-new-user-title">
            <h2><img alt="add-new-listing" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>/systemsettings.jpg">System Settings</h2>
        </div>
        <?= $messagebox; ?>
        <form  action="index.php?module=settings&view=system&action=edit&p=<?php echo $_REQUEST['p']; ?>" method="post" onsubmit="return validate();" enctype="multipart/form-data" >
            <?= $gridtabs ?>
            <br class="clear" />
            <? if ($p == "gen" || $p == "") { ?>
                <div class="add-new-form-bg" > General Settings</div>
                <div class="information-white-bg" id="dvpersonalinformation" >
                    <div class="clear"></div>
                    <?php if ($p == "gen") { ?>
                        <input type="hidden" name="p" id="p" value="<?= $p ?>">
                    <? } if ($p == "") { ?>
                        <input type="hidden" name="p" id="p" value="gen">
                    <? } ?>
                    <script type="text/javascript" src="html/js/highslide/highslide.js"></script>
                    <link rel="stylesheet" type="text/css" href="html/js/highslide/highslide.css" />
                    <script type="text/javascript">
                //<![CDATA[
                hs.registerOverlay({
                    html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
                    position: 'top right',
                    fade: 2 // fading the semi-transparent overlay looks bad in IE
                });


                hs.graphicsDir = 'html/js//highslide/graphics/';
                hs.wrapperClassName = 'borderless';
                //]]>
                    </script>
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="44%" align="left" valign="top">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="30%" align="left" valign="top" class="add-new-user-text">Site Name : <span style="color:#1979AC;">(required)</span></td>
                                        <td width="79%" colspan="2" align="left" valign="top"><input name="var_sitename" type="text" style="width:340px;" class="add-new-user-textarea" id="var_sitename" value="<?= htmlspecialchars($row['var_sitename']) ?>" maxlength="50" tabindex="1" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Site Path : <span style="color:#1979AC;">(required)</span></td>
                                        <td colspan="2" align="left" valign="top"><input name="var_sitepath" type="text" style="width:340px;" class="add-new-user-textarea" id="var_sitepath" value="<?= $row['var_sitepath'] ?>" maxlength="250" tabindex="1" /></td>
                                    </tr>
                                    <tr>
                                        <td  align="left" valign="top" class="add-new-user-text">Default Pagesize :</td>
                                        <td  colspan="2" align="left" valign="middle" ><input name="var_pagesize" type="text" style="width:340px;" class="add-new-user-textarea" id="var_pagesize" value="<?= $row['var_pagesize'] ?>" onkeypress="javascript : return KeycheckOnlyNumeric(event);" maxlength="2" tabindex="1" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Facebook Link : </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox"  type="checkbox" name="chr_facebook" id="chr_facebook"  onclick=" javascript : hidetxtbox('chr_facebook', 'var_facebook_link')" <?php
                                            if ($row['chr_facebook'] == 'Y') {
                                                echo "checked";
                                            } else {
                                                echo "";
                                            }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_facebook'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_facebook_link" type="text" class="add-new-user-textarea" id="var_facebook_link" value="<?= $row['var_facebook_link'] ?>" maxlength="255" tabindex="1" /></td>
                                    </tr>

                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Twitter Link: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_twitter" id="chr_twitter"  onclick=" javascript : hidetxtbox('chr_twitter', 'var_twitter_link')"  <?php
                                            if ($row['chr_twitter'] == 'Y') {
                                                echo "checked";
                                            } else {
                                                echo "";
                                            }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_twitter'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_twitter_link" type="text" class="add-new-user-textarea" id="var_twitter_link" value="<?= $row['var_twitter_link'] ?>" maxlength="255" tabindex="1" /></td>
                                    </tr>
                                   <!-- <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Twitter Link : </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_twitter" id="chr_twitter"  onclick=" javascript : hidetxtbox('chr_twitter','var_twitter_link')"  <?php
                                            if ($row['chr_twitter'] == 'Y') {
                                                echo "checked";
                                            } else {
                                                echo "";
                                            }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_twitter'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_twitter_link" type="text" class="add-new-user-textarea" id="var_twitter_link" value="<?= $row['var_twitter_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>-->

                                       <!-- <tr>
                                            <td align="left" valign="top" class="add-new-user-text">You Tube Link : </td>
                                            <td colspan="2" align="left" valign="center">
                                                <input class="add-new-user-chkbox" type="checkbox" name="chr_tripadvisor" id="chr_tripadvisor"  onclick=" javascript : hidetxtbox('chr_tripadvisor','var_tripadvisor_link')"  <?php
                                            if ($row['chr_tripadvisor'] == 'Y') {
                                                echo "checked";
                                            } else {
                                                echo "";
                                            }
                                            ?> />
                                                <input style="display:<?php echo ($row['chr_tripadvisor'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_tripadvisor_link" type="text" class="add-new-user-textarea" id="var_tripadvisor_link" value="<?= $row['var_tripadvisor_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                        </tr>-->

                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Youtube Link: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_youtube" id="chr_youtube"  onclick=" javascript : hidetxtbox('chr_youtube', 'var_youtube_link')"  <?php
                                        if ($row['chr_youtube'] == 'Y') {
                                            echo "checked";
                                        } else {
                                            echo "";
                                        }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_youtube'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_youtube_link" type="text" class="add-new-user-textarea" id="var_youtube_link" value="<?= $row['var_youtube_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>

                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Google Plus Link: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_google_plus" id="chr_google_plus"  onclick=" javascript : hidetxtbox('chr_google_plus', 'chr_google_plus_link')"  <?php
                                               if ($row['chr_google_plus'] == 'Y') {
                                                   echo "checked";
                                               } else {
                                                   echo "";
                                               }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_google_plus'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="chr_google_plus_link" type="text" class="add-new-user-textarea" id="chr_google_plus_link" value="<?= $row['chr_google_plus_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>

                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Pinterest Link: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_pinterest" id="chr_pinterest"  onclick=" javascript : hidetxtbox('chr_pinterest', 'chr_pinterest_link')"  <?php
                                            if ($row['chr_pinterest'] == 'Y') {
                                                echo "checked";
                                            } else {
                                                echo "";
                                            }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_pinterest'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="chr_pinterest_link" type="text" class="add-new-user-textarea" id="chr_pinterest_link" value="<?= $row['chr_pinterest_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Instagram Link: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_instagram" id="chr_instagram"  onclick=" javascript : hidetxtbox('chr_instagram', 'chr_instagram_link')"  <?php
                                            if ($row['chr_instagram'] == 'Y') {
                                                echo "checked";
                                            } else {
                                                echo "";
                                            }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_instagram'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="chr_instagram_link" type="text" class="add-new-user-textarea" id="chr_instagram_link" value="<?= $row['chr_instagram_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Trip advisor Link: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_tripadvisor" id="chr_tripadvisor"  onclick=" javascript : hidetxtbox('chr_tripadvisor', 'var_tripadvisor_link')"  <?php
                                        if ($row['chr_tripadvisor'] == 'Y') {
                                            echo "checked";
                                        } else {
                                            echo "";
                                        }
                                            ?> />
                                            <input style="display:<?php echo ($row['chr_tripadvisor'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_tripadvisor_link" type="text" class="add-new-user-textarea" id="var_tripadvisor_link" value="<?= $row['var_tripadvisor_link'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Passenger Picks Links: </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox" type="checkbox" name="chr_passengerpicks" id="chr_passengerpicks"  onclick=" javascript : hidetxtbox('chr_passengerpicks', 'var_passengerpicks')"  <?php
                                        if ($row['chr_passengerpicks'] == 'Y') {
                                            echo "checked";
                                        } else {
                                            echo "";
                                        }
                                        ?> />
                                            <input style="display:<?php echo ($row['chr_passengerpicks'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="var_passengerpicks" type="text" class="add-new-user-textarea" id="var_passengerpicks" value="<?= $row['var_passengerpicks'] ?>" maxlength="255" tabindex="1" value="Y" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Location Link : </td>
                                        <td colspan="2" align="left" valign="center">
                                            <input class="add-new-user-chkbox"  type="checkbox" name="chr_location" id="chr_location"  onclick=" javascript : hidetxtbox('chr_location', 'chr_location_link')" <?php
                                        if ($row['chr_location'] == 'Y') {
                                            echo "checked";
                                        } else {
                                            echo "";
                                        }
                                        ?> />
                                            <input style="display:<?php echo ($row['chr_location'] == "Y") ? '' : 'none' ?>;" style="width:317px;" name="chr_location_link" type="text" class="add-new-user-textarea" id="chr_location_link" value="<?= $row['chr_location_link'] ?>" maxlength="255" tabindex="1" /></td>
                                    </tr>

                                    <tr>
                                        <td width="30%"  align="left" valign="top" class="add-new-user-text">Powerpanel Date Format :</td>
                                        <td width="79%" colspan="2" align="left" valign="middle" ><!--<input name="var_dateformat" type="text" class="add-new-user-textarea" id="var_dateformat" value="<?= $row['var_dateformat'] ?>" maxlength="50" tabindex="1" /> -->
                                            <select name="var_dateformat" id="var_dateformat" tabindex="1" >
                                                <option <?= ($row['var_dateformat'] == '%d/%m/%Y') ? 'selected' : '' ?> value='%d/%m/%Y'>d/m/Y</option>
                                                <option <?= ($row['var_dateformat'] == '%m/%d/%Y') ? 'selected' : '' ?> value="%m/%d/%Y">m/d/Y</option>
                                                <option <?= ($row['var_dateformat'] == '%Y/%m/%d') ? 'selected' : '' ?> value="%Y/%m/%d">Y/m/d</option>
                                                <option <?= ($row['var_dateformat'] == '%Y/%d/%m') ? 'selected' : '' ?> value="%Y/%d/%m">Y/d/m</option>
                                                <!--<option <?= ($row['var_dateformat'] == '') ? 'selected' : '' ?> value="%d%m%Y">%d%m%Y</option>
        <option <?= ($row['var_dateformat'] == '') ? 'selected' : '' ?> value="%d%m%Y">%d%m%Y</option>-->
                                            </select></td>
                                    </tr>
                                    <tr>
                                        <td width="30%"  align="left" valign="top" class="add-new-user-text">Front Date Format :</td>
                                        <td width="79%" colspan="2" align="left" valign="middle" >
                                            <select name="var_frontdateformat" id="var_frontdateformat" >
                                                <!-- <option <?= ($row['var_frontdateformat'] == '%M/%d,%Y') ? 'selected' : '' ?> value='%M%d,%Y'>M d, Y</option>
        <option <?= ($row['var_frontdateformat'] == '%d%M,%Y') ? 'selected' : '' ?> value="%d%M,%Y">d M, Y</option>
        <option <?= ($row['var_frontdateformat'] == '%Y,%M%d') ? 'selected' : '' ?> value="%Y,%M%d">Y, M d</option>-->
                                                <option <?= ($row['var_frontdateformat'] == '%d/%m/%Y') ? 'selected' : '' ?> value='%d/%m/%Y'>d/m/Y</option>
                                                <option <?= ($row['var_frontdateformat'] == '%m/%d/%Y') ? 'selected' : '' ?> value="%m/%d/%Y">m/d/Y</option>
                                                <option <?= ($row['var_frontdateformat'] == '%Y/%m/%d') ? 'selected' : '' ?> value="%Y/%m/%d">Y/m/d</option>
                                                <option <?= ($row['var_frontdateformat'] == '%Y/%d/%m') ? 'selected' : '' ?> value="%Y/%d/%m">Y/d/m</option>

                                            </select></td>
                                    </tr>
    <?php if ($configObj->glSessionObj->value('admin_id') == '1') { ?>
                                        <tr>
                                            <td width="30%"  align="left" valign="top" class="add-new-user-text">Display Alias in Client ID :</td>
                                            <td width="79%" colspan="2" align="left" valign="middle" ><table width="100%" cellspacing="0" cellpadding="0" border="0">
                                                    <tr>
                                                        <td width="47%" colspan="2"><input type="radio" class="form-rediobutton" <?= ($row['chr_alias_flag'] == 'Y') ? 'checked' : '' ?> value="Y" id="chr_alias_flag1" name="chr_alias_flag">
                                                            &nbsp; <a style="text-decoration: none;" onclick="if (document.getElementById('chr_alias_flag1').checked != true)
                                                                        document.getElementById('chr_alias_flag1').checked = true;" href="javascript:"> Yes</a> &nbsp;&nbsp;&nbsp;
                                                            <input type="radio" name="chr_alias_flag" class="form-rediobutton" <?= ($row['chr_alias_flag'] == 'N') ? 'checked' : '' ?> id="chr_alias_flag2" value="N">
                                                            &nbsp; <a href="javascript:" onclick="if (document.getElementById('chr_alias_flag2').checked != true)
                                                                        document.getElementById('chr_alias_flag2').checked = true;" style="text-decoration: none;"> No</a></td>
                                                    </tr>
                                                </table></td>
                                        </tr>
                                        <tr>
                                            <td width="30%"  align="left" valign="top" class="add-new-user-text">Display SEO Information in Client ID :</td>
                                            <td width="79%" colspan="2" align="left" valign="middle" ><table width="100%" cellspacing="0" cellpadding="0" border="0">
                                                    <tr>
                                                        <td width="47%" colspan="2"><input type="radio" class="form-rediobutton" <?= ($row['chr_seo_flag'] == 'Y') ? 'checked' : '' ?> value="Y" id="chr_seo_flag1" name="chr_seo_flag">
                                                            &nbsp; <a style="text-decoration: none;" onclick="if (document.getElementById('chr_seo_flag1').checked != true)
                                                                        document.getElementById('chr_seo_flag1').checked = true;" href="javascript:"> Yes</a> &nbsp;&nbsp;&nbsp;
                                                            <input type="radio" name="chr_seo_flag" class="form-rediobutton" <?= ($row['chr_seo_flag'] == 'N') ? 'checked' : '' ?> id="chr_seo_flag2" value="N">
                                                            &nbsp; <a href="javascript:" onclick="if (document.getElementById('chr_seo_flag2').checked != true)
                                                                        document.getElementById('chr_seo_flag2').checked = true;" style="text-decoration: none;"> No</a></td>
                                                    </tr>
                                                </table></td>
                                        </tr>
                                        <tr>
                                            <td width="30%"  align="left" valign="top" class="add-new-user-text">Note :</td>
                                            <td width="79%" colspan="2" align="left" valign="top"><textarea name="var_note" id="var_note" class="add-new-user-seo" cols="38" rows="8"><?= trim($row['var_note']); ?></textarea></td>
                                        </tr>
    <? } ?>
                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  colspan="2" align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                </table>
                            </td>

                        </tr>

                    </table>
                </div>
                <div class="clear"></div>
    <?
} if ($p == "ser") {
    if ($row['var_mailer'] == 'sendmail') {
        $style = "style='display:none;'";
    }
    ?>
                <div class="add-new-form-bg" >Email Settings :</div>
                <div class="information-white-bg" id="dvpersonalinformation" >
                    <div class="clear"></div>
                    <input type="hidden" name="p" id="p" value="<?= $p ?>">
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="44%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td align="left" valign="top" width="18%" class="add-new-user-text">Mailer :</td>
                                        <td  align="left" valign="top" width="82%"><? //=$row['var_mailer']  ?>
                                            <select name="var_mailer" id="var_mailer" style="width:225px;" onchange="return setmailsettings();">
                                                <option <?= ($row['var_mailer'] == '') ? 'selected' : '' ?> value="">-- Please Select --</option>
                                                <option <?= ($row['var_mailer'] == 'sendmail') ? 'selected' : '' ?> value="sendmail" >Send Mail</option>
                                                <option <?= ($row['var_mailer'] == 'smtp') ? 'selected' : '' ?> value="smtp" >SMTP</option>
                                            </select></td>
                                    </tr>
                                </table>
                                <div id="smtpfields" <?= $style ?>>
                                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <?php //if($row['var_mailer'] == 'smtp'){  ?>
                                        <tr >
                                            <td width="17%" align="left" valign="top" class="add-new-user-text">SMTP Server  Name :<span>(required)</span></td>
                                            <td width="78%" colspan="2" align="left" valign="top"><input name="var_smtpserver" type="text" class="add-new-user-textarea" id="var_smtpserver" value="<?= $row['var_smtpserver'] ?>" maxlength="50" tabindex="1" /></td>
                                        </tr>
                                        <tr >
                                            <td align="left" valign="top" class="add-new-user-text">SMTP User  Name :<span>(required)</span></td>
                                            <td colspan="2" align="left" valign="top"><input name="var_smtpusername" type="text" class="add-new-user-textarea" id="var_smtpusername" value="<?= $row['var_smtpusername'] ?>" maxlength="50" tabindex="1" /></td>
                                        </tr>
                                        <tr >
                                            <td align="left" valign="top" class="add-new-user-text">SMTP Password :<span>(required)</span></td>
                                            <td colspan="2" align="left" valign="top"><input name="var_smtppassword" type="password" class="add-new-user-textarea" id="var_smtppassword" value="<?= $configObj->glLibraryObj->decryptPass($row['var_smtppassword']) ?>" maxlength="50" tabindex="1" /></td>
                                        </tr>
                                        <tr >
                                            <td align="left" valign="top" class="add-new-user-text">SMTP Authentication :<span>(required)</span></td>
                                            <td colspan="2" align="left" valign="middle">Yes
                                                <input type="radio" name="chr_smtpauthentication" id="Y" value="Y" <?php if ($row['chr_smtpauthentication'] == 'Y') echo 'checked'; ?>/>
                                                &nbsp;No
                                                <input type="radio" name="chr_smtpauthentication" id="N" value="N" <?php if ($row['chr_smtpauthentication'] == 'N') echo 'checked'; ?>/></td>
                                        </tr>
                                        <tr >
                                            <td align="left" valign="top" class="add-new-user-text">SMTP Port :</td>
                                            <td colspan="2" align="left" valign="top"><input name="var_smtpport" type="text" class="add-new-user-textarea" id="var_smtpport" value="<?= $row['var_smtpport'] ?>" maxlength="50" /></td>
                                        </tr>
                                    </table>
                                </div>
    <?php //}   ?>
                                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td align="left" valign="top" width="18%" class="add-new-user-text">Sender Name :</td>
                                        <td align="left" valign="top" width="82%"><input name="var_emailfrom" type="text" class="add-new-user-textarea" id="var_emailfrom" value="<?= $row['var_emailfrom'] ?>" maxlength="50"  /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Sender Email ID :</td>
                                        <td align="left" valign="top"><input name="var_adminmailid" type="text" class="add-new-user-textarea" id="var_adminmailid" value="<?= $row['var_adminmailid'] ?>" maxlength="100" /></td>
                                    </tr>
                                    <td align="left" valign="top" class="add-new-user-text"></td>
                                    <tr>

                                        <td align="left" valign="top" class="add-new-user-text">Email Signature : </td>
                                        <td align="left" valign="center">
    <?php
    if ($_REQUEST['action'] == 'edit') {
        ?>
                                                <textarea id="main_description" name="var_email_signature"><?php echo $row['var_email_signature']; ?></textarea>

                                                <script type="text/javascript">
                                                    $(document).ready(function () {
                                                        CKEDITOR.replace('main_description',
                                                                {
                                                                    toolbar: 'Basic',
                                                                    filebrowserBrowseUrl: '../libraries/ckeditor/pdw_file_browser/index.php?editor=ckeditor',
                                                                    filebrowserImageBrowseUrl: '../libraries/ckeditor/pdw_file_browser/index.php?editor=ckeditor&filter=image',
                                                                    //filebrowserUploadUrl : '../libraries/ckeditor/pdw_file_browser/swfupload/upload.php?editor=ckeditor',
                                                                    filebrowserFlashBrowseUrl: '../libraries/ckeditor/pdw_file_browser/index.php?editor=ckeditor&filter=flash'

                                                                });
                                                    });
                                                </script>
        <?php
    } else {
        ?>
                                                <textarea id="main_description" name="var_email_signature"><?php echo $row['var_email_signature']; ?></textarea>
    <?php } ?>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table>
                </div>
                <div class="clear"></div>
<? } if ($p == "map") { ?>
                <!--<div class="add-new-form-bg" > Maps Settings</div>
        <div class="information-white-bg" id="dvpersonalinformation" >
        <div class="clear"></div>
        <input type="hidden" name="p" id="p" value="<?= $p ?>">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
        <td width="44%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td align="left" valign="top" class="add-new-user-text">GEO Code</td>
        <td colspan="2" align="left" valign="top"><input name="var_geocode" type="text" class="add-new-user-textarea" id="var_geocode" value="<?= $row['var_geocode'] ?>" maxlength="50" tabindex="1" /></td>
        </tr>
        <tr>
        <td width="30%" align="left" valign="top" class="add-new-user-text">Google Map API Key</td>
        <td width="79%" colspan="2" align="left" valign="top"><input name="var_googlemapapikey" type="text" class="add-new-user-textarea" id="var_googlemapapikey" value="<?= $row['var_googlemapapikey'] ?>" maxlength="100" tabindex="1" /></td>
        </tr>
        <tr>
        <td align="left" valign="top" class="add-new-user-text">Yahoo Map API Key</td>
        <td colspan="2" align="left" valign="top"><input name="var_yahoomapapikey" type="text" class="add-new-user-textarea" id="var_yahoomapapikey" value="<?= $row['var_yahoomapapikey'] ?>" maxlength="50" tabindex="1" /></td>
        </tr>

        <tr>
        <td align="left" valign="top" class="add-new-user-text">&nbsp;</td>
        <td colspan="2" align="left" valign="top">&nbsp;</td>
        </tr>
        </table></td>
        </tr>
        </table>
        </div>
        <div class="clear"></div>-->
<? } if ($p == "cur") { ?>
                <div class="add-new-form-bg" > Currency Settings</div>
                <div class="information-white-bg" id="dvpersonalinformation" >
                    <div class="clear"></div>
                    <input type="hidden" name="p" id="p" value="<?= $p ?>">
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="44%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="20%" align="left" valign="top" class="add-new-user-text">Currency :</td>
                                        <td width="79%" colspan="2" align="left" valign="top"><input name="var_currency" type="text" class="add-new-user-textarea" id="var_currency" value="<?= $row['var_currency'] ?>" maxlength="50" tabindex="1" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Currency Symbol :</td>
                                        <td colspan="2" align="left" valign="top"><input name="var_currencysymbol" type="text" class="add-new-user-textarea" id="var_currencysymbol" value="<?= $row['var_currencysymbol'] ?>" maxlength="50" tabindex="1" /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">&nbsp;</td>
                                        <td colspan="2" align="left" valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">&nbsp;</td>
                                        <td colspan="2" align="left" valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  colspan="2" align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table>
                </div>
                <div class="clear"></div>

<? } if ($p == 'seo' && $configObj->glSessionObj->value('admin_id') == '1') { ?>
                <div class="add-new-form-bg" > SEO Settings</div>
                <div class="information-white-bg" id="dvpersonalinformation" >
                    <div class="clear"></div>
                    <input type="hidden" name="p" id="p" value="<?= $p ?>">
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="44%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="30%" align="left" valign="top" class="add-new-user-text">Apply Rewriting Rule?(Friendly URL) :</td>
                                        <td width="79%" colspan="2" align="left" valign="top"><input name="chr_urlrewriting" type="checkbox" id="chr_urlrewriting" <?php echo ($row['chr_urlrewriting'] == "Y") ? "checked='checked'" : ''; ?> tabindex="" /></td>
                                    </tr>
                                    <tr>
                                        <td width="30%" align="left" valign="top" class="add-new-user-text">Google Analytic Code :</td>
                                        <td width="79%" colspan="2" align="left" valign="top"><textarea name="var_googleanalyticcode" id="var_googleanalyticcode" class="add-new-user-seo" cols="38" rows="8"><?= trim($row['var_googleanalyticcode']); ?></textarea></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Meta Title :</td>
                                        <td colspan="2" align="left" valign="top"><input name="var_metatitle" type="text" class="add-new-user-textarea" id="var_metatitle" value="<?= trim($row['var_metatitle']); ?>" maxlength="50"  /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Meta Keyword :</td>
                                        <td colspan="2" align="left" valign="top"><input name="var_metakeywords" type="text" class="add-new-user-textarea" id="var_metakeywords" value="<?= trim($row['var_metakeywords']) ?>" maxlength="50"  /></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Meta Description :</td>
                                        <td colspan="2" align="left" valign="top"><textarea name="var_metadescription" id="var_metadescription" class="add-new-user-seo" ><?= trim($row['var_metadescription']) ?></textarea>
                                        <!--<input name="var_metadescription" type="text" class="add-new-user-textarea" id="var_metadescription" value="<?= trim($row['var_metadescription']) ?>" maxlength="50" tabindex="1" />--></td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">Meta Tag :</td>
                                        <td colspan="2" align="left" valign="top">
                                            <textarea name="var_commanmetatags" id="var_commanmetatags" class="add-new-user-seo" rows="5" cols="42" class="add-new-user-textarea"><?= trim($row['var_commanmetatags']) ?></textarea>
                                    </tr>
                                    <!--    <tr>
        <td colspan="3" align="left" valign="top">
        <div class="grid-list-subtitle-bg" style="margin-top:10px; cursor:pointer;" onClick="javascript:expandcollapsepanel('asignbannerseo');" >
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td align="left" valign="top" class="grid-td-left">SEO Information</td>
        </tr>
        </table>
        </div>
        <div class="information-white-bg" id="asignbannerseo" style="display:none;" >
        <div class="clear"></div>
        <div class="grid-list-inner-table-text">
        <table width="100%" border="0" cellspacing="3" cellpadding="3">
    <?php
    //					print_r($seomodules_array);
    if (!empty($seomodules_array))
        foreach ($seomodules_array as $value) {
            if ($value['var_seoprefix'] == '') {
                $value['var_seoprefix'] = $value['var_modulename'];
            }
            ?>
                            <tr>
                            <td width="30%" align="left" valign="top" class="add-new-user-text"><?= $value['var_modulename'] ?></td>
                            <td align="left" valign="top"><input name="seoprefix_array2[]" type="text" class="add-new-user-textarea" value="<?= $value['var_seoprefix'] ?>" maxlength="150"  />

                            <input name="seoprefix_array[<?= $value['int_glcode'] ?>]" type="hidden" id="seoprefix_array<?= $value['int_glcode'] ?>" value="<?= $value['var_seoprefix'] ?>">
                            </td>
                            </tr>
        <?php } ?>
        </table>
        </div>
        </div></td>
        </tr>-->

                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">&nbsp;</td>
                                        <td colspan="2" align="left" valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  colspan="2" align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table>
                </div>
                <div class="clear"></div>
                                            <?
                                        }
                                        if ($p == 'uman' && $configObj->glSessionObj->value('admin_id') == '1') {
                                            ?>
                <div class="add-new-form-bg" > Under Maintenance Settings</div>
                <div class="information-white-bg" id="dvpersonalinformation" >
                    <div class="clear"></div>
                    <input type="hidden" name="p" id="p" value="<?= $p ?>">
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="44%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="20%" align="left" valign="top" class="add-new-user-text">Under Maintenance :</td>
                                        <td width="79%" colspan="2" align="left" valign="top">
                                            <input name="chr_maintenance" value="Y" type="checkbox" onclick="javascript : showdescription();" id="chr_maintenance" <?php echo ($row['chr_maintenance'] == "Y") ? "checked='checked'" : ''; ?> tabindex="" />
                                        </td>                                    
                                    </tr>
                                    <tr id="ckeditormaindiv" style="display: none;">
                                        <td colspan="3" align="left" valign="top" class="add-new-user-text">Maintenance Description :</td>                                    
                                    </tr>
                                    <tr id="ckeditordiv">
                                        <td colspan="3" align="left" valign="top" class="add-new-user-text" >

                                            <?php
                                            if ($_REQUEST['action'] == 'edit') {
                                                //echo $configObj->glLibraryObj->load_ckeditor('main_description',$row['var_main_description']);
                                                ?>
                                                <textarea id="main_description" name="main_description"><?php echo $row['var_main_description']; ?></textarea>

                                                <script type="text/javascript">
                                                    $(document).ready(function () {
                                                        CKEDITOR.replace('main_description',
                                                                {
                                                                    toolbar: 'Basic',
                                                                    filebrowserBrowseUrl: '../libraries/ckeditor/pdw_file_browser/index.php?editor=ckeditor',
                                                                    filebrowserImageBrowseUrl: '../libraries/ckeditor/pdw_file_browser/index.php?editor=ckeditor&filter=image',
                                                                    //filebrowserUploadUrl : '../libraries/ckeditor/pdw_file_browser/swfupload/upload.php?editor=ckeditor',
                                                                    filebrowserFlashBrowseUrl: '../libraries/ckeditor/pdw_file_browser/index.php?editor=ckeditor&filter=flash'

                                                                });
                                                    });
                                                </script>
                    <?php
                } else {
                    ?>                                        
                                                <textarea id="main_description" name="main_description"><?php echo $row['var_main_description']; ?></textarea>
    <?php } //echo $configObj->glLibraryObj->load_ckeditor('main_description',$row['text_fulltext']);   ?>

                                        </td>

                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">&nbsp;</td>
                                        <td colspan="2" align="left" valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  colspan="2" align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table>
                </div>
                <div class="clear"></div>    
    <?php
}
if ($p == 'htaccess' && $configObj->glSessionObj->value('admin_id') == '1') {
    ?>
                <div class="add-new-form-bg" > Htaccess Settings</div>

                <div class="information-white-bg" id="dvpersonalinformation" style="padding-left: 10px;padding-right: 10px;">
                    <div style="padding-left:15px; padding-top:10px" class="blue-bg">
                        <div class="pagination-main1">
                            <div class="page-next-icon2"></div>            
                        </div>
                        <div class="new-search-area2">
                            <div class="new-search-refresh-text">
                                <a onclick="getNewBackup()" href="javascript:;">Generate New Backup</a></div>
                        </div>
                    </div>
                    <div class="grid-list-subtitle-bg" style="margin-top:10px;">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>

                                <td width="1%" align="left" valign="middle" class="grid-td-left">No.</td>
                                <td width="11%" align="left" valign="middle" class="grid-td-top" style="padding-left:10px;*padding-left:30px;">Htaccess Backup Name</td>


                                <td width="4%" align="center" valign="middle" class="grid-td-top" style="padding-left:15px;*padding-left:25px;">Download
                                </td>
                                <td width="2%" valign="middle">&nbsp;</td>
                                <td width="5%" align="left" valign="middle" class="grid-td-top">Delete Backup</td>

                            </tr>
                        </table>
                    </div>

                    <div class="information-white-bg" id="dvpersonalinformation" >
                        <div class="clear"></div>
                        <div class="grid-list-inner-table-text">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <?php
    $filecount = count($htaccessFileArr);

    if ($filecount > 0) {
        $rowcount = 1;

        arsort($htaccessFileArr);
        foreach ($htaccessFileArr as $fileArrValue) {
            //asort($fileArrValue);
            //print '<pre>';
            //print_r($fileArrValue['filetime']);
            ?>
                                        <tr id="gtr-<?= $row['int_glcode'] ?>"  style="background-color: transparent;"  class="<?= $clsname ?>" onmouseover="this.style.backgroundColor = '#f6f6f6'" onmouseout="this.style.backgroundColor = 'transparent'" >
                                            <td width="2%" align="left" valign="top" class="grid-td-left">
            <?= $rowcount ?>
                                            </td>
                                            <td width="13%" align="left" valign="middle" class="grid-td-top">
                                                <span> <?= $fileArrValue['displayname'] ?></span></td>
                                            <td width="6%" align="left" valign="middle" class="grid-td-top">
                                                <a href="download.php?f=<?php echo 'htaccessbackup/' . $fileArrValue['filename'] . '&file=htaccess'; ?>"><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>download.png" style="vertical-align:middle;cursor:pointer;" alt="download" /></a>
                                            </td>
                                            <td width="5%" align="left" valign="middle" class="grid-td-top">
                                                <a href="javascript:;"><img alt="delete"  id="tick" height="16" width="16" alt="<?= $title ?>" title="" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>delete1.png" style="vertical-align:middle;cursor:pointer;" onclick="delHtaccessFile('<?= $fileArrValue['filename'] ?>');"></a>
                                            </td>
                                        </tr>
            <?php
            $rowcount++;
        }
    } else {
        ?>
                                    <tr style="background-color: transparent;"  class="<?= $clsname ?>" onmouseover="this.style.backgroundColor = '#f6f6f6'" onmouseout="this.style.backgroundColor = 'transparent'">
                                        <td height="25" align="center" valign="middle" colspan="8" class="form_titles">No Htaccess Backup Available</td>
                                    </tr>
    <?php } ?>
                                <input type="hidden" name="ptrecords" id="ptrecords" value="<?= $rowcount ?>">
                            </table>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <input type="hidden" name="p" id="p" value="<?= $p ?>" />
                    <input type="hidden" name="backup" id="backup" value="N" />
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="44%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  colspan="2" align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" width="20%" align="left" valign="top" class="add-new-user-text"><strong>Htaccess Code :</strong></td>                                                                        
                                    </tr>
                                    <tr>
                                        <td colspan="3" width="79%" colspan="2" align="left" valign="top">
            <?php $file = file_get_contents('../.htaccess'); ?> 
                                            <textarea id="htaccesscode" name="htaccesscode" rows="30" cols="130"><?php echo $file; ?></textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" class="add-new-user-text">&nbsp;</td>
                                        <td colspan="2" align="left" valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td  align="left" valign="top">&nbsp;</td>
                                        <td  colspan="2" align="left" valign="middle" >&nbsp;</td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table>
                </div>
                <div class="clear"></div> 
<?php } ?>
            <div class="add-new-user-button">
                <input name="Submit" type="image" value="Submit" alt="Save-keep-editing"  src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>save-keep-editing-button.jpg"
                       />
                <a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image35', '', '<?= GLOBAL_ADMIN_IMAGES_PATH ?>cancel-button-hover.jpg', 1)" onClick="SetBackground()"><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>cancel-button.jpg" alt="cancel" name="Image35" width="81" height="25" hspace="5" border="0" id="Image35" /></a>
                <input name="h_save" type="hidden" id="h_save" value="F" />
            </div>
        </form>
<?php if ($ajax != 'Y') { ?>
        </div>
        <!-- End of gridbody div --> 
    </div>
<?php } ?>