  <script src="//cdn.ckeditor.com/4.7.3/standard/ckeditor.js"></script>
  <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   NewsLetter
                    <small>Subscriptions</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-envelope-o"></i>Newsletter</a></li>
                    <li class="active">Subscriptions</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
                <div class="container-fluid">
                    <!-- Row -->
                    <div class="row">
                     <?php if($this->session->flashdata("msg")!==""){ echo $this->session->flashdata("msg"); }?>
                        <div class="col-lg-12">
                            <div class="panel panel-default card-view">
                                <div class="panel-wrapper collapse in">
                                    <div class="panel-body">
                                        <div class="mail-box">
                                            <div class="row">
                                                <form action="<?php echo base_url();?>admin/sendmails" method="post" enctype="multipart/form-data">
                                                <aside class="col-md-3">
                                                <h3 class="text-center">Select Users</h3>
                                                    <div class="clearfix"></div>
            <table class="table table-bordered table-striped mb-none" id="datatable-tabletools">
									<thead>
										<tr>
                                 <th><div class="checkbox">
                                        <label>
                                          <input type="checkbox" class="select-all checkbox" name="select-all" /> All
                                        </label>
                                 </div> </th>
											<th>Email</th>
										</tr>
									</thead>
									<tbody>
                                    <?php $i=1;foreach($news as $news){?>
                      <tr><td><div class="checkbox">
                     <label><input type="checkbox" class="select-item checkbox" name="mails[]" value="<?php echo $news->email;?>" /></label></div> </td>
                      <td><i class="fa fa-envelope"></i> <?php echo $news->email;?></td>   
                                    </tr>
                                    <?php $i++;}?>
                                    </tbody>
								</table>
                                                </aside>
                                                <aside class="col-md-9 tab-container widget">
                                                   
                                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#home" data-toggle="tab">Compose New</a></li>
                                    <li><a href="#profile" data-toggle="tab">All Sent Mails</a></li>
                                 <!--   <li><a href="#messages" data-toggle="tab">Messages</a></li>-->
                                </ul>
                                <div class="tab-content" style="padding: 10px;">
                                    <div class="tab-pane active fade in" id="home">
          
            <div class="form-group">
                <label class="col-lg-2 control-label">To</label>
                <div class="col-lg-10">
                    <input type="text" placeholder="" id="inputEmail1" name="to" class="form-control">
                </div>
            </div>
            <div class="form-group" style="margin-bottom:70px;" >
                <label class="col-lg-2 control-label">Subject</label>
                <div class="col-lg-10">
                    <input type="text" placeholder="" id="inputPassword1" name="subject" class="form-control">
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-2 control-label">Message</label>
                <div class="col-lg-10">
                <textarea class="summernote"  name="editor1"></textarea>
                    <!--<textarea id="textarea" class="textarea_editor form-control" rows="15" placeholder="Enter text ..."></textarea>-->
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <!--<div class="fileupload btn btn-info btn-anim mr-10"><i class="fa fa-paperclip"></i><span class="btn-text">attachments</span>
                        <input type="file" class="upload" name="file">
                    </div>-->
                    <button class="btn btn-success" type="submit">Send Mails</button>
                </div>
            </div>
      
                                    </div>
                                    <div class="tab-pane fade in" id="profile">
                                        <h2>Listing All Sent Mails</h2>
                                       
                                    </div>
                                    <div class="tab-pane fade in" id="messages">
                                        <h2>Message</h2>
                                        <p>
                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis ratione, nisi maiores possimus culpa ut quas quae earum itaque, soluta reprehenderit neque eos. Placeat ratione, sapiente nemo expedita enim a.
                                        </p>
                                    </div>
                                </div>
                            
                                                    
                                                </aside>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /Row -->
                </div>
            </div>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <!-- Main Footer -->
         <footer class="main-footer">
            <!-- To the right -->
           <!-- <div class="pull-right hidden-xs">
                Developed by <i class="fa fa-heart"></i> Floatin
            </div>-->
            <!-- Default to the left -->
            <strong>Copyright &copy; 2017 <a href="#">Vector Khazana</a>.</strong> All rights reserved.
        </footer>
    </div>
    <!-- ./wrapper -->
    <!-- REQUIRED JS SCRIPTS -->
   
    <script src="<?php echo base_url();?>newadminassets/plugins/js/bootstrap.js"></script>
     <script>
	 CKEDITOR.replace( 'editor1' );
	 $(function(){

        //button select all or cancel
        $("#select-all").click(function () {
            var all = $("input.select-all")[0];
            all.checked = !all.checked
            var checked = all.checked;
            $("input.select-item").each(function (index,item) {
                item.checked = checked;
            });
        });

        //button select invert
        $("#select-invert").click(function () {
            $("input.select-item").each(function (index,item) {
                item.checked = !item.checked;
            });
            checkSelected();
        });

        //button get selected info
        $("#selected").click(function () {
            var items=[];
            $("input.select-item:checked:checked").each(function (index,item) {
                items[index] = item.value;
            });
            if (items.length < 1) {
                alert("no selected items!!!");
            }else {
                var values = items.join(',');
                console.log(values);
                var html = $("<div></div>");
                html.html("selected:"+values);
                html.appendTo("body");
            }
        });

        //column checkbox select all or cancel
        $("input.select-all").click(function () {
            var checked = this.checked;
            $("input.select-item").each(function (index,item) {
                item.checked = checked;
            });
        });

        //check selected items
        $("input.select-item").click(function () {
            var checked = this.checked;
            console.log(checked);
            checkSelected();
        });

        //check is all selected
        function checkSelected() {
            var all = $("input.select-all")[0];
            var total = $("input.select-item").length;
            var len = $("input.select-item:checked:checked").length;
            console.log("total:"+total);
            console.log("len:"+len);
            all.checked = len===total;
        }
    });
	</script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.sparkline.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/countUp.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/raphael.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/morris.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-jvectormap-2.0.2.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-jvectormap-world-mill-en.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/material.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/markdown.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/to-markdown.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/bootstrap-markdown.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.slimscroll.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/ripples.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/app.js"></script>
    
    <!-- Color Switcher -->
    
    
    <!-- END Skin switcher -->
</body>
</html>
