-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetowner.php
161 lines (141 loc) · 6.17 KB
/
petowner.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
150
151
152
153
154
155
156
157
158
159
160
161
<!doctype html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Petowner Information</title>
<!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function() {
$( "#accordion" ).accordion({
active: false,
collapsible: true,
heightStyle: "content",
});
if(document.cookie=="")
{
alert("Please login to your account");
window.location='./login.html';
}
else
{
var strCookie=document.cookie;
//将多cookie切割为多个名/值对
var arrCookie=strCookie.split("; ");
var arrCookieUserName= arrCookie[0].split("=");
var arrCookieUserAuthority= arrCookie[1].split("=");
var UserName=arrCookieUserName[1];
var UserAuthority=arrCookieUserAuthority[1];
//alert(UserName+UserAuthority);
$("#name").text("Welcome "+UserName);
};
if(UserAuthority=="doctor")
{
$(".edit2").hide();
}
else
{
$(".edit2").show();
}
});
</script>
<!-- Style Sheet-->
<link href="http://fonts.googleapis.com/css?family=Dosis:200,300,400,500,600,700,800" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/petowner.css" />
</head>
<body>
<div class="container">
<!--SIDEBAR-->
<aside id="sidebar">
<!--logo-->
<p id="name" style="color:white;font-size:20px;margin-left:40px;margin-top:60px;"></p>
<a href="#" class="logo"><img src="pic/logo2.png" alt="logo" /></a>
<!--main-menu-->
<nav class="main-nav">
<ul>
<li><a href="homepage.html">Homepage</a></li>
<li><a href="clinicinfohomepage.php">Clinic Info</a></li>
<li><a href="petview.php?page=1">Pet Info</a></li>
<li class="active"><a href="petowner.php">Petowner Info</a></li>
<li><a href="appointmentinfo.html">Appointment Info</a></li>
<li><a href="treatmentinfo.php?page=1">Treatment Info</a></li>
<li><a href="treatmentrecord.php">Treatment Record</a></li>
<li><a href="staffinfo.php">Staff Info</a></li>
</ul>
</nav>
</aside>
<!--CONTENT-->
<section id="content">
<!--header-->
<header>
<h1>Petowner Information</h1>
</header>
<!--main-->
<div class="main">
<?php
error_reporting(0);
$con = mysql_connect('localhost', 'root');
//these are the aforementioned vars
$db = mysql_select_db('399lovelypets');
//if($con){
//echo 'Successfully connected to the database';
//}
//else{
// die('Error.');
//}
?>
<div id="accordion">
<?php
$query = mysql_query("SELECT * FROM petowner");
while($row = mysql_fetch_array($query)){
$id = $row['PetOwnerID'];
$name = $row['PetOwnerName'];
$title = $row['PetOwnerGender'];
$num = $row['PetOwnerPhoneNumber'];
$email= $row['PetOwnerEmailAddress'];
$address = $row['PetOwnerHomeAddress'];
?>
<h3><?php echo $title . " " . $name;?><br><span>Moble:</span><?php echo $num;?><br><span>Address:</span><?php echo $address;?>
<br><span>Email: </span><?php echo $email;?></h3>
<div class="contain">
<form action="petownerinfo_edit.php" method="POST">
<input type='submit' style='float:right; background:url(pic/edit.png); width:20px; height:20px; border:none; text-indent:-9999px; cursor:pointer;' class='edit2' name='dosubmit' value='<?php echo $row['PetOwnerID'];?>' />
</form>
<p><strong><u><a href="petview.php?page=1">Pets Information</a></u></strong><br>
<?php $query2 = mysql_query("SELECT * FROM pet WHERE PetOwnerID = '$id'");
while ($row = mysql_fetch_array($query2)){
$pname = $row['PetName'];
$pspecies = $row['PetSpecies'];
$pgender = $row['PetGender'];
$pclinic = $row['ClinicID'];
$pdescription = $row['PetDescription'];
$page = $row['PetAge'];
$pen = $row['PenID'];
$petc = $row['PetCondition'];
?>
<span>Name:</span> <?php echo $pname;?><br>
<span>Species:</span> <?php echo $pspecies;?><br>
<span>Gender:</span> <?php echo $pgender;?><br>
<span>Age:</span> <?php echo $page;?><br>
<span>Description:</span> <?php echo $pdescription;?><br>
<span>PenID:</span> <?php echo $pen;?><br>
<span>Condition:</span> <?php echo $petc;?><br>
<br></p>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
</section>
</div>
</body>
</html>