-
Notifications
You must be signed in to change notification settings - Fork 11
/
connect.php
41 lines (33 loc) · 1.35 KB
/
connect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$db_host = "localhost";
$db_user = "root";
$db_pass = "";
$db_database = "ems";
include "idiorm.php";
/* End config */
ORM::configure("mysql:host=".$db_host.";dbname=".$db_database);
ORM::configure("username",$db_user);
ORM::configure("password",$db_pass);
$db = new PDO("mysql:host=".$db_host.";dbname=".$db_database, $db_user, $db_pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn = mysqli_connect($db_host, $db_user,$db_pass);
mysqli_select_db($conn, $db_database);
$mysqli = new mysqli;
class App {
public static function message($type,$message,$code=''){
if($type=='error'){
return '<div class="alert alert-danger alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
'.$message.' <a class="alert-link" href="#">'.$code.'</a>.
</div>';
}else{
return '<div class="alert alert-success alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
'.$message.' <a class="alert-link" href="#">'.$code.'</a>.
</div>';
}
}
}
function get($val){
return @$_GET[$val];
}