Correcting time entry slowness
[wrms.git] / inc / page-footer.php
blob00fdd851aa77c7972e965fc4219052c43c30a67d
1 <?php
2 function send_footers() {
3 global $settings, $c, $session, $theme, $dbconn, $total_query_time, $debuglevel;
4 global $REQUEST_URI, $HTTP_USER_AGENT, $HTTP_REFERER, $PHP_SELF;
6 $theme->EndContentArea();
7 if ( $theme->panel_right ) $theme->RightPanel();
8 $theme->EndPanels();
9 if ( $theme->panel_bottom ) $theme->PageFooter();
11 echo <<<CLOSEHTML
12 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
13 <script language="JavaScript" src="js/overlib.js"></script>
14 </body>
15 </html>
16 CLOSEHTML;
18 if ( is_object ( $settings ) && $settings->is_modified() ) {
20 if ( ! is_numeric($settings->get('counter')) )
21 $settings->set('counter', 0 );
22 else
23 $settings->set('counter', $settings->get('counter') + 1 );
25 $config_data_string = qpg($settings->to_save());
26 $query = "UPDATE session SET session_config=$config_data_string ";
27 $query .= "WHERE session_id=$session->session_id ";
28 $query .= "AND session_config != $config_data_string; ";
29 if ( $session->user_no > 0 ) {
30 $query .= "UPDATE usr SET config_data=$config_data_string WHERE user_no=$session->user_no ";
31 $query .= "AND config_data != $config_data_string; ";
34 $result = awm_pgexec( $dbconn, $query );
37 error_reporting(7);
38 if ( $debuglevel > 0 ) {
39 $total_query_time = sprintf( "%3.06lf", $total_query_time );
40 error_log( $c->sysabbr." total_query_ TQ: $total_query_time URI: $REQUEST_URI", 0);
41 $total_time = sprintf( "%3.06lf", duration( $c->started, microtime() ));
42 error_log( $c->sysabbr." process_time TT: $total_time Agent: $HTTP_USER_AGENT Referrer: $HTTP_REFERER ", 0);
43 error_log( "=============================================== Endof $PHP_SELF" );
47 send_footers();