. ***********************************************************************/ function dashboard($sel_app) { $selected_app = $sel_app; if (!$_SESSION["wa_current_user"]->check_application_access($selected_app)) return; // first have a look through the directory, // and remove old temporary pdfs and pngs $dir = company_path(). '/pdf_files'; if ($d = @opendir($dir)) { while (($file = readdir($d)) !== false) { if (!is_file($dir.'/'.$file) || $file == 'index.php') continue; // then check to see if this one is too old $ftime = filemtime($dir.'/'.$file); // seems 3 min is enough for any report download, isn't it? if (time()-$ftime > 180){ unlink($dir.'/'.$file); } } closedir($d); } //check_for_overdue_recurrent_invoices(); if ($selected_app == "orders") display_customer_topten(); elseif ($selected_app == "AP") display_supplier_topten(); elseif ($selected_app == "stock") display_stock_topten(); elseif ($selected_app == "manuf") display_stock_topten(1); elseif ($selected_app == "assets") display_stock_topten(2); elseif ($selected_app == "proj") display_dimension_topten(); elseif ($selected_app == "GL") display_gl_info(); else display_all(); } function display_customer_topten() { $pg = new graph(); echo "
\n"; // outer table $today = Today(); $title = customer_top($today, 10, 66, $pg); customer_trans($today); echo " | \n"; source_graphic($today, $title, _("Customer"), $pg); customer_recurrent_invoices($today); echo " |
\n"; // outer table } function table_two() { echo " | \n"; } function table_end() { echo " |