Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.56 KB | None | 0 0
  1.         function action_report() {
  2.                 $this->addStyle("style.css");
  3.  
  4.                 $db            = &$this->getDb();
  5.                 $ui            = &$this->getUi();
  6.                 $pageVars      = $this->getPageVars();
  7.  
  8.                 $ref_arr       = array("");
  9.                 $gpn_arr       = array("");
  10.                 $colEntries    = $this->setInitialColumns($pageVars['reportid']);
  11.                 $colHeaders    = $this->setInitialValues($pageVars['reportid']);        //get atktext of db column names
  12.  
  13.                 $col_ind       = $this->configureTable($pageVars);
  14.                 $col_ind       = $this->turnOnColumns($pageVars, $col_ind, $colEntries);
  15.                 $page          = $this->createPage();
  16.                 $defaultDate   = $this->getDefaultDate($pageVars);
  17.                 $custReport    = $this->configureReportKind($pageVars, $col_ind, $colEntries, $colHeaders);
  18.  
  19.                 $startDate_att = new atkDateAttribute("startdate", "", "", 0, date("Ymd"));
  20.                 $endDate_att   = new atkDateAttribute("enddate",   "", "", 0, date("Ymd"));
  21.                
  22.                 $selected      = ($pageVars['noclosed'] != 1) ? "selected" : "";
  23.                 $status_html   = '<OPTION VALUE="1" '.$selected.'>'.atktext("wo_closed_prs","inventory").'</OPTION>';
  24.                 $status_html  .= '<OPTION VALUE="0" '.$selected.'>'.atktext("w_closed_prs","inventory").'</OPTION>';
  25.  
  26.                 $seld[0]       = ($pageVars['reportid']=="1") ? "selected" : "";
  27.                 $seld[1]       = ($pageVars['reportid']=="2") ? "selected" : "";
  28.                 $seld[2]       = ($pageVars['reportid']=="3") ? "selected" : "";
  29.                 $seld[3]       = ($pageVars['reportid']=="4") ? "selected" : "";
  30.                 $content       = $this->createHtmlTable($pageVars, $ref_arr, $gpn_arr, $startDate_att, $endDate_att, $defaultDate, $status_html, $seld, $custReport);
  31.  
  32.                 $page->register_scriptcode($this->getJavascript());
  33.                 $page->addContent($ui->renderBox(array("title"=>atktext("parameters"), "content" => $content)));
  34.  
  35.                 //if user is logged in, query database and place results in table
  36.                 if ($pageVars['userid'] != "") {
  37.                         $records = $this->mainDBQuery($pageVars, $col_ind, $colEntries, $colHeaders, $ref_arr, $db);
  38.                         $data    = $this->formatResponseData($pageVars, $col_ind, $records, $colHeaders, $db);
  39.                         $this->createTableRenderBox($pageVars, $page, $ui, $data);
  40.  
  41.                 }
  42.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement