

 <link rel="stylesheet" href="css/summernote.css" />
 
<style>
    .panel-body
    {
        height:200px !important;
    }
    .chosen-choices
    {
       
    padding: 5px !important;
    font-size: 14px !important;

    }
    .chosen-results
    {
        font-size: 14px !important;
    }
</style>

 <div class="row">
  <div class="col-lg-6">
    <div class="view-mail-wrap">
      <div class="mail-title">
        <h2>Compose Mail</h2>
        <div class="view-mail-action"></div>
      </div>
      
      <br>
      <br>
     
      
      <div class="row">
        <div class="col-lg-12">
          <div class="row" style="<?php echo $checkdisplay;?>">
            <div class="col-lg-2">
              <div >
                <span style="float:right">To :</span>
              </div>
            </div>
            <div class="col-lg-10">
              <div class="">
              <input type="hidden" name="page_type" value="<?php echo $edit_file;?>" id="page_type">  
    <select class="chosen-select" data-placeholder="select emails" name="recipient_email[]" id="recipient_emailaddress" multiple>
        
        <?php


$sql = "SELECT * FROM official_mail where id!=''";

$sql_exe = mysqli_query($link,$sql);
$count = 1;
while($fetch_qr = mysqli_fetch_array($sql_exe)){

?>
<option value="<?php echo $fetch_qr['mail']; ?>"><?php echo $fetch_qr['mail']; ?></option>
<?php
}
?>

  </select>
              </div>
            </div>
          </div>
           <br>
           <div class="row">
              
            <div class="col-lg-2">
              <div class="">
                <span style="float:right">Cc :</span>
              </div>
            </div>
            <div class="col-lg-10">
              <div class="compose-multiple-cc">
                   <select class="chosen-select" data-placeholder="select cc emails" name="cc[]" id="recipient_emailaddress" multiple>
        
        <?php


$sql = "SELECT * FROM official_mail where id!=''";

$sql_exe = mysqli_query($link,$sql);
$count = 1;
while($fetch_qr = mysqli_fetch_array($sql_exe)){

?>
<option value="<?php echo $fetch_qr['mail']; ?>"><?php echo $fetch_qr['mail']; ?></option>
<?php
}
?>

  </select>
              </div>
            </div>
          </div>
          <br>
           <div class="row">
            <div class="col-lg-2">
              <div >
                <span style="float:right">Bcc :</span>
              </div>
            </div>
            <div class="col-lg-10">
              <div class="">
              <input type="hidden" name="page_type" value="<?php echo $edit_file;?>" id="page_type">  
    <select class="chosen-select" data-placeholder="select bcc emails" name="recipient_email[]" id="recipient_emailaddress" multiple>
        
        <?php


$sql = "SELECT * FROM official_mail where id!=''";

$sql_exe = mysqli_query($link,$sql);
$count = 1;
while($fetch_qr = mysqli_fetch_array($sql_exe)){

?>
<option value="<?php echo $fetch_qr['mail']; ?>"><?php echo $fetch_qr['mail']; ?></option>
<?php
}
?>

  </select>
              </div>
            </div>
          </div>
           <br>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
          <div class="row">
            <div class="col-lg-2">
              <div class="compose-email-to compose-subject-title">
                <span style="float:right">Subject :</span>
              </div>
            </div>
            <div class="col-lg-10">
              <div class="compose-multiple-email compose-subject-email">
                <input type="text" name="subject">
                <input type="text" name="idmessage" id="idmessage" hidden>
              </div>
            </div>
          </div>
        </div>
      </div>
       
         <div class="row" style="<?php echo $checkdisplay1;?>">
        <div class="col-lg-12">
          <div class="row">
            <div class="col-lg-2">
              <div class="compose-email-to compose-subject-title">
                <span style="float:right">Attach files </span>
              </div>
            </div>
            <div class="col-lg-10">
              <div class="compose-multiple-email compose-subject-email">
               
               <input name="upload[]" type="file"  multiple="multiple" />
              </div>
            </div>
          </div>
        </div>
      </div>
       
       
      <div class="row">
        <div class="col-lg-12">
          <div class="text-editor-compose">
            <div id="summernote5" >
             Write Your Content
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
           
         <div id="attach" style="
    display: flex;
    flex-wrap: wrap;
">
         
              
         </div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
          <div class="view-mail-reply-list">
            <ul class="view-mail-forword">
              <li>
                  
                <button hidden class="btn btn-warning" type="submit" id="messend_demo" name="submit_demo">Send Demo Mail</button>
                
                <button class="btn btn-warning" type="button" onclick="sendmsg('messend_demo')" >Send Demo Mail</button></li>
                    
                  <button hidden class="btn btn-success" type="submit" id="messend" name="submit">Send Mail</button>
                  
                  <button class="btn btn-success" type="button" onclick="sendmsg('messend')" >Send Mail</button></li>
                  
              <li><button class="btn btn-danger">Cancel</button></li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="js/vendor/jquery-1.11.3.min.js"></script> 
<script src="js/bootstrap.min.js"></script> 
<script src="js/dropzone.js"></script> 
<script>
    $(document).ready(function() {
      $('#recipient_emailaddress').chosen();
    });
     function sendmsg(x){
           
      
       document.getElementById("idmessage").value=document.getElementsByClassName("note-editable")['0'].innerHTML;
       
    
       
       

    
            document.getElementById(x).click();
            
            
            
       
     
            }
    function checkall(x)
   {
       var temp="";
       
       if(x.checked==true)
       {
          
           
           window.localStorage.setItem("temp",1);
           
           var len=document.getElementsByClassName("check-input").length;
           for(var i=0;i<len;i++)
           {
               var val=document.getElementsByClassName("check-input")[i].value;
               val=val.split(",");
                extension = val[1].split('.').pop(); 
                var textv="";
               if(extension=="pdf")
               {
                    textv=val[3]+"</a>";
                   var tagname="<a target='_blank'";
                   var srcname="href";
                   var style="margin-bottom:5px;height: fit-content;margin-left:10px;background: #305592;color: white;padding: 5px;border-radius: 12px";
               }
               else
               {
                     textv="";
                   var tagname="<img";
                   var srcname="src";
                   var style="margin-bottom:5px;width:100px;margin-left:10px;color: white;padding: 5px;border-radius: 12px";
               }
               temp=temp+tagname+" style='"+style+"' id='"+val[1]+"' "+srcname+"='"+val[1]+"'>"+textv+"";
               document.getElementsByClassName("check-input")[i].setAttribute("checked","true");
               document.getElementsByClassName("check-input")[i].checked=true;
           }
           document.getElementById("attach").innerHTML=temp;
       }
       else
       {
         
           window.localStorage.setItem("temp",2);
           var len=document.getElementsByClassName("check-input").length;
           for(var i=0;i<len;i++)
           {
               document.getElementsByClassName("check-input")[i].setAttribute("checked","false");
                document.getElementsByClassName("check-input")[i].checked=false;
           }
           
           document.getElementById("attach").innerHTML="";

           
       }
   }
   
   
   function checkin(x)
   {
       
       var temp="";
       if(x.checked==true)
       {
           var val=x.value;
               val=val.split(",");
                extension = val[1].split('.').pop(); 
                var textv="";
               if(extension=="pdf")
               {
                    textv=val[3]+"</a>";
                   var tagname="<a target='_blank'";
                   var srcname="href";
                   var style="margin-bottom:5px;height: fit-content;margin-left:10px;background: #305592;color: white;padding: 5px;border-radius: 12px";
               }
               else
               {
                     textv="";
                   var tagname="<img";
                   var srcname="src";
                   var style="margin-bottom:5px;width:100px;margin-left:10px;color: white;padding: 5px;border-radius: 12px";
               }
               temp=temp+tagname+" style='"+style+"' id='"+val[1]+"' "+srcname+"='"+val[1]+"'>"+textv+"";
           document.getElementById("attach").innerHTML+=temp;
       }
       else
       {
           var val=x.value;
               val=val.split(",");
               
           document.getElementById(val[1]).remove();
       }
   }
   
   
      function checkallpage(x)
   {
       var temp="";
       
       if(x.checked==true)
       {
          
           
           window.localStorage.setItem("temp",1);
           
           var len=document.getElementsByClassName("check-input").length;
           for(var i=0;i<len;i++)
           {
               
             
               document.getElementsByClassName("check-input")[i].setAttribute("checked","true");
               document.getElementsByClassName("check-input")[i].checked=true;
           }
           document.getElementById("attach").innerHTML=temp;
       }
       else
       {
         
           window.localStorage.setItem("temp",2);
           var len=document.getElementsByClassName("check-input").length;
           for(var i=0;i<len;i++)
           {
               document.getElementsByClassName("check-input")[i].setAttribute("checked","false");
                document.getElementsByClassName("check-input")[i].checked=false;
           }
           
           document.getElementById("attach").innerHTML="";

           
       }
   }
   
   
   function checkinpage(x)
   {
       
       
   }
  </script>
<!--<script src="js/multiple-email/multiple-email-active.js"></script> -->
<!--<script src="js/summernote.min.js"></script> -->
<!--<script src="js/summernote-active.js"></script>-->