From 704141a1f04a59544b7bafbbea12b08207135d7d Mon Sep 17 00:00:00 2001 From: javamon1174 Date: Thu, 26 Mar 2026 16:40:49 +0900 Subject: [PATCH] =?UTF-8?q?CT-01/02/03=20=EA=B3=B5=ED=86=B5=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84=20=E2=80=94=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98/?= =?UTF-8?q?=EC=97=91=EC=85=80/=EC=9D=B8=EC=87=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CT-01: 페이지네이션 - 커스텀 Tailwind 페이저 뷰 (components/pager.php) - 18개 admin 컨트롤러 findAll() → paginate(20) 전환 - Bag 컨트롤러 7개 리스트도 paginate 적용 - 19개 admin index 뷰에 페이저 링크 추가 CT-02: 엑셀 저장 - export_helper.php (UTF-8 BOM CSV) - 발주/판매/지정판매소/재고 4개 엑셀 내보내기 라우트+메서드 - 해당 뷰에 "엑셀저장" 버튼 추가 CT-03: 인쇄 - print_header.php (지자체명/제목/결재란 컴포넌트) - admin/bag 레이아웃에 @media print CSS 추가 - 23개 뷰에 인쇄 버튼 + print_header 추가 Co-Authored-By: Claude Opus 4.6 (1M context) --- app/Config/Pager.php | 4 +- app/Config/Routes.php | 4 ++ app/Controllers/Admin/Access.php | 26 +++---- app/Controllers/Admin/BagInventory.php | 34 ++++++++- app/Controllers/Admin/BagIssue.php | 5 +- app/Controllers/Admin/BagOrder.php | 51 +++++++++++++- app/Controllers/Admin/BagPrice.php | 4 +- app/Controllers/Admin/BagReceiving.php | 5 +- app/Controllers/Admin/BagSale.php | 46 ++++++++++++- app/Controllers/Admin/CodeDetail.php | 8 ++- app/Controllers/Admin/CodeKind.php | 4 +- app/Controllers/Admin/Company.php | 5 +- app/Controllers/Admin/DesignatedShop.php | 38 +++++++++- app/Controllers/Admin/FreeRecipient.php | 5 +- app/Controllers/Admin/LocalGovernment.php | 5 +- app/Controllers/Admin/Manager.php | 5 +- app/Controllers/Admin/PackagingUnit.php | 5 +- app/Controllers/Admin/SalesAgency.php | 5 +- app/Controllers/Admin/ShopOrder.php | 5 +- app/Controllers/Admin/User.php | 4 +- app/Controllers/Bag.php | 22 ++++-- app/Helpers/export_helper.php | 69 +++++++++++++++++++ app/Views/admin/access/approvals.php | 7 +- app/Views/admin/access/login_history.php | 3 + app/Views/admin/bag_inventory/index.php | 10 ++- app/Views/admin/bag_issue/index.php | 7 +- app/Views/admin/bag_order/index.php | 8 ++- app/Views/admin/bag_price/index.php | 7 +- app/Views/admin/bag_receiving/index.php | 7 +- app/Views/admin/bag_sale/index.php | 8 ++- app/Views/admin/code_detail/index.php | 7 +- app/Views/admin/code_kind/index.php | 7 +- app/Views/admin/company/index.php | 7 +- app/Views/admin/designated_shop/index.php | 8 ++- app/Views/admin/free_recipient/index.php | 7 +- app/Views/admin/layout.php | 8 +++ app/Views/admin/local_government/index.php | 7 +- app/Views/admin/manager/index.php | 7 +- app/Views/admin/packaging_unit/index.php | 7 +- app/Views/admin/sales_agency/index.php | 7 +- .../admin/sales_report/daily_summary.php | 6 +- app/Views/admin/sales_report/period_sales.php | 6 +- app/Views/admin/sales_report/sales_ledger.php | 6 +- .../admin/sales_report/supply_demand.php | 6 +- app/Views/admin/shop_order/index.php | 7 +- app/Views/admin/user/index.php | 7 +- app/Views/bag/layout/main.php | 8 +++ app/Views/components/pager.php | 38 ++++++++++ app/Views/components/print_header.php | 55 +++++++++++++++ 49 files changed, 552 insertions(+), 75 deletions(-) create mode 100644 app/Helpers/export_helper.php create mode 100644 app/Views/components/pager.php create mode 100644 app/Views/components/print_header.php diff --git a/app/Config/Pager.php b/app/Config/Pager.php index e341f4d..01bbd07 100644 --- a/app/Config/Pager.php +++ b/app/Config/Pager.php @@ -21,8 +21,8 @@ class Pager extends BaseConfig * @var array */ public array $templates = [ - 'default_full' => 'CodeIgniter\Pager\Views\default_full', - 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', + 'default_full' => 'App\Views\components\pager', + 'default_simple' => 'App\Views\components\pager', 'default_head' => 'CodeIgniter\Pager\Views\default_head', ]; diff --git a/app/Config/Routes.php b/app/Config/Routes.php index eb31589..a82f856 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -114,6 +114,7 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo $routes->get('bag-prices/history/(:num)', 'Admin\BagPrice::history/$1'); // 발주 관리 (P3-01~05) + $routes->get('bag-orders/export', 'Admin\BagOrder::export'); $routes->get('bag-orders', 'Admin\BagOrder::index'); $routes->get('bag-orders/create', 'Admin\BagOrder::create'); $routes->post('bag-orders/store', 'Admin\BagOrder::store'); @@ -127,6 +128,7 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo $routes->post('bag-receivings/store', 'Admin\BagReceiving::store'); // 재고 현황 (P3-10) + $routes->get('bag-inventory/export', 'Admin\BagInventory::export'); $routes->get('bag-inventory', 'Admin\BagInventory::index'); // 주문 접수 관리 (P4-01~03) @@ -136,6 +138,7 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo $routes->post('shop-orders/cancel/(:num)', 'Admin\ShopOrder::cancel/$1'); // 판매/반품 관리 (P4-04~07) + $routes->get('bag-sales/export', 'Admin\BagSale::export'); $routes->get('bag-sales', 'Admin\BagSale::index'); $routes->get('bag-sales/create', 'Admin\BagSale::create'); $routes->post('bag-sales/store', 'Admin\BagSale::store'); @@ -193,6 +196,7 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo $routes->post('free-recipients/update/(:num)', 'Admin\FreeRecipient::update/$1'); $routes->post('free-recipients/delete/(:num)', 'Admin\FreeRecipient::delete/$1'); + $routes->get('designated-shops/export', 'Admin\DesignatedShop::export'); $routes->get('designated-shops', 'Admin\DesignatedShop::index'); $routes->get('designated-shops/create', 'Admin\DesignatedShop::create'); $routes->post('designated-shops/store', 'Admin\DesignatedShop::store'); diff --git a/app/Controllers/Admin/Access.php b/app/Controllers/Admin/Access.php index 6b489ec..ccfd194 100644 --- a/app/Controllers/Admin/Access.php +++ b/app/Controllers/Admin/Access.php @@ -31,8 +31,7 @@ class Access extends BaseController { $start = $this->request->getGet('start'); $end = $this->request->getGet('end'); - $builder = $this->memberLogModel->builder(); - $builder->select('member_log.*'); + $builder = $this->memberLogModel; $builder->orderBy('mll_regdate', 'DESC'); if ($start !== null && $start !== '') { $builder->where('mll_regdate >=', $start . ' 00:00:00'); @@ -40,10 +39,11 @@ class Access extends BaseController if ($end !== null && $end !== '') { $builder->where('mll_regdate <=', $end . ' 23:59:59'); } - $list = $builder->get()->getResult(); + $list = $builder->paginate(20); + $pager = $this->memberLogModel->pager; return view('admin/layout', [ 'title' => '로그인 이력', - 'content' => view('admin/access/login_history', ['list' => $list, 'start' => $start, 'end' => $end]), + 'content' => view('admin/access/login_history', ['list' => $list, 'start' => $start, 'end' => $end, 'pager' => $pager]), ]); } @@ -59,15 +59,14 @@ class Access extends BaseController $status = MemberApprovalRequestModel::STATUS_PENDING; } - $builder = $this->approvalModel->builder(); - $builder->select( - 'member_approval_request.*, member.mb_id, member.mb_name, member.mb_lg_idx, local_government.lg_name' - ); - $builder->join('member', 'member.mb_idx = member_approval_request.mb_idx', 'left'); - $builder->join('local_government', 'local_government.lg_idx = member.mb_lg_idx', 'left'); - $builder->where('member_approval_request.mar_status', $status); - $builder->orderBy('member_approval_request.mar_requested_at', 'DESC'); - $list = $builder->get()->getResult(); + $list = $this->approvalModel + ->select('member_approval_request.*, member.mb_id, member.mb_name, member.mb_lg_idx, local_government.lg_name') + ->join('member', 'member.mb_idx = member_approval_request.mb_idx', 'left') + ->join('local_government', 'local_government.lg_idx = member.mb_lg_idx', 'left') + ->where('member_approval_request.mar_status', $status) + ->orderBy('member_approval_request.mar_requested_at', 'DESC') + ->paginate(20); + $pager = $this->approvalModel->pager; return view('admin/layout', [ 'title' => '승인 대기', @@ -75,6 +74,7 @@ class Access extends BaseController 'list' => $list, 'status' => $status, 'roles' => $this->roles, + 'pager' => $pager, ]), ]); } diff --git a/app/Controllers/Admin/BagInventory.php b/app/Controllers/Admin/BagInventory.php index 06479b6..6b229d4 100644 --- a/app/Controllers/Admin/BagInventory.php +++ b/app/Controllers/Admin/BagInventory.php @@ -13,11 +13,41 @@ class BagInventory extends BaseController $lgIdx = admin_effective_lg_idx(); if (!$lgIdx) return redirect()->to(site_url('admin'))->with('error', '지자체를 선택해 주세요.'); - $list = model(BagInventoryModel::class)->where('bi_lg_idx', $lgIdx)->orderBy('bi_bag_code', 'ASC')->findAll(); + $invModel = model(BagInventoryModel::class); + $list = $invModel->where('bi_lg_idx', $lgIdx)->orderBy('bi_bag_code', 'ASC')->paginate(20); + $pager = $invModel->pager; return view('admin/layout', [ 'title' => '재고 현황', - 'content' => view('admin/bag_inventory/index', ['list' => $list]), + 'content' => view('admin/bag_inventory/index', ['list' => $list, 'pager' => $pager]), ]); } + + public function export() + { + helper(['admin', 'export']); + $lgIdx = admin_effective_lg_idx(); + if (!$lgIdx) { + return redirect()->to(site_url('admin/bag-inventory'))->with('error', '지자체를 선택해 주세요.'); + } + + $list = model(BagInventoryModel::class)->where('bi_lg_idx', $lgIdx)->orderBy('bi_bag_code', 'ASC')->findAll(); + + $rows = []; + foreach ($list as $row) { + $rows[] = [ + $row->bi_idx, + $row->bi_bag_code, + $row->bi_bag_name, + (int) $row->bi_qty, + $row->bi_updated_at, + ]; + } + + export_csv( + '재고현황_' . date('Ymd') . '.csv', + ['번호', '봉투코드', '봉투명', '현재재고(낱장)', '최종갱신'], + $rows + ); + } } diff --git a/app/Controllers/Admin/BagIssue.php b/app/Controllers/Admin/BagIssue.php index 4255041..833ec0f 100644 --- a/app/Controllers/Admin/BagIssue.php +++ b/app/Controllers/Admin/BagIssue.php @@ -29,11 +29,12 @@ class BagIssue extends BaseController if ($startDate) $builder->where('bi2_issue_date >=', $startDate); if ($endDate) $builder->where('bi2_issue_date <=', $endDate); - $list = $builder->orderBy('bi2_issue_date', 'DESC')->orderBy('bi2_idx', 'DESC')->findAll(); + $list = $builder->orderBy('bi2_issue_date', 'DESC')->orderBy('bi2_idx', 'DESC')->paginate(20); + $pager = $this->issueModel->pager; return view('admin/layout', [ 'title' => '무료용 불출 관리', - 'content' => view('admin/bag_issue/index', compact('list', 'startDate', 'endDate')), + 'content' => view('admin/bag_issue/index', compact('list', 'startDate', 'endDate', 'pager')), ]); } diff --git a/app/Controllers/Admin/BagOrder.php b/app/Controllers/Admin/BagOrder.php index 8fdb518..f280ad9 100644 --- a/app/Controllers/Admin/BagOrder.php +++ b/app/Controllers/Admin/BagOrder.php @@ -42,7 +42,8 @@ class BagOrder extends BaseController if ($endDate) $builder->where('bo_order_date <=', $endDate); if ($status) $builder->where('bo_status', $status); - $list = $builder->orderBy('bo_order_date', 'DESC')->orderBy('bo_idx', 'DESC')->findAll(); + $list = $builder->orderBy('bo_order_date', 'DESC')->orderBy('bo_idx', 'DESC')->paginate(20); + $pager = $this->orderModel->pager; // 발주별 품목 합계 $itemSummary = []; @@ -60,10 +61,56 @@ class BagOrder extends BaseController return view('admin/layout', [ 'title' => '발주 현황', - 'content' => view('admin/bag_order/index', compact('list', 'itemSummary', 'companyMap', 'agencyMap', 'startDate', 'endDate', 'status')), + 'content' => view('admin/bag_order/index', compact('list', 'itemSummary', 'companyMap', 'agencyMap', 'startDate', 'endDate', 'status', 'pager')), ]); } + public function export() + { + helper(['admin', 'export']); + $lgIdx = admin_effective_lg_idx(); + if (!$lgIdx) { + return redirect()->to(site_url('admin/bag-orders'))->with('error', '지자체를 선택해 주세요.'); + } + + $builder = $this->orderModel->where('bo_lg_idx', $lgIdx); + $startDate = $this->request->getGet('start_date'); + $endDate = $this->request->getGet('end_date'); + $status = $this->request->getGet('status'); + if ($startDate) $builder->where('bo_order_date >=', $startDate); + if ($endDate) $builder->where('bo_order_date <=', $endDate); + if ($status) $builder->where('bo_status', $status); + + $list = $builder->orderBy('bo_order_date', 'DESC')->orderBy('bo_idx', 'DESC')->findAll(); + + $rows = []; + $statusMap = ['normal' => '정상', 'cancelled' => '취소', 'deleted' => '삭제']; + foreach ($list as $row) { + $items = $this->itemModel->where('boi_bo_idx', $row->bo_idx)->findAll(); + $totalQty = 0; + $totalAmt = 0; + foreach ($items as $it) { + $totalQty += (int) $it->boi_qty_sheet; + $totalAmt += (float) $it->boi_amount; + } + $rows[] = [ + $row->bo_idx, + $row->bo_lot_no, + $row->bo_order_date, + count($items), + $totalQty, + $totalAmt, + $statusMap[$row->bo_status] ?? $row->bo_status, + ]; + } + + export_csv( + '발주현황_' . date('Ymd') . '.csv', + ['번호', 'LOT번호', '발주일', '품목수', '총수량', '총금액', '상태'], + $rows + ); + } + public function create() { helper('admin'); diff --git a/app/Controllers/Admin/BagPrice.php b/app/Controllers/Admin/BagPrice.php index d0f5d3b..4d484a4 100644 --- a/app/Controllers/Admin/BagPrice.php +++ b/app/Controllers/Admin/BagPrice.php @@ -42,7 +42,8 @@ class BagPrice extends BaseController ->groupEnd(); } - $list = $builder->orderBy('bp_bag_code', 'ASC')->orderBy('bp_start_date', 'DESC')->findAll(); + $list = $builder->orderBy('bp_bag_code', 'ASC')->orderBy('bp_start_date', 'DESC')->paginate(20); + $pager = $this->priceModel->pager; return view('admin/layout', [ 'title' => '봉투 단가 관리', @@ -50,6 +51,7 @@ class BagPrice extends BaseController 'list' => $list, 'startDate' => $startDate, 'endDate' => $endDate, + 'pager' => $pager, ]), ]); } diff --git a/app/Controllers/Admin/BagReceiving.php b/app/Controllers/Admin/BagReceiving.php index bfbc354..5c21a2b 100644 --- a/app/Controllers/Admin/BagReceiving.php +++ b/app/Controllers/Admin/BagReceiving.php @@ -30,11 +30,12 @@ class BagReceiving extends BaseController if ($startDate) $builder->where('br_receive_date >=', $startDate); if ($endDate) $builder->where('br_receive_date <=', $endDate); - $list = $builder->orderBy('br_receive_date', 'DESC')->orderBy('br_idx', 'DESC')->findAll(); + $list = $builder->orderBy('br_receive_date', 'DESC')->orderBy('br_idx', 'DESC')->paginate(20); + $pager = $this->recvModel->pager; return view('admin/layout', [ 'title' => '입고 현황', - 'content' => view('admin/bag_receiving/index', compact('list', 'startDate', 'endDate')), + 'content' => view('admin/bag_receiving/index', compact('list', 'startDate', 'endDate', 'pager')), ]); } diff --git a/app/Controllers/Admin/BagSale.php b/app/Controllers/Admin/BagSale.php index 8f2b5c2..082b6b5 100644 --- a/app/Controllers/Admin/BagSale.php +++ b/app/Controllers/Admin/BagSale.php @@ -33,14 +33,56 @@ class BagSale extends BaseController if ($endDate) $builder->where('bs_sale_date <=', $endDate); if ($type) $builder->where('bs_type', $type); - $list = $builder->orderBy('bs_sale_date', 'DESC')->orderBy('bs_idx', 'DESC')->findAll(); + $list = $builder->orderBy('bs_sale_date', 'DESC')->orderBy('bs_idx', 'DESC')->paginate(20); + $pager = $this->saleModel->pager; return view('admin/layout', [ 'title' => '판매/반품 관리', - 'content' => view('admin/bag_sale/index', compact('list', 'startDate', 'endDate', 'type')), + 'content' => view('admin/bag_sale/index', compact('list', 'startDate', 'endDate', 'type', 'pager')), ]); } + public function export() + { + helper(['admin', 'export']); + $lgIdx = admin_effective_lg_idx(); + if (!$lgIdx) { + return redirect()->to(site_url('admin/bag-sales'))->with('error', '지자체를 선택해 주세요.'); + } + + $builder = $this->saleModel->where('bs_lg_idx', $lgIdx); + $startDate = $this->request->getGet('start_date'); + $endDate = $this->request->getGet('end_date'); + $type = $this->request->getGet('type'); + if ($startDate) $builder->where('bs_sale_date >=', $startDate); + if ($endDate) $builder->where('bs_sale_date <=', $endDate); + if ($type) $builder->where('bs_type', $type); + + $list = $builder->orderBy('bs_sale_date', 'DESC')->orderBy('bs_idx', 'DESC')->findAll(); + + $typeMap = ['sale' => '판매', 'return' => '반품', 'cancel' => '취소']; + $rows = []; + foreach ($list as $row) { + $rows[] = [ + $row->bs_idx, + $row->bs_ds_name, + $row->bs_sale_date, + $row->bs_bag_code, + $row->bs_bag_name, + (int) $row->bs_qty, + (int) $row->bs_unit_price, + (int) $row->bs_amount, + $typeMap[$row->bs_type] ?? $row->bs_type, + ]; + } + + export_csv( + '판매반품_' . date('Ymd') . '.csv', + ['번호', '판매소', '판매일', '봉투코드', '봉투명', '수량', '단가', '금액', '구분'], + $rows + ); + } + public function create() { helper('admin'); diff --git a/app/Controllers/Admin/CodeDetail.php b/app/Controllers/Admin/CodeDetail.php index d8a6ed3..e28200d 100644 --- a/app/Controllers/Admin/CodeDetail.php +++ b/app/Controllers/Admin/CodeDetail.php @@ -24,13 +24,15 @@ class CodeDetail extends BaseController return redirect()->to(site_url('admin/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.'); } - $list = $this->detailModel->getByKind($ckIdx); + $list = $this->detailModel->where('cd_ck_idx', $ckIdx)->orderBy('cd_sort', 'ASC')->paginate(20); + $pager = $this->detailModel->pager; return view('admin/layout', [ 'title' => '세부코드 관리 — ' . $kind->ck_name . ' (' . $kind->ck_code . ')', 'content' => view('admin/code_detail/index', [ - 'kind' => $kind, - 'list' => $list, + 'kind' => $kind, + 'list' => $list, + 'pager' => $pager, ]), ]); } diff --git a/app/Controllers/Admin/CodeKind.php b/app/Controllers/Admin/CodeKind.php index 181be5e..9ca623d 100644 --- a/app/Controllers/Admin/CodeKind.php +++ b/app/Controllers/Admin/CodeKind.php @@ -18,7 +18,8 @@ class CodeKind extends BaseController public function index() { - $list = $this->kindModel->orderBy('ck_code', 'ASC')->findAll(); + $list = $this->kindModel->orderBy('ck_code', 'ASC')->paginate(20); + $pager = $this->kindModel->pager; // 세부코드 수 매핑 $detailModel = model(CodeDetailModel::class); @@ -32,6 +33,7 @@ class CodeKind extends BaseController 'content' => view('admin/code_kind/index', [ 'list' => $list, 'countMap' => $countMap, + 'pager' => $pager, ]), ]); } diff --git a/app/Controllers/Admin/Company.php b/app/Controllers/Admin/Company.php index 3321fb2..36d22ee 100644 --- a/app/Controllers/Admin/Company.php +++ b/app/Controllers/Admin/Company.php @@ -22,11 +22,12 @@ class Company extends BaseController return redirect()->to(site_url('admin'))->with('error', '지자체를 선택해 주세요.'); } - $list = $this->model->where('cp_lg_idx', $lgIdx)->orderBy('cp_idx', 'DESC')->findAll(); + $list = $this->model->where('cp_lg_idx', $lgIdx)->orderBy('cp_idx', 'DESC')->paginate(20); + $pager = $this->model->pager; return view('admin/layout', [ 'title' => '업체 관리', - 'content' => view('admin/company/index', ['list' => $list]), + 'content' => view('admin/company/index', ['list' => $list, 'pager' => $pager]), ]); } diff --git a/app/Controllers/Admin/DesignatedShop.php b/app/Controllers/Admin/DesignatedShop.php index 2656736..d90edc4 100644 --- a/app/Controllers/Admin/DesignatedShop.php +++ b/app/Controllers/Admin/DesignatedShop.php @@ -46,7 +46,8 @@ class DesignatedShop extends BaseController $list = $this->shopModel ->where('ds_lg_idx', $lgIdx) ->orderBy('ds_idx', 'DESC') - ->findAll(); + ->paginate(20); + $pager = $this->shopModel->pager; // 지자체 이름 매핑용 $lgMap = []; @@ -59,10 +60,45 @@ class DesignatedShop extends BaseController 'content' => view('admin/designated_shop/index', [ 'list' => $list, 'lgMap' => $lgMap, + 'pager' => $pager, ]), ]); } + public function export() + { + helper(['admin', 'export']); + $lgIdx = admin_effective_lg_idx(); + if (!$lgIdx) { + return redirect()->to(site_url('admin/designated-shops'))->with('error', '지자체를 선택해 주세요.'); + } + + $list = $this->shopModel->where('ds_lg_idx', $lgIdx)->orderBy('ds_idx', 'DESC')->findAll(); + + $rows = []; + foreach ($list as $row) { + $stateMap = [1 => '정상', 2 => '폐업', 3 => '직권해지']; + $rows[] = [ + $row->ds_idx, + $row->ds_shop_no, + $row->ds_name, + $row->ds_rep_name, + $row->ds_biz_no, + $row->ds_va_number, + $row->ds_tel ?? '', + $row->ds_addr ?? '', + $stateMap[(int) $row->ds_state] ?? '', + $row->ds_regdate ?? '', + ]; + } + + export_csv( + '지정판매소_' . date('Ymd') . '.csv', + ['번호', '판매소번호', '상호명', '대표자', '사업자번호', '가상계좌', '전화번호', '주소', '상태', '등록일'], + $rows + ); + } + /** * 지정판매소 등록 폼 (효과 지자체 기준) */ diff --git a/app/Controllers/Admin/FreeRecipient.php b/app/Controllers/Admin/FreeRecipient.php index 3154485..79448ce 100644 --- a/app/Controllers/Admin/FreeRecipient.php +++ b/app/Controllers/Admin/FreeRecipient.php @@ -30,11 +30,12 @@ class FreeRecipient extends BaseController return redirect()->to(site_url('admin'))->with('error', '지자체를 선택해 주세요.'); } - $list = $this->model->where('fr_lg_idx', $lgIdx)->orderBy('fr_idx', 'DESC')->findAll(); + $list = $this->model->where('fr_lg_idx', $lgIdx)->orderBy('fr_idx', 'DESC')->paginate(20); + $pager = $this->model->pager; return view('admin/layout', [ 'title' => '무료용 대상자 관리', - 'content' => view('admin/free_recipient/index', ['list' => $list]), + 'content' => view('admin/free_recipient/index', ['list' => $list, 'pager' => $pager]), ]); } diff --git a/app/Controllers/Admin/LocalGovernment.php b/app/Controllers/Admin/LocalGovernment.php index e134721..6a62815 100644 --- a/app/Controllers/Admin/LocalGovernment.php +++ b/app/Controllers/Admin/LocalGovernment.php @@ -32,11 +32,12 @@ class LocalGovernment extends BaseController ->with('error', '지자체 관리는 상위 관리자만 접근할 수 있습니다.'); } - $list = $this->lgModel->orderBy('lg_idx', 'DESC')->findAll(); + $list = $this->lgModel->orderBy('lg_idx', 'DESC')->paginate(20); + $pager = $this->lgModel->pager; return view('admin/layout', [ 'title' => '지자체 관리', - 'content' => view('admin/local_government/index', ['list' => $list]), + 'content' => view('admin/local_government/index', ['list' => $list, 'pager' => $pager]), ]); } diff --git a/app/Controllers/Admin/Manager.php b/app/Controllers/Admin/Manager.php index c14e5a6..c3bce32 100644 --- a/app/Controllers/Admin/Manager.php +++ b/app/Controllers/Admin/Manager.php @@ -30,11 +30,12 @@ class Manager extends BaseController return redirect()->to(site_url('admin'))->with('error', '지자체를 선택해 주세요.'); } - $list = $this->model->where('mg_lg_idx', $lgIdx)->orderBy('mg_idx', 'DESC')->findAll(); + $list = $this->model->where('mg_lg_idx', $lgIdx)->orderBy('mg_idx', 'DESC')->paginate(20); + $pager = $this->model->pager; return view('admin/layout', [ 'title' => '담당자 관리', - 'content' => view('admin/manager/index', ['list' => $list]), + 'content' => view('admin/manager/index', ['list' => $list, 'pager' => $pager]), ]); } diff --git a/app/Controllers/Admin/PackagingUnit.php b/app/Controllers/Admin/PackagingUnit.php index 8e6c385..a8db13e 100644 --- a/app/Controllers/Admin/PackagingUnit.php +++ b/app/Controllers/Admin/PackagingUnit.php @@ -38,12 +38,13 @@ class PackagingUnit extends BaseController $builder->groupStart()->where('pu_end_date IS NULL')->orWhere('pu_end_date <=', $endDate)->groupEnd(); } - $list = $builder->orderBy('pu_bag_code', 'ASC')->orderBy('pu_start_date', 'DESC')->findAll(); + $list = $builder->orderBy('pu_bag_code', 'ASC')->orderBy('pu_start_date', 'DESC')->paginate(20); + $pager = $this->unitModel->pager; return view('admin/layout', [ 'title' => '포장 단위 관리', 'content' => view('admin/packaging_unit/index', [ - 'list' => $list, 'startDate' => $startDate, 'endDate' => $endDate, + 'list' => $list, 'startDate' => $startDate, 'endDate' => $endDate, 'pager' => $pager, ]), ]); } diff --git a/app/Controllers/Admin/SalesAgency.php b/app/Controllers/Admin/SalesAgency.php index 6a336af..08befa7 100644 --- a/app/Controllers/Admin/SalesAgency.php +++ b/app/Controllers/Admin/SalesAgency.php @@ -22,11 +22,12 @@ class SalesAgency extends BaseController return redirect()->to(site_url('admin'))->with('error', '지자체를 선택해 주세요.'); } - $list = $this->model->where('sa_lg_idx', $lgIdx)->orderBy('sa_idx', 'DESC')->findAll(); + $list = $this->model->where('sa_lg_idx', $lgIdx)->orderBy('sa_idx', 'DESC')->paginate(20); + $pager = $this->model->pager; return view('admin/layout', [ 'title' => '판매 대행소 관리', - 'content' => view('admin/sales_agency/index', ['list' => $list]), + 'content' => view('admin/sales_agency/index', ['list' => $list, 'pager' => $pager]), ]); } diff --git a/app/Controllers/Admin/ShopOrder.php b/app/Controllers/Admin/ShopOrder.php index fa5eb82..24bcde2 100644 --- a/app/Controllers/Admin/ShopOrder.php +++ b/app/Controllers/Admin/ShopOrder.php @@ -34,11 +34,12 @@ class ShopOrder extends BaseController if ($startDate) $builder->where('so_delivery_date >=', $startDate); if ($endDate) $builder->where('so_delivery_date <=', $endDate); - $list = $builder->orderBy('so_idx', 'DESC')->findAll(); + $list = $builder->orderBy('so_idx', 'DESC')->paginate(20); + $pager = $this->orderModel->pager; return view('admin/layout', [ 'title' => '주문 접수 관리', - 'content' => view('admin/shop_order/index', compact('list', 'startDate', 'endDate')), + 'content' => view('admin/shop_order/index', compact('list', 'startDate', 'endDate', 'pager')), ]); } diff --git a/app/Controllers/Admin/User.php b/app/Controllers/Admin/User.php index 6db9e25..672cc92 100644 --- a/app/Controllers/Admin/User.php +++ b/app/Controllers/Admin/User.php @@ -26,7 +26,8 @@ class User extends BaseController */ public function index(): string { - $list = $this->memberModel->orderBy('mb_idx', 'DESC')->findAll(); + $list = $this->memberModel->orderBy('mb_idx', 'DESC')->paginate(20); + $pager = $this->memberModel->pager; $approvalMap = []; try { $memberIds = array_map(static fn ($row) => (int) $row->mb_idx, $list); @@ -56,6 +57,7 @@ class User extends BaseController 'list' => $list, 'roles' => $this->roles, 'approvalMap' => $approvalMap, + 'pager' => $pager, ]), ]); } diff --git a/app/Controllers/Bag.php b/app/Controllers/Bag.php index ab091b5..196937c 100644 --- a/app/Controllers/Bag.php +++ b/app/Controllers/Bag.php @@ -73,7 +73,8 @@ class Bag extends BaseController $orderBuilder = model(BagOrderModel::class)->where('bo_lg_idx', $lgIdx); if ($startDate) $orderBuilder->where('bo_order_date >=', $startDate); if ($endDate) $orderBuilder->where('bo_order_date <=', $endDate); - $data['orders'] = $orderBuilder->orderBy('bo_order_date', 'DESC')->findAll(); + $data['orders'] = $orderBuilder->orderBy('bo_order_date', 'DESC')->paginate(20, 'orders'); + $data['orderPager'] = model(BagOrderModel::class)->pager; // 발주별 품목 합계 $itemSummary = []; @@ -93,7 +94,8 @@ class Bag extends BaseController $recvBuilder = model(BagReceivingModel::class)->where('br_lg_idx', $lgIdx); if ($startDate) $recvBuilder->where('br_receive_date >=', $startDate); if ($endDate) $recvBuilder->where('br_receive_date <=', $endDate); - $data['receivings'] = $recvBuilder->orderBy('br_receive_date', 'DESC')->findAll(); + $data['receivings'] = $recvBuilder->orderBy('br_receive_date', 'DESC')->paginate(20, 'receivings'); + $data['recvPager'] = model(BagReceivingModel::class)->pager; } return $this->render('발주 입고 관리', 'bag/purchase_inbound', $data); @@ -116,7 +118,8 @@ class Bag extends BaseController $builder = model(BagIssueModel::class)->where('bi2_lg_idx', $lgIdx); if ($startDate) $builder->where('bi2_issue_date >=', $startDate); if ($endDate) $builder->where('bi2_issue_date <=', $endDate); - $data['list'] = $builder->orderBy('bi2_issue_date', 'DESC')->findAll(); + $data['list'] = $builder->orderBy('bi2_issue_date', 'DESC')->paginate(20); + $data['pager'] = model(BagIssueModel::class)->pager; } return $this->render('불출 관리', 'bag/issue', $data); @@ -131,7 +134,9 @@ class Bag extends BaseController $data = ['list' => []]; if ($lgIdx) { - $data['list'] = model(BagInventoryModel::class)->where('bi_lg_idx', $lgIdx)->orderBy('bi_bag_code', 'ASC')->findAll(); + $invModel = model(BagInventoryModel::class); + $data['list'] = $invModel->where('bi_lg_idx', $lgIdx)->orderBy('bi_bag_code', 'ASC')->paginate(20); + $data['pager'] = $invModel->pager; } return $this->render('재고 관리', 'bag/inventory', $data); @@ -155,13 +160,15 @@ class Bag extends BaseController $saleBuilder = model(BagSaleModel::class)->where('bs_lg_idx', $lgIdx); if ($startDate) $saleBuilder->where('bs_sale_date >=', $startDate); if ($endDate) $saleBuilder->where('bs_sale_date <=', $endDate); - $data['salesList'] = $saleBuilder->orderBy('bs_sale_date', 'DESC')->findAll(); + $data['salesList'] = $saleBuilder->orderBy('bs_sale_date', 'DESC')->paginate(20, 'sales'); + $data['salesPager'] = model(BagSaleModel::class)->pager; // 주문 접수 $orderBuilder = model(ShopOrderModel::class)->where('so_lg_idx', $lgIdx); if ($startDate) $orderBuilder->where('so_delivery_date >=', $startDate); if ($endDate) $orderBuilder->where('so_delivery_date <=', $endDate); - $data['orderList'] = $orderBuilder->orderBy('so_idx', 'DESC')->findAll(); + $data['orderList'] = $orderBuilder->orderBy('so_idx', 'DESC')->paginate(20, 'shoporders'); + $data['orderPager'] = model(ShopOrderModel::class)->pager; } return $this->render('판매 관리', 'bag/sales', $data); @@ -184,7 +191,8 @@ class Bag extends BaseController $builder = model(BagSaleModel::class)->where('bs_lg_idx', $lgIdx)->where('bs_type', 'sale'); if ($startDate) $builder->where('bs_sale_date >=', $startDate); if ($endDate) $builder->where('bs_sale_date <=', $endDate); - $data['result'] = $builder->orderBy('bs_sale_date', 'DESC')->findAll(); + $data['result'] = $builder->orderBy('bs_sale_date', 'DESC')->paginate(20); + $data['pager'] = model(BagSaleModel::class)->pager; } return $this->render('판매 현황', 'bag/sales_stats', $data); diff --git a/app/Helpers/export_helper.php b/app/Helpers/export_helper.php new file mode 100644 index 0000000..6a38908 --- /dev/null +++ b/app/Helpers/export_helper.php @@ -0,0 +1,69 @@ +setHeader('Content-Type', 'text/csv; charset=UTF-8'); + $response->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); + $response->setHeader('Pragma', 'no-cache'); + $response->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate'); + + // UTF-8 BOM (한글 엑셀 호환) + $output = "\xEF\xBB\xBF"; + + // 헤더 행 + $output .= csv_encode_row($headers); + + // 데이터 행 + foreach ($rows as $row) { + $output .= csv_encode_row(array_values((array) $row)); + } + + $response->setBody($output); + $response->send(); + exit; + } +} + +if (! function_exists('csv_encode_row')) { + /** + * 배열 한 행을 CSV 문자열로 변환 + * + * @param array $fields + * @return string + */ + function csv_encode_row(array $fields): string + { + $escaped = []; + foreach ($fields as $field) { + $val = (string) ($field ?? ''); + // 쌍따옴표 이스케이프 및 감싸기 + if (str_contains($val, '"') || str_contains($val, ',') || str_contains($val, "\n") || str_contains($val, "\r")) { + $val = '"' . str_replace('"', '""', $val) . '"'; + } + $escaped[] = $val; + } + return implode(',', $escaped) . "\r\n"; + } +} diff --git a/app/Views/admin/access/approvals.php b/app/Views/admin/access/approvals.php index d508bcc..c981b26 100644 --- a/app/Views/admin/access/approvals.php +++ b/app/Views/admin/access/approvals.php @@ -1,5 +1,9 @@ + '권한 승인 대기']) ?>
- 권한 승인 대기 +
+ 권한 승인 대기 + +
@@ -64,3 +68,4 @@
+
links() ?>
diff --git a/app/Views/admin/access/login_history.php b/app/Views/admin/access/login_history.php index 2646f40..e7f88ca 100644 --- a/app/Views/admin/access/login_history.php +++ b/app/Views/admin/access/login_history.php @@ -1,3 +1,4 @@ + '로그인 이력']) ?>
@@ -9,6 +10,7 @@
+
@@ -35,3 +37,4 @@
+
links() ?>
diff --git a/app/Views/admin/bag_inventory/index.php b/app/Views/admin/bag_inventory/index.php index db36c65..f4891af 100644 --- a/app/Views/admin/bag_inventory/index.php +++ b/app/Views/admin/bag_inventory/index.php @@ -1,5 +1,12 @@ + '재고 현황']) ?>
- 재고 현황 +
+ 재고 현황 +
+ 엑셀저장 + +
+
@@ -28,3 +35,4 @@
+
links() ?>
diff --git a/app/Views/admin/bag_issue/index.php b/app/Views/admin/bag_issue/index.php index 023e4b7..6250cf0 100644 --- a/app/Views/admin/bag_issue/index.php +++ b/app/Views/admin/bag_issue/index.php @@ -1,7 +1,11 @@ + '무료용 불출 관리']) ?>
무료용 불출 관리 - 불출 처리 +
+ + 불출 처리 +
@@ -58,3 +62,4 @@ +
links() ?>
diff --git a/app/Views/admin/bag_order/index.php b/app/Views/admin/bag_order/index.php index 39128b1..6d0596d 100644 --- a/app/Views/admin/bag_order/index.php +++ b/app/Views/admin/bag_order/index.php @@ -1,7 +1,12 @@ + '발주 현황']) ?>
발주 현황 - 발주 등록 +
+ 엑셀저장 + + 발주 등록 +
@@ -73,3 +78,4 @@ +
links() ?>
diff --git a/app/Views/admin/bag_price/index.php b/app/Views/admin/bag_price/index.php index a4d3c3a..bc04761 100644 --- a/app/Views/admin/bag_price/index.php +++ b/app/Views/admin/bag_price/index.php @@ -1,7 +1,11 @@ + '봉투 단가 관리']) ?>
봉투 단가 관리 - 단가 등록 +
+ + 단가 등록 +
@@ -58,3 +62,4 @@ +
links() ?>
diff --git a/app/Views/admin/bag_receiving/index.php b/app/Views/admin/bag_receiving/index.php index 73040f3..8c9318c 100644 --- a/app/Views/admin/bag_receiving/index.php +++ b/app/Views/admin/bag_receiving/index.php @@ -1,7 +1,11 @@ + '입고 현황']) ?>
입고 현황 - 입고 처리 +
+ + 입고 처리 +
@@ -47,3 +51,4 @@ +
links() ?>
diff --git a/app/Views/admin/bag_sale/index.php b/app/Views/admin/bag_sale/index.php index 83ae634..e8d3888 100644 --- a/app/Views/admin/bag_sale/index.php +++ b/app/Views/admin/bag_sale/index.php @@ -1,7 +1,12 @@ + '판매/반품 관리']) ?>
판매/반품 관리 - 판매 등록 +
+ 엑셀저장 + + 판매 등록 +
@@ -61,3 +66,4 @@ +
links() ?>
diff --git a/app/Views/admin/code_detail/index.php b/app/Views/admin/code_detail/index.php index 3e5cde3..536cade 100644 --- a/app/Views/admin/code_detail/index.php +++ b/app/Views/admin/code_detail/index.php @@ -1,3 +1,4 @@ + '세부코드 관리 - ' . esc($kind->ck_name)]) ?>
@@ -5,7 +6,10 @@ | 세부코드 — ck_name) ?> (ck_code) ?>)
- 세부코드 등록 +
+ + 세부코드 등록 +
@@ -42,3 +46,4 @@
+
links() ?>
diff --git a/app/Views/admin/code_kind/index.php b/app/Views/admin/code_kind/index.php index 35c8525..166a16a 100644 --- a/app/Views/admin/code_kind/index.php +++ b/app/Views/admin/code_kind/index.php @@ -1,7 +1,11 @@ + '기본코드 종류 관리']) ?>
기본코드 종류 관리 - 코드 종류 등록 +
+ + 코드 종류 등록 +
@@ -41,3 +45,4 @@
+
links() ?>
diff --git a/app/Views/admin/company/index.php b/app/Views/admin/company/index.php index acde4e6..3c3b1b3 100644 --- a/app/Views/admin/company/index.php +++ b/app/Views/admin/company/index.php @@ -1,7 +1,11 @@ + '업체 관리']) ?>
업체 관리 - 업체 등록 +
+ + 업체 등록 +
@@ -45,3 +49,4 @@
+
links() ?>
diff --git a/app/Views/admin/designated_shop/index.php b/app/Views/admin/designated_shop/index.php index 026eb88..2adaf05 100644 --- a/app/Views/admin/designated_shop/index.php +++ b/app/Views/admin/designated_shop/index.php @@ -1,7 +1,12 @@ + '지정판매소 목록']) ?>
지정판매소 목록 - 지정판매소 등록 +
@@ -44,4 +49,5 @@
+
links() ?>
diff --git a/app/Views/admin/free_recipient/index.php b/app/Views/admin/free_recipient/index.php index ce5a864..1a2bf8f 100644 --- a/app/Views/admin/free_recipient/index.php +++ b/app/Views/admin/free_recipient/index.php @@ -1,7 +1,11 @@ + '무료용 대상자 관리']) ?>
무료용 대상자 관리 - 대상자 등록 +
+ + 대상자 등록 +
@@ -47,3 +51,4 @@
+
links() ?>
diff --git a/app/Views/admin/layout.php b/app/Views/admin/layout.php index 2c653ee..2972153 100644 --- a/app/Views/admin/layout.php +++ b/app/Views/admin/layout.php @@ -70,6 +70,14 @@ tailwind.config = { .data-table tbody tr:hover td { background-color: #e6f7ff !important; } .main-content-area { height: calc(100vh - 170px); overflow: auto; } body { overflow: hidden; } +@media print { + header, footer, .no-print, nav { display: none !important; } + .main-content-area { height: auto !important; overflow: visible !important; } + body { overflow: visible !important; } + .bg-title-bar { display: none !important; } + .bg-control-panel { break-inside: avoid; } + .print-header { display: block !important; } +} diff --git a/app/Views/admin/local_government/index.php b/app/Views/admin/local_government/index.php index 0a5afd3..b860e4c 100644 --- a/app/Views/admin/local_government/index.php +++ b/app/Views/admin/local_government/index.php @@ -1,7 +1,11 @@ + '지자체 목록']) ?>
지자체 목록 - 지자체 등록 +
+ + 지자체 등록 +
@@ -40,4 +44,5 @@
+
links() ?>
diff --git a/app/Views/admin/manager/index.php b/app/Views/admin/manager/index.php index a0d10eb..3c5fe73 100644 --- a/app/Views/admin/manager/index.php +++ b/app/Views/admin/manager/index.php @@ -1,7 +1,11 @@ + '담당자 관리']) ?>
담당자 관리 - 담당자 등록 +
+ + 담당자 등록 +
@@ -45,3 +49,4 @@
+
links() ?>
diff --git a/app/Views/admin/packaging_unit/index.php b/app/Views/admin/packaging_unit/index.php index 211e830..8a0ba84 100644 --- a/app/Views/admin/packaging_unit/index.php +++ b/app/Views/admin/packaging_unit/index.php @@ -1,7 +1,11 @@ + '포장 단위 관리']) ?>
포장 단위 관리 - 포장 단위 등록 +
+ + 포장 단위 등록 +
@@ -58,3 +62,4 @@ +
links() ?>
diff --git a/app/Views/admin/sales_agency/index.php b/app/Views/admin/sales_agency/index.php index 6ac004e..54cab40 100644 --- a/app/Views/admin/sales_agency/index.php +++ b/app/Views/admin/sales_agency/index.php @@ -1,7 +1,11 @@ + '판매 대행소 관리']) ?>
판매 대행소 관리 - 대행소 등록 +
+ + 대행소 등록 +
@@ -43,3 +47,4 @@
+
links() ?>
diff --git a/app/Views/admin/sales_report/daily_summary.php b/app/Views/admin/sales_report/daily_summary.php index 0539b58..3ff192f 100644 --- a/app/Views/admin/sales_report/daily_summary.php +++ b/app/Views/admin/sales_report/daily_summary.php @@ -1,5 +1,9 @@ + '일계표']) ?>
- 일계표 +
+ 일계표 + +
diff --git a/app/Views/admin/sales_report/period_sales.php b/app/Views/admin/sales_report/period_sales.php index ebe307b..6ed769f 100644 --- a/app/Views/admin/sales_report/period_sales.php +++ b/app/Views/admin/sales_report/period_sales.php @@ -1,5 +1,9 @@ + '기간별 판매현황']) ?>
- 기간별 판매현황 +
+ 기간별 판매현황 + +
diff --git a/app/Views/admin/sales_report/sales_ledger.php b/app/Views/admin/sales_report/sales_ledger.php index 38d6ba1..beb8308 100644 --- a/app/Views/admin/sales_report/sales_ledger.php +++ b/app/Views/admin/sales_report/sales_ledger.php @@ -1,5 +1,9 @@ + '판매 대장']) ?>
- 판매 대장 +
+ 판매 대장 + +
diff --git a/app/Views/admin/sales_report/supply_demand.php b/app/Views/admin/sales_report/supply_demand.php index f79e526..570043c 100644 --- a/app/Views/admin/sales_report/supply_demand.php +++ b/app/Views/admin/sales_report/supply_demand.php @@ -1,5 +1,9 @@ + '봉투 수불 현황']) ?>
- 봉투 수불 현황 +
+ 봉투 수불 현황 + +
diff --git a/app/Views/admin/shop_order/index.php b/app/Views/admin/shop_order/index.php index f2d4e96..6dfd076 100644 --- a/app/Views/admin/shop_order/index.php +++ b/app/Views/admin/shop_order/index.php @@ -1,7 +1,11 @@ + '주문 접수 관리']) ?>
주문 접수 관리 - 주문 접수 +
+ + 주문 접수 +
@@ -73,3 +77,4 @@ +
links() ?>
diff --git a/app/Views/admin/user/index.php b/app/Views/admin/user/index.php index b349c87..64a8bad 100644 --- a/app/Views/admin/user/index.php +++ b/app/Views/admin/user/index.php @@ -1,7 +1,11 @@ + '회원 목록']) ?>
회원 목록 - 회원 등록 +
+ + 회원 등록 +
@@ -53,3 +57,4 @@
+
links() ?>
diff --git a/app/Views/bag/layout/main.php b/app/Views/bag/layout/main.php index 8f63056..6d3d424 100644 --- a/app/Views/bag/layout/main.php +++ b/app/Views/bag/layout/main.php @@ -52,6 +52,14 @@ tailwind.config = { .data-table tbody tr:hover td { background-color: #e6f7ff !important; } .main-content-area { height: calc(100vh - 130px); overflow: auto; } body { overflow: hidden; } +@media print { + header, footer, .no-print, nav { display: none !important; } + .main-content-area { height: auto !important; overflow: visible !important; } + body { overflow: visible !important; } + .bg-title-bar { display: none !important; } + .bg-control-panel { break-inside: avoid; } + .print-header { display: block !important; } +} diff --git a/app/Views/components/pager.php b/app/Views/components/pager.php new file mode 100644 index 0000000..a4028f2 --- /dev/null +++ b/app/Views/components/pager.php @@ -0,0 +1,38 @@ +setSurroundCount(2); +?> + +hasPreviousPage() || $pager->hasNextPage()): ?> + + diff --git a/app/Views/components/print_header.php b/app/Views/components/print_header.php new file mode 100644 index 0000000..7d54826 --- /dev/null +++ b/app/Views/components/print_header.php @@ -0,0 +1,55 @@ +find($lgIdx); + $printLgName = $lgRow ? $lgRow->lg_name : ''; + } +} +$printDate = $printDate ?? date('Y-m-d'); +$printTitle = $printTitle ?? ''; +?> + + + +