diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-01-30 22:45:15 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-01-30 22:45:15 +0000 |
| commit | 3c87c569eb999a68a07b0e5acc3d79d5aa4e2a3d (patch) | |
| tree | 2057249c4b38f9e3c2f1a828709b107a47bd1002 /library | |
| parent | c29fbe06963fa5611b37f9255f9152f9b044a73e (diff) | |
| download | webtrees-3c87c569eb999a68a07b0e5acc3d79d5aa4e2a3d.tar.gz webtrees-3c87c569eb999a68a07b0e5acc3d79d5aa4e2a3d.tar.bz2 webtrees-3c87c569eb999a68a07b0e5acc3d79d5aa4e2a3d.zip | |
Dashboard
Diffstat (limited to 'library')
| -rw-r--r-- | library/WT/Query/Admin.php | 352 |
1 files changed, 0 insertions, 352 deletions
diff --git a/library/WT/Query/Admin.php b/library/WT/Query/Admin.php deleted file mode 100644 index 1e930f55f0..0000000000 --- a/library/WT/Query/Admin.php +++ /dev/null @@ -1,352 +0,0 @@ -<?php - -/** - * Class WT_Query_Admin - generate statistics for admin.php - * - * @package webtrees - * @copyright (c) 2014 webtrees development team - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 - */ -class WT_Query_Admin { - /** - * Count the number of individuals that have been edited today - * - * @param integer $ged_id - * - * @return string - */ - public static function countIndiChangesToday($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##individuals` ON (gedcom_id=i_file AND i_id=xref)" . - " WHERE status='accepted' AND DATE(change_time)= DATE(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of individuals that have been edited this week - * - * @param integer $ged_id - * - * @return string - */ - public static function countIndiChangesWeek($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##individuals` ON (gedcom_id=i_file AND i_id=xref)" . - " WHERE status='accepted' AND WEEK(change_time,2)= WEEK(NOW(),2) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of individuals that have been edited this month - * - * @param integer $ged_id - * - * @return string - */ - public static function countIndiChangesMonth($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##individuals` ON (gedcom_id=i_file AND i_id=xref)" . - " WHERE status='accepted' AND MONTH(change_time)= MONTH(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of families that have been edited today - * - * @param integer $ged_id - * - * @return string - */ - public static function countFamChangesToday($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##families` ON (gedcom_id=f_file AND f_id=xref)" . - " WHERE status='accepted' AND DATE(change_time)= DATE(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of families that have been edited this week - * - * @param integer $ged_id - * - * @return string - */ - public static function countFamChangesWeek($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##families` ON (gedcom_id=f_file AND f_id=xref)" . - " WHERE status='accepted' AND WEEK(change_time,2)= WEEK(NOW(),2) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of families that have been edited this month - * - * @param integer $ged_id - * - * @return string - */ - public static function countFamChangesMonth($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##families` ON (gedcom_id=f_file AND f_id=xref)" . - " WHERE status='accepted' AND MONTH(change_time)= MONTH(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of sources that have been edited today - * - * @param integer $ged_id - * - * @return string - */ - public static function countSourChangesToday($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##sources` ON (gedcom_id=s_file AND s_id=xref)" . - " WHERE status='accepted' AND DATE(change_time)= DATE(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of sources that have been edited this week - * - * @param integer $ged_id - * - * @return string - */ - public static function countSourChangesWeek($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##sources` ON (gedcom_id=s_file AND s_id=xref)" . - " WHERE status='accepted' AND WEEK(change_time,2)= WEEK(NOW(),2) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of sources that have been edited this month - * - * @param integer $ged_id - * - * @return string - */ - public static function countSourChangesMonth($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##sources` ON (gedcom_id=s_file AND s_id=xref)" . - " WHERE status='accepted' AND MONTH(change_time)= MONTH(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of repositories that have been edited today - * - * @param integer $ged_id - * - * @return string - */ - public static function countRepoChangesToday($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##other` ON (gedcom_id=o_file AND o_id=xref AND o_type='REPO')" . - " WHERE status='accepted' AND DATE(change_time)= DATE(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of repositories that have been edited this week - * - * @param integer $ged_id - * - * @return string - */ - public static function countRepoChangesWeek($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##other` ON (gedcom_id=o_file AND o_id=xref AND o_type='REPO')" . - " WHERE status='accepted' AND WEEK(change_time,2)= WEEK(NOW(),2) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of repositories that have been edited this month - * - * @param integer $ged_id - * - * @return string - */ - public static function countRepoChangesMonth($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##other` ON (gedcom_id=o_file AND o_id=xref AND o_type='REPO')" . - " WHERE status='accepted' AND MONTH(change_time)= MONTH(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of note objects that have been edited today - * - * @param integer $ged_id - * - * @return string - */ - public static function countNoteChangesToday($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##other` ON (gedcom_id=o_file AND o_id=xref AND o_type='NOTE')" . - " WHERE status='accepted' AND DATE(change_time)= DATE(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of note objects that have been edited this week - * - * @param integer $ged_id - * - * @return string - */ - public static function countNoteChangesWeek($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##other` ON (gedcom_id=o_file AND o_id=xref AND o_type='NOTE')" . - " WHERE status='accepted' AND WEEK(change_time,2)= WEEK(NOW(),2) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of note objects that have been edited this month - * - * @param integer $ged_id - * - * @return string - */ - public static function countNoteChangesMonth($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##other` ON (gedcom_id=o_file AND o_id=xref AND o_type='NOTE')" . - " WHERE status='accepted' AND MONTH(change_time)= MONTH(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of media objects that have been edited today - * - * @param integer $ged_id - * - * @return string - */ - public static function countObjeChangesToday($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##media` ON (gedcom_id=m_file AND m_id=xref)" . - " WHERE status='accepted' AND DATE(change_time)= DATE(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of media objects that have been edited this week - * - * @param integer $ged_id - * - * @return string - */ - public static function countObjeChangesWeek($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##media` ON (gedcom_id=m_file AND m_id=xref)" . - " WHERE status='accepted' AND WEEK(change_time,2)= WEEK(NOW(),2) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } - - /** - * Count the number of media objects that have been edited this month - * - * @param integer $ged_id - * - * @return string - */ - public static function countObjeChangesMonth($ged_id) { - return WT_I18N::number( - WT_DB::prepare( - "SELECT count(change_id) FROM `##change`" . - " JOIN `##media` ON (gedcom_id=m_file AND m_id=xref)" . - " WHERE status='accepted' AND MONTH(change_time)= MONTH(NOW()) AND gedcom_id=?" - ) - ->execute(array($ged_id)) - ->fetchOne() - ); - } -} |
