File "bootstrap_alert_fonctions.php"
Full Path: /home/analogde/www/Design/fileman/Fusion/PROD/bootstrap_alert_fonctions.php
File size: 3.04 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* Create a bootstrap success alert
* @param String $bold - First words in the alert. Will be put inside <strong> html tag for emphasis
* @param String $message - What will be used for the main description in the alert
*/
function successAlert($bold, $message){
echo '<div class="container">
<div class="alert alert-success fade in">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>'.$bold.'</strong> '.$message.'
</div>
</div>';
}
/**
* Create a bootstrap danger alert
* @param String $bold - First words in the alert. Will be put inside <strong> html tag for emphasis
* @param String $message - What will be used for the main description in the alert
*/
function dangerAlert($bold, $message){
echo '<div class="container">
<div class="alert alert-danger fade in">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>'.$bold.'</strong> '.$message.'
</div>
</div>';
}
/**
* Create a bootstrap info alert
* @param String $bold - First words in the alert. Will be put inside <strong> html tag for emphasis
* @param String $message - What will be used for the main description in the alert
*/
function infoAlert($bold, $message){
echo '<div class="container">
<div class="alert alert-info fade in">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>'.$bold.'</strong> '.$message.'
</div>
</div>';
}
/**
* Create a bootstrap warning alert
* @param String $bold - First words in the alert. Will be put inside <strong> html tag for emphasis
* @param String $message - What will be used for the main description in the alert
*/
function warningAlert($bold, $message){
echo '<div class="container">
<div class="alert alert-warning fade in">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>'.$bold.'</strong> '.$message.'
</div>
</div>';
}
?>
<html>
<head>
<title>Bootstrap Alert PHP</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Alerts</h2>
<!-- Just call the alert function you need and send in two strings - the alert header and the alert message -->
<?php
successAlert("Success!","This is a Bootstrap success alert");
infoAlert("Info!","This is a Bootstrap info alert");
warningAlert("Warning!","This is a Bootstrap warning alert");
dangerAlert("Danger!","This is a Bootstrap danger alert");
?>
</body>
</html>