4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
25 public function __construct($a_parent_obj, $a_parent_cmd, $a_records, $a_mode =
"chronological")
29 $this->ctrl = $DIC->ctrl();
30 $this->lng = $DIC->language();
31 $this->access = $DIC->access();
33 $lng = $DIC->language();
34 $ilAccess = $DIC->access();
35 $lng = $DIC->language();
37 parent::__construct($a_parent_obj, $a_parent_cmd);
39 $this->mode = $a_mode;
41 switch ($this->mode) {
44 $this->
setTitle(
$lng->txt(
"adm_db_bench_slowest_first"));
45 $this->
addColumn($this->lng->txt(
"adm_time"));
46 $this->
addColumn($this->lng->txt(
"adm_sql"));
51 $this->
setTitle(
$lng->txt(
"adm_db_bench_sorted_by_sql"));
52 $this->
addColumn($this->lng->txt(
"adm_time"));
53 $this->
addColumn($this->lng->txt(
"adm_sql"));
56 case "by_first_table":
58 $this->
setTitle(
$lng->txt(
"adm_db_bench_by_first_table"));
59 $this->
addColumn($this->lng->txt(
"adm_time"));
60 $this->
addColumn($this->lng->txt(
"adm_nr_statements"));
61 $this->
addColumn($this->lng->txt(
"adm_table"));
66 $this->
setTitle(
$lng->txt(
"adm_db_bench_chronological"));
67 $this->
addColumn($this->lng->txt(
"adm_time"));
68 $this->
addColumn($this->lng->txt(
"adm_sql"));
75 $this->
setRowTemplate(
"tpl.db_bench.html",
"Modules/SystemFolder");
92 foreach ($a_needles as $needle) {
93 $pos2 = strpos($a_str, $needle);
95 if ($pos2 > 0 && ($pos2 < $pos || $pos == 0)) {
111 $pos1 = $this->
getFirst(strtolower($a_sql), array(
"from ",
"from\n",
"from\t",
"from\r"));
115 $tablef = substr(strtolower($a_sql), $pos1 + 5);
116 $pos2 = $this->
getFirst($tablef, array(
" ",
"\n",
"\t",
"\r"));
118 $table = substr($tablef, 0, $pos2);
140 foreach ($a_records as
$r) {
146 if (count(
$data) > 0) {
160 switch ($this->mode) {
161 case "by_first_table":
162 $this->tpl->setCurrentBlock(
"td");
163 $this->tpl->setVariable(
"VAL", $a_set[
"table"]);
164 $this->tpl->parseCurrentBlock();
165 $this->tpl->setVariable(
"VAL1", $a_set[
"time"]);
166 $this->tpl->setVariable(
"VAL2", $a_set[
"cnt"]);
169 case "slowest_first":
170 case "sorted_by_sql":
172 $this->tpl->setVariable(
"VAL1", $a_set[
"time"]);
173 $this->tpl->setVariable(
"VAL2", $a_set[
"sql"]);
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getDataByFirstTable($a_records)
Get data by first table.
__construct($a_parent_obj, $a_parent_cmd, $a_records, $a_mode="chronological")
Constructor.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
extractFirstTableFromSQL($a_sql)
Extract first table from sql.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
getFirst($a_str, $a_needles)
Get first occurence of string.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
fillRow($a_set)
Fill table row.
setEnableHeader($a_enableheader)
Set Enable Header.
if(empty($password)) $table
setEnableTitle($a_enabletitle)
Set Enable Title.
setLimit($a_limit=0, $a_default_limit=0)