'.__('You don\'t have enough privileges to access this area!').''); } /* loan report */ $table = new simbio_table(); $table->table_attr = 'align="center" class="border" cellpadding="5" cellspacing="0"'; // total number of member $report_q = $dbs->query('SELECT COUNT(member_id) FROM member'); $report_d = $report_q->fetch_row(); $loan_report[__('Total Registered Members')] = $report_d[0]; // total number of active member $report_q = $dbs->query('SELECT COUNT(member_id) FROM member WHERE TO_DAYS(expire_date)>TO_DAYS(\''.date('Y-m-d').'\')'); $report_d = $report_q->fetch_row(); $loan_report[__('Total Active Member')] = $report_d[0]; // total number of active member by membership type $report_q = $dbs->query('SELECT member_type_name, COUNT(member_id) FROM mst_member_type AS mt LEFT JOIN member AS m ON mt.member_type_id=m.member_type_id WHERE TO_DAYS(expire_date)>TO_DAYS(\''.date('Y-m-d').'\') GROUP BY m.member_type_id ORDER BY COUNT(member_id) DESC'); $report_d = '
';; while ($data = $report_q->fetch_row()) { $report_d .= ''.$data[0].' : '.$data[1].', '; } $loan_report[__('Total Members By Membership Type')] = $report_d; // total expired member $report_q = $dbs->query('SELECT COUNT(member_id) FROM member WHERE TO_DAYS(\''.date('Y-m-d').'\')>TO_DAYS(expire_date)'); $report_d = $report_q->fetch_row(); $loan_report[__('Total Expired Member')] = $report_d[0]; // 10 most active member $report_q = $dbs->query('SELECT m.member_name, m.member_id, COUNT(loan_id) FROM loan AS l INNER JOIN member AS m ON m.member_id=l.member_id WHERE TO_DAYS(expire_date)>TO_DAYS(\''.date('Y-m-d').'\') GROUP BY l.member_id ORDER BY COUNT(loan_id) DESC LIMIT 10'); $report_d = '