  <?php require ("header.php")?>
  
  <?php 
session_start();
if(isset($_SESSION['SESS_ADMINLOGGEDIN']) == FALSE) {
    header("Location: " . $config_basedir."../admin/adminlogin.php");
}
require_once("achieved/config.php");
require_once("achieved/db.php");
require_once("achieved/functions.php");
?>
       
       
     
     <?php
if(isset($_GET['id']) == TRUE) {
    $validid = pf_validate_number($_GET['id'], "redirect", $config_basedir);
    $funcsql = "DELETE FROM message WHERE id = " . $_GET['id'];
    mysql_query($funcsql);
   
    $delete=1;
   
   
   
}if(isset($_GET['func']) == TRUE) {

    if($_GET['func'] != "conf") {
        header("Location: " . $config_basedir ."../admin/outbox.php");
    }
    $validid = pf_validate_number($_GET['id'], "redirect", $config_basedir);
    $funcsql = "UPDATE message SET verified = 2 WHERE id = " . $_GET['id'];
    mysql_query($funcsql);
    
    header("Location: " . $config_basedir . "../admin/outbox.php");
}


   ?>
       
       
       <div wire:id="0ho7JEz65LVMGIzD4ceZ" wire:initial-data="{&quot;fingerprint&quot;:{&quot;id&quot;:&quot;0ho7JEz65LVMGIzD4ceZ&quot;,&quot;name&quot;:&quot;admin.manage-users&quot;,&quot;locale&quot;:&quot;en&quot;,&quot;path&quot;:&quot;admin\/dashboard\/manageusers&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;v&quot;:&quot;acj&quot;},&quot;effects&quot;:{&quot;listeners&quot;:[],&quot;path&quot;:&quot;https:\/\/xtbtrading.live\/trade\/admin\/dashboard\/manageusers&quot;},&quot;serverMemo&quot;:{&quot;children&quot;:[],&quot;errors&quot;:[],&quot;htmlHash&quot;:&quot;ed570425&quot;,&quot;data&quot;:{&quot;pagenum&quot;:10,&quot;searchvalue&quot;:&quot;&quot;,&quot;orderby&quot;:&quot;id&quot;,&quot;orderdirection&quot;:&quot;desc&quot;,&quot;selectPage&quot;:false,&quot;selectAll&quot;:false,&quot;checkrecord&quot;:[],&quot;selected&quot;:&quot;&quot;,&quot;action&quot;:&quot;Delete&quot;,&quot;username&quot;:null,&quot;fullname&quot;:null,&quot;email&quot;:null,&quot;password&quot;:null,&quot;message&quot;:null,&quot;subject&quot;:null,&quot;plan&quot;:null,&quot;datecreated&quot;:null,&quot;topamount&quot;:null,&quot;toptype&quot;:null,&quot;topcolumn&quot;:&quot;Bonus&quot;,&quot;page&quot;:1,&quot;paginators&quot;:{&quot;page&quot;:1}},&quot;dataMeta&quot;:[],&quot;checksum&quot;:&quot;9e82a6adabccc53607a584c57da8f89b4130352eb62c7aa9cc50f9455ca3c494&quot;}}">
    <div class="main-panel">
        <div class="content bg-light">
            <div class="page-inner">
                <div class="mt-2 mb-4">
                    <h1 class="title1 text-dark">OUTBOX</h1>
                </div>
                <div>
    </div>                <div>
    </div>                
               
               
               
               
                <div class="mb-5 row">
                    <div class="col-md-12 ">
                        <!--<div class="card shadow p-4 bg-light">-->
                           
                           
   
          

                           
           
           
            <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title">OUTBOX MAILS ( <?php
                            $sql=mysql_fetch_assoc(mysql_query("SELECT COUNT(id) FROM message WHERE status='1'"));
                            echo $sql['COUNT(id)'];
                            ?> )</h4>
                        <div class="ml-auto text-right">
                            <nav aria-label="breadcrumb">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="index.php">Home</a></li>
                                    <li class="breadcrumb-item active" aria-current="page">outbox</li>
                                </ol>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        

  <div class='container-fluid'>
               
               
                <div class='row'>
                    <div class='col-md-10'>
                        <div class='card'>
                            <div class='card-body'>
                                <h4 class='card-title m-b-0'>Recent Posts</h4>
                            </div>
                           <div class='comment-widgets scrollable'>
                                 <!--Comment Row -->
                               
                               
                               
                               
                       <?php
 $orderssql = "SELECT * from message  ORDER BY id DESC";
    $ordersres = mysql_query($orderssql);
    $numrows = mysql_num_rows($ordersres);

   
  
 	
     if(isset($delete)){
         echo " <center>  <span style='color:red'>successfully deleted mail from outbox<br><br>
         <div class='loader'></div>
         <meta http-equiv='refresh' content='5 url=outbox.php'/>
         </div></center>";
     }
    
     
      while($row = mysql_fetch_assoc($ordersres))
     {
         
       	if($row['status'] == 1)
         {
         
          echo "
                                <div class='d-flex flex-row comment-row m-t-0'>
                                    <div class='p-2'>";
                                    
                                    
                                    
                                    
                                     if($row['photo'] == 0) {
        echo "
        <img src='../accounts/upload/photo/default.png' class='rounded-circle' alt='" . $userrow['username'] . "' style='width:50px;height:50px'>
        ";
    }
    
   elseif($row['photo'] == 1) {
        echo "
      <img  src='../" . $row['P_location'] . "' class='rounded-circle' alt='" . $row['username'] . "'  style='width:50px;height:50px' >
      ";
}
                                    
                                    
                                   

                                    
                                    
                                    
                                   echo" </div>
                                   
                                   
                                    <div class='comment-text w-100'>
                                        <h6 class='font-medium'>". $row['name']."</h6>
                                        <span class='m-b-15 d-block'>". $row['msg']." </span>
                                        
                                        <div class='comment-footer'>
                                            
                                            <span class='btn btn-success btn-sm float-right'>". $row['date']."</span> 
                                           
                                            <!--<button type='button' class='btn btn-cyan btn-sm'>Edit</button>-->
                                            
                                            
                                             <a type='button' class='btn btn-info btn-sm'  href='reply_outbox.php?id=" . $row['id'] . "'>View</a>
                                           
                                            <a type='button' class='btn btn-success btn-sm'  #='reply_msg.php?id=" . $row['id'] . "'>Reply</a>
                                           
                                            <a type='button' class='btn btn-danger btn-sm' href='outbox.php?id=" . $row['id'] . "'>Delete</a>
                                        
                                        </div>
                                    </div>
                                </div>";                
                                
     }
     }
     ?>
                                
                                
                                </div></div></div>
                            </div>
                        </div>
                          <!-- accoridan part -->
                          
                          
                          
                       
               </div></div></div></div></div>
               
            </div>
           
             <?php require ("footer.php")?>