프레임 프린트 기능 메모
<?php
if(!defined('_SCM_')) exit;
//print_r2($_POST);
$list = $_POST['list'];
$menu = array();
if(sizeof($list) > 0){
foreach($list[0] as $menuName => $value){
if(substr($menuName, 0, 1) == "_"){
continue;
}
$menu[] = $menuName;
}
}
?>
<table width="100%">
<tr>
<td align="left">
<button type="button" class="btn btn-primary" id="outGoingPrintBtn"><i class="fa fa-print"></i> 출고지시서 출력</button>
</td>
<td align="right">
<button type="button" class="btn btn-primary" onclick="ajy_modal.open(this);" json='{"name":"outGoingSheetItemAddModal","getParameter":{"idx":""}}'><i class="fa fa-plus"></i> 출고 등록</button>
</td>
</tr>
</table>
<div id="outGoingSheetItemListBox">
<table class="table xtable-bordered outGoingSheetItemListTable table-hover table_scroll" style="margin-top:10px;">
<?php
if(sizeof($menu) > 0){
?>
<thead>
<tr>
<?php
foreach($menu as $menuName){
echo "<th class='text-center'>".$menuName."</th>";
}
?>
</tr>
</thead>
<?php
}
?>
<tbody>
<?php
if(sizeof($list) > 0){
foreach($list as $key => $row) {
?>
<tr>
<?php
foreach($row as $menuName => $value){
if(substr($menuName, 0, 1) == "_"){
continue;
}
?>
<td class='text-left outGoingSheetItemListTd' style="cursor:pointer;" json='<?=json_encode($row)?>'><?=$value?></td>
<?php
}
?>
<?php
}
}
else{
?>
<tr>
<td align="center"> - </td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<iframe id="printFrame" name="printFrame" src="?v=outGoingSheetItemListPrint" style="width:0px;height:0px;" onload="gogoPrint();"></iframe>
<div style="display:none;" id="printFormBox"></div>
<script>
var isPrintGo = false;
var frm = document.getElementById("printFrame").contentWindow;
$(document).off("click", "#outGoingPrintBtn");
$(document).on ("click", "#outGoingPrintBtn", function(){
var json = $.parseJSON($(".outGoingAccountTd_NOW").attr("json"));
//console.log(json);
var content = $("#outGoingSheetItemListBox").html();
var form = "";
form += "<form method='post' id='outGoingPrintForm' action='?v=outGoingSheetItemListPrint' target='printFrame'>";
form += " <input type='text' name='content' value='" + encodeURIComponent(content) + "' />";
form += " <input type='text' name='_OutSheetNum' value='" + encodeURIComponent(json._OutSheetNum) + "' />";
form += " <input type='text' name='_CltComName' value='" + encodeURIComponent(json._CltComName) + "' />";
form += "</form>";
$("#printFormBox").html(form);
$("#outGoingPrintForm").submit();
isPrintGo = true;
});
function gogoPrint(){
if(isPrintGo){
frm.focus();
frm.print();
}
}
</script>
<?php
/*
<script>
$(document).off("click", ".outGoingSheetItemListTd");
$(document).on ("click", ".outGoingSheetItemListTd", function(res){
$(".outGoingSheetItemListTd").parents("tr").css("background-color", "#FFFFFF");
$(this).parents("tr").css("background-color", "#f1f1f1");
//클릭데이터 유지
$(".outGoingSheetItemListTd").removeClass("outGoingSheetItemListTd_NOW");
$(this).addClass("outGoingSheetItemListTd_NOW");
var json = $.parseJSON($(this).attr("json"));
var param = {
"_TrgComRegNum" : json._CltRegNum,
};
$("#outGoingSheetItemList").html("<?=LOADING_IMAGE?>");
$.post("?v=proc&f=Out_GetOutSheetItemList", param, function(res){
$.post("?v=outGoingSheetItemList", res, function(html){
$("#outGoingSheetItemList").html(html);
}, "html");
}, "json");
});
$(document).ready(function(){
tableAutoResize();
$(".outGoingSheetItemListTd").eq(0).trigger("click");
});
</script>
*/
?>