<?php
if ($send_invitation_tab == 'anonymous') {
    if(isset($anonymous_invitation['invitation']) && !empty($anonymous_invitation['invitation'])){
        foreach ($anonymous_invitation['invitation'] as $invitation){
    ?>
            <div class="col-sm-12 gray">
                <div class="col-sm-1">
                    <span id="pending<?php echo $invitation->invitation_id; ?>" 
                          style="display :<?php echo ($invitation->invitation_user_number > 0) ? 'block' : 'none'?>" 
                          title="Pending"><i class="fa fa-clock-o green"></i></span>
                    <span id="processing<?php echo $invitation->invitation_id; ?>" title="Processing" style="display: none"><i class="fa fa-spinner fa-spin green"></i></span>
                    <span id="sent<?php echo $invitation->invitation_id;?>" 
                          style="display : <?php echo ($invitation->invitation_user_number == 0) ? 'block' : 'none'?>" 
                          title="Sent"><i class="fa fa-check-circle green"></i></span>
                </div>
                <div class="col-sm-3">TT-Admin</div>
                <div class="col-sm-2" id="invitation_user_number<?php echo $invitation->invitation_id; ?>"><?php echo $invitation->invitation_user_number; ?></div>
                <input type="hidden" id="total_invitation_user_number<?php echo $invitation->invitation_id; ?>" value="<?php echo $invitation->invitation_user_number; ?>">
                <div class="col-sm-2" id="sent_invitation_user_number<?php echo $invitation->invitation_id; ?>"><?php echo $anonymous_invitation['invitation_receive_person']['invitation_sent'][$invitation->invitation_id]; ?></div>
                <div class="col-sm-2"><?php echo $invitation->invitation_sent_date; ?></div>
                <div class="col-sm-2">
                    <a href="<?php echo base_url().'send-video-course-invitation-user-list/'.$invitation->invitation_id; ?>">
                        <i class="fa fa-users" title="Member List"></i>
                    </a>&nbsp;
                    <?php if($invitation->invitation_user_number != 0){ ?>
                    <a href="javascript:void(0)" id="send_invitation<?php echo $invitation->invitation_id; ?>" onclick="sendInvitation('<?php echo base_url() . 'send-invitation'; ?>','<?php echo $invitation->invitation_id; ?>')">
                        <i class="fa fa-paper-plane" title="Send"></i>
                    </a>&nbsp;
                    <?php } ?>
                </div>
            </div>
        <?php 
        }
        echo $anonymous_invitation['anonymous_view_video_course_invitation_pagination'];
    }
    else{ 
    ?>
        <center><p>You have no mail to send currently !!!</p></center> 
    <?php 
    } 
}
?>



<?php
if ($send_invitation_tab == 'user') {
    if(isset($user_invitation['invitation']) && !empty($user_invitation['invitation'])){
        foreach ($user_invitation['invitation'] as $invitation){
        ?>
            <div class="col-sm-12 gray">
                <div class="col-sm-1">
                    <span id="pending<?php echo $invitation->invitation_id; ?>" 
                          style="display :<?php echo ($invitation->invitation_user_number > 0) ? 'block' : 'none'?>" 
                          title="Pending"><i class="fa fa-clock-o green"></i></span>
                    <span id="processing<?php echo $invitation->invitation_id; ?>" title="Processing" style="display: none"><i class="fa fa-spinner fa-spin green"></i></span>
                    <span id="sent<?php echo $invitation->invitation_id;?>" 
                          style="display : <?php echo ($invitation->invitation_user_number == 0) ? 'block' : 'none'?>" 
                          title="Sent"><i class="fa fa-check-circle green"></i></span>
                </div>
                <div class="col-sm-3"><?php 
                    if ($invitation->invitation_send_type == 2){
                        echo 'TT';
                    }
                    if ($invitation->invitation_send_type == 3){
                        echo 'Individual';
                    }
                    if ($invitation->invitation_send_type == 4){
                        echo 'Groups';
                    }
                ?>
                </div>
                <div class="col-sm-2" id="invitation_user_number<?php echo $invitation->invitation_id; ?>"><?php echo $invitation->invitation_user_number; ?></div>
                <input type="hidden" id="total_invitation_user_number<?php echo $invitation->invitation_id; ?>" value="<?php echo $invitation->invitation_user_number; ?>">
                <div class="col-sm-2" id="sent_invitation_user_number<?php echo $invitation->invitation_id; ?>"><?php echo $user_invitation['invitation_receive_person']['invitation_sent'][$invitation->invitation_id]; ?></div>
                <div class="col-sm-2"><?php echo $invitation->invitation_sent_date; ?></div>
                <div class="col-sm-2">
                    <a href="<?php echo base_url() . 'send-video-course-invitation-user-list/'.$invitation->invitation_id;?>">
                        <i class="fa fa-users" title="Member List"></i>
                    </a>&nbsp;
                    <?php if($invitation->invitation_user_number != 0){ ?>
                    <a href="javascript:void(0)" id="send_invitation" onclick="sendInvitation('<?php echo base_url() . 'send-invitation';?>', '<?php echo $invitation->invitation_id; ?>')">
                        <i class="fa fa-paper-plane" title="Send"></i>
                    </a>&nbsp;
                <?php } ?>
                </div>
            </div>
    <?php 
        }
        echo $user_invitation['user_view_video_course_invitation_pagination'];
    }
    else{ 
    ?>
        <center><p>You have no user mail to send currently !!!</p></center> 
    <?php 
    } 
}
?>
                    