array(
'controller' => 'plugin_tk_admin_ui',
'path' => null,
'ui' => 'plugin_tk_admin_form_ui',
'uipath' => null
),
'score' => array(
'controller' => 'tk_Score_ui',
'path' => null,
'ui' => 'tk_Score_form_ui',
'uipath' => null
),
'pending' => array(
'controller' => 'tk_Pending_ui',
'path' => null,
'ui' => 'tk_Pending_form_ui',
'uipath' => null
),
'report' => array(
'controller' => 'tk_Report_ui',
'path' => null,
'ui' => 'tk_Report_form_ui',
'uipath' => null
),
'reportold' => array(
'controller' => 'tk_Reportold_ui',
'path' => null,
'ui' => 'tk_Reportold_form_ui',
'uipath' => null
),
'wordlist' => array(
'controller' => 'tk_Wordlist_ui',
'path' => null,
'ui' => 'tk_Wordlist_form_ui',
'uipath' => null
),
'geography' => array(
'controller' => 'tk_geography_ui',
'path' => null,
'ui' => 'tk_geography_form_ui',
'uipath' => null
),
);
protected $adminMenu = array(
'main/list' => array('caption' => 'List Questions', 'perm' => '0'),
'main/create' => array('caption' => LAN_CREATE, 'perm' => '0'),
'other0' => array('divider' => true),
//'subjects/list' => array('caption'=> 'List Subjects', 'perm' => '0'),
//'subjects/create' => array('caption'=> 'Add Subjects', 'perm' => '0'),
//'other1' => array('divider' => true),
'Score/list' => array('caption' => 'List Score', 'perm' => '0'),
'other2' => array('divider' => true),
'Pending/list' => array('caption' => 'List Pending', 'perm' => '0'),
'other3' => array('divider' => true),
'Report/list' => array('caption' => 'List Report', 'perm' => '0'),
'Reportold/list' => array('caption' => 'List Report (Old)', 'perm' => '0'),
'other4' => array('divider' => true),
'Wordlist/list' => array('caption' => 'Spelling Words', 'perm' => '0'),
'Wordlist/create' => array('caption' => 'Add Words', 'perm' => '0'),
'Wordlist/custom' => array('caption' => 'Spelling Score', 'perm' => '0'),
'other5' => array('divider' => true),
'Geography/list' => array('caption' => 'Geography', 'perm' => '0'),
);
protected $adminMenuAliases = array(
'main/edit' => 'main/list'
);
protected $menuTitle = 'TimeKeeper';
}
/*
=========================================================================
===== Questions table interface
=========================================================================
*/
class plugin_tk_admin_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'timekeeperQuestions';
protected $pid = 'timekeeper_id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'timekeeper_id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_questiondescription' => array('title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_question' => array('title' => "Question", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_answers' => array('title' => "Answers", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_subject' => array('title' => "Subject", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_addeddatestamp' => array('title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly' => true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_yearlevel' => array('title' => "Year Level", 'type' => 'dropdown', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array('optArray' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)), 'class' => 'left', 'thclass' => 'left',),
'timekeeper_correctanswer' => array('title' => "Correct Answer", 'type' => 'number', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'timekeeper_questiondescription', 'timekeeper_question', 'timekeeper_answers', 'timekeeper_correctanswer', 'timekeeper_yearlevel', 'options');
}
class plugin_tk_admin_form_ui extends e_admin_form_ui {
}
/*
=========================================================================
===== Score table interface
=========================================================================
*/
class tk_Score_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'timekeeperScore';
protected $pid = 'timekeeper_id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'timekeeper_id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_username' => array('title' => "User Name", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_lifetimequestions' => array('title' => "life time Question", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_lifetimecorrect' => array('title' => "life time correct", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_minutes' => array('title' => "minutes", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_lastquestiondatestamp' => array('title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly' => true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_yearlevel' => array('title' => "Year Level", 'type' => 'dropdown', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array('optArray' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)), 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'timekeeper_username', 'timekeeper_lifetimequestions', 'timekeeper_lifetimecorrect', 'timekeeper_minutes', 'options');
/*
protected $prefs = array(
'rss_othernews' => array('title'=> RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
'rss_summarydiz' => array('title'=> RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
'rss_shownewsimage' => array('title'=> RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
);
*/
}
class tk_Score_form_ui extends e_admin_form_ui {
// Custom Method/Function
function rss_url3($curVal, $mode) {
switch ($mode) {
case 'read': // List Page
$type = $this->getController()->getListModel()->get('rss_type');
$topic = $this->getController()->getListModel()->get('rss_topicid');
$link = e107::url('rss_menu', 'rss', array('rss_type' => $type, 'rss_url' => $curVal, 'rss_topicid' => $topic));
return "" . $curVal . "";
case 'write': // Edit Page
$link = SITEURL . "feed/"; // e107::url('rss_menu','index').'/';
return "
" . $link . e107::getForm()->text('rss_url', $curVal, 255, 'size=small') . "/rss/{Topic id}
";
case 'filter':
case 'batch':
return null;
}
}
}
/*
=========================================================================
===== Pending table interface
=========================================================================
*/
class tk_Pending_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'Pending';
protected $pid = 'timekeeper_id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'timekeeper_id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_questiondescription' => array('title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_question' => array('title' => "Question", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_answers' => array('title' => "Answers", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_subject' => array('title' => "Subject", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_addeddatestamp' => array('title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly' => true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_yearlevel' => array('title' => "Year Level", 'type' => 'dropdown', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array('optArray' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)), 'class' => 'left', 'thclass' => 'left',),
'timekeeper_correctanswer' => array('title' => "Correct Answer", 'type' => 'number', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'timekeeper_questiondescription', 'timekeeper_question', 'timekeeper_answers', 'timekeeper_correctanswer', 'timekeeper_yearlevel', 'options');
/*
protected $prefs = array(
'rss_othernews' => array('title'=> RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
'rss_summarydiz' => array('title'=> RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
'rss_shownewsimage' => array('title'=> RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
);
*/
}
class tk_Pending_form_ui extends e_admin_form_ui {
// Custom Method/Function
function rss_url4($curVal, $mode) {
switch ($mode) {
case 'read': // List Page
$type = $this->getController()->getListModel()->get('rss_type');
$topic = $this->getController()->getListModel()->get('rss_topicid');
$link = e107::url('rss_menu', 'rss', array('rss_type' => $type, 'rss_url' => $curVal, 'rss_topicid' => $topic));
return "" . $curVal . "";
case 'write': // Edit Page
$link = SITEURL . "feed/"; // e107::url('rss_menu','index').'/';
return "" . $link . e107::getForm()->text('rss_url', $curVal, 255, 'size=small') . "/rss/{Topic id}
";
case 'filter':
case 'batch':
return null;
}
}
}
/*
=========================================================================
===== Report table interface
=========================================================================
*/
class tk_Report_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'tkReport';
protected $pid = 'id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'username' => array('title' => "User Name", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'question' => array('title' => "Question", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'userAnswer' => array('title' => "User Answer", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'answer' => array('title' => "Correct Answer", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'subject' => array('title' => "Subject", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'answereddatestamp' => array('title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly' => true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'correct' => array('title' => "Correct", 'type' => 'bool', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'username', 'question', 'userAnswer', 'answer', 'options');
/*
protected $prefs = array(
'rss_othernews' => array('title'=> RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
'rss_summarydiz' => array('title'=> RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
'rss_shownewsimage' => array('title'=> RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
);
*/
}
class tk_Report_form_ui extends e_admin_form_ui {
// Custom Method/Function
function rss_url5($curVal, $mode) {
switch ($mode) {
case 'read': // List Page
$type = $this->getController()->getListModel()->get('rss_type');
$topic = $this->getController()->getListModel()->get('rss_topicid');
$link = e107::url('rss_menu', 'rss', array('rss_type' => $type, 'rss_url' => $curVal, 'rss_topicid' => $topic));
return "" . $curVal . "";
case 'write': // Edit Page
$link = SITEURL . "feed/"; // e107::url('rss_menu','index').'/';
return "" . $link . e107::getForm()->text('rss_url', $curVal, 255, 'size=small') . "/rss/{Topic id}
";
case 'filter':
case 'batch':
return null;
}
}
}
class tk_Reportold_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'timekeeperReport';
protected $pid = 'timekeeper_id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'timekeeper_id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_username' => array('title' => "User Name", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_question' => array('title' => "Question", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_userAnswer' => array('title' => "User Answer", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_answer' => array('title' => "Correct Answer", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_subject' => array('title' => "Subject", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_answereddatestamp' => array('title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly' => true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_yearLevel' => array('title' => "Year Level", 'type' => 'number', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'timekeeper_correct' => array('title' => "Correct", 'type' => 'bool', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'timekeeper_username', 'timekeeper_question', 'timekeeper_userAnswer', 'timekeeper_answer', 'timekeeper_yearLevel', 'options');
/*
protected $prefs = array(
'rss_othernews' => array('title'=> RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
'rss_summarydiz' => array('title'=> RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
'rss_shownewsimage' => array('title'=> RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
);
*/
}
class tk_Reportold_form_ui extends e_admin_form_ui {
// Custom Method/Function
function rss_url5($curVal, $mode) {
switch ($mode) {
case 'read': // List Page
$type = $this->getController()->getListModel()->get('rss_type');
$topic = $this->getController()->getListModel()->get('rss_topicid');
$link = e107::url('rss_menu', 'rss', array('rss_type' => $type, 'rss_url' => $curVal, 'rss_topicid' => $topic));
return "" . $curVal . "";
case 'write': // Edit Page
$link = SITEURL . "feed/"; // e107::url('rss_menu','index').'/';
return "" . $link . e107::getForm()->text('rss_url', $curVal, 255, 'size=small') . "/rss/{Topic id}
";
case 'filter':
case 'batch':
return null;
}
}
}
/*
=========================================================================
===== Wordlist table interface
=========================================================================
*/
class tk_Wordlist_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'tk_wordList';
protected $pid = 'indexNo';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'indexNo' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'readonly' => 1, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'word' => array('title' => "Word", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'usage' => array('title' => "Word Usage", 'type' => 'textarea', 'data' => 'str', 'width' => '65%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'year' => array('title' => "Year Level", 'type' => 'number', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => ['default' => 1, 'min' => 1, 'max' => 13], 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'indexNo', 'word', 'usage', 'year', 'options');
public function customPage() {
$sql = e107::getdb();
$text = '| User | Subject | Percentage | Questions last month |
';
$Users = [];
$getUsers = "SELECT DISTINCT username FROM e107.e107_tkReport WHERE `answereddatestamp` > UNIX_TIMESTAMP((NOW()) - INTERVAL 1 MONTH);";
$getSubjects = "SELECT DISTINCT `subject` FROM e107_tkReport WHERE `answereddatestamp` > UNIX_TIMESTAMP((NOW()) - INTERVAL 1 MONTH) AND `username` = '';";
$getScore = "SELECT CAST((SUM(correct) / COUNT(id) * 100) AS DECIMAL (5 , 2 )) AS percent, COUNT(id) as `count`,'' AS `subject`
FROM e107_tkReport WHERE `answereddatestamp` > UNIX_TIMESTAMP((NOW()) - INTERVAL 1 MONTH) AND `username` = '' AND `subject` = '';";
$sql->gen($getUsers);
while ($row = $sql->fetch()) {
$Users[] = $row['username'];
}
foreach ($Users as $user) {
$Subjects = [];
$sql->gen(str_replace('', $user, $getSubjects));
while ($row = $sql->fetch()) {
$Subjects[] = $row['subject'];
}
foreach ($Subjects as $Subject) {
$sql->gen(str_replace('', $Subject, str_replace('', $user, $getScore)));
while ($row = $sql->fetch()) {
$text .= '| '.$user.' | '.$row['subject'].' | '.$row['percent'].' | '.$row['count'].' |
';
}
}
$returnArray['totalQuestionCount'] = e107::getDb()->count("tkReport", "(id)", "username = '" . $user . "'");
e107::getDb()->gen("SELECT COUNT(id) as cntr, CAST((SUM(correct)/COUNT(id)*100) as DECIMAL(5,2)) as percent
FROM e107.`e107_tkReport` WHERE username = '" . $user . "'
AND answereddatestamp >= unix_timestamp(CURRENT_DATE() - INTERVAL 1 MONTH)
AND answereddatestamp <= unix_timestamp(CURRENT_DATE() + INTERVAL 1 DAY)");
while ($row = e107::getDb()->fetch()) {
$returnArray = array_merge($returnArray,$row);
}
$diffi = $returnArray['totalQuestionCount']*$returnArray['percent'];
$text .= '| Difficulty | '.$diffi.' |
';
}
$text .= '
';
$text .= $sql->retrieve('SELECT COUNT(`usage`) FROM `#tk_wordList` WHERE `usage`="";');
$text .= ' words need a usage entered.
';
$nextWord = $sql->retrieve('SELECT `indexNo`,`word` FROM `#tk_wordList` WHERE `usage`="";');
$text .= 'The next word to be entered is "'.$nextWord['word'].'" at position '.$nextWord['indexNo'].'.';
$ns = e107::getRender();
$ns->tablerender("Scores", $text);
}
}
class tk_Wordlist_form_ui extends e_admin_form_ui {
}
class tk_geography_ui extends e_admin_ui {
protected $pluginTitle = 'TimeKeeper';
protected $pluginName = 'TimeKeeper';
protected $table = 'tk_countries';
protected $pid = 'id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'readonly' => 1, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'country' => array('title' => "Country", 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'currency' => array('title' => "Currency", 'type' => 'text', 'data' => 'str', 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'capital' => array('title' => "Capital", 'type' => 'text', 'data' => 'str', 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'isoCode' => array('title' => "isoCode", 'type' => 'text', 'data' => 'str', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'difficulty' => array('title' => "Difficulty", 'type' => 'number', 'data' => 'int', 'inline' => true, 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => ['default' => 10, 'min' => 1, 'max' => 10], 'class' => 'left', 'thclass' => 'left',),
'culture' => array('title' => "Culture", 'type' => 'textarea', 'data' => 'str', 'width' => '20%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'continent' => array('title' => "Continent", 'type' => 'dropdown', 'data' => 'str', 'inline' => true, 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => ['optArray' => ['Africa'=>'Africa', 'Asia'=>'Asia', 'Europe'=>'Europe', 'North America'=>'North America', 'South America'=>'South America', 'Oceania'=>'Oceania']], 'class' => 'left', 'thclass' => 'left',),
'map_coords' => array('title' => "Map Coords", 'type' => 'text', 'data' => 'str', 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => ['default' => '{}'], 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'id', 'country', 'isoCode', 'difficulty', 'options');
}
class tk_geography_form_ui extends e_admin_form_ui {
}
new timekeeper_admin();
require_once(e_ADMIN . "auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN . "footer.php");
exit;