-
Notifications
You must be signed in to change notification settings - Fork 0
/
kiriman_pribadi.php
105 lines (52 loc) · 1.81 KB
/
kiriman_pribadi.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
<?PHP
require "koneksi_ke_mysql.php";
require "data_akun_masuk.php";
$db_tabel_kiriman="kiriman_user_publik";
$db_tabel_user="data_user";
$user=$akun["id_user"];
$sort=mysqli_query($link, "SELECT * FROM ".$db_tabel_kiriman." WHERE id_user =".$user." ORDER BY waktu_kiriman DESC");
while ($tampilkan_kiriman=mysqli_fetch_array($sort, MYSQLI_ASSOC))
{
$id_pengirim=$tampilkan_kiriman["id_user"];
$user=mysqli_query($link, "SELECT * FROM ".$db_tabel_user." WHERE id_user=".$id_pengirim.";");
$tampilkan_user=mysqli_fetch_array($user, MYSQLI_ASSOC);
$nama_user=$tampilkan_user["nama_lengkap"];
$foto_profil_user=$tampilkan_user["foto_profil"];
$foto_kiriman=$tampilkan_kiriman["foto_kiriman"];
if (strlen($foto_kiriman) > 1) //KALAU ADA FOTONYA
{
$direktori_foto_kiriman="images/kiriman/";
$foto_kiriman=
"<img src='".$direktori_foto_kiriman.$foto_kiriman."' style='max-width:100%; max-height:500px;'/><br><br>";
}
else
{
$foto_kiriman="";
}
echo
"<div class='isi_konten'>"
."<div class='header_content'>"
."<div class='nama_pengirim'>"
."<img src='images/profile_pic/".$foto_profil_user."' style='width:40px; height:40px'/> "
.$nama_user
."</div>"
."<div class='waktu_konten'>"
.$tampilkan_kiriman["waktu_kiriman"]." WITA"
."</div>"
."<div style='clear:both'>"
."</div>"
."</div>"
."<div class='center_content'>"
."<div class='pesan_konten'>"
."<div class='foto_kiriman'>"
.$foto_kiriman
."</div>"
."<pre>"
.$tampilkan_kiriman["isi_kiriman"]
."</pre>"
."</div>"
."<a href='hapus_kiriman.php?kiriman=".$tampilkan_kiriman["id_kiriman"]."'>Hapus kiriman</a>"
."</div>"
."</div>";
}
?>