<script type="text/javascript" src="html/js/highslide/highslide-with-html.js"></script>
<link rel="stylesheet" type="text/css" href="html/js/highslide/highslide.css" />
<script type="text/javascript">
    hs.graphicsDir = 'html/js/highslide/graphics/';
    hs.outlineType = 'rounded-white';
    hs.showCredits = false;
    hs.wrapperClassName = 'draggable-header';
</script>
<script type="text/ecmascript">
    function verifyHistory()
    {
    SendGridBindRequestDeleteHistory('<?= $historyObj->urlwithpara ?>','gridbody','chkgrowhistory','N');
    }
</script>
<div class="grid-list-subtitle-bg" style="margin-top:10px;">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="2%" align="left" valign="middle" class="grid-td-left"><input name="chkallhistory" id="chkallhistory" type="checkbox" onclick="checkallhistory('chkgrowhistory')"  /></td>
            <td width="36%" align="left" valign="middle" class="grid-td-top">
                <a href="#">
                    <?= $searchfield['0'] ?>
                    <?= ${"setsortimg" . $fieldlist[$searchfield['0']]} ?>
                </a>
            </td>
            <td width="10%" align="left" valign="middle" class="grid-td-top">
                <a href="#">
                    <?= $searchfield['1'] ?>
                    <?= ${"setsortimg" . $fieldlist[$searchfield['1']]} ?>
                </a>
            </td>
            <td width="10%" align="left" valign="middle" class="grid-td-top">
                <a href="#">
                    <?= $searchfield['2'] ?>
                    <?= ${"setsortimg" . $fieldlist[$searchfield['2']]} ?>
                </a>
            </td>
            <td width="14%" align="left" valign="middle" class="grid-td-top"><a href="#">Action Date</a></td>
            <td width="8%" align="left" valign="middle" class="grid-td-top"><a href="#">History</a></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
            if ($historyObj->numofrows > 0 && !empty($resultArray)) {
                $rowcount = 0;
                foreach ($resultArray as $i => $result) {
                    $clsname = ($result['chr_read'] == 'N') ? "grid-list-inner-table-text-active-history" : "grid-list-inner-table-text-history";
                    if ($result['action'] == 'I')
                        $action = "Add";
                    else if ($result['action'] == 'U')
                        $action = "Update";
                    else if ($result['action'] == 'D')
                        $action = "Delete";

                    if ($result['chr_approve'] == 'Y')
                        $approve_imagename = '_tick.png';
                    else
                        $approve_imagename = '_tick_cross.png';

                    if ($result['chr_read'] == 'N')
                        $rowcolor = "#F6CEE3;";
                    else
                        $rowcolor = "transparent;";
                    ?>
                    <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="middle" class="grid-td-left">
                            <input name="chkgrowhistory" id="chkgrowhistory" type="checkbox" value="<?= $result['int_glcode'] ?>" /></td>

                        <td width="40%" align="left" valign="middle" class="grid-td-top">
                            <span>
                                <a href="index.php?module=<?= $_REQUEST['module'] ?>&action=edit&eid=<?= $result['int_glcode'] ?>" >
                                    <?= $result[$fieldlist[$searchfield['0']]] ?></a>
                                <?php
                                if (($result['action'] == 'I') && ($configObj->glSessionObj->value('group_id') == '1' || $configObj->glSessionObj->value('group_id') == '2')) {
                                    ?>
                                    &nbsp;<img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>new-flag.png"/>
                                    <?php
                                }
                                ?>
                                <div class="highslide-maincontent">
                                    <table cellpadding="2" cellspacing="2">
                                        <?php
                                        foreach ($detailfieldlistdetails as $dkey => $dvalue) {
                                            if ($dvalue != '') {
                                                if ($dvalue == 'PDF' && $result[$dkey] != '') {
                                                    ?>
                                                    <tr>
                                                        <td nowrap="nowrap" valign="top"><b><?= $dvalue ?></b></td>
                                                        <td valign="top"><a href="modules/<?= $_REQUEST['module'] ?>/html/uploads/pdfs/<?= $result[$dkey] ?>" target="_blank">Download</a></td>
                                                    </tr>
                                                    <?php } else if ($dvalue == 'Image' && $result[$dkey] != '') {
                                                    ?>
                                                    <tr>
                                                        <td nowrap="nowrap" valign="top"><b><?= $dvalue ?></b></td>
                                                        <td valign="top">
                                                            <a onClick="return hs.expand(this);" href="modules/<?= $_REQUEST['module'] ?>/html/uploads/images/<?= $result[$dkey] ?>">View</a></td>
                                                    </tr>		
                                                    <?php } else {
                                                    ?>
                                                    <tr>
                                                        <td nowrap="nowrap" valign="top"><b><?= $dvalue ?></b></td>
                                                        <td valign="top"><?= $result[$dkey] ?></td>
                                                    </tr>
                                                    <?php
                                                }
                                            }
                                        }
                                        ?>
                                    </table>
                                </div></span>
                        </td>
                        <td width="10%" align="left" valign="middle" class="grid-td-top">
                            <span><?= $result[$fieldlist[$searchfield['1']]] ?></span>
                        </td>
                        <td width="10%" align="left" valign="middle" class="grid-td-top">
                            <span>
                                <?php
                                if ($result[$fieldlist[$searchfield['2']]] == '')
                                    echo "N/A";
                                else
                                    echo $result[$fieldlist[$searchfield['2']]];
                                ?>
                            </span>
                        </td>
                        <td width="15%" align="left" valign="middle" class="grid-td-top">
                            <span><?= $result['actiondate'] ?></span>
                        </td>
                        <td width="8%" align="left" valign="middle" class="grid-td-top">
                            <a href="index.php?module=<?= $_REQUEST['module'] ?>&action=history&id=<?= $result['int_glcode'] ?>">
                                <img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>histry-icon.png" alt="History">
                            </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="5" class="form_titles">No Records Available</td>
                </tr>
            <?php } ?>
            <input type="hidden" name="ptrecords" id="ptrecords" value="<?= $rowcount ?>">
        </table>
    </div>
</div>
<div class="clear"></div>
<div class="add-new-user-button">
    <a href="javascript:" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image47','','<?= GLOBAL_ADMIN_IMAGES_PATH ?>delete-button-hover.jpg',0)"><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>delete-button.jpg" alt="Delete" name="Image47" width="80" height="25" border="0" id="Image47" onclick="return verifyHistory();" /></a>
</div>