<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="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide-with-html.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide-with-html.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide.css" />
<link rel="stylesheet" type="text/css" href="<?php echo GLOBAL_ADMIN_CSS_PATH; ?>highslide/highslide.css" />
<link type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/themes/base/jquery.ui.dialog.css" rel="stylesheet" />
<link type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/themes/base/jquery.ui.resizable.css" rel="stylesheet" />
<script type="text/javascript">
    hs.graphicsDir = '<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/graphics/';
    hs.outlineType = 'rounded-white';
    hs.showCredits = false;
    hs.wrapperClassName = 'draggable-header';
</script>

<script type="text/javascript">
    function verify()
    {
        SendGridBindRequest('<?= $fblogmanagerObj->urlwithpara ?>','gridbody','D','chkgrow');
    }
    
    function updateread(id)
    {
        var p='';
        $.ajax({
            type: "GET",
            url:"index.php" ,
            data: "module=fblogmanager&action=updatereaddata&ajax=Y&id="+id,
            async: false,
            success: function(data){
                p=data;

                document.getElementById('gtr-'+p).className = 'grid-list-inner-table-text';
                if(document.getElementById('star1-'+p).style.display=='inline')
                {
                    document.getElementById('star1-'+p).style.display='none';
                }
            }
        });
    }
    
    function yes_no(intglcode)
    {
        var path=document.getElementById('reply'+intglcode).src;
        var file_a= path.substring(path.lastIndexOf("/")+1,path.length);
        var value;
        if(file_a == 'cross.png'){
            value = 'Y';
        }else if(file_a == 'tick-icon.jpg'){
            value = 'N';
        }
        SetBackground();
        $.ajax({
            type: "GET",
            url:"index.php" ,
            data: "module=fblogmanager&action=approvenewslatterleads&ajax=Y&value="+value+"&id="+intglcode,
            async: false,
            success: function(result){
                if(value == 'Y'){
                    document.getElementById('reply'+intglcode).src = 'html/images/tick-icon.jpg';
                } else {
                    document.getElementById('reply'+intglcode).src = 'html/images/cross.png';
                }
                UnsetBackground();
            }
        });
    }
    
    function popreply1(id)
    {
        var response;
        $.ajax({
            type: "GET",
            url:"index.php" ,
            data: "module=fblogmanager&action=email&ajax=Y&id="+id,
                         
            async: false,
            success: function(data){
                //alert(data);
                response=data;
            }
        });

    
        $('#dialog-modal').html(response);
    

        $('#dialog-modal').dialog({
            autoOpen: false,
            height: 295,
            width: 615,
            modal: true
        });
        $('#dialog-modal').dialog('open');
    }

    function excelreport()
    {
        var chkelements = document.getElementsByName('chkgrow');
        var ids = "";
        var countChecked = 0;

        for(var i = 0; i < chkelements.length; i++)
        {
            if(chkelements.item(i).checked == true)
            {
                countChecked++;
                if(ids != "")
                    ids += ",";
                ids += chkelements.item(i).value;
            }
        }

        var totalpagerecords = document.getElementById('ptrecords').value;
        document.getElementById('totalrecords').value = totalpagerecords;
        document.getElementById('chkids').value = ids;
    
        document.forms["exportform"].submit();
    }
</script>
<div id="dialog-modal" title="Reply Form"></div>
<div class="web-booking-main" id="gridbody">
    <div class="breadcrumbs"><a href="index.php">Home </a>&nbsp;>&nbsp; <span class="current">Manage Facebook Log Manager</span></div>
    <div class="clear"></div>
    <?= $messagebox; ?><?= $sendmailstatus; ?>
    <?php echo $headerpanel; ?>
    <?php echo $pagingTop; ?>

    <div class="grid-list-subtitle-bg" style="margin-top:10px;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <?php if ($paramMain['Delete'] == 'Y') { ?>
                    <td width="3%" align="left" valign="top" class="grid-td-left"><input name="chkall" id="chkall" type="checkbox" onclick="checkall('chkgrow')"  /></td>                      
                <?php } else { ?>
                    <td width="3%" align="left" valign="top" class="grid-td-left">&nbsp;</td>
                <?php } ?>
                <td width="10%" align="left" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=var_title&sorting=Y','gridbody','ST')">Title<?= $setsortimgvar_title ?></a></td>
                <td width="10%" align="center" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=fk_module&sorting=Y','gridbody','ST')">Module<?= $setsortimgfk_module ?></a></td>
                <td width="10%" align="center" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=chr_type&sorting=Y','gridbody','ST')">Type<?= $setsortimgchr_type ?></a></td>
                <td width="10%" align="center" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=Account_Type&sorting=Y','gridbody','ST')">Account Name<?= $setsortimgAccount_Type ?></a></td>
                <td width="10%" align="center" valign="middle" class="grid-td-top">Actual Details</td>            
                <td width="10%" align="center" valign="top" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=var_name&sorting=Y','gridbody','ST')">User Name<?= $setsortimgvar_name ?></a></td>
                <td width="10%" align="center" valign="top" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=var_ipaddress&sorting=Y','gridbody','ST')">IP Address<?= $setsortimgvar_ipaddress ?></a></td>
                <td width="10%" align="center" valign="top" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?= $fblogmanagerObj->urlwithoutsort ?>&orderby=dt_createdate&sorting=Y','gridbody','ST')">Date/Time<?= $setsortimgdt_createdate ?></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">
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <?php
                if ($numofrows > 0) {
                    $rowcount = 0;

                    while ($row = $configObj->glDbObj->fetch_array($result)) {
                        if ($configObj->glSessionObj->value('admin_id') == '1') {
                            $clsname = ($row['chr_read'] == 'N') ? "grid-list-inner-table-text-active" : "grid-list-inner-table-text"; // For read unread class
                            if ($row['chr_read'] == 'N') {
                                $style = 'display:inline;';
                            } else {
                                $style = 'display:none;';
                            }
                        } else {
                            $clsname = "grid-list-inner-table-text"; // For read unread class

                            $style = 'display:none;';
                        }
                        
                        ?>
                        <tr id="gtr-<?= $row['int_glcode'] ?>"  style="background-color: transparent;"  class="<?= $clsname ?>" onmouseover="this.style.backgroundColor='#f6f6f6'" onmouseout="this.style.backgroundColor='transparent'" >
                            <?php if ($paramMain['Delete'] == 'Y') { ?>
                                <td width="3%" align="left" valign="middle" class="grid-td-left"><input name="chkgrow" id="chkgrow" type="checkbox" value="<?php echo $row['int_glcode'] ?>" /></td>
                            <?php } else { ?>
                                <td width="3%" align="left" valign="middle" class="grid-td-left"></td>
                            <?php } ?>
                                
                                <?php
                                $char = substr($row['var_title'], 0, 40);
                                if (strlen($row['var_title']) > 40) {
                                    $char.='...';
                                }
                                ?>
                            <td width="10%" align="left" valign="middle" class="grid-td-top"><?php echo $char; ?></td>
                            <td width="10%" align="center" valign="middle" class="grid-td-top">
                                <?php
                                $sel="select var_modulename from ".DB_PREFIX."modules where int_glcode=".$row['fk_module'];
                                $res=  mysql_query($sel);
                                $rows = mysql_fetch_array($res);
                                echo $rows['var_modulename'];
                                ?>
                                                          
                            </td>
                            
                         
                            <td width="10%" align="center" valign="middle" class="grid-td-top">
                                 <?php 
                            if($row['chr_type']=='F')
                            {
                                echo"Facebook";
                            }
                           else if($row['chr_type']=='T')
                                {
                                echo"Twitter";
                            }
                            ?>
                            </td>
            
                            <td width="10%" align="center" valign="middle" class="grid-td-top"><?php echo $row['Account_Type']; ?></td>

                            <td width="10%" align="center" valign="middle" class="grid-td-top">
            <?php if ($row['var_description'] != '') { ?>
             <a href="index.php?module=fblogmanager" onclick="return hs.htmlExpand(this, { headingText: 'Descrition' })">View                                  
                 </a>
             <?php } ?>
             <div class="highslide-maincontent">
                 <table cellspacing="0" cellpadding="0" border="0" align="center" width="98%">
                     <tbody>

                         <tr>
                             <td align="left" valign="top"><?php echo $row['var_description']; ?></td>
                         </tr>
                     </tbody>
                 </table>
             </div>
            </td>
            <td width="10%" align="center" valign="middle" class="grid-td-top"><?php echo $row['var_name']; ?></td>
            <td width="10%" align="center" valign="middle" class="grid-td-top"><?php echo $row['var_ipaddress']; ?></td>
                            
                            
                            <td width="10%" align="center" valign="top" class="grid-td-top" >

                                <?
                                $date_news = DEFAULT_DATEFORMAT;

                                if ($date_news == "%d/%m/%Y") {
                                    $date_news1 = "d/m/Y H:i";
                                }
                                if ($date_news == "%m/%d/%Y") {
                                    $date_news1 = "m/d/Y H:i";
                                }
                                if ($date_news == "%Y/%m/%d") {
                                    $date_news1 = "Y/m/d H:i";
                                }
                                if ($date_news == "%Y/%d/%m") {
                                    $date_news1 = "Y/d/m H:i";
                                }
                           $date = date($date_news1, strtotime($row['dt_createdate'])); 
                                ?>


                                <?php echo $row['dt_createdate'];  ?>
                            </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="6" class="form_titles">
                            No new leads, Please <a target="_blank" href="http://www.netclues.ky/seo-search-engine-optimization-cayman-islands.php"> <strong>Click Here</strong> </a> to find out how to get more leads.</td>
                    </tr>
                <?php } ?>
                <input type="hidden" name="ptrecords" id="ptrecords" value="<?= $rowcount ?>">
            </table>
        </div>
    </div>
    <div class="clear"></div>

    <?php echo $pagingBottom; ?>
    
    <form name="exportform" id="exportform" action="index.php?module=fblogmanager&action=export"  method="post">
        <input type="hidden" name="totalrecords" id="totalrecords" value="">
        <input type="hidden" name="chkids" id="chkids" value="">
        <?php if ($numofrows > 0) { ?>
            <div class="add-new-user-button"><a href="javascript:" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image48','','<?= GLOBAL_ADMIN_IMAGES_PATH ?>export-button-hover.gif',0)"><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>export-button.gif" alt="Delete" name="Image48" width="81" height="25" border="0" id="Image48" onclick="return excelreport();" /></a></div>
                <?php } ?>
    </form>
</div>