-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetail_kucing.php
149 lines (124 loc) · 4.81 KB
/
detail_kucing.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 'layout/header.php'; ?>
<div class="page-header d-print-none">
<div class="row align-items-center">
<div class="col">
<!-- Page pre-title -->
<h2 class="page-title">
Detail Kucing
</h2>
<div class="page-pretitle">
Ketahui detail kucing yang akan diadopsi
</div>
</div>
<!-- Page title actions -->
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<span class="d-none d-sm-inline">
<a href="cari_kucing.php" class="btn btn-white">
Kembali
</a>
</span>
</div>
</div>
</div>
</div>
<?php
$query = mysqli_query($koneksi, "SELECT kucing.*, user.nama, user.email FROM kucing JOIN user ON user.id = kucing.user_id WHERE is_adopted = '0' AND status = 'acc' AND kucing.id='".$_GET['id']."'") or die(mysqli_error($koneksi));
$kucing = mysqli_fetch_assoc($query);
if(isset($_SESSION['login'])){
$query = mysqli_query($koneksi, "SELECT * FROM adopsi WHERE kucing_id='".$_GET['id']."' AND user_id='".$_SESSION['login_data']['id']."'");
$adopsi = mysqli_fetch_assoc($query);
}
?>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<?php
if(isset($_SESSION['alert'])){
echo $_SESSION['alert'];
unset($_SESSION['alert']);
}
?>
<center>
<img src="adopt_img/<?= $kucing['foto'] ?>" class="img-fluid" style="width: 50%">
</center>
<div class="card-footer mt-3 mb-4">
<div class="row">
<div class="col-md-8">
<span style="font-size:18px"><b><?= $kucing['judul_iklan'] ?></b></span>
</div>
<div class="col-md-4">
<div class="avatar-list avatar-list-stacked" style="float: right">
<span class="avatar avatar-sm avatar-rounded" style="background-image: url(assets/img/paw.jpg)"></span> <span class="mt-1">  <?= $kucing['nama'] ?></span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<h3>Informasi</h3>
<table class="table">
<tr>
<td>Nama</td>
<th class="text-right"><?= $kucing['nama_kucing'] ?></th>
</tr>
<tr>
<td>Jenis</td>
<th class="text-right"><?= $kucing['jenis'] ?></th>
</tr>
<tr>
<td>Umur</td>
<th class="text-right"><?= $kucing['umur'] ?></th>
</tr>
<tr>
<td>Jenis Kelamin</td>
<th class="text-right"><?= $kucing['jenis_kelamin'] ?></th>
</tr>
<tr class="bg-light">
<th colspan="2" class="text-center">
<?php if(isset($_SESSION['login'])){ ?>
<?php if(!empty($adopsi)){ ?>
<h4 class="text-danger">Anda sudah melakukan request adopsi</h4>
<?php }else{ ?>
<a href="#" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modal-simple">ADOPSI SEKARANG</a>
<?php } ?>
<?php }else{ ?>
<h4 class="text-danger">Silahkan Login untuk melakukan adopsi</h4>
<?php } ?>
</th>
</tr>
</table>
</div>
<div class="col-md-8">
<h3>Keterangan</h3>
<p><?= $kucing['deskripsi'] ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'layout/footer.php'; ?>
<form method="POST" action="proses/kucing_request_adopsi.php?id=<?= $kucing['id'] ?>" enctype="multipart/form-data">
<div class="modal modal-blur fade" id="modal-simple" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Request Adopsi</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Alasan Adopsi</label>
<textarea class="form-control" required="" name="alasan_adopsi" placeholder="Ketikkan alasan pengadopsian kucing ini"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn me-auto" data-bs-dismiss="modal">Close</button>
<button class="btn btn-primary">Simpan</button>
</div>
</div>
</div>
</div>
</form>