echo $layout->txtdesc(txt('logs_app_title_desc')); $logs = new phpos_logs(); $logs_dir = $logs->get_logs_dir(); echo $layout->column('70%'); $log_file_id = $my_app->get_param('log_id'); if (!empty($log_file_id)) { $today = ''; if ($logs->is_today_date($my_app->get_param('year_id'), $my_app->get_param('month_id'), $my_app->get_param('day_id'))) { $today = ' <span style="font-weight:bold; color: #1d791e">(' . txt('today') . ')</span>'; } $log_title = txt('logs_log_from_title') . $my_app->get_param('year_id') . ' - ' . $my_app->get_param('month_id') . ' - ' . $my_app->get_param('day_id') . $today; echo $layout->subtitle($log_title, ICONS . 'logs/section_logs.png'); echo $layout->txtdesc($txt['logs_list']); $download_action = browser_url(PHPOS_WEBROOT_URL . "phpos_downloader.php?hash=" . md5(PHPOS_KEY) . "&download_type=" . base64_encode('log') . "&file=" . base64_encode($log_file_id)); $download_btn = $layout->button(txt('logs_section_btn_download'), $download_action, 'download1'); $view_action = browser_url('../_phpos/' . str_replace('../', '', $log_file_id)); $view_btn = $layout->button(txt('logs_section_btn_see_raw'), $view_action, 'edit'); echo $download_btn . ' ' . $view_btn; //echo 'Download raw log file here: <a href="'.$logs->get_logs_url().$log_file_id.'" target="_blank"><b>'.basename($log_file_id).'</b></a>'; //echo nl2br($f); $logs->set_log_dir($my_app->get_param('year_id'), $my_app->get_param('month_id'), $my_app->get_param('day_id')); $logs->set_log_file(basename($log_file_id)); $parsed_log = $logs->parse_log_file($log_file_id); echo $layout->tbl_start(); $layout->td_classes(array('')); echo $layout->head(array(txt('logs_section_tbl_id') => '10%', txt('logs_section_tbl_time') => '20%', txt('logs_section_tbl_user') => '25%', txt('logs_section_tbl_ip') => '15%', txt('logs_section_tbl_action') => '20%', txt('logs_section_tbl_session') => '10%')); foreach ($parsed_log as $log_data) { $btn = txt('logs_section_btn_see_session_empty'); $sessions = new phpos_users(); if ($sessions->is_session_id($log_data['log_session'])) { $action = helper_reload(array('section' => 'sessions', 'id_session' => $log_data['log_session']));
die; } switch ($context_fs) { case 'db_mysql': $contextMenus['FILE'] = array('open::' . txt('open') . '::alert("normalopen' . $item . '");::folder_open', '---', 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit'); $contextMenus['DIR'] = array('open::Otwórz folder::phpos.windowRefresh("' . $apiWindow->getID() . '","dir_id:' . $phposFS->addLastSlash($icons[$i]['id']) . '");::open', 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit'); $contextMenus['WINDOW'] = array('newshortcut::' . txt('new_shortcut') . '::' . winmodal(txt('new_shortcut'), 'app', 'app_id:shortcuts@index,width:300,height:350', 'desktop:1,location:' . $context_location . ',dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::edit_add', 'newfolder::' . txt('new_folder') . '::' . winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null,dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::folder_files'); break; case 'local_files': $contextMenus['FILE'] = array('open::' . txt('open') . '::explorer_open_in_browser("' . $icons[$i]['id'] . '");::folder_open', '---', 'open_with::' . txt('open_with') . '::alert();::icon', array('openwith1::' . txt('in_web_browser') . '::explorer_open_in_browser("' . $icons[$i]['id'] . '");')); if (!$readonly || is_root()) { $contextMenus['FILE'][] = '---'; $contextMenus['FILE'][] = 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit'; } $contextMenus['FILE'][] = '---'; $contextMenus['FILE'][] = 'download::' . txt('download') . '::' . browser_url(PHPOS_WEBROOT_URL . 'phpos_downloader.php?hash=' . md5(PHPOS_KEY) . '&download_type=' . base64_encode('local_file') . '&file=' . base64_encode(str_replace(PHPOS_WEBROOT_DIR, '', $icons[$i]['id']))) . '::download'; $contextMenus['DIR'] = array('open::' . txt('open') . '::alert("normalopen' . $item . '");::folder_open', 'open_with::' . txt('open_with') . '::alert();::icon', array('openwith1::' . txt('in_new_win') . '::explorer_open_in_browser("' . $icons[$i]['id'] . '");')); if (!$readonly || is_root()) { $contextMenus['DIR'][] = '---'; $contextMenus['DIR'][] = 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit'; } if (!$readonly || is_root()) { $contextMenus['WINDOW'][] = 'newfolder::' . txt('new_folder') . '::' . winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null, dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::folder_files'; if (globalconfig('disable_upload') != 1 || is_root()) { $contextMenus['WINDOW'][] = 'upload::' . txt('upload_here') . '::' . winmodal('Nowa ikona', 'app', 'app_id:shortcuts@upload,width:300,height:350', 'desktop:1,location:' . $context_location . ',back:null,dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::disk'; } } else { $contextMenus['WINDOW'] = array('read::This folder is readonly::;::login'); } break; case 'ftp':
public function ftp_download($to_dir_id = null) { $clipboard = new phpos_clipboard(); $clipboard->get_clipboard(); $id_file = $clipboard->get_file_id(); $fs = $clipboard->get_file_fs(); $tmp_name = basename($id_file); if (ftp_get($this->conn_id, PHPOS_TEMP . $tmp_name, $id_file, FTP_BINARY)) { $basename = basename($id_file); $clipboard->reset_clipboard(); echo '<script>' . browser_url(PHPOS_WEBROOT_URL . 'phpos_downloader.php?hash=' . md5(PHPOS_KEY) . '&download_type=' . base64_encode('ftp_file') . '&file=' . base64_encode(str_replace(PHPOS_WEBROOT_DIR, '', PHPOS_TEMP . $tmp_name))) . '</script>'; return true; } }