diff --git a/src/admin/api/dashboard.php b/src/admin/api/dashboard.php new file mode 100644 index 0000000..d5cdca8 --- /dev/null +++ b/src/admin/api/dashboard.php @@ -0,0 +1,36 @@ +count('clients', array('client_status' => 1)); + $count_clients = $DB->count('clients'); + $count_account = $DB->count('account', array('account_status' => 1)); + $count_accounts = $DB->count('account'); + $count_ssl = $DB->count('ssl'); + $count_ssls = $DB->count('ssl'); + $count_ticket = $DB->count('tickets', "`ticket_status`=0 OR `ticket_status`=2"); + $count_tickets = $DB->count('tickets'); + + $result = [ + "count_client" => $count_client, + "count_clients" => $count_clients, + "count_account" => $count_account, + "count_accounts" => $count_accounts, + "count_ssl" => $count_ssl, + "count_ssls" => $count_ssls, + "count_ticket" => $count_ticket, + "count_tickets" => $count_tickets + ]; + send_response(0, $result); + break; + default: + send_response(-4, null, 'No Act'); + break; +} diff --git a/src/admin/api/emails.php b/src/admin/api/emails.php new file mode 100755 index 0000000..05745de --- /dev/null +++ b/src/admin/api/emails.php @@ -0,0 +1,63 @@ + 0) { + $row = $DB->find('emails', '*', array('email_id' => $email_id), null, 1); + } else { + $row = null; + } + + if (!$row) send_response(-1, null, '记录不存在'); + send_response(0, $row); + break; + case 'list': + $where = " 1=1"; + $email_id = intval(post('email_id')); + $email_client_id = post('email_client_id'); + $email_subject = post('email_subject'); + $email_to = post('email_to'); + + if (!empty($email_id)) { + $where .= " AND `email_id`='{$email_id}'"; + } + if (!empty($email_client_id)) { + $where .= " AND `email_client_id`='{$email_client_id}'"; + } + if (!empty($email_subject)) { + $where .= " AND `email_subject` like '%{$email_subject}%'"; + } + if (!empty($email_to)) { + $where .= " AND `email_to` like '%{$email_to}%'"; + } + + $offset = intval(post('offset', 0)); + $limit = intval(post('limit', 10)); + $total = $DB->count('emails', $where); + + if ($total > 0) { + $rows = $DB->findAll('emails', 'email_id,email_client_id,email_subject,email_date,email_to,email_read', $where, "`email_id` DESC", "$offset,$limit"); + } else { + $rows = array(); + } + + // send_response(0, array('total' => $total, 'rows' => $rows)); + exit(json_encode(array('code' => 0, 'rows' => $rows, 'total' => $total))); + break; + default: + send_response(-4, null, 'No Act'); + break; +} diff --git a/src/admin/application.php b/src/admin/application.php index 0d0511b..79786b9 100755 --- a/src/admin/application.php +++ b/src/admin/application.php @@ -1,4 +1,7 @@ find('account', '*', array('account_id' => $account_id), null, 1); + +if (empty($AccountInfo)) { + setMessage('not found', 'danger'); + redirect('admin/accounts'); +} + +$PageInfo['title'] = 'Account Domains'; + +$AccountDomainList = $DB->findAll('account_domain', '*', array('domain_account_id' => $account_id)); diff --git a/src/admin/controllers/dashboard/view.php b/src/admin/controllers/dashboard/view.php index abcdc75..94e0342 100755 --- a/src/admin/controllers/dashboard/view.php +++ b/src/admin/controllers/dashboard/view.php @@ -1,14 +1,6 @@ count('clients', array('client_status' => 1)); -$count_clients = $DB->count('clients'); -$count_account = $DB->count('account', array('account_status' => 1)); -$count_accounts = $DB->count('account'); -$count_ssl = $DB->count('ssl'); -$count_ssls = $DB->count('ssl'); -$count_ticket = $DB->count('tickets', "`ticket_status`=0 OR `ticket_status`=2"); -$count_tickets = $DB->count('tickets'); $date = date("Y-m-d H:i:s"); $mysqlversion = $DB->getColumn("select VERSION()"); diff --git a/src/admin/emails.php b/src/admin/emails.php index 82f5f69..342638d 100755 --- a/src/admin/emails.php +++ b/src/admin/emails.php @@ -9,8 +9,4 @@ if (!in_array($action, array('list', 'view'))) { } require __DIR__ . '/controllers/emails/' . $action . '.php'; -require __DIR__ . '/views/header.php'; -require __DIR__ . '/views/navbar.php'; -require __DIR__ . '/views/sidebar.php'; require __DIR__ . '/views/emails/' . $action . '.php'; -require __DIR__ . '/views/footer.php'; diff --git a/src/admin/index.php b/src/admin/index.php index 5bf64c1..eca64f4 100755 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -2,8 +2,4 @@ require_once __DIR__ . '/application.php'; require_once __DIR__ . '/controllers/dashboard/view.php'; -require_once __DIR__ . '/views/header.php'; -require_once __DIR__ . '/views/navbar.php'; -require_once __DIR__ . '/views/sidebar.php'; require_once __DIR__ . '/views/dashboard/view.php'; -require_once __DIR__ . '/views/footer.php'; diff --git a/src/admin/views/accounts/list.php b/src/admin/views/accounts/list.php index 73612f7..2864afb 100755 --- a/src/admin/views/accounts/list.php +++ b/src/admin/views/accounts/list.php @@ -31,8 +31,16 @@ 0): ?>