<?php
session_start();
require_once 'class.admin.php';
include_once ('session.php');
if(!isset($_SESSION['email'])){
	
header("Location: login.php");

exit(); 
}

$reg_user = new USER();

if(isset($_GET['id'])){
	
$id=$_GET['id'];
$stmt = $reg_user->runQuery("SELECT * FROM temp_account WHERE id='$id'");
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
}
if(isset($_POST['decline']))
{	 
	$email = $row['email']; 
	$fname = $row['fname']; 

	if($reg_user->del($id))
			{			
			$id=$_GET['id'];
			$deleteuser = $reg_user->runQuery("DELETE FROM temp_account WHERE id = '$id'");
			$deleteuser->execute();
			
			
	$messag = "	<div class=''>
  <div class='aHl'></div>
  <div id=':190' tabindex='-1'></div>
  <div id=':18p' class='ii gt' jslog='20277; u014N:xr6bB; 4:W251bGwsbnVsbCxbXV0.'>
    <div id=':18o' class='a3s aiL msg3853875273355017072'>
      <u></u>
      <div style='width: 100% !important; margin: 0; padding: 0; background-color: #e8f8ff;'>
        <span style='color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; width: 0;'> </span>
        <table border='0' cellpadding='0' cellspacing='0' role='presentation' style='table-layout: fixed;' width='100%'>
          <tbody>
            <tr>
              <td align='center' valign='top'>
                <table align='center' border='0' cellpadding='0' cellspacing='0' class='m_3853875273355017072pc-email-container' role='presentation' style='margin: 0 auto; max-width: 620px;' width='100%'>
                  <tbody>
                    <tr>
                      <td align='left' style='padding: 0 10px;' valign='top'>
                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                          <tbody>
                            <tr>
                              <td height='20' style='font-size: 1px; line-height: 1px;'>&nbsp;</td>
                            </tr>
                          </tbody>
                        </table>
                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                          <tbody>
                            <tr>
                              <td valign='top'>
                                <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                  <tbody>
                                    <tr>
                                      <td bgcolor='#E8F8FF' class='m_3853875273355017072pc-sm-p-30 m_3853875273355017072pc-xs-p-20' style='padding: 29px 35px; background-color: #ffffff; text-align: right; font-size: 0;' valign='top'>
                                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                          <tbody>
                                            <tr>
                                              <td align='center' valign='top'>
                                                  <img alt='' height='32' src='https://skyutahcapitals.com/sitelogo.png' style='max-width: 100%; height: auto; border: 0; line-height: 100%; outline: 0; font-size: 14px; color: #1b1b1b;' width='130' class='CToWUd' data-bit='iit'>
                                              </td>
                                            </tr>
                                          </tbody>
                                        </table>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                                <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                  <tbody>
                                    <tr>
                                      <td bgcolor='#E8F8FF' class='m_3853875273355017072pc-xs-p-15-10-20 m_3853875273355017072pc-sm-p-20-20-25' style='padding: 20px 30px 35px; background-color: #ffffff;' valign='top'>
                                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                          <tbody>
                                            <tr>
                                              <td height='0' style='font-size: 1px; line-height: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          <tbody>
                                            <tr>
                                              <td style='padding: 0 10px;' valign='top'>
                                                  <img alt='' height='' src='https://ba.rclays.co/dam/images/index/Index_Hero-Banner.png' style='border: 0; line-height: 100%; outline: 0; border-radius: 6px; max-width: 100%; color: #1b1b1b; display: block; height: auto;' width='520' class='CToWUd' data-bit='iit'>
                                              </td>
                                            </tr>
                                            <tr>
                                              <td height='30' style='line-height: 1px; font-size: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          <tbody>
                                            <tr>
                                              <td height='12' style='line-height: 1px; font-size: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          <tbody>
                                            <tr>
                                              
                                            </tr>
                                            <tr>
                                              <td height='25' style='line-height: 1px; font-size: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          <tbody>
                                            <tr>
                                              <td style='padding: 0 10px; font-family: 'Averta', 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 28px; letter-spacing: -0.2px; color: #00425f;' valign='top'>
                                                <p>We are sorry, $fname</p>
                                                <p>Your account application was decline! However, you can re-apply after 3 months.</p>

                                                
                                                
                                                
                                                
                                              </td>
                                            </tr>
                                            <tr>
                                              <td height='15' style='line-height: 1px; font-size: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          <tbody>
                                            <tr>
                                              <td height='20' style='line-height: 1px; font-size: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                        </table>
                                        
                                        
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                                <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                  <tbody>
                                    <tr>
                                      <td bgcolor='#00425F' style='background-color: #00425f;' valign='top'>
                                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                          <tbody>
                                            <tr>
                                              
                                            </tr>
                                          </tbody>
                                        </table>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                                <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                  <tbody>
                                    <tr>
                                      <td bgcolor='#FFFFFF' class='m_3853875273355017072pc-sm-p-38-30-40 m_3853875273355017072pc-xs-p-25-20' style='padding: 38px 40px 40px 40px; background-color: #ffffff;' valign='top'>
                                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                                          <tbody>
                                            <tr>
                                              <td class='m_3853875273355017072pc-xs-fs-14' style='text-align: center; font-family: Arial, sans-serif; font-size: 24px;' valign='top'>
                                                  <img alt='' height='21' src='http://img.nc.quickteller.com/images/quicktellersmart/quicktellersmart_568/5_53b0d85e-c406-4bcd-92cf-046e6ae77be7.png' style='border: 0; line-height: 100%; outline: 0; font-size: 14px; color: #151515;' width='21' class='CToWUd' data-bit='iit'>
                                                <span>&nbsp;&nbsp;&nbsp;</span>
                                                  <img alt='' height='21' src='http://img.nc.quickteller.com/images/quicktellersmart/quicktellersmart_568/6_1c4aee3c-ad24-4a2e-b4f2-b5aad2b734e6.png' style='border: 0; line-height: 100%; outline: 0; font-size: 14px; color: #151515;' width='21' class='CToWUd' data-bit='iit'>
                                                <span>&nbsp;&nbsp;&nbsp;</span>
                                                  <img alt='' height='21' src='http://img.nc.quickteller.com/images/quicktellersmart/quicktellersmart_568/7_5463fd6e-a546-4c41-8f1f-5110c75f53db.png' style='border: 0; line-height: 100%; outline: 0; font-size: 14px; color: #151515;' width='21' class='CToWUd' data-bit='iit'>
                                              </td>
                                            </tr>
                                            <tr>
                                              <td height='15' style='font-size: 1px; line-height: 1px;' valign='top'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          <tbody>
                                            <tr>
                                              <td style='text-align: center; line-height: 20px; letter-spacing: -0.2px; font-family: 'Averta', 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 14px; color: #9b9b9b;' valign='top'>
                                                Philadelphia, PA 19176
                                                <p style='#F00; font-size:13px;line-height: 15px;'>This message is sent to this email to $fname <br> <br> </p><center><b>How do I know this is not a fake email?</b></center> <br>

An email really coming from us will address you by your registered first and last name or your business name. It will not ask you for sensitive information like your password, bank account or credit card details.<br><br>
                                      <p></p>
                                      <p style='#F00; font-size:13px;line-height: 15px;'>Remember not to click any links in suspicious looking emails. </p>
                                              </td>
                                            </tr>
                                            <tr>
                                              <td height='13' style='font-size: 1px; line-height: 1px;'>&nbsp;</td>
                                            </tr>
                                          </tbody>
                                          
                                        </table>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                        <table border='0' cellpadding='0' cellspacing='0' role='presentation' width='100%'>
                          <tbody>
                            <tr>
                              <td height='20' style='font-size: 1px; line-height: 1px;'>&nbsp;</td>
                            </tr>
                          </tbody>
                        </table>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
          </tbody>
        </table>
        <br>
        <div></div>
      </div>
    </div>
  </div>
</div> ";
						
					$email = $row['email']; 
					$fname = $row['fname']; 	
			$subject = "We Are Sorry $fname! - Your Account Application Was Declined!";
						
			$reg_user->send_mail($email,$messag,$subject);	
			
			
			
					 header("Location: pending_accounts.php?declined");
			}
			else {
				
					  header("Location: pending_accounts.php?error");
			}
		
	}
    
      
   
?>


<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
        <meta name="format-detection" content="telephone=no">
        <meta charset="UTF-8">

        <meta name="description" content="">
        <meta name="keywords" content="">
		<link rel="icon" href="img/favicon.png" type="image/x-icon">

        <title>Intercontinental Reserve | Admin - Decline Account</title>
            
        <!-- CSS -->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/animate.min.css" rel="stylesheet">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <link href="css/form.css" rel="stylesheet">
        <link href="css/calendar.css" rel="stylesheet">
        <link href="css/style.css" rel="stylesheet">
        <link href="css/icons.css" rel="stylesheet">
        <link href="css/generics.css" rel="stylesheet"> 
    </head>
    <body id="skin-blur-nexus">

        <header id="header" class="media">
            <a href="index.php" id="menu-toggle"></a> 
            <a class="logo pull-left" href="index.php"><img src="" class="img-responsive" alt=""></a>
            
            <div class="media-body">
                <div class="media" id="top-menu">
                    
                    <div id="time" class="pull-right">
                        <span id="hours"></span>
                        :
                        <span id="min"></span>
                        :
                        <span id="sec"></span>
                    </div>
                    
                    
                </div>
            </div>
        </header>
        
        <div class="clearfix"></div>
        
        <section id="main" class="p-relative" role="main">
            
            <!-- Sidebar -->
            <aside id="sidebar">
                
                <!-- Sidbar Widgets -->
                <div class="side-widgets overflow">
                    <!-- Profile Menu -->
                    <div class="text-center s-widget m-b-25 dropdown" id="profile-menu">
                        <a href="index.php" data-toggle="dropdown">
                            <img class="profile-pic animated" src="img/htb.jpg" alt="Profile Pic">
                        </a>
                        <ul class="dropdown-menu profile-menu">
                            
                            <li><a href="logout.php">Sign Out</a> <i class="fa fa-sign-out icon left">&#61903;</i><i class="icon right fa fa-sign-out">&#61815;</i></li>
							<li><a href="#edit" data-toggle="modal">Edit Profile</a><i class="right fa fa-edit fa-2x"></i></li>
					   </ul>
                        <h4 class="m-0">Intercontinental Reserve</h4>
                      
                    </div>
                    
                    <!-- Calendar -->
                    <div class="s-widget m-b-25">
                        <div id="sidebar-calendar"></div>
                    </div>
                    
                    <!-- Feeds -->
                    <div class="s-widget m-b-25">
                        <h2 class="tile-title">
                           Developer Info
                        </h2>
						<div class="">
                        
                        <p><i class="fa fa-skype fa-2x"></i> mosaic_mos</p>
						</div>
                        <div class="s-widget-body">
                            <div id="news-feed"></div>
                        </div>
                    </div>
                    
                    <!-- Projects -->
                     
                </div>
                
                <!-- Side Menu -->
                <ul class="list-unstyled side-menu">
                    <li>
                        <a class="sa-side-home" href="index.php">
                            <span class="menu-item">Dashboard</span>
                        </a>
                    </li>
                    <li class="dropdown active">
                        <a class="sa-list-vcard" href="">
                            <span class="menu-item">Accounts</span>
                        </a>
						<ul class="list-unstyled menu-item">
                            <li><a href="create_account.php">Create Account</a></li>
                            <li><a href="view_account.php">View Accounts</a></li>
                            <li><a href="update.php">Update Accounts</a></li>
							<li><a href="upload.php">Upload Image</a></li>
							<li><a href="upload.php"></a></li>
                        </ul>
                    </li>
                    <li>
                        <a class="sa-list-secret" href="pending_accounts.php">
                            <span class="menu-item">Pending Accounts</span>
                        </a>
                    </li>
                    <li>
                        <a class="sa-top-message" href="messages.php">
                            <span class="menu-item">Messages</span>
                        </a>
                    </li>
					<li>
                        <a class="sa-list-comment" href="tickets.php">
                            <span class="menu-item">Tickets</span>
                        </a>
                    </li>
					<li>
                        <a class="sa-list-database" href="credit_debit_list.php">
                            <span class="menu-item">Credit/Debit History</span>
                        </a>
                    </li>
					<li>
                        <a class="sa-list-cc" href="transfer_rec.php">
                            <span class="menu-item">Transaction Records</span>
                        </a>
                    </li>
					<li>
                        <a class="sa-list-cog" href="settings.php">
                            <span class="menu-item">Settings</span>
                        </a>
                    </li>
                   
                </ul>

            </aside>
			<section id="content" class="container">
			<h4 class="page-title block-title">Decline Approval</h4>
                                
                <div class="container-fluid">
				
				 <div class="col-md-8">
				  <?php if(isset($msg)) echo $msg;  ?>
                            <div class="card">
                                <div class="card-header card-header-icon" data-background-color="rose">
                                    <i class="fa fa-trash-o fa-3x"></i>
                                </div><br>
                               
                                    
                                    <form class="form-horizontal" method="POST">
										<div class="row">
                                            <label class="col-md-3 label-on-left">Full Name</label>
                                            <div class="col-md-9">
                                                <div class="form-group label-floating is-empty">
                                                    <label class="control-label"></label>
                                                    <a><?php echo $row['fname']; ?> <?php echo $row['mname']; ?> <?php echo $row['lname']; ?></a>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <label class="col-md-3 label-on-left">Email</label>
                                            <div class="col-md-9">
                                                <div class="form-group label-floating is-empty">
                                                    <label class="control-label"></label>
													
                                                    <a><?php echo $row['email']; ?></a><br />
													
                                                </div>
                                            </div>
                                        </div>
										<div class="row">
                                            <label class="col-md-3 label-on-left">Phone</label>
                                            <div class="col-md-9">
                                                <div class="form-group label-floating is-empty">
                                                    <label class="control-label"></label>
                                                    <a><?php echo $row['phone']; ?></a>
                                                </div>
                                            </div>
                                        </div>
										<div class="row">
                                            <label class="col-md-3 label-on-left">Sex</label>
                                            <div class="col-md-9">
                                                <div class="form-group label-floating is-empty">
                                                    <label class="control-label"></label>
                                                    <a><?php echo $row['sex']; ?></a>
                                                </div>
                                            </div>
                                        </div>
										<div class="clearfix"></div>
										<br />
									   
										<input class="btn btn-md" type="submit" name="decline" value="Decline Account">
                                    </form>
                               
                            </div>
                        </div>
						
				
				
                        
                        
                        
                    
                </div>
              </div>  
                <hr class="whiter m-t-20" />
			</section>
          

            <!-- Older IE Message -->
            <!--[if lt IE 9]>
                <div class="ie-block">
                    <h1 class="Ops">Ooops!</h1>
                    <p>You are using an outdated version of Internet Explorer, upgrade to any of the following web browser in order to access the maximum functionality of this website. </p>
                    <ul class="browsers">
                        <li>
                            <a href="https://www.google.com/intl/en/chrome/browser/">
                                <img src="img/browsers/chrome.png" alt="">
                                <div>Google Chrome</div>
                            </a>
                        </li>
                        <li>
                            <a href="http://www.mozilla.org/en-US/firefox/new/">
                                <img src="img/browsers/firefox.png" alt="">
                                <div>Mozilla firefox</div>
                            </a>
                        </li>
                        <li>
                            <a href="http://www.opera.com/computer/windows">
                                <img src="img/browsers/opera.png" alt="">
                                <div>Opera</div>
                            </a>
                        </li>
                        <li>
                            <a href="http://safari.en.softonic.com/">
                                <img src="img/browsers/safari.png" alt="">
                                <div>Safari</div>
                            </a>
                        </li>
                        <li>
                            <a href="http://windows.microsoft.com/en-us/internet-explorer/downloads/ie-10/worldwide-languages">
                                <img src="img/browsers/ie.png" alt="">
                                <div>Internet Explorer(New)</div>
                            </a>
                        </li>
                    </ul>
                    <p>Upgrade your browser for a Safer and Faster web experience. <br/>Thank you for your patience...</p>
                </div>   
            <![endif]-->
        </section>
        
        <!-- Javascript Libraries -->
        <!-- jQuery -->
        <script src="js/jquery.min.js"></script> <!-- jQuery Library -->
       

        <!-- Bootstrap -->
        <script src="js/bootstrap.min.js"></script>

        <!-- Charts -->
        <script src="js/validation/validate.min.js"></script> <!-- jQuery Form Validation Library -->
        <script src="js/validation/validationEngine.min.js"></script> <!-- jQuery Form Validation Library - requirred with above js -->
		<script src="js/sparkline.min.js"></script> <!-- Sparkline - Tiny charts -->
        <script src="js/easypiechart.js"></script> <!-- EasyPieChart - Animated Pie Charts -->
        <script src="js/charts.js"></script> <!-- All the above chart related functions -->
		<script src="js/datetimepicker.min.js"></script> <!-- Date & Time Picker -->
        

        <!-- UX -->
        <script src="js/scroll.min.js"></script> <!-- Custom Scrollbar -->

        <!-- Other -->
        <script src="js/calendar.min.js"></script> <!-- Calendar -->
        <script src="js/feeds.min.js"></script> <!-- News Feeds -->
        

        <!-- All JS functions -->
        <script src="js/functions.js"></script>
    </body>
</html>
