 <!--start main wrapper-->
    <main class="main-wrapper">
        <div class="main-content">
            <button class="btn guestBtn d-flex gap-2 align-items-center" id="backBtn"><img
                    src="<?php echo base_url(); ?>assets/images/arowleft.svg" alt="" width="15px"> Back</button>
            <div class="row">
                <div class="col-md-8 my-2">
                    <h3 class="fmon fw-bold">Sent Message Details</h3>
                </div>

            </div>
            <div class="row">
                <div class="col-md-7">
                    <div class="modal-body">


                        <form class="row">

                            <div class="col-md-12 my-2">
                                <label for="" class="form-label">Message title</label>
                                <input type="text" name="bank_name" id="bank_name" value="<?php echo $message['subject']; ?>" class="form-select Formselet"
                                    placeholder="Bank Name"  readonly/>


                            </div>
                            <div class="col-md-12 my-2">
                                <label for="" class="form-label">Message Content</label>
                                <!-- <div id="editor">
                                    <p>Hello World!</p>
                                    <p>Some initial <strong>bold</strong> text</p>
                                    <p><br /></p>
                                </div> -->
                                <textarea id="editor" readonly><?php echo $message['content']; ?></textarea>

                            </div>



                            <div class="col-m-12 my-2">
                                <div class="brower2 d-flex justify-content-center align-items-center">
                                    <div class="d-flex flex-column align-items-center">
                                        <?php if($message['attachments']!=""){ 
                                            foreach($message['attachments'] as $key => $value){
                                            ?>
                                      <a href="<?php echo $value; ?>" target="_blank">
                                    <img src="<?php echo base_url(); ?>assets/images/up2.png" alt="" width="20px">
                                      </a> 
                                      <?php }
                                       } ?>
                                      
                                      
                                    </div>
                                </div>
                            </div>




                        </form>
                        <!-- button for attahmnts -->



                    </div>
                </div>
                <div class="col-md-5 my-2">
                    <div>
                        <div class="custom-toolbar2 px-3 py-2">
                            <p class="mb-0 ft8">Recipients</p>
                        </div>
                        <div class="d-flex justify-content-between align-items-center my-2">
                            <label for="" class="form-label">Select the recipients of the message</label>
                            
                          
                        </div>
                        <div class="recbox d-flex gap-3 flex-wrap p-2">
                           <?php 
                           $total_recipients=count($message['recipientuserlistid']);
                           $read_recipients=0;
                           $unread_recipients=0;
                           foreach($message['recipientuserlistid'] as $key => $value){
                            if($value==true){
                                $read_recipients++;
                            }else{
                                $unread_recipients++;

                            }
                            $user=$this->common->readdatadocument('Users',$key);      
                            ?>
                            <div class="recbox2 my-2 d-flex justify-content-between align-items-center">
                                <?php echo $user['fullName'].','; ?>

                            </div>
                            
                            <?php } ?>
                            
                        </div> 
                        <!-- Select2 Dropdown -->

                        <!-- Recipients Box -->
                   
                        <div class="row">
                            <div class="col-md-6 my-2">
                                <p class="text-primary ">Read on the App: <?php echo $read_recipients; ?></p>


                            </div>
                            <div class="col-md-6 my-2">
                                <p class="text-muted">Unread: <?php echo $unread_recipients; ?></p>
                            </div>
                            <div class="col-md-6 my-2">
                                <p class="text-success">Read on email: 0</p>
                            </div>
                            <div class="col-md-6 my-2">
                                <p class="text-danger">
                                    Undeliverable emails: 0
                                </p>
                            </div>
                        </div>

                        <!-- Predefined Items Box -->
                       
                        <div class="form-check form-switch my-4">

                            <label class="form-check-label" for="sendcopy">Send a copy to the recipients
                                email address?</label>
                            <input class="form-check-input" type="checkbox" role="switch" disabled id="sendcopy" name="sendcopy" <?php if($message['send_copy']==true){ echo 'checked'; } ?> >
                        </div>

                    </div>
                    <div class="custom-toolbar2 px-3 py-2 mt-2">
                        <p class="mb-0 ft8">Message Delivery </p>

                    </div>
                    <div class="form-group">
                        <label>Select when to send the message:</label><br>
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="sendTime" id="immediately"
                                value="immediately" <?php if($message['send_time']=="immediately"){ echo 'checked'; } ?> disabled>
                            <label class="form-check-label" for="immediately">Immediately</label>
                        </div>
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="sendTime" id="specificDate"
                                value="specificDate" <?php if($message['send_time']=="specificDate"){ echo 'checked'; } ?> disabled>
                            <label class="form-check-label" for="specificDate">Specific Date</label>
                        </div>
                    </div>

                    <div id="dateTimePicker" class="form-group" style="display: none;">
                        <label for="datetime">Select Date and Time:</label>
                        <div class='input-group date' id='datetimepicker1'>
                            <input type='datetime-local' readonly class="form-control" id="" value="<?php echo date('Y-m-d\TH:i:s',$message['scheduled_time']); ?>" />

                        </div>
                    </div>



                    <div class="row justify-content-end d-none">
                        <div class="col-md-5 my-2 ">
                            <button type="submit" class="btn savedBtn py-2 w-100">Save Draft</button>
                        </div>
                        <div class="col-md-3 my-2 ">
                            <button type="submit" class="btn sendBtn py-2  w-100">Send </button>
                        </div>

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

    </main>
    <!--end main wrapper-->
