dbms_init...1

This commit is contained in:
choi.jh 2025-06-09 18:35:02 +09:00
parent 7bd8830b28
commit 922af9dc02
2 changed files with 8 additions and 6 deletions

View File

@ -244,6 +244,7 @@ abstract class CommonController extends BaseController
case 'login_form':
case 'index':
case 'view':
case 'download':
$this->control = $this->getControlDatas();
$this->getHelper()->setViewDatas($this->getViewDatas());
$result = view($this->view_path . $this->getAction(), [
@ -705,7 +706,7 @@ abstract class CommonController extends BaseController
return array($full_path, $file_name);
}
// Download
final public function download(string $output_type, mixed $uid = false): DownloadResponse|RedirectResponse
final public function download(string $output_type, mixed $uid = false): DownloadResponse|RedirectResponse|string
{
try {
//각 Field 초기화
@ -717,12 +718,13 @@ abstract class CommonController extends BaseController
case 'pdf':
// string buffer에서 읽어오는 경우
$this->entities = $this->index_process();
$html = view('templates' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR . __FUNCTION__, ['viewDatas' => $this->getViewDatas()]);
$html = $this->getResultSuccess();
//data loading
$reader = new Html();
$loaded_data = $reader->loadFromString($html);
list($full_path, $file_name) = $this->download_document($output_type, $loaded_data);
$full_path .= DIRECTORY_SEPARATOR . $file_name;
return $this->response->download($full_path, null)->setFileName($file_name);
break;
default:
if (!$uid) {
@ -735,9 +737,9 @@ abstract class CommonController extends BaseController
$this->entity = $entity;
list($file_name, $uploaded_filename) = $this->entity->getDownlaodFile();
$full_path = WRITEPATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . $uploaded_filename;
return $this->response->download($full_path, null)->setFileName($file_name);
break;
}
return $this->response->download($full_path, null)->setFileName($file_name);
} catch (\Exception $e) {
return $this->getResultFail($e->getMessage());
}

View File

@ -1,16 +1,16 @@
<table>
<thead>
<tr>
<?php foreach ($viewDatas['fields'] as $field): ?>
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
<th><?= lang("{$viewDatas['class_path']}.label.{$field}") ?></th>
<?php endforeach ?>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entitys'] as $entity): ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<tr>
<?php foreach ($viewDatas['fields'] as $field): ?>
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
<td><?= $entity->$field ?></td>
<?php endforeach ?>
</tr>