
<script type="text/javascript">
    
     function excelreport2()
    {
//        alert('sandip');
        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;
            }
        }
        if(countChecked == 0)
        {
            //alert(" Please select atleast one record for export.");
            //return false;
        }

        var totalpagerecords = document.getElementById('ptrecords').value;
        document.getElementById('totalrecords').value = totalpagerecords;
        document.getElementById('chkids').value = ids;
        // appendurl = '&action=export&ptotalr='+totalpagerecords+'&dids='+ids;*/

        document.forms["exportform"].submit();
    }
    
    
function verify()
{
	//alert('Only unused log will be deleted.');
alert('<?=$settingsObj->urlwithpara?>');
	SendGridBindRequest('<?=$settingsObj->urlwithpara?>','gridbody','D','chkgrow');
}
</script>
<div class="web-booking-main" id="gridbody">
<div class="breadcrumbs"><a href="index.php">Home </a>&nbsp;>&nbsp; <span class="current"> Log Manager</span></div>
            <div class="clear"></div>
   		<?=$messagebox;?>		
    <?php echo $headerpanel;?>        
    <?php echo $pagingTop;?>
            <?php echo $notemessagebox; ?>
    <?php
	if($configObj->AllmoduleAccess['settings']['Delete'] == 'Y') 
        				{
							$delete_link="true";
						}
						else
						{
							$delete_link="false";
						} ?>
               
           

               <div class="grid-list-subtitle-bg" style="margin-top:10px;margin-right: 2px;">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                    <? if($delete_link=='true') { ?>
                      <td width="3%" align="left" valign="top" class="grid-td-left"><input name="chkall" id="chkall" type="checkbox" onclick="checkall('chkgrow')"  /></td>
                      <? } else {?>
                      <td width="3%" align="left" valign="top" class="grid-td-left">&nbsp;</td>
                     <? } ?>
                      <td width="3%" align="left" valign="middle" class="grid-td-top">&nbsp;</td>
                      
                      <td width="20%" align="left" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?=$settingsObj->urlwithoutsort?>&orderby=var_modulename&sorting=Y','gridbody','ST')">Module Name<?=$setsortimgvar_modulename?></a></td>
                     
                      <td width="30%" align="left" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?=$settingsObj->urlwithoutsort?>&orderby=var_name&sorting=Y','gridbody','ST')">Name<?=$setsortimgvar_name?></a></td>
                      <td width="10%" align="left" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?=$settingsObj->urlwithoutsort?>&orderby=var_fname&sorting=Y','gridbody','ST')">User Name<?=$setsortimgvar_fname?></a>
                      </td>

                      <td width="15%" align="center" valign="middle" class="grid-td-top" style="padding-left:5px;"><a href="javascript:;" onclick="SendGridBindRequest('<?=$settingsObj->urlwithoutsort?>&orderby=dt_operationdate&sorting=Y','gridbody','ST')">Date<?=$setsortimgdt_operationdate?></a></td>
                      <td width="10%" align="left" valign="middle" class="grid-td-top">Ip Address</td>
                     <td width="10%" align="left" valign="middle" class="grid-td-top"><a href="javascript:;" onclick="SendGridBindRequest('<?=$settingsObj->urlwithoutsort?>&orderby=var_operation&sorting=Y','gridbody','ST')">Operation<?=$setsortimgvar_operation?></a>
                      </td>                     
                    </tr>
                  </table>
                </div>
            <div class="information-white-bg" id="dvpersonalinformation" >
            <div class="clear"></div>

            <div class="grid-list-inner-table-text" style="margin-right: 2px;">
      <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)) 
					{
//					$clsname = ($row['chr_read'] == 'N')?"grid-list-inner-table-text-active":"grid-list-inner-table-text";	// For read unread class
					//$clsname = 'grid-list-inner-table-text-active';
						
					$starimg = ($row['chr_star'] == 'Y')?"gstar.png":"gstar-disable.png"; // Displaying the stat and unstart image
                    $tool = ($row['chr_star'] == 'Y')?"Starred":"Not starred";
					?>
                   <?  $char = substr(stripcslashes($row['var_name']),0,25);
                if(strlen($row['var_name'])>25) {
                    $char.='...';
                }?>
        <tr id="gtr-<?=$row['int_glcode']?>"  style="background-color: transparent;"   onmouseover="this.style.backgroundColor='#f6f6f6'" onmouseout="this.style.backgroundColor='transparent'" >
              <? if($delete_link=='true') { ?>
          <td width="6%" align="left" valign="middle" class="grid-td-left"><input name="chkgrow" id="chkgrow" type="checkbox" value="<?php echo $row['int_glcode']?>" /></td>
<? } else { ?>
<td width="3%" align="left" valign="middle" class="grid-td-left">&nbsp;</td>
<? } ?>
          <?php if($configObj->glSessionObj->value('admin_id') == '1')  { ?>

          <!--<td width="3%" align="center" valign="middle" class="grid-left1"><img id="star-<?=$row['int_glcode']?>" height="16" width="16" alt="remember me" title="<?php echo $tool;?>" src="<?=GLOBAL_ADMIN_IMAGES_PATH?><?=$starimg?>" style="vertical-align:middle;cursor:pointer;"onclick="UpdateStar('<?=DB_PREFIX ?>logmanager','chr_star','<?=$row['int_glcode']?>');"></td>-->

          <?php }else{ ?>

          <td width="3%" align="center" valign="middle" class="grid-left1"></td>

          <?php } ?>

          <td width="20%" align="left" valign="middle" class="grid-td-top">
          <?php echo $row['var_modulename']; ?></td>
          <td width="30%" align="left" valign="middle" class="grid-td-top">
          <?php echo $char ?></td>
         <td width="10%" align="left" valign="middle" class="grid-td-top">
          <?php echo $row['var_fname']; ?></td>
          <td width="15%" align="center" valign="middle" class="grid-td-top">
     <?        $date_news=DEFAULT_DATEFORMAT;

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

?>
          <?php echo $date; ?></td>
          <td width="11%" align="left" valign="middle" class="grid-td-top">
          <?php echo $row['var_ipaddress']; ?></td>
         <?php
		 if($row['var_operation']=='I')
		 {
			$operation="Insert"; 
		 }
		 else if($row['var_operation']=='U')
		 {
			 $operation="Update"; 
		 }
		 else if($row['var_operation']=='D')
		 {
			 $operation="Delete";  
		 }
		 ?>
            <td width="10%" align="left" valign="middle" class="grid-td-top">
          <?php echo $operation; ?></td>               
        </tr>
           <?php  $rowcount++;
			} 
		 }
		 else
		 {
		?>
             <tr style="background-color: transparent;"   onmouseover="this.style.backgroundColor='#f6f6f6'" onmouseout="this.style.backgroundColor='transparent'"> 
                <td height="25" align="center" valign="middle" colspan="6" class="form_titles">No records are available.</td>
             </tr>
		<?
		 }
		?>
			<input type="hidden" name="ptrecords" id="ptrecords" value="<?=$rowcount?>">      
      </table>
      </div>
  </div>            
 <div class="clear"></div>
            
<?php echo $pagingBottom; ?>
        <?php if ($numofrows > 0) { ?>
 <? if($delete_link=='true') { ?>
<!--            <div style="width:90px; float: left;" 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 verify();" /></a>
            </div>-->
 <div  style="width:90px; float: left;" class="add-new-user-button" <?=$paramMain['Publish']?>><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 SendGridBindRequest('<?=$settingsObj->urlwithpara?>','gridbody','D','chkgrow');" /></a></div>
        <?php } ?>
        <form name="exportform" id="exportform" action="index.php?module=settings&view=logmanager&action=export"  method="post">
            <input type="hidden" name="totalrecords" id="totalrecords" value="">
            <input type="hidden" name="chkids" id="chkids" value="">
            <? 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="Export" name="Image48" width="81" height="25" border="0" id="Image48" onclick="return excelreport2();" /></a></div>
                    <?php }}?>
        </form>
</div>