<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Company Mailer | <?php echo $sitename;  ?></title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

   <!--CSS-->
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

    <!-- Bootstrap Core CSS -->
      <link href="css/bootstrap.min.css" rel="stylesheet">

     <!-- Font Awesome -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

      <!-- Custom CSS -->
      <link href="css/blog-home.css" rel="stylesheet">

      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
      <!--[if lt IE 9]-->
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
          <script src="js/jquery.js"></script>
          <script src="js/bootstrap.js"></script>



</head>

<body>
  <?php  include("includes/dashboard_navbar.php"); ?>
  <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
 <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
  <style>
    body{
      background-color: #f5f5f5;
    }
    .destop-siderbar{
      background-color: #131e2a;
      height: 100%;
      width:240px;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      position: fixed;
      margin-left:-20px;
      padding:50px 25px;
    }
    .destop-siderbar li{
       padding: 30px 20px;
       list-style: none;
    }
    .destop-siderbar li a{
      color: #fff;
      font-size: 17px;
      padding:10px 0px;
    }
    .destop-siderbar li a i{
      color:rgb(45, 156, 219);
      font-weight: lighter;
    }
    .destop-siderbar .active {
      background-color:#123962;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      
    }
    .destop-siderbar .active a{
      color:#fff;
    }
    .destop-siderbar .active a:hover{
      color:#fff;
    }
    .destop-siderbar li a:hover{
      color: #a5bdd9;
      text-decoration: none;
    }
    .panel{
      border-radius: 0px;
      border-color: transparent;
    }
    .input-danger{
       border:1px solid darkred;
       color:darkred;
     }
     .input-danger::placeholder{
       opacity: 0.6;
       color:darkred;
     }
  </style>

  <div class="container-fluid">
    <div class="row">
      <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-2 hidden-xs" style="height: 100%;">
               <?php include("includes/desktop_side.php"); ?>
      </div>
      <!--/////////////////////// DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-10">
        <br><br><br><br>
        <div class="row">
          
        </div>

        <!----------------------------------------------------------------------------------->

        <div class="row">
          <div class="col-sm-8">
            <div class="row">
              

              <div class="col-sm-6">
                 <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/3296464.png" width="35">&nbsp;&nbsp;<b>COMPANY MAILER</b>
                <br><hr><br>


                <?php
                 if(isset($_GET["client_email"])){

                  $client_email = $_GET["client_email"];
                  $issue_type = $_GET["issue_type"];
                  $issue_type = "REPLY ON[$issue_type]";
                  $description = $_GET["description"];

                 }else{
                  $client_email = "";
                  $issue_type = "";
                  $description = "";
                 }
                ?>

                            <?php
                             if(isset($_POST["mailerbtn"])){
                                 
                               $email_to = $_POST["email_to"];
                               $subject = $_POST["subject"];
                               $message_2 = $_POST["message"];

                            
                               
                               
                               
                                   //SEND MAIL TO USERS THAT SIGN-UP
                                   
                          $to = $email_to;
                          $message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    <html xmlns="http://www.w3.org/1999/xhtml">
                     <head>
                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                      <title>Account created.</title>
                      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
                    </head>
                    <body>
                      <!------------------------------------------------------>
                      <div style="background-color:#0b1118; padding:10px 10px;">
                      
                      
                         <div style="background-color:#0b1118; padding: 10px 10px; align-items: center;">
                          <img src="'.$sitelogo.'" width="100">
                         </div>
                     
                    
                      <br><br>
                      <div class="mail-signup">
                        <span style="font-size: 20px; color:#fff; text-align:center; font-weight:bold;">'.$issue_type.'</span>
                        <br><br>
                        <span style="font-size: 14px; letter-spacing: 0.2px; color:#fff;">
                         
                         '.$message_2.'
                        
                        </span>
                        
                      
                        <br><hr>
                        <span style="font-size: 10px; font-weight:bold; letter-spacing: 0.1px; line-height:-5px; color:#fff;">
                          We\'re sure '.$siteshortname.' is simple enough for you to DIY, but if you ever need our help, we\'re always one email <span style="font-weight: bold; color:#a5bdd9 !important;">support@'.$siteshortname.'.com</span> away.
                        </span>
                        <br><br>
                        </div>
                      </div>

                    </div>
                    </body>
                    </html>';
                        
                             // To send HTML mail, the Content-type header must be set
                          $headers[] = 'MIME-Version: 1.0';
                          $headers[] = 'Content-type: text/html; charset=iso-8859-1';

                          // Additional headers
                          $headers[] = 'From: '.$siteshortname.' <support@'.$siteshortname.'.com>';

                          mail($to, $subject, $message,  implode("\r\n", $headers));
                          
                          echo "<div class='alert alert-success'>Mail Sent...</div>";
                         /*
                         =================================
                        */
                              

                             }
                            ?>
                
                <div class="row">
                  <div class="col-xs-12">
                    <form  action="" method="POST">
                                <input type="email" name="email_to" class="form-control input-lg" style="border-radius: 0px;" placeholder="Receiver Email" value="<?php echo $client_email; ?>">
                                <br>
                                <input type="tet" name="subject" class="form-control input-lg" style="border-radius: 0px;" placeholder="Subject" value="<?php echo $issue_type; ?>">
                                <br>
                                <textarea class="input-lg form-control" rows="5" name="message"></textarea>
                                <span id="email-error" style="color:darkred;"></span>
                                <br>
                                <button type="submit" name="mailerbtn" class="btn btn-primary" style="border-radius:0px; ">SEND EMAIL</button>
                                </form>
                  </div>
                </div>

                <br><hr><br>

                <br>
                


                  </div>
                </div>
              </div>

              <div class="col-sm-6">
                
              </div>

            </div>

            <!--------------------------->







          </div>


          <div class="col-sm-4">
            
            </div>
          </div>
        </div>
        
        
        
        
        
        
      </div>
    </div>
  </div>
</body>
</html>