<?php
if (isset($status)) {
    
    switch ($this->session->userdata('alert_message_info')) {

        case'alert_pregnant_delivery_status':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
            case'add_mapping_region_user':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'update_application_right_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'add_application_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'add_region_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;

        case'mapping_app_admin_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'add_admin_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'add_country_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'add_state_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'add_district_message':
            if ($status) {
                ?>
                <div class="alert alert-success fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-country">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>  </div>
                <?php
            }
            break;
        case'application_create_message':
            $message = explode(':', $message);
            if ($status) {
                $application_name = explode(':', $application_name);
                $application_id = explode(':', $application_id);
                ?>
                <div class="alert alert-success fade in mira-application">
                    <a href="#"class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message[0] ?></strong> <?= $message[1] ?></p>
                    <p class="text-center"><strong><?= $application_name[0] . ":" . $application_name[1] ?></strong></p>
                    <p class="text-center"><strong><?= $application_id[0] . ":" . $application_id[1] ?></strong></p>

                </div>   
            <?php } else { ?>
                <div class="alert alert-danger fade in mira-application">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message[0] ?></strong><?= $message[1] ?></p>
                </div>
                <?php
            }
            break;
        case 'login_alert_message':

    $msgArr = (!empty($message) && strpos($message, ':') !== false) 
        ? explode(':', $message) 
        : [$message, ''];

    if ($status) {
?>
        <div class="alert alert-info fade in login-id-password">
            <a href="#" class="close" data-dismiss="alert">&times;</a>
            <p class="text-center">
                <strong><?= $msgArr[0] ?? '' ?></strong> <?= $msgArr[1] ?? '' ?>
            </p>
        </div>
<?php
    } else {
?>
        <div class="alert alert-danger fade in login-id-password">
            <a href="#" class="close" data-dismiss="alert">&times;</a>
            <p class="text-center">
                <strong><?= $msgArr[0] ?? '' ?></strong> <?= $msgArr[1] ?? '' ?>
            </p>
        </div>
<?php
    }
    break;
        case 'success_alert_message':
            if ($status) {
                ?>
                <div class="alert alert-info fade in login-success">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>   
                <?php
            }
            break;
        case 'alert_house_registration':
            if ($status) {
                ?>
                <div class="alert alert-success fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>   
                <?php
            }  else {?>
                <div class="alert alert-danger fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>
           <?php }
            break;
            case 'alert_women_registration':
            if ($status) {
                ?>
                <div class="alert alert-success fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>   
                <?php
            }  else {?>
                <div class="alert alert-danger fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>
           <?php }
            break;
            
            case 'alert_child_registration':
            if ($status) {
                ?>
                <div class="alert alert-success fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>   
                <?php
            }  else {?>
                <div class="alert alert-danger fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>
           <?php }
            break;
            case 'alert_pregnant_registration':
            if ($status) {
                ?>
                <div class="alert alert-success fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>   
                <?php
            }  else {?>
                <div class="alert alert-danger fade in house-registration">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    <p class="text-center"><strong><?= $message ?></strong></p>
                </div>
           <?php }
            break;
            
            
    }
    unset($status);
}
?>
<script type="text/javascript">
    $(document).ready(function () {
        window.setTimeout(function () {
            $('.login-id-password').fadeTo(1500, 0);
            $('.login-id-password').slideUp(500, function () {
                $('.login-id-password').remove();
            });

        }, 4000);
        window.setTimeout(function () {
            $('.house-registration').fadeTo(500, 0);
            $('.house-registration').slideUp(500, function () {
                $('.house-registration').remove();
            });

        }, 1000);
        window.setTimeout(function () {
            $('.login-success').fadeTo(500, 0);
            $('.login-success').slideUp(500, function () {
                $('.login-success').remove();
            });

        }, 10000);
        window.setTimeout(function () {
            $('.mira-application').fadeTo(500, 0);
            $('.mira-application').slideUp(500, function () {
                $('.mira-application').remove();
            });

        }, 4000);
        window.setTimeout(function () {
            $('.mira-country').fadeTo(500, 0);
            $('.mira-country').slideUp(500, function () {
                $('.mira-country').remove();
            });

        }, 4000);
    });
</script>



