-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
149 lines (138 loc) · 3.95 KB
/
index.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
include('connector.php');
include('form.php');
$table='info';
$db_name='contacts';
$conector= new DatabaseManager();
$conector->SelectDB($db_name);
$result=$conector->Read($table);
if(isset($_POST['firstname'])&&!empty($_POST['firstname'])){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$address = $_POST['address'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$isfriend = $_POST['isfriend'];
$conector->Insert($table,$firstname,$lastname,$phone,$email,$address,$city,$zip,$isfriend);
}
?>
<html>
<head>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js">< </script>
<script src="js/ui-bootstrap-tpls-0.11.0.min.js"></script>
<link href="css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="css/bootstrap.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
$(function(){
$('table').on('click','tr a',function(e){
e.preventDefault();
$(this).parents('tr').remove();
var id=$(this).parents('tr').attr('id');
});
});
</script>
<style>
table {
width:100%;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
table#t01 tr:nth-child(even) {
background-color: #eee;
}
table#t01 tr:nth-child(odd) {
background-color:#fff;
}
table#t01 th {
background-color: black;
color: white;
}
</style>
</head>
<body>
<nav class="navbar navbar" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src="images/widelogo.png" style="margin-top:none;float:center;width:30px;height:30px"/> Directory</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Setting<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#" data-toggle="modal" data-target="#adduser">New User</a></li>
<li class="divider"></li>
<li><a href="#" data-toggle="modal" data-target="#database">Refresh</a></li>
</ul>
</li>
<li><a href="#">About</a></li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Search <span class="glyphicon glyphicon-search"></span></button>
</form>
</div><!-- /.navbar-collapse -->
<div id="wrapper">
<table>
<tr>
<th>Action</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone</th>
<th>Email</th>
<th>Address</th>
<th>City</th>
<th>Zip</th>
<th>Is Friend</th>
</tr>
<?php
$id=0;
while($row = mysql_fetch_array($result)){
$firstname=$row['FirstName'];
$lastname=$row['LastName'];
$phone=$row['Phone'];
$email=$row['Email'];
$address=$row['Address'];
$city=$row['City'];
$zip=$row['Zip'];
$isfriend=$row['IsFriend'];
echo "<tr id=".$id.">
<td><a class=\"del\" href=\"#\">del</a><a href=\"#\">edit</a></td>
<td>".$firstname."</td>
<td>".$lastname."</td>
<td>".$phone."</td>
<td>".$email."</td>
<td>".$address."</td>
<td>".$city."</td>
<td>".$zip."</td>
<td>".$isfriend."</td></tr>";
$id++;
}
?>
</table>
</div>
<p><br/></p>
</div><!-- /.container-fluid -->
</nav>
</body>
</html>