49 lines
1.6 KiB
PHP
Executable File
49 lines
1.6 KiB
PHP
Executable File
<?php
|
||
|
||
if (!function_exists('show_alert')) {
|
||
function show_alert($type, $content) {
|
||
$icon = '';
|
||
$class = '';
|
||
switch ($type) {
|
||
case 'success':
|
||
$icon = ' <i class="fa fa-check"></i> ';
|
||
$class = ' alert-success';
|
||
break;
|
||
case 'warning':
|
||
$icon = '<i class="fa fa-warning"></i> ';
|
||
$class = ' alert-danger';
|
||
break;
|
||
case 'danger':
|
||
$icon = '<i class="fa-exclamation"></i> ';
|
||
$class = ' alert-danger';
|
||
break;
|
||
case 'info':
|
||
$icon = '<i class="fa fa-info-circle"></i> ';
|
||
$class = ' alert-info';
|
||
break;
|
||
case 'error':
|
||
$icon = '<i class="fa fa-times-circle"></i> ';
|
||
$class = ' alert-error ';
|
||
break;
|
||
case 'question' :
|
||
$icon = '<i class="fa fa-question"></i> ';
|
||
$class = ' alert-info';
|
||
break;
|
||
default:
|
||
$icon = '<i class="fa fa-comment"></i> ';
|
||
$class = ' alert-info';
|
||
break;
|
||
}
|
||
|
||
$html = '
|
||
<div class="col-md-4 col-md-offset-8">
|
||
<div class="alert ' . $class . ' alert-dismissable">
|
||
' . $icon . '
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
' . $content . '
|
||
</div>
|
||
</div>';
|
||
|
||
return $html;
|
||
}
|
||
} |