<?php
/* 
* Theme: PREMIUMPRESS CORE FRAMEWORK FILE
* Url: www.premiumpress.com
* Author: Mark Fail
*
* THIS FILE WILL BE UPDATED WITH EVERY UPDATE
* IF YOU WANT TO MODIFY THIS FILE, CREATE A CHILD THEME
*
* http://codex.wordpress.org/Child_Themes
*/
if (!defined('THEME_VERSION')) {	header('HTTP/1.0 403 Forbidden'); exit; }

global $CORE, $post, $CORE_UI;

	
	
	// GET POST META 
	$data = $CORE->FUNC("format_logtype", $post->ID );
	 
	$user_id = 1;
  
  if(isset($data['userid'])){
    $user_id = $data['userid'];
  }
 

  $key = array();
  if(isset($data['name'])){
	$key = explode("(",$data['name']);
  }

  $name = "";
	$desc = "";

	// NAME
  if(isset($data['log_type']) && in_array($data['log_type'],array("email"))){ 
    $data['name'] = "Admin Email";
    $name = "Admin Email";
    $desc = "You were sent an email.";
  }else{
    if(isset($data['title_from'])){
      $name = notify_string_filter($data, $data['title_from'], "from"); 
    }
	  if(isset($data['desc_from'])){
	    $desc = notify_string_filter($data, $data['desc_from'], "from");
    }
  }
	 
	
	 
?>



<tr id="postid-<?php echo $post->ID; ?>" class="logclass <?php if(isset($data['log_type'])){ echo $data['log_type']; } ?>">
  <td><input class="checkbox1" type="checkbox" name="check[]" value="<?php echo $post->ID; ?>">
  </td>


  
  <td> 
  
  <ul class="list-inline mb-0 ">
      <li class="list-inline-item"> 
      <?php if(is_numeric($user_id)){ ?>
        <?php echo $CORE_UI->AVATAR("user", array("size" => "md", "uid" => $user_id, "css" => "rounded-circle", "online" => 0)); ?>

        <?php } ?>
        
        
        
         </li>
      <li class="list-inline-item">
        <div class="font-weight-bold mb-2"><?php echo $name; ?></div>
        <div class="small btn-block"> <?php echo $desc; ?> </div>
      </li>
    </ul>
    
    
    
    
    </td>
 
 
  
  
  
  <td><?php if(isset($data['time'])){ echo $data['time']; } ?></td>


  <td><i class="<?php if(isset($data['icon'])){ echo $data['icon']; } ?> fa-2x float-left pr-3" title="<?php if(isset($data['log_type'])){ echo $data['log_type']; } ?>"></i></td>

 <td>
 
 <?php if(isset($data['log_type']) && in_array($data['log_type'],array("email_admin","email"))){ ?>

     <span class="badge badge-success">Mail Sent</span>

<?php }elseif(isset($data['log_type']) && in_array($data['log_type'],array("listing_added"))){ ?>
    
<span class="badge badge-warning">New Listing</span>
 <?php }else{ ?>

 <span class="badge badge-secondary">Notify</span>
 <?php } ?>

</td>

  
  <td style="width:180px;">
  

  <a href="javascript:void(0);" onclick="previewreport(<?php echo $post->ID; ?>);" class="btn btn-system btn-md mr-2"> <i class="fa fa-eye" style="font-size: 12px;"></i> </a> 
  
  <a href="<?php echo home_url(); ?>/wp-admin/admin.php?page=reports&eid=<?php echo $post->ID; ?>" class="btn btn-system btn-md mr-2"> <i class="fa fa-pencil" style="font-size: 12px;"></i> </a> 
  <a href="javascript:void(0);"  onclick="ajax_delete_log('<?php echo $post->ID; ?>')"   class="btn btn-system btn-md"><i class="fa fa-trash" style="font-size: 12px;"></i></a> 


</td>
</tr>
