-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_DataSellerHome.php
36 lines (30 loc) · 1.13 KB
/
get_DataSellerHome.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
<?php
include $_SERVER['DOCUMENT_ROOT']."/tokopetra/connect.php";
header('Content-type: application/json');
// Get Complain
$sql = "SELECT * FROM `ulasan` WHERE `rating` <= 2";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$Complain = $stmt->rowCount();
// Get New Order
$sql = "SELECT * FROM `transaksi` WHERE `id_status` = 1";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$NewOrder = $stmt->rowCount();
// Get New Diskusi
$sql = "SELECT * FROM `diskusi` WHERE `id_terbaca` = 1";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$Diskusi = $stmt->rowCount();
// Get New Ulasan
$sql = "SELECT * FROM `ulasan` WHERE `id_terbaca` = 1";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$Ulasan = $stmt->rowCount();
// Get Ready Order
$sql = "SELECT * FROM `transaksi` WHERE `id_status` = 3";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$ReadyOrder = $stmt->rowCount();
echo json_encode(array('varComplain' => $Complain, 'varNewOrder' => $NewOrder, 'varDiskusi' => $Diskusi, 'varUlasan' => $Ulasan, 'varReadyOrder' => $ReadyOrder));
?>