초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
This commit is contained in:
756
analysis/bending_write_form.php
Normal file
756
analysis/bending_write_form.php
Normal file
@@ -0,0 +1,756 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=5) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["mode"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="not";
|
||||
$outputnum=$_REQUEST["outputnum"]; // 출고현황에서 넘어온 출고번호
|
||||
$callback=$_REQUEST["callback"]; // 출고현황에서 체크번호
|
||||
|
||||
if((int)$num>=1)
|
||||
{
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.atbending where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$counter = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
|
||||
if($counter>=1) {
|
||||
$mode="modify"; //수정모드로 전환
|
||||
$num=$row["num"];
|
||||
// print "번호를 찾았습니다.<br>" . $num;
|
||||
}
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($_REQUEST["num"])) //수정 버튼을 클릭해서 호출했는지 체크 출고현황에서 부르지 않았을때
|
||||
$num=$_REQUEST["num"];
|
||||
else
|
||||
$num=0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(isset($_REQUEST["page"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1;
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
|
||||
if(isset($_REQUEST["sort"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$sort=$_REQUEST["sort"];
|
||||
else
|
||||
$sort="1";
|
||||
|
||||
if(isset($_REQUEST["outdate"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$outdate=$_REQUEST["outdate"];
|
||||
else
|
||||
$outdate="";
|
||||
|
||||
if(isset($_REQUEST["item_indate"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_indate=$_REQUEST["item_indate"];
|
||||
else
|
||||
$item_indate="";
|
||||
|
||||
if(isset($_REQUEST["item_outworkplace"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_outworkplace=$_REQUEST["item_outworkplace"];
|
||||
else
|
||||
$item_outworkplace="";
|
||||
|
||||
if(isset($_REQUEST["item_receiver"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_receiver=$_REQUEST["item_receiver"];
|
||||
else
|
||||
$item_receiver="";
|
||||
|
||||
if(isset($_REQUEST["item_orderman"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_orderman=$_REQUEST["item_orderman"];
|
||||
else
|
||||
$item_orderman="";
|
||||
|
||||
if(isset($_REQUEST["item_outputplace"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_outputplace=$_REQUEST["item_outputplace"];
|
||||
else
|
||||
$item_outputplace="";
|
||||
|
||||
if(isset($_REQUEST["item_phone"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_phone=$_REQUEST["item_phone"];
|
||||
else
|
||||
$item_phone="";
|
||||
|
||||
if(isset($_REQUEST["item_comment"]))
|
||||
$item_comment=$_REQUEST["item_comment"];
|
||||
else
|
||||
$item_comment="";
|
||||
|
||||
if(isset($_REQUEST["delivery"]))
|
||||
$item_delivery=$_REQUEST["delivery"];
|
||||
else
|
||||
$item_delivery="";
|
||||
|
||||
$modify="0"; // 정렬모드 초기화
|
||||
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
$outputnumint=(int)$outputnum;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($mode=="modify"){
|
||||
try{
|
||||
$sql = "select * from chandj.atbending where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$count = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
if($count<1){
|
||||
print "검색결과가 없습니다.<br>";
|
||||
}else{
|
||||
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
$copy_steeltype=$row["steeltype"];
|
||||
|
||||
$copied_file_name=$row["copied_file_name"];
|
||||
$uploaded_file=$row["uploaded_file"];
|
||||
|
||||
|
||||
$a1=$row["a1"];
|
||||
$a2=$row["a2"];
|
||||
$a3=$row["a3"];
|
||||
$a4=$row["a4"];
|
||||
$a5=$row["a5"];
|
||||
$a6=$row["a6"];
|
||||
$a7=$row["a7"];
|
||||
$a8=$row["a8"];
|
||||
$a9=$row["a9"];
|
||||
$a10=$row["a10"];
|
||||
$a11=$row["a11"];
|
||||
$a12=$row["a12"];
|
||||
$a13=$row["a13"];
|
||||
$a14=$row["a14"];
|
||||
$a15=$row["a15"];
|
||||
$a16=$row["a16"];
|
||||
$a17=$row["a17"];
|
||||
$a18=$row["a18"];
|
||||
$a19=$row["a19"];
|
||||
$a20=$row["a20"];
|
||||
$a21=$row["a21"];
|
||||
$a22=$row["a22"];
|
||||
$a23=$row["a23"];
|
||||
$a24=$row["a24"];
|
||||
$a25=$row["a25"];
|
||||
$b1=$row["b1"];
|
||||
$b2=$row["b2"];
|
||||
$b3=$row["b3"];
|
||||
$b4=$row["b4"];
|
||||
$b5=$row["b5"];
|
||||
$b6=$row["b6"];
|
||||
$b7=$row["b7"];
|
||||
$b8=$row["b8"];
|
||||
$b9=$row["b9"];
|
||||
$b10=$row["b10"];
|
||||
$b11=$row["b11"];
|
||||
$b12=$row["b12"];
|
||||
$b13=$row["b13"];
|
||||
$b14=$row["b14"];
|
||||
$b15=$row["b15"];
|
||||
$b16=$row["b16"];
|
||||
$b17=$row["b17"];
|
||||
$b18=$row["b18"];
|
||||
$b19=$row["b19"];
|
||||
$b20=$row["b20"];
|
||||
$b21=$row["b21"];
|
||||
$b22=$row["b22"];
|
||||
$b23=$row["b23"];
|
||||
$b24=$row["b24"];
|
||||
$b25=$row["b25"];
|
||||
$c1=$row["c1"];
|
||||
$c2=$row["c2"];
|
||||
$c3=$row["c3"];
|
||||
$c4=$row["c4"];
|
||||
$c5=$row["c5"];
|
||||
$c6=$row["c6"];
|
||||
$c7=$row["c7"];
|
||||
$c8=$row["c8"];
|
||||
$c9=$row["c9"];
|
||||
$c10=$row["c10"];
|
||||
$c11=$row["c11"];
|
||||
$c12=$row["c12"];
|
||||
$c13=$row["c13"];
|
||||
$c14=$row["c14"];
|
||||
$c15=$row["c15"];
|
||||
$c16=$row["c16"];
|
||||
$c17=$row["c17"];
|
||||
$c18=$row["c18"];
|
||||
$c19=$row["c19"];
|
||||
$c20=$row["c20"];
|
||||
$c21=$row["c21"];
|
||||
$c22=$row["c22"];
|
||||
$c23=$row["c23"];
|
||||
$c24=$row["c24"];
|
||||
$c25=$row["c25"];
|
||||
$d1=$row["d1"];
|
||||
$d2=$row["d2"];
|
||||
$d3=$row["d3"];
|
||||
$d4=$row["d4"];
|
||||
$d5=$row["d5"];
|
||||
$d6=$row["d6"];
|
||||
$d7=$row["d7"];
|
||||
$d8=$row["d8"];
|
||||
$d9=$row["d9"];
|
||||
$d10=$row["d10"];
|
||||
$d11=$row["d11"];
|
||||
$d12=$row["d12"];
|
||||
$d13=$row["d13"];
|
||||
$d14=$row["d14"];
|
||||
$d15=$row["d15"];
|
||||
$d16=$row["d16"];
|
||||
$d17=$row["d17"];
|
||||
$d18=$row["d18"];
|
||||
$d19=$row["d19"];
|
||||
$d20=$row["d20"];
|
||||
$d21=$row["d21"];
|
||||
$d22=$row["d22"];
|
||||
$d23=$row["d23"];
|
||||
$d24=$row["d24"];
|
||||
$d25=$row["d25"];
|
||||
$e1=$row["e1"];
|
||||
$e2=$row["e2"];
|
||||
$e3=$row["e3"];
|
||||
$e4=$row["e4"];
|
||||
$e5=$row["e5"];
|
||||
$e6=$row["e6"];
|
||||
$e7=$row["e7"];
|
||||
$e8=$row["e8"];
|
||||
$e9=$row["e9"];
|
||||
$e10=$row["e10"];
|
||||
$e11=$row["e11"];
|
||||
$e12=$row["e12"];
|
||||
$e13=$row["e13"];
|
||||
$e14=$row["e14"];
|
||||
$e15=$row["e15"];
|
||||
$e16=$row["e16"];
|
||||
$e17=$row["e17"];
|
||||
$e18=$row["e18"];
|
||||
$e19=$row["e19"];
|
||||
$e20=$row["e20"];
|
||||
$e21=$row["e21"];
|
||||
$e22=$row["e22"];
|
||||
$e23=$row["e23"];
|
||||
$e24=$row["e24"];
|
||||
$e25=$row["e25"];
|
||||
$f1=$row["f1"];
|
||||
$f2=$row["f2"];
|
||||
$f3=$row["f3"];
|
||||
$f4=$row["f4"];
|
||||
$f5=$row["f5"];
|
||||
$f6=$row["f6"];
|
||||
$f7=$row["f7"];
|
||||
$f8=$row["f8"];
|
||||
$f9=$row["f9"];
|
||||
$f10=$row["f10"];
|
||||
$f11=$row["f11"];
|
||||
$f12=$row["f12"];
|
||||
$f13=$row["f13"];
|
||||
$f14=$row["f14"];
|
||||
$f15=$row["f15"];
|
||||
$f16=$row["f16"];
|
||||
$f17=$row["f17"];
|
||||
$f18=$row["f18"];
|
||||
$f19=$row["f19"];
|
||||
$f20=$row["f20"];
|
||||
$f21=$row["f21"];
|
||||
$f22=$row["f22"];
|
||||
$f23=$row["f23"];
|
||||
$f24=$row["f24"];
|
||||
$f25=$row["f25"];
|
||||
$g1=$row["g1"];
|
||||
$g2=$row["g2"];
|
||||
$g3=$row["g3"];
|
||||
$g4=$row["g4"];
|
||||
$g5=$row["g5"];
|
||||
$g6=$row["g6"];
|
||||
$g7=$row["g7"];
|
||||
$g8=$row["g8"];
|
||||
$g9=$row["g9"];
|
||||
$g10=$row["g10"];
|
||||
$g11=$row["g11"];
|
||||
$g12=$row["g12"];
|
||||
$g13=$row["g13"];
|
||||
$g14=$row["g14"];
|
||||
$g15=$row["g15"];
|
||||
$g16=$row["g16"];
|
||||
$g17=$row["g17"];
|
||||
$g18=$row["g18"];
|
||||
$g19=$row["g19"];
|
||||
$g20=$row["g20"];
|
||||
$g21=$row["g21"];
|
||||
$g22=$row["g22"];
|
||||
$g23=$row["g23"];
|
||||
$g24=$row["g24"];
|
||||
$g25=$row["g25"];
|
||||
$h1=$row["h1"];
|
||||
$h2=$row["h2"];
|
||||
$h3=$row["h3"];
|
||||
$h4=$row["h4"];
|
||||
$h5=$row["h5"];
|
||||
$h6=$row["h6"];
|
||||
$h7=$row["h7"];
|
||||
$h8=$row["h8"];
|
||||
$h9=$row["h9"];
|
||||
$h10=$row["h10"];
|
||||
$h11=$row["h11"];
|
||||
$h12=$row["h12"];
|
||||
$h13=$row["h13"];
|
||||
$h14=$row["h14"];
|
||||
$h15=$row["h15"];
|
||||
$h16=$row["h16"];
|
||||
$h17=$row["h17"];
|
||||
$h18=$row["h18"];
|
||||
$h19=$row["h19"];
|
||||
$h20=$row["h20"];
|
||||
$h21=$row["h21"];
|
||||
$h22=$row["h22"];
|
||||
$h23=$row["h23"];
|
||||
$h24=$row["h24"];
|
||||
$h25=$row["h25"];
|
||||
|
||||
|
||||
}
|
||||
}catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode=="not"){ // 수정모드가 아닐때 신규 자료일때는 변수 초기화 한다.
|
||||
|
||||
$outdate=date("Y-m-d");
|
||||
$outputnum=null;
|
||||
$item_indate=date("Y-m-d");
|
||||
$item_orderman=$_SESSION["name"];
|
||||
$item_outworkplace=null;
|
||||
$item_outputplace=null;
|
||||
$item_receiver=null;
|
||||
$item_phone=null;
|
||||
$item_comment=null;
|
||||
$item_delivery=null;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/radio.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bending_write.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="/order/order.js"></script>
|
||||
|
||||
<div id="wrap">
|
||||
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<br><br>
|
||||
<?php
|
||||
if($mode=="modify"){
|
||||
?>
|
||||
<form name="board_form" method="post" action="bendingdata_insert.php?mode=modify&num=<?=$num?>&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>" enctype="multipart/form-data">
|
||||
<?php }
|
||||
else {
|
||||
?>
|
||||
<form name="board_form" method="post" action="bendingdata_insert.php?mode=not&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>&callback=1" enctype="multipart/form-data">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="work_col3"> <h2> 절곡데이터 등록/수정 데이터 고유번호: <?=$num?> </h2>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div id="sero1"> 절곡구분 : </div>
|
||||
<div id="sero2">
|
||||
<select name="steeltype" id="steeltype">
|
||||
<option value=""></option>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[1] = '가이드레일';
|
||||
$options[2] = '포스트';
|
||||
$options[3] = '셔터박스';
|
||||
$options[4] = '마구리';
|
||||
$options[5] = '린텔';
|
||||
$options[6] = '절단판';
|
||||
$options[7] = '알몰딩';
|
||||
$options[8] = '알케이스';
|
||||
$options[9] = '보강';
|
||||
$options[10] = '삼각쫄대';
|
||||
$options[11]= '짜부가스켓';
|
||||
$options[12] = '하장바';
|
||||
$options[13] = '엘바';
|
||||
$options[14] = '평철';
|
||||
$options[15] = '갈바앵글';
|
||||
$options[16] = '기타절곡물';
|
||||
|
||||
|
||||
if (! empty($options)) {
|
||||
foreach ($options as $key => $val) {
|
||||
$sel="";
|
||||
if($copy_steeltype==$val)
|
||||
$sel="selected";
|
||||
?>
|
||||
<option value="<?php echo $val;?>" <?php echo $sel;?> > <?php echo $val;?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div id="sero7"> <input type="text" id="steel_alias" name="steel_alias" size="45" value="<?=$steel_alias?>" > </div>
|
||||
|
||||
<div id="sero3"> 이미지등록 : </div>
|
||||
<div id="sero4">
|
||||
|
||||
<?php
|
||||
if($mode=="modify"&& $copied_file_name!="") {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="file" name="upfile" class="inp-img" accept=".gif, .jpg, .png"> <span class="btn-delete">삭제</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($mode=="modify" && $copied_file_name)
|
||||
{
|
||||
?>
|
||||
<div class="delete_ok">
|
||||
<a href="<?=$uploaded_file?>" onclick="window.open(this.href,'파일보기',width=800,height=600); return false;" style="color:blue;"> <b> <?=$copied_file_name?> </b> </a>
|
||||
등록
|
||||
<input type="checkbox" name="del_file[]" value="1"> 삭제 </div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="work_col_left">
|
||||
<div id="preview">
|
||||
<?php
|
||||
if($mode=="modify") {
|
||||
print '<img src="' . $uploaded_file . '">';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
// 등록 이미지 등록 미리보기
|
||||
function readInputFile(input) {
|
||||
if(input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
$('#preview').html("<img src="+ e.target.result +">");
|
||||
}
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$(".inp-img").on('change', function(){
|
||||
readInputFile(this);
|
||||
});
|
||||
|
||||
|
||||
// 등록 이미지 삭제 ( input file reset )
|
||||
function resetInputFile($input, $preview) {
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
if((navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (agent.indexOf("msie") != -1)) {
|
||||
// ie 일때
|
||||
$input.replaceWith($input.clone(true));
|
||||
$preview.empty();
|
||||
} else {
|
||||
//other
|
||||
$input.val("");
|
||||
$preview.empty();
|
||||
}
|
||||
}
|
||||
|
||||
$(".btn-delete").click(function(event) {
|
||||
var $input = $(".inp-img");
|
||||
var $preview = $('#preview');
|
||||
resetInputFile($input, $preview);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="work_col_right">
|
||||
<br><br>
|
||||
<?php
|
||||
for($j=0;$j<=7;$j++) {
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
print '<div class="a_col"> </div>'; // 첫 타이틀
|
||||
for($i=1;$i<=25;$i++) {
|
||||
print '<div class="a_col">' . $str . $i . '</div>';
|
||||
}
|
||||
print ' <div class="clear"></div> ';
|
||||
print '<div class="a_col">' . ($j+1) . '행</div>';
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
if((int)$arr[$temp]>0)
|
||||
$altertmp=$arr[$temp];
|
||||
else
|
||||
$altertmp="";
|
||||
|
||||
print '<input type="text" name="' . $str . ($i+1) . '" id="' . $str . ($i+1) .'" style="width:36px;height:15px;color:blue;font-size:17px;" value="' . $altertmp . '">';
|
||||
}
|
||||
print ' <div class="clear"></div> ';
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="hidden" id="copied_file_name" name="copied_file_name" value="<?=$copied_file_name?>" size="5" >
|
||||
<input type="hidden" id="uploaded_file" name="uploaded_file" value="<?=$uploaded_file?>" size="5" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>" size="5" >
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br><br>
|
||||
<div id="write_button">
|
||||
<button > <img src="../img/savefile.png"></button>
|
||||
|
||||
<a href="bendingdatalist.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>"><img src="../img/list.png"></a>
|
||||
</div> <br>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end of col3 -->
|
||||
</div> <!-- end of wrap -->
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("fromdate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
$("#todate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
|
||||
});
|
||||
|
||||
function inputNumberFormat(obj) {
|
||||
obj.value = comma(uncomma(obj.value));
|
||||
}
|
||||
function comma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
function uncomma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/[^\d]+/g, '');
|
||||
}
|
||||
|
||||
|
||||
function date_mask(formd, textid) {
|
||||
|
||||
/*
|
||||
input onkeyup에서
|
||||
formd == this.form.name
|
||||
textid == this.name
|
||||
*/
|
||||
|
||||
var form = eval("document."+formd);
|
||||
var text = eval("form."+textid);
|
||||
|
||||
var textlength = text.value.length;
|
||||
|
||||
if (textlength == 4) {
|
||||
text.value = text.value + "-";
|
||||
} else if (textlength == 7) {
|
||||
text.value = text.value + "-";
|
||||
} else if (textlength > 9) {
|
||||
//날짜 수동 입력 Validation 체크
|
||||
var chk_date = checkdate(text);
|
||||
|
||||
if (chk_date == false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkdate(input) {
|
||||
var validformat = /^\d{4}\-\d{2}\-\d{2}$/; //Basic check for format validity
|
||||
var returnval = false;
|
||||
|
||||
if (!validformat.test(input.value)) {
|
||||
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
|
||||
} else { //Detailed check for valid date ranges
|
||||
var yearfield = input.value.split("-")[0];
|
||||
var monthfield = input.value.split("-")[1];
|
||||
var dayfield = input.value.split("-")[2];
|
||||
var dayobj = new Date(yearfield, monthfield - 1, dayfield);
|
||||
}
|
||||
|
||||
if ((dayobj.getMonth() + 1 != monthfield)
|
||||
|| (dayobj.getDate() != dayfield)
|
||||
|| (dayobj.getFullYear() != yearfield)) {
|
||||
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
|
||||
} else {
|
||||
//alert ('Correct date');
|
||||
returnval = true;
|
||||
}
|
||||
if (returnval == false) {
|
||||
input.select();
|
||||
}
|
||||
return returnval;
|
||||
}
|
||||
|
||||
function input_Text(){
|
||||
document.getElementById("test").value = comma(Math.floor(uncomma(document.getElementById("test").value)*1.1)); // 콤마를 계산해 주고 다시 붙여주고
|
||||
var copyText = document.getElementById("test"); // 클립보드 복사
|
||||
copyText.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
|
||||
function captureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function recaptureReturnKey(e) {
|
||||
if (e.keyCode==13)
|
||||
exe_search();
|
||||
}
|
||||
function Enter_Check(){
|
||||
// 엔터키의 코드는 13입니다.
|
||||
if(event.keyCode == 13){
|
||||
exe_search(); // 실행할 이벤트
|
||||
}
|
||||
}
|
||||
function Enter_CheckTel(){
|
||||
// 엔터키의 코드는 13입니다.
|
||||
if(event.keyCode == 13){
|
||||
exe_searchTel(); // 실행할 이벤트
|
||||
}
|
||||
}
|
||||
|
||||
function exe_search()
|
||||
{
|
||||
var postData = changeUri(document.getElementById("outworkplace").value);
|
||||
var sendData = $(":input:radio[name=root]:checked").val();
|
||||
|
||||
$("#displaysearch").show();
|
||||
// if(sendData=='주일')
|
||||
// $("#displaysearch").load("./search.php?mode=search&search=" + postData);
|
||||
// if(sendData=='경동')
|
||||
$("#displaysearch").load("./searchkd.php?mode=search&search=" + postData);
|
||||
}
|
||||
function exe_searchTel()
|
||||
{
|
||||
var postData = changeUri(document.getElementById("receiver").value);
|
||||
$("#displaysearchworker").show();
|
||||
$("#displaysearchworker").load("./workerlist.php?mode=search&search=" + postData);
|
||||
}
|
||||
function del(href)
|
||||
{
|
||||
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
|
||||
document.location.href = href;
|
||||
}
|
||||
}
|
||||
|
||||
function sortall(){
|
||||
var sort;
|
||||
sort=$("#sort").val();
|
||||
if(sort=='1')
|
||||
$("#sort").val("2");
|
||||
else
|
||||
$("#sort").val("1");
|
||||
$("#modify").val("1"); // 소팅할 것
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function saveit() {
|
||||
// $("#modify").val("1"); // 이전화면 유지
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
var tmp=$("#mode").val();
|
||||
var type_tmp=$("#steeltype").val();
|
||||
if(tmp=='modify')
|
||||
$("#steeltype").val(type_tmp).prop("selected", true); // 선택사항 변경
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
693
analysis/bendingdata_copy.php
Normal file
693
analysis/bendingdata_copy.php
Normal file
@@ -0,0 +1,693 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=5) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$num=$_REQUEST["num"]; // 출고현황에서 체크번호
|
||||
$callback=$_REQUEST["callback"]; // 출고현황에서 체크번호
|
||||
|
||||
if(isset($_REQUEST["page"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1;
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
|
||||
if(isset($_REQUEST["sort"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$sort=$_REQUEST["sort"];
|
||||
else
|
||||
$sort="1";
|
||||
|
||||
if(isset($_REQUEST["indate"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$indate=$_REQUEST["indate"];
|
||||
else
|
||||
$indate="";
|
||||
|
||||
if(isset($_REQUEST["item_outworkplace"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_outworkplace=$_REQUEST["item_outworkplace"];
|
||||
else
|
||||
$item_outworkplace="";
|
||||
|
||||
if(isset($_REQUEST["item_receiver"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_receiver=$_REQUEST["item_receiver"];
|
||||
else
|
||||
$item_receiver="";
|
||||
|
||||
if(isset($_REQUEST["item_orderman"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_orderman=$_REQUEST["item_orderman"];
|
||||
else
|
||||
$item_orderman="";
|
||||
|
||||
if(isset($_REQUEST["item_outputplace"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_outputplace=$_REQUEST["item_outputplace"];
|
||||
else
|
||||
$item_outputplace="";
|
||||
|
||||
if(isset($_REQUEST["item_phone"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_phone=$_REQUEST["item_phone"];
|
||||
else
|
||||
$item_phone="";
|
||||
|
||||
if(isset($_REQUEST["item_comment"]))
|
||||
$item_comment=$_REQUEST["item_comment"];
|
||||
else
|
||||
$item_comment="";
|
||||
|
||||
if(isset($_REQUEST["delivery"]))
|
||||
$item_delivery=$_REQUEST["delivery"];
|
||||
else
|
||||
$item_delivery="";
|
||||
|
||||
$modify="0"; // 정렬모드 초기화
|
||||
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
$outputnumint=(int)$outputnum;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.atbending where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$count = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
$copy_steeltype=$row["steeltype"];
|
||||
|
||||
$copied_file_name=$row["copied_file_name"];
|
||||
$uploaded_file=$row["uploaded_file"];
|
||||
|
||||
$a1=$row["a1"];
|
||||
$a2=$row["a2"];
|
||||
$a3=$row["a3"];
|
||||
$a4=$row["a4"];
|
||||
$a5=$row["a5"];
|
||||
$a6=$row["a6"];
|
||||
$a7=$row["a7"];
|
||||
$a8=$row["a8"];
|
||||
$a9=$row["a9"];
|
||||
$a10=$row["a10"];
|
||||
$a11=$row["a11"];
|
||||
$a12=$row["a12"];
|
||||
$a13=$row["a13"];
|
||||
$a14=$row["a14"];
|
||||
$a15=$row["a15"];
|
||||
$a16=$row["a16"];
|
||||
$a17=$row["a17"];
|
||||
$a18=$row["a18"];
|
||||
$a19=$row["a19"];
|
||||
$a20=$row["a20"];
|
||||
$a21=$row["a21"];
|
||||
$a22=$row["a22"];
|
||||
$a23=$row["a23"];
|
||||
$a24=$row["a24"];
|
||||
$a25=$row["a25"];
|
||||
$b1=$row["b1"];
|
||||
$b2=$row["b2"];
|
||||
$b3=$row["b3"];
|
||||
$b4=$row["b4"];
|
||||
$b5=$row["b5"];
|
||||
$b6=$row["b6"];
|
||||
$b7=$row["b7"];
|
||||
$b8=$row["b8"];
|
||||
$b9=$row["b9"];
|
||||
$b10=$row["b10"];
|
||||
$b11=$row["b11"];
|
||||
$b12=$row["b12"];
|
||||
$b13=$row["b13"];
|
||||
$b14=$row["b14"];
|
||||
$b15=$row["b15"];
|
||||
$b16=$row["b16"];
|
||||
$b17=$row["b17"];
|
||||
$b18=$row["b18"];
|
||||
$b19=$row["b19"];
|
||||
$b20=$row["b20"];
|
||||
$b21=$row["b21"];
|
||||
$b22=$row["b22"];
|
||||
$b23=$row["b23"];
|
||||
$b24=$row["b24"];
|
||||
$b25=$row["b25"];
|
||||
$c1=$row["c1"];
|
||||
$c2=$row["c2"];
|
||||
$c3=$row["c3"];
|
||||
$c4=$row["c4"];
|
||||
$c5=$row["c5"];
|
||||
$c6=$row["c6"];
|
||||
$c7=$row["c7"];
|
||||
$c8=$row["c8"];
|
||||
$c9=$row["c9"];
|
||||
$c10=$row["c10"];
|
||||
$c11=$row["c11"];
|
||||
$c12=$row["c12"];
|
||||
$c13=$row["c13"];
|
||||
$c14=$row["c14"];
|
||||
$c15=$row["c15"];
|
||||
$c16=$row["c16"];
|
||||
$c17=$row["c17"];
|
||||
$c18=$row["c18"];
|
||||
$c19=$row["c19"];
|
||||
$c20=$row["c20"];
|
||||
$c21=$row["c21"];
|
||||
$c22=$row["c22"];
|
||||
$c23=$row["c23"];
|
||||
$c24=$row["c24"];
|
||||
$c25=$row["c25"];
|
||||
$d1=$row["d1"];
|
||||
$d2=$row["d2"];
|
||||
$d3=$row["d3"];
|
||||
$d4=$row["d4"];
|
||||
$d5=$row["d5"];
|
||||
$d6=$row["d6"];
|
||||
$d7=$row["d7"];
|
||||
$d8=$row["d8"];
|
||||
$d9=$row["d9"];
|
||||
$d10=$row["d10"];
|
||||
$d11=$row["d11"];
|
||||
$d12=$row["d12"];
|
||||
$d13=$row["d13"];
|
||||
$d14=$row["d14"];
|
||||
$d15=$row["d15"];
|
||||
$d16=$row["d16"];
|
||||
$d17=$row["d17"];
|
||||
$d18=$row["d18"];
|
||||
$d19=$row["d19"];
|
||||
$d20=$row["d20"];
|
||||
$d21=$row["d21"];
|
||||
$d22=$row["d22"];
|
||||
$d23=$row["d23"];
|
||||
$d24=$row["d24"];
|
||||
$d25=$row["d25"];
|
||||
$e1=$row["e1"];
|
||||
$e2=$row["e2"];
|
||||
$e3=$row["e3"];
|
||||
$e4=$row["e4"];
|
||||
$e5=$row["e5"];
|
||||
$e6=$row["e6"];
|
||||
$e7=$row["e7"];
|
||||
$e8=$row["e8"];
|
||||
$e9=$row["e9"];
|
||||
$e10=$row["e10"];
|
||||
$e11=$row["e11"];
|
||||
$e12=$row["e12"];
|
||||
$e13=$row["e13"];
|
||||
$e14=$row["e14"];
|
||||
$e15=$row["e15"];
|
||||
$e16=$row["e16"];
|
||||
$e17=$row["e17"];
|
||||
$e18=$row["e18"];
|
||||
$e19=$row["e19"];
|
||||
$e20=$row["e20"];
|
||||
$e21=$row["e21"];
|
||||
$e22=$row["e22"];
|
||||
$e23=$row["e23"];
|
||||
$e24=$row["e24"];
|
||||
$e25=$row["e25"];
|
||||
$f1=$row["f1"];
|
||||
$f2=$row["f2"];
|
||||
$f3=$row["f3"];
|
||||
$f4=$row["f4"];
|
||||
$f5=$row["f5"];
|
||||
$f6=$row["f6"];
|
||||
$f7=$row["f7"];
|
||||
$f8=$row["f8"];
|
||||
$f9=$row["f9"];
|
||||
$f10=$row["f10"];
|
||||
$f11=$row["f11"];
|
||||
$f12=$row["f12"];
|
||||
$f13=$row["f13"];
|
||||
$f14=$row["f14"];
|
||||
$f15=$row["f15"];
|
||||
$f16=$row["f16"];
|
||||
$f17=$row["f17"];
|
||||
$f18=$row["f18"];
|
||||
$f19=$row["f19"];
|
||||
$f20=$row["f20"];
|
||||
$f21=$row["f21"];
|
||||
$f22=$row["f22"];
|
||||
$f23=$row["f23"];
|
||||
$f24=$row["f24"];
|
||||
$f25=$row["f25"];
|
||||
$g1=$row["g1"];
|
||||
$g2=$row["g2"];
|
||||
$g3=$row["g3"];
|
||||
$g4=$row["g4"];
|
||||
$g5=$row["g5"];
|
||||
$g6=$row["g6"];
|
||||
$g7=$row["g7"];
|
||||
$g8=$row["g8"];
|
||||
$g9=$row["g9"];
|
||||
$g10=$row["g10"];
|
||||
$g11=$row["g11"];
|
||||
$g12=$row["g12"];
|
||||
$g13=$row["g13"];
|
||||
$g14=$row["g14"];
|
||||
$g15=$row["g15"];
|
||||
$g16=$row["g16"];
|
||||
$g17=$row["g17"];
|
||||
$g18=$row["g18"];
|
||||
$g19=$row["g19"];
|
||||
$g20=$row["g20"];
|
||||
$g21=$row["g21"];
|
||||
$g22=$row["g22"];
|
||||
$g23=$row["g23"];
|
||||
$g24=$row["g24"];
|
||||
$g25=$row["g25"];
|
||||
$h1=$row["h1"];
|
||||
$h2=$row["h2"];
|
||||
$h3=$row["h3"];
|
||||
$h4=$row["h4"];
|
||||
$h5=$row["h5"];
|
||||
$h6=$row["h6"];
|
||||
$h7=$row["h7"];
|
||||
$h8=$row["h8"];
|
||||
$h9=$row["h9"];
|
||||
$h10=$row["h10"];
|
||||
$h11=$row["h11"];
|
||||
$h12=$row["h12"];
|
||||
$h13=$row["h13"];
|
||||
$h14=$row["h14"];
|
||||
$h15=$row["h15"];
|
||||
$h16=$row["h16"];
|
||||
$h17=$row["h17"];
|
||||
$h18=$row["h18"];
|
||||
$h19=$row["h19"];
|
||||
$h20=$row["h20"];
|
||||
$h21=$row["h21"];
|
||||
$h22=$row["h22"];
|
||||
$h23=$row["h23"];
|
||||
$h24=$row["h24"];
|
||||
$h25=$row["h25"];
|
||||
|
||||
}
|
||||
catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/radio.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bending_write.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="/order/order.js"></script>
|
||||
|
||||
<div id="wrap">
|
||||
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<br><br>
|
||||
<?php
|
||||
if($mode=="modify"){
|
||||
?>
|
||||
<form name="board_form" method="post" action="bendingdata_insert.php?mode=modify&num=<?=$num?>&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>" enctype="multipart/form-data">
|
||||
<?php }
|
||||
else {
|
||||
?>
|
||||
<form name="board_form" method="post" action="bendingdata_insert.php?mode=not&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>&callback=1" enctype="multipart/form-data">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="work_col3"> <h2> 절곡데이터 등록/수정 데이터 고유번호: <?=$num?> </h2>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div id="sero1"> 절곡구분 : </div>
|
||||
<div id="sero2">
|
||||
<select name="steeltype" id="steeltype">
|
||||
<option value=""></option>
|
||||
<?php
|
||||
|
||||
$options = array();
|
||||
$options[1] = '가이드레일';
|
||||
$options[2] = '포스트';
|
||||
$options[3] = '셔터박스';
|
||||
$options[4] = '마구리';
|
||||
$options[5] = '린텔';
|
||||
$options[6] = '절단판';
|
||||
$options[7] = '알몰딩';
|
||||
$options[8] = '알케이스';
|
||||
$options[9] = '보강';
|
||||
$options[10] = '삼각쫄대';
|
||||
$options[11]= '짜부가스켓';
|
||||
$options[12] = '하장바';
|
||||
$options[13] = '엘바';
|
||||
$options[14] = '평철';
|
||||
$options[15] = '갈바앵글';
|
||||
$options[16] = '기타절곡물';
|
||||
|
||||
|
||||
if (! empty($options)) {
|
||||
foreach ($options as $key => $val) {
|
||||
$sel="";
|
||||
if($copy_steeltype==$val)
|
||||
$sel="selected";
|
||||
?>
|
||||
<option value="<?php echo $val;?>" <?php echo $sel;?> > <?php echo $val;?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div id="sero7"> <input type="text" id="steel_alias" name="steel_alias" size="48" value="<?=$steel_alias?>" > </div>
|
||||
|
||||
<div id="sero3"> 이미지등록 : </div>
|
||||
<div id="sero4">
|
||||
|
||||
<?php
|
||||
if($mode=="modify"&& $copied_file_name!="") {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="file" name="upfile" class="inp-img" accept=".gif, .jpg, .png"> <span class="btn-delete">삭제</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($mode=="modify" && $copied_file_name)
|
||||
{
|
||||
?>
|
||||
<div class="delete_ok">
|
||||
<a href="<?=$uploaded_file?>" onclick="window.open(this.href,'파일보기',width=800,height=600); return false;" style="color:blue;"> <b> <?=$copied_file_name?> </b> </a>
|
||||
등록
|
||||
<input type="checkbox" name="del_file[]" value="1"> 삭제 </div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="work_col_left">
|
||||
<div id="preview">
|
||||
<?php
|
||||
if($mode=="modify") {
|
||||
print '<img src="' . $uploaded_file . '">';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
// 등록 이미지 등록 미리보기
|
||||
function readInputFile(input) {
|
||||
if(input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
$('#preview').html("<img src="+ e.target.result +">");
|
||||
}
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$(".inp-img").on('change', function(){
|
||||
readInputFile(this);
|
||||
});
|
||||
|
||||
|
||||
// 등록 이미지 삭제 ( input file reset )
|
||||
function resetInputFile($input, $preview) {
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
if((navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (agent.indexOf("msie") != -1)) {
|
||||
// ie 일때
|
||||
$input.replaceWith($input.clone(true));
|
||||
$preview.empty();
|
||||
} else {
|
||||
//other
|
||||
$input.val("");
|
||||
$preview.empty();
|
||||
}
|
||||
}
|
||||
|
||||
$(".btn-delete").click(function(event) {
|
||||
var $input = $(".inp-img");
|
||||
var $preview = $('#preview');
|
||||
resetInputFile($input, $preview);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="work_col_right">
|
||||
<br><br>
|
||||
<?php
|
||||
for($j=0;$j<=7;$j++) {
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
print '<div class="a_col"> </div>'; // 첫 타이틀
|
||||
for($i=1;$i<=25;$i++) {
|
||||
print '<div class="a_col">' . $str . $i . '</div>';
|
||||
}
|
||||
print ' <div class="clear"></div> ';
|
||||
print '<div class="a_col">' . ($j+1) . '행</div>';
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
if((int)$arr[$temp]>0)
|
||||
$altertmp=$arr[$temp];
|
||||
else
|
||||
$altertmp="";
|
||||
|
||||
print '<input type="text" name="' . $str . ($i+1) . '" id="' . $str . ($i+1) .'" style="width:36px;height:15px;color:blue;font-size:17px;" value="' . $altertmp . '">';
|
||||
}
|
||||
print ' <div class="clear"></div> ';
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="hidden" id="copied_file_name" name="copied_file_name" value="<?=$copied_file_name?>" size="5" >
|
||||
<input type="hidden" id="uploaded_file" name="uploaded_file" value="<?=$uploaded_file?>" size="5" >
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>" size="5" >
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br><br>
|
||||
<div id="write_button">
|
||||
<button > <img src="../img/savefile.png"></button>
|
||||
|
||||
<a href="bendingdatalist.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>"><img src="../img/list.png"></a>
|
||||
</div> <br>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end of col3 -->
|
||||
</div> <!-- end of wrap -->
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("fromdate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
$("#todate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
|
||||
});
|
||||
|
||||
function inputNumberFormat(obj) {
|
||||
obj.value = comma(uncomma(obj.value));
|
||||
}
|
||||
function comma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
function uncomma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/[^\d]+/g, '');
|
||||
}
|
||||
|
||||
|
||||
function date_mask(formd, textid) {
|
||||
|
||||
/*
|
||||
input onkeyup에서
|
||||
formd == this.form.name
|
||||
textid == this.name
|
||||
*/
|
||||
|
||||
var form = eval("document."+formd);
|
||||
var text = eval("form."+textid);
|
||||
|
||||
var textlength = text.value.length;
|
||||
|
||||
if (textlength == 4) {
|
||||
text.value = text.value + "-";
|
||||
} else if (textlength == 7) {
|
||||
text.value = text.value + "-";
|
||||
} else if (textlength > 9) {
|
||||
//날짜 수동 입력 Validation 체크
|
||||
var chk_date = checkdate(text);
|
||||
|
||||
if (chk_date == false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkdate(input) {
|
||||
var validformat = /^\d{4}\-\d{2}\-\d{2}$/; //Basic check for format validity
|
||||
var returnval = false;
|
||||
|
||||
if (!validformat.test(input.value)) {
|
||||
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
|
||||
} else { //Detailed check for valid date ranges
|
||||
var yearfield = input.value.split("-")[0];
|
||||
var monthfield = input.value.split("-")[1];
|
||||
var dayfield = input.value.split("-")[2];
|
||||
var dayobj = new Date(yearfield, monthfield - 1, dayfield);
|
||||
}
|
||||
|
||||
if ((dayobj.getMonth() + 1 != monthfield)
|
||||
|| (dayobj.getDate() != dayfield)
|
||||
|| (dayobj.getFullYear() != yearfield)) {
|
||||
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
|
||||
} else {
|
||||
//alert ('Correct date');
|
||||
returnval = true;
|
||||
}
|
||||
if (returnval == false) {
|
||||
input.select();
|
||||
}
|
||||
return returnval;
|
||||
}
|
||||
|
||||
function input_Text(){
|
||||
document.getElementById("test").value = comma(Math.floor(uncomma(document.getElementById("test").value)*1.1)); // 콤마를 계산해 주고 다시 붙여주고
|
||||
var copyText = document.getElementById("test"); // 클립보드 복사
|
||||
copyText.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
|
||||
function captureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function recaptureReturnKey(e) {
|
||||
if (e.keyCode==13)
|
||||
exe_search();
|
||||
}
|
||||
function Enter_Check(){
|
||||
// 엔터키의 코드는 13입니다.
|
||||
if(event.keyCode == 13){
|
||||
exe_search(); // 실행할 이벤트
|
||||
}
|
||||
}
|
||||
function Enter_CheckTel(){
|
||||
// 엔터키의 코드는 13입니다.
|
||||
if(event.keyCode == 13){
|
||||
exe_searchTel(); // 실행할 이벤트
|
||||
}
|
||||
}
|
||||
|
||||
function exe_search()
|
||||
{
|
||||
var postData = changeUri(document.getElementById("outworkplace").value);
|
||||
var sendData = $(":input:radio[name=root]:checked").val();
|
||||
|
||||
$("#displaysearch").show();
|
||||
// if(sendData=='주일')
|
||||
// $("#displaysearch").load("./search.php?mode=search&search=" + postData);
|
||||
// if(sendData=='경동')
|
||||
$("#displaysearch").load("./searchkd.php?mode=search&search=" + postData);
|
||||
}
|
||||
function exe_searchTel()
|
||||
{
|
||||
var postData = changeUri(document.getElementById("receiver").value);
|
||||
$("#displaysearchworker").show();
|
||||
$("#displaysearchworker").load("./workerlist.php?mode=search&search=" + postData);
|
||||
}
|
||||
function del(href)
|
||||
{
|
||||
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
|
||||
document.location.href = href;
|
||||
}
|
||||
}
|
||||
|
||||
function sortall(){
|
||||
var sort;
|
||||
sort=$("#sort").val();
|
||||
if(sort=='1')
|
||||
$("#sort").val("2");
|
||||
else
|
||||
$("#sort").val("1");
|
||||
$("#modify").val("1"); // 소팅할 것
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function saveit() {
|
||||
// $("#modify").val("1"); // 이전화면 유지
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
var tmp=$("#mode").val();
|
||||
var type_tmp=$("#steeltype").val();
|
||||
if(tmp=='modify')
|
||||
$("#steeltype").val(type_tmp).prop("selected", true); // 선택사항 변경
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
567
analysis/bendingdata_insert.php
Normal file
567
analysis/bendingdata_insert.php
Normal file
@@ -0,0 +1,567 @@
|
||||
<?php
|
||||
session_start();
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=5) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
$modify=$_REQUEST["modify"];
|
||||
$outputnum=$_REQUEST["outputnum"];
|
||||
$callback=$_REQUEST["callback"]; // 출고현황에서 호출했는지 체크함.
|
||||
|
||||
if(isset($_REQUEST["page"]))
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1; // 1로 설정해야 함
|
||||
if(isset($_REQUEST["mode"])) //modify_form에서 호출할 경우
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
if(isset($_REQUEST["num"]))
|
||||
$num=$_REQUEST["num"];
|
||||
else
|
||||
$num="";
|
||||
|
||||
if(isset($_REQUEST["sort"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$sort=$_REQUEST["sort"];
|
||||
else
|
||||
$sort="1";
|
||||
|
||||
if(isset($_REQUEST["upnum"]))
|
||||
$upnum=$_REQUEST["upnum"];
|
||||
else
|
||||
$upnum=0;
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
// 이미지파일 저장에 대한 것
|
||||
|
||||
if(isset($_REQUEST["copied_file_name"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$copied_file_name=$_REQUEST["copied_file_name"];
|
||||
else
|
||||
$copied_file_name="";
|
||||
|
||||
if(isset($_REQUEST["uploaded_file"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$uploaded_file=$_REQUEST["uploaded_file"];
|
||||
else
|
||||
$uploaded_file="";
|
||||
|
||||
$files = $_FILES["upfile"]; //첨부파일
|
||||
$count = count($files["name"]);
|
||||
if($count>0)
|
||||
{
|
||||
$upload_dir = '../img/uploads/'; //물리적 저장위치
|
||||
|
||||
$upfile_name = $files["name"];
|
||||
$upfile_tmp_name = $files["tmp_name"];
|
||||
$upfile_type = $files["type"];
|
||||
$upfile_size = $files["size"];
|
||||
$upfile_error = $files["error"];
|
||||
$file = explode(".", $upfile_name);
|
||||
$file_name = $file[0];
|
||||
$file_ext = $file[1];
|
||||
|
||||
if (!$upfile_error)
|
||||
{
|
||||
$new_file_name = date("Y_m_d_H_i_s");
|
||||
$new_file_name = $new_file_name."_";
|
||||
$copied_file_name = $new_file_name.".".$file_ext;
|
||||
$uploaded_file = $upload_dir . $copied_file_name;
|
||||
|
||||
if( $upfile_size > 12000000 ) {
|
||||
|
||||
print("
|
||||
<script>
|
||||
alert('업로드 파일 크기가 지정된 용량(10MB)을 초과합니다!<br>파일 크기를 체크해주세요! ');
|
||||
history.back();
|
||||
</script>
|
||||
");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!move_uploaded_file($upfile_tmp_name, $uploaded_file))
|
||||
{
|
||||
print("<script>
|
||||
alert('파일을 지정한 디렉토리에 복사하는데 실패했습니다.');
|
||||
history.back();
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$steeltype=$_REQUEST["steeltype"];
|
||||
$steel_alias=$_REQUEST["steel_alias"];
|
||||
|
||||
$a1=$_REQUEST["a1"];
|
||||
$a2=$_REQUEST["a2"];
|
||||
$a3=$_REQUEST["a3"];
|
||||
$a4=$_REQUEST["a4"];
|
||||
$a5=$_REQUEST["a5"];
|
||||
$a6=$_REQUEST["a6"];
|
||||
$a7=$_REQUEST["a7"];
|
||||
$a8=$_REQUEST["a8"];
|
||||
$a9=$_REQUEST["a9"];
|
||||
$a10=$_REQUEST["a10"];
|
||||
$a11=$_REQUEST["a11"];
|
||||
$a12=$_REQUEST["a12"];
|
||||
$a13=$_REQUEST["a13"];
|
||||
$a14=$_REQUEST["a14"];
|
||||
$a15=$_REQUEST["a15"];
|
||||
$a16=$_REQUEST["a16"];
|
||||
$a17=$_REQUEST["a17"];
|
||||
$a18=$_REQUEST["a18"];
|
||||
$a19=$_REQUEST["a19"];
|
||||
$a20=$_REQUEST["a20"];
|
||||
$a21=$_REQUEST["a21"];
|
||||
$a22=$_REQUEST["a22"];
|
||||
$a23=$_REQUEST["a23"];
|
||||
$a24=$_REQUEST["a24"];
|
||||
$a25=$_REQUEST["a25"];
|
||||
$b1=$_REQUEST["b1"];
|
||||
$b2=$_REQUEST["b2"];
|
||||
$b3=$_REQUEST["b3"];
|
||||
$b4=$_REQUEST["b4"];
|
||||
$b5=$_REQUEST["b5"];
|
||||
$b6=$_REQUEST["b6"];
|
||||
$b7=$_REQUEST["b7"];
|
||||
$b8=$_REQUEST["b8"];
|
||||
$b9=$_REQUEST["b9"];
|
||||
$b10=$_REQUEST["b10"];
|
||||
$b11=$_REQUEST["b11"];
|
||||
$b12=$_REQUEST["b12"];
|
||||
$b13=$_REQUEST["b13"];
|
||||
$b14=$_REQUEST["b14"];
|
||||
$b15=$_REQUEST["b15"];
|
||||
$b16=$_REQUEST["b16"];
|
||||
$b17=$_REQUEST["b17"];
|
||||
$b18=$_REQUEST["b18"];
|
||||
$b19=$_REQUEST["b19"];
|
||||
$b20=$_REQUEST["b20"];
|
||||
$b21=$_REQUEST["b21"];
|
||||
$b22=$_REQUEST["b22"];
|
||||
$b23=$_REQUEST["b23"];
|
||||
$b24=$_REQUEST["b24"];
|
||||
$b25=$_REQUEST["b25"];
|
||||
$c1=$_REQUEST["c1"];
|
||||
$c2=$_REQUEST["c2"];
|
||||
$c3=$_REQUEST["c3"];
|
||||
$c4=$_REQUEST["c4"];
|
||||
$c5=$_REQUEST["c5"];
|
||||
$c6=$_REQUEST["c6"];
|
||||
$c7=$_REQUEST["c7"];
|
||||
$c8=$_REQUEST["c8"];
|
||||
$c9=$_REQUEST["c9"];
|
||||
$c10=$_REQUEST["c10"];
|
||||
$c11=$_REQUEST["c11"];
|
||||
$c12=$_REQUEST["c12"];
|
||||
$c13=$_REQUEST["c13"];
|
||||
$c14=$_REQUEST["c14"];
|
||||
$c15=$_REQUEST["c15"];
|
||||
$c16=$_REQUEST["c16"];
|
||||
$c17=$_REQUEST["c17"];
|
||||
$c18=$_REQUEST["c18"];
|
||||
$c19=$_REQUEST["c19"];
|
||||
$c20=$_REQUEST["c20"];
|
||||
$c21=$_REQUEST["c21"];
|
||||
$c22=$_REQUEST["c22"];
|
||||
$c23=$_REQUEST["c23"];
|
||||
$c24=$_REQUEST["c24"];
|
||||
$c25=$_REQUEST["c25"];
|
||||
$d1=$_REQUEST["d1"];
|
||||
$d2=$_REQUEST["d2"];
|
||||
$d3=$_REQUEST["d3"];
|
||||
$d4=$_REQUEST["d4"];
|
||||
$d5=$_REQUEST["d5"];
|
||||
$d6=$_REQUEST["d6"];
|
||||
$d7=$_REQUEST["d7"];
|
||||
$d8=$_REQUEST["d8"];
|
||||
$d9=$_REQUEST["d9"];
|
||||
$d10=$_REQUEST["d10"];
|
||||
$d11=$_REQUEST["d11"];
|
||||
$d12=$_REQUEST["d12"];
|
||||
$d13=$_REQUEST["d13"];
|
||||
$d14=$_REQUEST["d14"];
|
||||
$d15=$_REQUEST["d15"];
|
||||
$d16=$_REQUEST["d16"];
|
||||
$d17=$_REQUEST["d17"];
|
||||
$d18=$_REQUEST["d18"];
|
||||
$d19=$_REQUEST["d19"];
|
||||
$d20=$_REQUEST["d20"];
|
||||
$d21=$_REQUEST["d21"];
|
||||
$d22=$_REQUEST["d22"];
|
||||
$d23=$_REQUEST["d23"];
|
||||
$d24=$_REQUEST["d24"];
|
||||
$d25=$_REQUEST["d25"];
|
||||
$e1=$_REQUEST["e1"];
|
||||
$e2=$_REQUEST["e2"];
|
||||
$e3=$_REQUEST["e3"];
|
||||
$e4=$_REQUEST["e4"];
|
||||
$e5=$_REQUEST["e5"];
|
||||
$e6=$_REQUEST["e6"];
|
||||
$e7=$_REQUEST["e7"];
|
||||
$e8=$_REQUEST["e8"];
|
||||
$e9=$_REQUEST["e9"];
|
||||
$e10=$_REQUEST["e10"];
|
||||
$e11=$_REQUEST["e11"];
|
||||
$e12=$_REQUEST["e12"];
|
||||
$e13=$_REQUEST["e13"];
|
||||
$e14=$_REQUEST["e14"];
|
||||
$e15=$_REQUEST["e15"];
|
||||
$e16=$_REQUEST["e16"];
|
||||
$e17=$_REQUEST["e17"];
|
||||
$e18=$_REQUEST["e18"];
|
||||
$e19=$_REQUEST["e19"];
|
||||
$e20=$_REQUEST["e20"];
|
||||
$e21=$_REQUEST["e21"];
|
||||
$e22=$_REQUEST["e22"];
|
||||
$e23=$_REQUEST["e23"];
|
||||
$e24=$_REQUEST["e24"];
|
||||
$e25=$_REQUEST["e25"];
|
||||
$f1=$_REQUEST["f1"];
|
||||
$f2=$_REQUEST["f2"];
|
||||
$f3=$_REQUEST["f3"];
|
||||
$f4=$_REQUEST["f4"];
|
||||
$f5=$_REQUEST["f5"];
|
||||
$f6=$_REQUEST["f6"];
|
||||
$f7=$_REQUEST["f7"];
|
||||
$f8=$_REQUEST["f8"];
|
||||
$f9=$_REQUEST["f9"];
|
||||
$f10=$_REQUEST["f10"];
|
||||
$f11=$_REQUEST["f11"];
|
||||
$f12=$_REQUEST["f12"];
|
||||
$f13=$_REQUEST["f13"];
|
||||
$f14=$_REQUEST["f14"];
|
||||
$f15=$_REQUEST["f15"];
|
||||
$f16=$_REQUEST["f16"];
|
||||
$f17=$_REQUEST["f17"];
|
||||
$f18=$_REQUEST["f18"];
|
||||
$f19=$_REQUEST["f19"];
|
||||
$f20=$_REQUEST["f20"];
|
||||
$f21=$_REQUEST["f21"];
|
||||
$f22=$_REQUEST["f22"];
|
||||
$f23=$_REQUEST["f23"];
|
||||
$f24=$_REQUEST["f24"];
|
||||
$f25=$_REQUEST["f25"];
|
||||
$g1=$_REQUEST["g1"];
|
||||
$g2=$_REQUEST["g2"];
|
||||
$g3=$_REQUEST["g3"];
|
||||
$g4=$_REQUEST["g4"];
|
||||
$g5=$_REQUEST["g5"];
|
||||
$g6=$_REQUEST["g6"];
|
||||
$g7=$_REQUEST["g7"];
|
||||
$g8=$_REQUEST["g8"];
|
||||
$g9=$_REQUEST["g9"];
|
||||
$g10=$_REQUEST["g10"];
|
||||
$g11=$_REQUEST["g11"];
|
||||
$g12=$_REQUEST["g12"];
|
||||
$g13=$_REQUEST["g13"];
|
||||
$g14=$_REQUEST["g14"];
|
||||
$g15=$_REQUEST["g15"];
|
||||
$g16=$_REQUEST["g16"];
|
||||
$g17=$_REQUEST["g17"];
|
||||
$g18=$_REQUEST["g18"];
|
||||
$g19=$_REQUEST["g19"];
|
||||
$g20=$_REQUEST["g20"];
|
||||
$g21=$_REQUEST["g21"];
|
||||
$g22=$_REQUEST["g22"];
|
||||
$g23=$_REQUEST["g23"];
|
||||
$g24=$_REQUEST["g24"];
|
||||
$g25=$_REQUEST["g25"];
|
||||
$h1=$_REQUEST["h1"];
|
||||
$h2=$_REQUEST["h2"];
|
||||
$h3=$_REQUEST["h3"];
|
||||
$h4=$_REQUEST["h4"];
|
||||
$h5=$_REQUEST["h5"];
|
||||
$h6=$_REQUEST["h6"];
|
||||
$h7=$_REQUEST["h7"];
|
||||
$h8=$_REQUEST["h8"];
|
||||
$h9=$_REQUEST["h9"];
|
||||
$h10=$_REQUEST["h10"];
|
||||
$h11=$_REQUEST["h11"];
|
||||
$h12=$_REQUEST["h12"];
|
||||
$h13=$_REQUEST["h13"];
|
||||
$h14=$_REQUEST["h14"];
|
||||
$h15=$_REQUEST["h15"];
|
||||
$h16=$_REQUEST["h16"];
|
||||
$h17=$_REQUEST["h17"];
|
||||
$h18=$_REQUEST["h18"];
|
||||
$h19=$_REQUEST["h19"];
|
||||
$h20=$_REQUEST["h20"];
|
||||
$h21=$_REQUEST["h21"];
|
||||
$h22=$_REQUEST["h22"];
|
||||
$h23=$_REQUEST["h23"];
|
||||
$h24=$_REQUEST["h24"];
|
||||
$h25=$_REQUEST["h25"];
|
||||
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($mode=="modify" ){
|
||||
$num_checked = count($_REQUEST['del_file']);
|
||||
|
||||
if($num_checked==1) // delete checked item
|
||||
{
|
||||
unlink($uploaded_file);
|
||||
$uploaded_file="";
|
||||
$copied_file_name="";
|
||||
}
|
||||
|
||||
// 데이터 수정구간
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = " update chandj.atbending set steeltype=?, steel_alias=?, copied_file_name=?, uploaded_file=?,";
|
||||
|
||||
for ($j=0;$j<8;$j++) {
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp=$i+1;
|
||||
$sql .= strtolower($str) . $temp . "=? ,";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$sql = substr($sql,1,strlen($sql)-2); // 마지막 , 제거
|
||||
|
||||
$sql .= ", indate=? where num=? limit 1";
|
||||
|
||||
print $sql;
|
||||
print "<br>";
|
||||
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $steeltype, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $steel_alias, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $copied_file_name, PDO::PARAM_STR);
|
||||
$stmh->bindValue(4, $uploaded_file, PDO::PARAM_STR);
|
||||
|
||||
|
||||
for ($j=0;$j<8;$j++) {
|
||||
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
$cc=($j*25)+$i+5;
|
||||
$stmh->bindValue($cc, $arr[$temp], PDO::PARAM_STR);
|
||||
print $cc;
|
||||
}
|
||||
print "<br>";
|
||||
}
|
||||
$now= date('Y-m-d'); //now();
|
||||
|
||||
|
||||
|
||||
$stmh->bindValue(205, $now, PDO::PARAM_STR); // $num에 대한 값이 신규랑 다르다. 반드시 넣어야 에러가 없다
|
||||
$stmh->bindValue(206, $num, PDO::PARAM_STR); // $num에 대한 값이 신규랑 다르다. 반드시 넣어야 에러가 없다
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// 데이터 신규 등록하는 구간
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = " insert into chandj.atbending (steeltype, steel_alias, copied_file_name, uploaded_file,";
|
||||
|
||||
for ($j=0;$j<8;$j++) {
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp=$i+1;
|
||||
$sql .= strtolower($str) . $temp . " ,";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$sql = substr($sql,1,strlen($sql)-2); // 마지막 , 제거
|
||||
|
||||
$sql .= ", indate)"; // 마지막에 등록일 추가
|
||||
|
||||
$sql .= " values(?, ?, ?, ?, ";
|
||||
|
||||
for ($j=0;$j<8;$j++) {
|
||||
|
||||
for($i=0;$i<25;$i++) {
|
||||
$sql .= " ? ,";
|
||||
}
|
||||
}
|
||||
$sql = substr($sql,1,strlen($sql)-2); // 마지막 , 제거
|
||||
|
||||
$sql .= ",now() )";
|
||||
print $sql;
|
||||
print "<br>";
|
||||
print $steeltype;
|
||||
print $a1;
|
||||
|
||||
|
||||
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $steeltype, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $steel_alias, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $copied_file_name, PDO::PARAM_STR);
|
||||
$stmh->bindValue(4, $uploaded_file, PDO::PARAM_STR);
|
||||
|
||||
|
||||
for ($j=0;$j<8;$j++) {
|
||||
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
$cc=$j*25+$i+5;
|
||||
$stmh->bindValue($cc, $arr[$temp], PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// $now= date('Y-m-d'); //now();
|
||||
// $stmh->bindValue(204, $now, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if($mode=="modify")
|
||||
header("Location:/analysis/bendingdata_view.php?num=$num&upnum=$upnum&outputnum=$outputnum&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date&outworkplace=$item_outworkplace&sort=$sort&parentnum=$num&callback=$callback");
|
||||
else
|
||||
header("Location:/analysis/bendingdata_view.php?num=0&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date&outworkplace=$item_outworkplace&sort=$sort&parentnum=$num&callback=$callback");
|
||||
|
||||
?>
|
||||
436
analysis/bendingdata_view.php
Normal file
436
analysis/bendingdata_view.php
Normal file
@@ -0,0 +1,436 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=5) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["mode"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="not";
|
||||
$num=$_REQUEST["num"]; // 출고현황에서 넘어온 출고번호
|
||||
$callback=$_REQUEST["callback"]; // 출고현황에서 체크번호
|
||||
|
||||
if((int)$num==0)
|
||||
{
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.atbending order by num desc limit 1";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$counter = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
|
||||
$num=$row["num"];
|
||||
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($_REQUEST["num"])) //수정 버튼을 클릭해서 호출했는지 체크 출고현황에서 부르지 않았을때
|
||||
$num=$_REQUEST["num"];
|
||||
}
|
||||
|
||||
|
||||
if(isset($_REQUEST["page"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1;
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
|
||||
if(isset($_REQUEST["sort"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$sort=$_REQUEST["sort"];
|
||||
else
|
||||
$sort="1";
|
||||
|
||||
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.atbending where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$count = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
if($count<1){
|
||||
print "검색결과가 없습니다.<br>";
|
||||
}else{
|
||||
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
$copied_file_name=$row["copied_file_name"];
|
||||
$uploaded_file=$row["uploaded_file"];
|
||||
|
||||
$a1=$row["a1"];
|
||||
$a2=$row["a2"];
|
||||
$a3=$row["a3"];
|
||||
$a4=$row["a4"];
|
||||
$a5=$row["a5"];
|
||||
$a6=$row["a6"];
|
||||
$a7=$row["a7"];
|
||||
$a8=$row["a8"];
|
||||
$a9=$row["a9"];
|
||||
$a10=$row["a10"];
|
||||
$a11=$row["a11"];
|
||||
$a12=$row["a12"];
|
||||
$a13=$row["a13"];
|
||||
$a14=$row["a14"];
|
||||
$a15=$row["a15"];
|
||||
$a16=$row["a16"];
|
||||
$a17=$row["a17"];
|
||||
$a18=$row["a18"];
|
||||
$a19=$row["a19"];
|
||||
$a20=$row["a20"];
|
||||
$a21=$row["a21"];
|
||||
$a22=$row["a22"];
|
||||
$a23=$row["a23"];
|
||||
$a24=$row["a24"];
|
||||
$a25=$row["a25"];
|
||||
$b1=$row["b1"];
|
||||
$b2=$row["b2"];
|
||||
$b3=$row["b3"];
|
||||
$b4=$row["b4"];
|
||||
$b5=$row["b5"];
|
||||
$b6=$row["b6"];
|
||||
$b7=$row["b7"];
|
||||
$b8=$row["b8"];
|
||||
$b9=$row["b9"];
|
||||
$b10=$row["b10"];
|
||||
$b11=$row["b11"];
|
||||
$b12=$row["b12"];
|
||||
$b13=$row["b13"];
|
||||
$b14=$row["b14"];
|
||||
$b15=$row["b15"];
|
||||
$b16=$row["b16"];
|
||||
$b17=$row["b17"];
|
||||
$b18=$row["b18"];
|
||||
$b19=$row["b19"];
|
||||
$b20=$row["b20"];
|
||||
$b21=$row["b21"];
|
||||
$b22=$row["b22"];
|
||||
$b23=$row["b23"];
|
||||
$b24=$row["b24"];
|
||||
$b25=$row["b25"];
|
||||
$c1=$row["c1"];
|
||||
$c2=$row["c2"];
|
||||
$c3=$row["c3"];
|
||||
$c4=$row["c4"];
|
||||
$c5=$row["c5"];
|
||||
$c6=$row["c6"];
|
||||
$c7=$row["c7"];
|
||||
$c8=$row["c8"];
|
||||
$c9=$row["c9"];
|
||||
$c10=$row["c10"];
|
||||
$c11=$row["c11"];
|
||||
$c12=$row["c12"];
|
||||
$c13=$row["c13"];
|
||||
$c14=$row["c14"];
|
||||
$c15=$row["c15"];
|
||||
$c16=$row["c16"];
|
||||
$c17=$row["c17"];
|
||||
$c18=$row["c18"];
|
||||
$c19=$row["c19"];
|
||||
$c20=$row["c20"];
|
||||
$c21=$row["c21"];
|
||||
$c22=$row["c22"];
|
||||
$c23=$row["c23"];
|
||||
$c24=$row["c24"];
|
||||
$c25=$row["c25"];
|
||||
$d1=$row["d1"];
|
||||
$d2=$row["d2"];
|
||||
$d3=$row["d3"];
|
||||
$d4=$row["d4"];
|
||||
$d5=$row["d5"];
|
||||
$d6=$row["d6"];
|
||||
$d7=$row["d7"];
|
||||
$d8=$row["d8"];
|
||||
$d9=$row["d9"];
|
||||
$d10=$row["d10"];
|
||||
$d11=$row["d11"];
|
||||
$d12=$row["d12"];
|
||||
$d13=$row["d13"];
|
||||
$d14=$row["d14"];
|
||||
$d15=$row["d15"];
|
||||
$d16=$row["d16"];
|
||||
$d17=$row["d17"];
|
||||
$d18=$row["d18"];
|
||||
$d19=$row["d19"];
|
||||
$d20=$row["d20"];
|
||||
$d21=$row["d21"];
|
||||
$d22=$row["d22"];
|
||||
$d23=$row["d23"];
|
||||
$d24=$row["d24"];
|
||||
$d25=$row["d25"];
|
||||
$e1=$row["e1"];
|
||||
$e2=$row["e2"];
|
||||
$e3=$row["e3"];
|
||||
$e4=$row["e4"];
|
||||
$e5=$row["e5"];
|
||||
$e6=$row["e6"];
|
||||
$e7=$row["e7"];
|
||||
$e8=$row["e8"];
|
||||
$e9=$row["e9"];
|
||||
$e10=$row["e10"];
|
||||
$e11=$row["e11"];
|
||||
$e12=$row["e12"];
|
||||
$e13=$row["e13"];
|
||||
$e14=$row["e14"];
|
||||
$e15=$row["e15"];
|
||||
$e16=$row["e16"];
|
||||
$e17=$row["e17"];
|
||||
$e18=$row["e18"];
|
||||
$e19=$row["e19"];
|
||||
$e20=$row["e20"];
|
||||
$e21=$row["e21"];
|
||||
$e22=$row["e22"];
|
||||
$e23=$row["e23"];
|
||||
$e24=$row["e24"];
|
||||
$e25=$row["e25"];
|
||||
$f1=$row["f1"];
|
||||
$f2=$row["f2"];
|
||||
$f3=$row["f3"];
|
||||
$f4=$row["f4"];
|
||||
$f5=$row["f5"];
|
||||
$f6=$row["f6"];
|
||||
$f7=$row["f7"];
|
||||
$f8=$row["f8"];
|
||||
$f9=$row["f9"];
|
||||
$f10=$row["f10"];
|
||||
$f11=$row["f11"];
|
||||
$f12=$row["f12"];
|
||||
$f13=$row["f13"];
|
||||
$f14=$row["f14"];
|
||||
$f15=$row["f15"];
|
||||
$f16=$row["f16"];
|
||||
$f17=$row["f17"];
|
||||
$f18=$row["f18"];
|
||||
$f19=$row["f19"];
|
||||
$f20=$row["f20"];
|
||||
$f21=$row["f21"];
|
||||
$f22=$row["f22"];
|
||||
$f23=$row["f23"];
|
||||
$f24=$row["f24"];
|
||||
$f25=$row["f25"];
|
||||
$g1=$row["g1"];
|
||||
$g2=$row["g2"];
|
||||
$g3=$row["g3"];
|
||||
$g4=$row["g4"];
|
||||
$g5=$row["g5"];
|
||||
$g6=$row["g6"];
|
||||
$g7=$row["g7"];
|
||||
$g8=$row["g8"];
|
||||
$g9=$row["g9"];
|
||||
$g10=$row["g10"];
|
||||
$g11=$row["g11"];
|
||||
$g12=$row["g12"];
|
||||
$g13=$row["g13"];
|
||||
$g14=$row["g14"];
|
||||
$g15=$row["g15"];
|
||||
$g16=$row["g16"];
|
||||
$g17=$row["g17"];
|
||||
$g18=$row["g18"];
|
||||
$g19=$row["g19"];
|
||||
$g20=$row["g20"];
|
||||
$g21=$row["g21"];
|
||||
$g22=$row["g22"];
|
||||
$g23=$row["g23"];
|
||||
$g24=$row["g24"];
|
||||
$g25=$row["g25"];
|
||||
$h1=$row["h1"];
|
||||
$h2=$row["h2"];
|
||||
$h3=$row["h3"];
|
||||
$h4=$row["h4"];
|
||||
$h5=$row["h5"];
|
||||
$h6=$row["h6"];
|
||||
$h7=$row["h7"];
|
||||
$h8=$row["h8"];
|
||||
$h9=$row["h9"];
|
||||
$h10=$row["h10"];
|
||||
$h11=$row["h11"];
|
||||
$h12=$row["h12"];
|
||||
$h13=$row["h13"];
|
||||
$h14=$row["h14"];
|
||||
$h15=$row["h15"];
|
||||
$h16=$row["h16"];
|
||||
$h17=$row["h17"];
|
||||
$h18=$row["h18"];
|
||||
$h19=$row["h19"];
|
||||
$h20=$row["h20"];
|
||||
$h21=$row["h21"];
|
||||
$h22=$row["h22"];
|
||||
$h23=$row["h23"];
|
||||
$h24=$row["h24"];
|
||||
$h25=$row["h25"];
|
||||
|
||||
}
|
||||
}catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/radio.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bending_write.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="/order/order.js"></script>
|
||||
|
||||
<div id="wrap">
|
||||
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<br><br>
|
||||
<?php
|
||||
if($mode=="modify"){
|
||||
?>
|
||||
<form name="board_form" method="post" action="bendingdata_insert.php?mode=modify&num=<?=$num?>&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>" enctype="multipart/form-data">
|
||||
<?php }
|
||||
else {
|
||||
?>
|
||||
<form name="board_form" method="post" action="bendingdata_insert.php?mode=not&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>&callback=1" enctype="multipart/form-data">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="work_col3"> <h2> 절곡데이터 등록 데이터 고유번호: <?=$num?> </h2>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div id="sero1"> 절곡구분 : </div>
|
||||
<div id="sero2"> <?=$steeltype?>
|
||||
|
||||
</div>
|
||||
<div id="sero7"> <input type="text" id="steel_alias" name="steel_alias" size="47" value="<?=$steel_alias?>" disabled > </div>
|
||||
<div id="sero3"> 등록이미지 : </div>
|
||||
<div id="sero4"> <?=$copied_file_name?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="work_col_left">
|
||||
<div id="preview"> <img src="<?=$uploaded_file?>"> </div>
|
||||
</div>
|
||||
|
||||
<div id="work_col_right">
|
||||
<br><br>
|
||||
<?php
|
||||
for($j=0;$j<=7;$j++) {
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
print '<div class="a_col"> </div>'; // 첫 타이틀
|
||||
for($i=1;$i<=25;$i++) {
|
||||
print '<div class="a_col">' . $str . $i . '</div>';
|
||||
}
|
||||
print ' <div class="clear"></div> ';
|
||||
print '<div class="a_col">' . ($j+1) . '행</div>';
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
if((int)$arr[$temp]>0)
|
||||
$altertmp=$arr[$temp];
|
||||
else
|
||||
$altertmp="";
|
||||
|
||||
print '<input type="text" name="' . $str . ($i+1) . '" id="' . $str . ($i+1) .'" style="width:36px;height:15px;color:blue;font-size:17px;" disabled value="' . $altertmp . '">';
|
||||
}
|
||||
print ' <div class="clear"></div> ';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<input type="hidden" id="upnum" name="upnum" value="<?=$upnum?>" size="5" >
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br><br>
|
||||
<div id="write_button">
|
||||
<a href="bending_write_form.php?mode=not&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&process=<?=$process?>&asprocess=<?=$asprocess?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>"> <img src="../img/write.png"></a>
|
||||
<a href="bending_write_form.php?mode=modify&num=<?=$num?>&page=<?=$page?>search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>"><img src="../img/modify.png"></a>
|
||||
|
||||
<a href="bendingdatalist.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>"><img src="../img/list.png"></a>
|
||||
<a href="bendingdata_copy.php?num=<?=$num?>&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>">데이터 복사(신규) </a>
|
||||
</div> <br>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end of col3 -->
|
||||
</div> <!-- end of wrap -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
892
analysis/bendingdatalist.php
Normal file
892
analysis/bendingdatalist.php
Normal file
@@ -0,0 +1,892 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>5) {
|
||||
/* alert("관리자 승인이 필요합니다."); */
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
header("Expires: 0"); // rfc2616 - Section 14.21
|
||||
//header("Refresh:0"); // reload refresh
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/output.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bending_write.css">
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!--날짜 선택 창 UI 필요 -->
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
</head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
if(isset($_REQUEST["search"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$search=$_REQUEST["search"];
|
||||
if(isset($_REQUEST["search"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$find=$_REQUEST["search"];
|
||||
if(isset($_REQUEST["separate_date"])) //출고일 접수일
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
|
||||
if(isset($_REQUEST["list"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$list=$_REQUEST["list"];
|
||||
else
|
||||
$list=0;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
// $find="firstord"; //검색할때 고정시킬 부분 저장 ex) 전체/공사담당/건설사 등
|
||||
if(isset($_REQUEST["page"])) // $_REQUEST["page"]값이 없을 때에는 1로 지정
|
||||
{
|
||||
$page=$_REQUEST["page"]; // 페이지 번호
|
||||
}
|
||||
else
|
||||
{
|
||||
$page=1;
|
||||
}
|
||||
|
||||
$scale = 20; // 한 페이지에 보여질 게시글 수
|
||||
$page_scale = 10; // 한 페이지당 표시될 페이지 수 10페이지
|
||||
$first_num = ($page-1) * $scale; // 리스트에 표시되는 게시글의 첫 순번.
|
||||
|
||||
if(isset($_REQUEST["mode"]))
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
$cursort=$_REQUEST["cursort"]; // 현재 정렬모드 지정
|
||||
if(isset($_REQUEST["sortof"]))
|
||||
{
|
||||
$sortof=$_REQUEST["sortof"]; // 클릭해서 넘겨준 값
|
||||
if($sortof==1) {
|
||||
|
||||
if($cursort!=1)
|
||||
$cursort=1;
|
||||
else
|
||||
$cursort=2;
|
||||
}
|
||||
if($sortof==2) { //접수일 클릭되었을때
|
||||
|
||||
if($cursort!=3)
|
||||
$cursort=3;
|
||||
else
|
||||
$cursort=4;
|
||||
}
|
||||
if($sortof==3) { //구분 클릭되었을때
|
||||
|
||||
if($cursort!=5)
|
||||
$cursort=5;
|
||||
else
|
||||
$cursort=6;
|
||||
}
|
||||
if($sortof==4) { //절곡 클릭되었을때
|
||||
|
||||
if($cursort!=7)
|
||||
$cursort=7;
|
||||
else
|
||||
$cursort=8;
|
||||
}
|
||||
if($sortof==5) { //모터 클릭되었을때
|
||||
|
||||
if($cursort!=9)
|
||||
$cursort=9;
|
||||
else
|
||||
$cursort=10;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortof=0;
|
||||
$cursort=0;
|
||||
}
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 기간을 정하는 구간
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
if($fromdate=="")
|
||||
{
|
||||
$fromdate=substr(date("Y-m-d",time()),0,4) ;
|
||||
$fromdate=$fromdate . "-01-01";
|
||||
}
|
||||
if($todate=="")
|
||||
{
|
||||
$todate=substr(date("Y-m-d",time()),0,4) . "-12-31" ;
|
||||
$Transtodate=strtotime($todate.'+1 days');
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
else
|
||||
{
|
||||
$Transtodate=strtotime($todate);
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["find"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$find=$_REQUEST["find"];
|
||||
|
||||
$process="전체"; // 기본 전체로 정한다.
|
||||
|
||||
$common=" where indate between date('$fromdate') and date('$Transtodate') order by indate ";
|
||||
$a= $common . " desc, num desc limit $first_num, $scale"; //내림차순
|
||||
$b= $common . " desc, num desc "; //내림차순 전체
|
||||
$c= $common . " asc, num desc limit $first_num, $scale"; //오름차순
|
||||
$d= $common . " asc, num desc "; //오름차순 전체
|
||||
|
||||
$where=" where indate between date('$fromdate') and date('$Transtodate') ";
|
||||
$all=" limit $first_num, $scale";
|
||||
|
||||
if($mode=="search"){
|
||||
if($search==""){
|
||||
|
||||
if($find=="전체"){
|
||||
$sql="select * from chandj.atbending " . $a;
|
||||
$sqlcon = "select * from chandj.atbending " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$sql ="select * from chandj.atbending where (steeltype like '%$find%') and (steel_alias like '%$search%') order by indate desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.atbending where (steeltype like '%$find%') and (steel_alias like '%$search%') order by indate desc, num desc ";
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
elseif($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
|
||||
|
||||
if($find=="전체") {
|
||||
$sql ="select * from chandj.atbending where (indate like '%$search%') or (steeltype like '%$search%') or (steel_alias like '%$search%') order by indate desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.atbending where (indate like '%$search%') or (steeltype like '%$search%') or (steel_alias like '%$search%') order by indate desc, num desc ";
|
||||
}
|
||||
else { // '전체'가 아닌 가이드레일/셔터박스 등 선택시
|
||||
|
||||
$sql ="select * from chandj.atbending where (steeltype like '%$find%') and (steel_alias like '%$search%') order by indate desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.atbending where (steeltype like '%$find%') and (steel_alias like '%$search%') order by indate desc, num desc ";
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if($mode=="") {
|
||||
$sql="select * from chandj.atbending " . $a;
|
||||
$sqlcon = "select * from chandj.atbending " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
|
||||
|
||||
if($cursort==1)
|
||||
{
|
||||
$sql="select * from chandj.atbending " . $c;
|
||||
$sqlcon="select * from chandj.atbending " . $d;
|
||||
}
|
||||
|
||||
if($cursort==2)
|
||||
{
|
||||
$sql="select * from chandj.atbending " . $a;
|
||||
$sqlcon="select * from chandj.atbending " . $b;
|
||||
}
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
try{
|
||||
$allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수
|
||||
$temp2=$allstmh->rowCount();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$temp1=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp2; // 전체 글수
|
||||
|
||||
$total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수
|
||||
$current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산
|
||||
// print "$page $total_page $current_page $search $mode";
|
||||
|
||||
?>
|
||||
|
||||
<body >
|
||||
<div id="wrap">
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="col2">
|
||||
<form name="board_form" id="board_form" method="post" action="bendingdatalist.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>">
|
||||
<div id="col2">
|
||||
<div id="title"> <h2> 절곡DATA 등록/수정/삭제 </h2> </div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="list_search">
|
||||
<div id="list_search1"> <br> ▷ 총 <?= $total_row ?> 개의 자료 파일이 있습니다.</div>
|
||||
<div id="list_search111">
|
||||
|
||||
<input id="preyear" type='button' onclick='pre_year()' value='전년도'>
|
||||
<input id ="premonth" type='button' onclick='pre_month()' value='전월'>
|
||||
<input type="text" id="fromdate" name="fromdate" size="12" value="<?=$fromdate?>" placeholder="기간 시작일">부터
|
||||
<input type="text" id="todate" name="todate" size="12" value="<?=$todate?>" placeholder="기간 끝">까지
|
||||
|
||||
<input id ="thistoday" type='button' onclick='this_today()' value='금일'>
|
||||
<input id ="tomorrow" type='button' onclick='this_tomorrow()' value='익일'>
|
||||
<input id ="Fromthistoday" type='button' onclick='Fromthis_today()' value='금일이후~'>
|
||||
<input id ="thismonth" type='button' onclick='this_month()' value='당월'>
|
||||
<!-- <input id ="thisyear" type='button' onclick='this_year()' value='당해년도'> -->
|
||||
</div>
|
||||
<div id="list_search2"> <img src="../img/select_search.gif"></div>
|
||||
<div id="list_search3">
|
||||
<select name="find">
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0] = '전체';
|
||||
$options[1] = '가이드레일';
|
||||
$options[2] = '포스트';
|
||||
$options[3] = '셔터박스';
|
||||
$options[4] = '마구리';
|
||||
$options[5] = '린텔';
|
||||
$options[6] = '절단판';
|
||||
$options[7] = '알몰딩';
|
||||
$options[8] = '알케이스';
|
||||
$options[9] = '보강';
|
||||
$options[10] = '삼각쫄대';
|
||||
$options[11]= '짜부가스켓';
|
||||
$options[12] = '하장바';
|
||||
$options[13] = '엘바';
|
||||
$options[14] = '평철';
|
||||
$options[15] = '갈바앵글';
|
||||
$options[16] = '기타절곡물';
|
||||
|
||||
if (! empty($options)) {
|
||||
foreach ($options as $key => $val) {
|
||||
$sel="";
|
||||
if($find==$val)
|
||||
$sel="selected";
|
||||
?>
|
||||
<option value="<?php echo $val;?>" <?php echo $sel;?> > <?php echo $val;?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
|
||||
</div> <!-- end of list_search3 -->
|
||||
|
||||
<div id="list_search4"><input type="text" name="search" id="search" value="<?=$search?>"> </div>
|
||||
|
||||
<div id="list_search5"><input type="image" src="../img/list_search_button.gif"></div>
|
||||
|
||||
</div> <!-- end of list_search -->
|
||||
<div class="clear"></div>
|
||||
<div id="top_title">
|
||||
<div id="title1"> <a href="bendingdatalist.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=1&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>">번호 </a> </div>
|
||||
<div id="title22"> 이미지 </div>
|
||||
<div id="title2"> 절곡 품명 </div>
|
||||
<div id="title12"> 별칭(상세내역) </div>
|
||||
<div id="title3"> 등록(수정)일 </div>
|
||||
|
||||
<div id="title4"> 1행 절곡합 </div>
|
||||
<div id="title5"> 2행 절곡합 </div>
|
||||
<div id="title6"> 3행 절곡합 </div>
|
||||
<div id="title7"> 4행 절곡합 </div>
|
||||
<div id="title8"> 5행 절곡합 </div>
|
||||
<div id="title8"> 6행 절곡합 </div>
|
||||
<div id="title9"> 7행 절곡합 </div>
|
||||
<div id="title10"> 8행 절곡합 </div>
|
||||
<div id="title11"> 총 합 </div>
|
||||
|
||||
</div>
|
||||
<div id="list_content">
|
||||
<?php
|
||||
if ($page<=1)
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
else
|
||||
$start_num=$total_row-($page-1) * $scale;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$num=$row["num"];
|
||||
$indate=$row["indate"];
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
$copied_file_name=$row["copied_file_name"];
|
||||
$uploaded_file=$row["uploaded_file"];
|
||||
|
||||
$a1=$row["a1"];
|
||||
$a2=$row["a2"];
|
||||
$a3=$row["a3"];
|
||||
$a4=$row["a4"];
|
||||
$a5=$row["a5"];
|
||||
$a6=$row["a6"];
|
||||
$a7=$row["a7"];
|
||||
$a8=$row["a8"];
|
||||
$a9=$row["a9"];
|
||||
$a10=$row["a10"];
|
||||
$a11=$row["a11"];
|
||||
$a12=$row["a12"];
|
||||
$a13=$row["a13"];
|
||||
$a14=$row["a14"];
|
||||
$a15=$row["a15"];
|
||||
$a16=$row["a16"];
|
||||
$a17=$row["a17"];
|
||||
$a18=$row["a18"];
|
||||
$a19=$row["a19"];
|
||||
$a20=$row["a20"];
|
||||
$a21=$row["a21"];
|
||||
$a22=$row["a22"];
|
||||
$a23=$row["a23"];
|
||||
$a24=$row["a24"];
|
||||
$a25=$row["a25"];
|
||||
$b1=$row["b1"];
|
||||
$b2=$row["b2"];
|
||||
$b3=$row["b3"];
|
||||
$b4=$row["b4"];
|
||||
$b5=$row["b5"];
|
||||
$b6=$row["b6"];
|
||||
$b7=$row["b7"];
|
||||
$b8=$row["b8"];
|
||||
$b9=$row["b9"];
|
||||
$b10=$row["b10"];
|
||||
$b11=$row["b11"];
|
||||
$b12=$row["b12"];
|
||||
$b13=$row["b13"];
|
||||
$b14=$row["b14"];
|
||||
$b15=$row["b15"];
|
||||
$b16=$row["b16"];
|
||||
$b17=$row["b17"];
|
||||
$b18=$row["b18"];
|
||||
$b19=$row["b19"];
|
||||
$b20=$row["b20"];
|
||||
$b21=$row["b21"];
|
||||
$b22=$row["b22"];
|
||||
$b23=$row["b23"];
|
||||
$b24=$row["b24"];
|
||||
$b25=$row["b25"];
|
||||
$c1=$row["c1"];
|
||||
$c2=$row["c2"];
|
||||
$c3=$row["c3"];
|
||||
$c4=$row["c4"];
|
||||
$c5=$row["c5"];
|
||||
$c6=$row["c6"];
|
||||
$c7=$row["c7"];
|
||||
$c8=$row["c8"];
|
||||
$c9=$row["c9"];
|
||||
$c10=$row["c10"];
|
||||
$c11=$row["c11"];
|
||||
$c12=$row["c12"];
|
||||
$c13=$row["c13"];
|
||||
$c14=$row["c14"];
|
||||
$c15=$row["c15"];
|
||||
$c16=$row["c16"];
|
||||
$c17=$row["c17"];
|
||||
$c18=$row["c18"];
|
||||
$c19=$row["c19"];
|
||||
$c20=$row["c20"];
|
||||
$c21=$row["c21"];
|
||||
$c22=$row["c22"];
|
||||
$c23=$row["c23"];
|
||||
$c24=$row["c24"];
|
||||
$c25=$row["c25"];
|
||||
$d1=$row["d1"];
|
||||
$d2=$row["d2"];
|
||||
$d3=$row["d3"];
|
||||
$d4=$row["d4"];
|
||||
$d5=$row["d5"];
|
||||
$d6=$row["d6"];
|
||||
$d7=$row["d7"];
|
||||
$d8=$row["d8"];
|
||||
$d9=$row["d9"];
|
||||
$d10=$row["d10"];
|
||||
$d11=$row["d11"];
|
||||
$d12=$row["d12"];
|
||||
$d13=$row["d13"];
|
||||
$d14=$row["d14"];
|
||||
$d15=$row["d15"];
|
||||
$d16=$row["d16"];
|
||||
$d17=$row["d17"];
|
||||
$d18=$row["d18"];
|
||||
$d19=$row["d19"];
|
||||
$d20=$row["d20"];
|
||||
$d21=$row["d21"];
|
||||
$d22=$row["d22"];
|
||||
$d23=$row["d23"];
|
||||
$d24=$row["d24"];
|
||||
$d25=$row["d25"];
|
||||
$e1=$row["e1"];
|
||||
$e2=$row["e2"];
|
||||
$e3=$row["e3"];
|
||||
$e4=$row["e4"];
|
||||
$e5=$row["e5"];
|
||||
$e6=$row["e6"];
|
||||
$e7=$row["e7"];
|
||||
$e8=$row["e8"];
|
||||
$e9=$row["e9"];
|
||||
$e10=$row["e10"];
|
||||
$e11=$row["e11"];
|
||||
$e12=$row["e12"];
|
||||
$e13=$row["e13"];
|
||||
$e14=$row["e14"];
|
||||
$e15=$row["e15"];
|
||||
$e16=$row["e16"];
|
||||
$e17=$row["e17"];
|
||||
$e18=$row["e18"];
|
||||
$e19=$row["e19"];
|
||||
$e20=$row["e20"];
|
||||
$e21=$row["e21"];
|
||||
$e22=$row["e22"];
|
||||
$e23=$row["e23"];
|
||||
$e24=$row["e24"];
|
||||
$e25=$row["e25"];
|
||||
$f1=$row["f1"];
|
||||
$f2=$row["f2"];
|
||||
$f3=$row["f3"];
|
||||
$f4=$row["f4"];
|
||||
$f5=$row["f5"];
|
||||
$f6=$row["f6"];
|
||||
$f7=$row["f7"];
|
||||
$f8=$row["f8"];
|
||||
$f9=$row["f9"];
|
||||
$f10=$row["f10"];
|
||||
$f11=$row["f11"];
|
||||
$f12=$row["f12"];
|
||||
$f13=$row["f13"];
|
||||
$f14=$row["f14"];
|
||||
$f15=$row["f15"];
|
||||
$f16=$row["f16"];
|
||||
$f17=$row["f17"];
|
||||
$f18=$row["f18"];
|
||||
$f19=$row["f19"];
|
||||
$f20=$row["f20"];
|
||||
$f21=$row["f21"];
|
||||
$f22=$row["f22"];
|
||||
$f23=$row["f23"];
|
||||
$f24=$row["f24"];
|
||||
$f25=$row["f25"];
|
||||
$g1=$row["g1"];
|
||||
$g2=$row["g2"];
|
||||
$g3=$row["g3"];
|
||||
$g4=$row["g4"];
|
||||
$g5=$row["g5"];
|
||||
$g6=$row["g6"];
|
||||
$g7=$row["g7"];
|
||||
$g8=$row["g8"];
|
||||
$g9=$row["g9"];
|
||||
$g10=$row["g10"];
|
||||
$g11=$row["g11"];
|
||||
$g12=$row["g12"];
|
||||
$g13=$row["g13"];
|
||||
$g14=$row["g14"];
|
||||
$g15=$row["g15"];
|
||||
$g16=$row["g16"];
|
||||
$g17=$row["g17"];
|
||||
$g18=$row["g18"];
|
||||
$g19=$row["g19"];
|
||||
$g20=$row["g20"];
|
||||
$g21=$row["g21"];
|
||||
$g22=$row["g22"];
|
||||
$g23=$row["g23"];
|
||||
$g24=$row["g24"];
|
||||
$g25=$row["g25"];
|
||||
$h1=$row["h1"];
|
||||
$h2=$row["h2"];
|
||||
$h3=$row["h3"];
|
||||
$h4=$row["h4"];
|
||||
$h5=$row["h5"];
|
||||
$h6=$row["h6"];
|
||||
$h7=$row["h7"];
|
||||
$h8=$row["h8"];
|
||||
$h9=$row["h9"];
|
||||
$h10=$row["h10"];
|
||||
$h11=$row["h11"];
|
||||
$h12=$row["h12"];
|
||||
$h13=$row["h13"];
|
||||
$h14=$row["h14"];
|
||||
$h15=$row["h15"];
|
||||
$h16=$row["h16"];
|
||||
$h17=$row["h17"];
|
||||
$h18=$row["h18"];
|
||||
$h19=$row["h19"];
|
||||
$h20=$row["h20"];
|
||||
$h21=$row["h21"];
|
||||
$h22=$row["h22"];
|
||||
$h23=$row["h23"];
|
||||
$h24=$row["h24"];
|
||||
$h25=$row["h25"];
|
||||
|
||||
$arr_sum=compact("a_sum","b_sum","c_sum","d_sum","e_sum","f_sum","g_sum","h_sum","total_sum");
|
||||
for ($j=0;$j<8;$j++) {
|
||||
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
$arr_row_tmp=$str."_sum";
|
||||
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
$cc=($j*25)+$i+4;
|
||||
$arr_sum[$arr_row_tmp] += $arr[$temp];
|
||||
// print $arr_sum[$arr_row_tmp];
|
||||
}
|
||||
|
||||
$arr_sum["total_sum"] += $arr_sum[$arr_row_tmp];
|
||||
|
||||
}
|
||||
|
||||
|
||||
$date_font="black"; // 현재일자 Red 색상으로 표기
|
||||
if($nowday==$outdate) {
|
||||
$date_font="red";
|
||||
}
|
||||
|
||||
if($indate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$indate = $indate . $week[ date('w', strtotime($indate) ) ] ;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="list_item" >
|
||||
<div id="list_item1">
|
||||
<a href="bendingdata_view.php?num=<?=$num?>&page=<?=$page?>&find=<?=$find?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&callback=1" >
|
||||
<?=$start_num ?></div>
|
||||
<div id="list_item22" > <img src="<?=$uploaded_file?>" class="maxsmall"> </div>
|
||||
<div id="list_item2" style="color:<?=$date_font?>;">
|
||||
<b> <?=$steeltype?></b></div>
|
||||
<div id="list_item13" > <?=iconv_substr($steel_alias,0,28,"utf-8")?></div>
|
||||
<div id="list_item3" >
|
||||
<b> <?=substr($indate,0,15)?></b></div>
|
||||
<div id="list_item4" > <?=$arr_sum["a_sum"]?></div>
|
||||
<div id="list_item5" > <?=$arr_sum["b_sum"]?> </div>
|
||||
<div id="list_item6" > <?=$arr_sum["c_sum"]?> </div>
|
||||
<div id="list_item7" > <?=$arr_sum["d_sum"]?> </div>
|
||||
<div id="list_item8" > <?=$arr_sum["e_sum"]?> </div>
|
||||
<div id="list_item9" > <?=$arr_sum["f_sum"]?></div>
|
||||
<div id="list_item10" > <?=$arr_sum["g_sum"]?></div>
|
||||
<div id="list_item11" > <?=$arr_sum["h_sum"]?> </div>
|
||||
<div id="list_item12" > <?=$arr_sum["total_sum"]?> </div>
|
||||
|
||||
|
||||
<div class="clear"> </div>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
<div id="page_button">
|
||||
<div id="page_num">
|
||||
<?php
|
||||
if($page!=1 && $page>$page_scale)
|
||||
{
|
||||
$prev_page = $page - $page_scale;
|
||||
// 이전 페이지값은 해당 페이지 수에서 리스트에 표시될 페이지수 만큼 감소
|
||||
if($prev_page <= 0)
|
||||
$prev_page = 1; // 만약 감소한 값이 0보다 작거나 같으면 1로 고정
|
||||
print "<a href=bendingdatalist.php?page=$prev_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>◀ </a>";
|
||||
}
|
||||
for($i=$start_page; $i<=$end_page && $i<= $total_page; $i++)
|
||||
{ // [1][2][3] 페이지 번호 목록 출력
|
||||
if($page==$i) // 현재 위치한 페이지는 링크 출력을 하지 않도록 설정.
|
||||
print "<font color=red><b>[$i]</b></font>";
|
||||
else
|
||||
print "<a href=bendingdatalist.php?page=$i&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>[$i]</a>";
|
||||
}
|
||||
|
||||
if($page<$total_page)
|
||||
{
|
||||
$next_page = $page + $page_scale;
|
||||
if($next_page > $total_page)
|
||||
$next_page = $total_page;
|
||||
// netx_page 값이 전체 페이지수 보다 크면 맨 뒤 페이지로 이동시킴
|
||||
print "<a href=bendingdatalist.php?page=$next_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year> ▶</a><p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="write_button">
|
||||
<a href="bendingdatalist.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&process=<?=$process?>&asprocess=<?=$asprocess?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>"><img src="../img/list.png"></a>
|
||||
<?php
|
||||
if(isset($_SESSION["userid"]))
|
||||
{
|
||||
?>
|
||||
<a href="bending_write_form.php?page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&process=<?=$process?>&asprocess=<?=$asprocess?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>"> <img src="../img/write.png"></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end of col2 -->
|
||||
</div> <!-- end of content -->
|
||||
</div> <!-- end of wrap -->
|
||||
<script>
|
||||
function blinker() {
|
||||
$('.blinking').fadeOut(500);
|
||||
$('.blinking').fadeIn(500);
|
||||
}
|
||||
setInterval(blinker, 1000);
|
||||
</script>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script>
|
||||
/* $(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
); */
|
||||
|
||||
$(function() {
|
||||
$( "#id_of_the_component" ).datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#fromdate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
$("#todate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
});
|
||||
|
||||
function pre_year(){ // 전년도 추출
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
today = mm+'/'+dd+'/'+yyyy;
|
||||
yyyy=yyyy-1;
|
||||
frompreyear = yyyy+'-01-01';
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function pre_month(){
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
mm=mm-1;
|
||||
if(mm<1) {
|
||||
mm='12';
|
||||
}
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
if(mm>=12) {
|
||||
yyyy=yyyy-1;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-01';
|
||||
topreyear = yyyy+'-'+mm+'-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_year(){ // 당해년도
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
today = mm+'/'+dd+'/'+yyyy;
|
||||
frompreyear = yyyy+'-01-01';
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
fromdate1=frompreyear;
|
||||
todate1=topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
function this_month(){ // 당해월
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-01';
|
||||
topreyear = yyyy+'-'+mm+'-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function Fromthis_today(){ // 금일이후
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_today(){ // 금일
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-'+mm+'-'+dd;
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_tomorrow(){ // 익일
|
||||
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate()+1;
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-'+mm+'-'+dd;
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function process_list(){ // 접수일 출고일 라디오버튼 클릭시
|
||||
document.getElementById('search').value=null;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
if($mode==""&&$fromdate==null)
|
||||
{
|
||||
echo ("<script language=javascript> this_year();</script>"); // 당해년도 화면에 초기세팅하기
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
<script>
|
||||
// 스크린합 구한값 화면에 출력하기
|
||||
var total_sum = '<?php echo $total_sum ;?>';
|
||||
var total_m2 = '<?php echo $total_m2 ;?>';
|
||||
$("#top_board2").text(total_sum);
|
||||
$("#top_board4").text(total_m2);
|
||||
</script>
|
||||
</html>
|
||||
75
analysis/delete.php
Normal file
75
analysis/delete.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$ordercompany=$_REQUEST["ordercompany"]; // 발주처
|
||||
$parentnum=$_REQUEST["parentnum"]; // 리스트번호
|
||||
$upnum=$_REQUEST["upnum"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
$num=$_REQUEST["num"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
$outputnum=$_REQUEST["outputnum"];
|
||||
$length1=$_REQUEST["length1"];
|
||||
$length2=$_REQUEST["length2"];
|
||||
$length3=$_REQUEST["length3"];
|
||||
$length4=$_REQUEST["length4"];
|
||||
$length5=$_REQUEST["length5"];
|
||||
$amount1=$_REQUEST["amount1"];
|
||||
$amount2=$_REQUEST["amount2"];
|
||||
$amount3=$_REQUEST["amount3"];
|
||||
$amount4=$_REQUEST["amount4"];
|
||||
$amount5=$_REQUEST["amount5"];
|
||||
$material1=$_REQUEST["material1"];
|
||||
$material2=$_REQUEST["material2"];
|
||||
$material3=$_REQUEST["material3"];
|
||||
$material4=$_REQUEST["material4"];
|
||||
$material5=$_REQUEST["material5"];
|
||||
$material6=$_REQUEST["material6"];
|
||||
$material7=$_REQUEST["material7"];
|
||||
$material8=$_REQUEST["material8"];
|
||||
$sum1=$_REQUEST["sum1"];
|
||||
$sum2=$_REQUEST["sum2"];
|
||||
$sum3=$_REQUEST["sum3"];
|
||||
$sum4=$_REQUEST["sum4"];
|
||||
$sum5=$_REQUEST["sum5"];
|
||||
$sum6=$_REQUEST["sum6"];
|
||||
$sum7=$_REQUEST["sum7"];
|
||||
$sum8=$_REQUEST["sum8"];
|
||||
|
||||
$total_text=$_REQUEST["total_text"];
|
||||
$datanum=$_REQUEST["datanum"]; //절곡데이터 번호 기억
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($mode=="all")
|
||||
{
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.bending_write where upnum = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$upnum,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.bending_write where num = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
header("Location:/analysis/write.php?upnum=$upnum&outputnum=$outputnum&datanum=$datanum&ordercompany=$ordercompany&callname=$callname&cutheight=$cutheight&cutwidth=$cutwidth&number=$number&comment=$comment&printside=$printside&direction=$direction&exititem=$exititem&intervalnum=$intervalnum&intervalnumsecond=$intervalnumsecond&memo=$memo&parentnum=$parentnum"); // 신규가입일때는 리스트로 이동
|
||||
?>
|
||||
70
analysis/deletelist.php
Normal file
70
analysis/deletelist.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
session_start();
|
||||
$num=$_REQUEST["num"];
|
||||
$upnum=$num; // 상위번호 호출
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($num=="all")
|
||||
{
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "truncate chandj.bendinglist";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
header("Location:/analysis/list.php"); // 리스트로 이동
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.bendinglist where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$count = $stmh->rowCount();
|
||||
|
||||
}catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.bendinglist where num = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
// 리스트를 삭제하고 밑에 딸려있는 세부 항목도 지워줘야 한다.
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "delete from chandj.bending_write where upnum = ?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$upnum,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
header("Location:/analysis/list.php"); // 신규가입일때는 리스트로 이동
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
714
analysis/inputdata.php
Normal file
714
analysis/inputdata.php
Normal file
@@ -0,0 +1,714 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>5) {
|
||||
/* alert("관리자 승인이 필요합니다."); */
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
header("Expires: 0"); // rfc2616 - Section 14.21
|
||||
//header("Refresh:0"); // reload refresh
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/output.css">
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!--날짜 선택 창 UI 필요 -->
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
</head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
if(isset($_REQUEST["search"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$search=$_REQUEST["search"];
|
||||
if(isset($_REQUEST["separate_date"])) //출고일 접수일
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
|
||||
if(isset($_REQUEST["list"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$list=$_REQUEST["list"];
|
||||
else
|
||||
$list=0;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
// $find="firstord"; //검색할때 고정시킬 부분 저장 ex) 전체/공사담당/건설사 등
|
||||
if(isset($_REQUEST["page"])) // $_REQUEST["page"]값이 없을 때에는 1로 지정
|
||||
{
|
||||
$page=$_REQUEST["page"]; // 페이지 번호
|
||||
}
|
||||
else
|
||||
{
|
||||
$page=1;
|
||||
}
|
||||
|
||||
$scale = 20; // 한 페이지에 보여질 게시글 수
|
||||
$page_scale = 10; // 한 페이지당 표시될 페이지 수 10페이지
|
||||
$first_num = ($page-1) * $scale; // 리스트에 표시되는 게시글의 첫 순번.
|
||||
|
||||
if(isset($_REQUEST["mode"]))
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
$cursort=$_REQUEST["cursort"]; // 현재 정렬모드 지정
|
||||
if(isset($_REQUEST["sortof"]))
|
||||
{
|
||||
$sortof=$_REQUEST["sortof"]; // 클릭해서 넘겨준 값
|
||||
if($sortof==1) {
|
||||
|
||||
if($cursort!=1)
|
||||
$cursort=1;
|
||||
else
|
||||
$cursort=2;
|
||||
}
|
||||
if($sortof==2) { //접수일 클릭되었을때
|
||||
|
||||
if($cursort!=3)
|
||||
$cursort=3;
|
||||
else
|
||||
$cursort=4;
|
||||
}
|
||||
if($sortof==3) { //구분 클릭되었을때
|
||||
|
||||
if($cursort!=5)
|
||||
$cursort=5;
|
||||
else
|
||||
$cursort=6;
|
||||
}
|
||||
if($sortof==4) { //절곡 클릭되었을때
|
||||
|
||||
if($cursort!=7)
|
||||
$cursort=7;
|
||||
else
|
||||
$cursort=8;
|
||||
}
|
||||
if($sortof==5) { //모터 클릭되었을때
|
||||
|
||||
if($cursort!=9)
|
||||
$cursort=9;
|
||||
else
|
||||
$cursort=10;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortof=0;
|
||||
$cursort=0;
|
||||
}
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 기간을 정하는 구간
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
if($fromdate=="")
|
||||
{
|
||||
$fromdate=substr(date("Y-m-d",time()),0,4) ;
|
||||
$fromdate=$fromdate . "-01-01";
|
||||
}
|
||||
if($todate=="")
|
||||
{
|
||||
$todate=substr(date("Y-m-d",time()),0,4) . "-12-31" ;
|
||||
$Transtodate=strtotime($todate.'+1 days');
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
else
|
||||
{
|
||||
$Transtodate=strtotime($todate);
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["find"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$find=$_REQUEST["find"];
|
||||
|
||||
$process="전체"; // 기본 전체로 정한다.
|
||||
/*
|
||||
$a=" order by outdate desc limit $first_num, $scale";
|
||||
$b=" order by outdate desc"; */
|
||||
|
||||
if($separate_date=="1") $SettingDate="outdate ";
|
||||
else
|
||||
$SettingDate="indate ";
|
||||
|
||||
|
||||
$common=" where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') order by " . $SettingDate;
|
||||
$a= $common . " desc, num desc limit $first_num, $scale"; //내림차순
|
||||
$b= $common . " desc, num desc "; //내림차순 전체
|
||||
$c= $common . " asc, num desc limit $first_num, $scale"; //오름차순
|
||||
$d= $common . " asc, num desc "; //오름차순 전체
|
||||
|
||||
$where=" where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') ";
|
||||
$all=" limit $first_num, $scale";
|
||||
|
||||
if($mode=="search"){
|
||||
if($search==""){
|
||||
$sql="select * from chandj.bendinglist " . $a;
|
||||
$sqlcon = "select * from chandj.bendinglist " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
elseif($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
|
||||
$sql ="select * from chandj.bendinglist where (outdate like '%$search%') or (outworkplace like '%$search%') ";
|
||||
$sql .="or (orderman like '%$search%') or (outputplace like '%$search%') or (receiver like '%$search%') or";
|
||||
$sql .=" (phone like '%$search%') or (comment like '%$search%') order by " . $SettingDate . " desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.bendinglist where (outdate like '%$search%') or (outworkplace like '%$search%') ";
|
||||
$sqlcon .="or (orderman like '%$search%') or (outputplace like '%$search%') or (receiver like '%$search%') or";
|
||||
$sqlcon .=" (phone like '%$search%') or (comment like '%$search%') order by " . $SettingDate . " desc, num desc ";
|
||||
}
|
||||
|
||||
}
|
||||
if($mode=="") {
|
||||
$sql="select * from chandj.bendinglist " . $a;
|
||||
$sqlcon = "select * from chandj.bendinglist " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
|
||||
|
||||
if($cursort==1)
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $c;
|
||||
$sqlcon="select * from chandj.bendinglist " . $d;
|
||||
}
|
||||
|
||||
if($cursort==2)
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $a;
|
||||
$sqlcon="select * from chandj.bendinglist " . $b;
|
||||
}
|
||||
if($cursort==3) // 접수일 클릭시 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $where . " order by indate desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist " . $where . " order by indate desc, num desc " ;
|
||||
}
|
||||
if($cursort==4) // 접수일 클릭시 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $where . " order by indate asc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist " . $where . " order by indate asc, num desc " ;
|
||||
}
|
||||
if($cursort==5) // 구분 클릭시 주일/경동 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $where . " order by root desc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist " . $where . " order by root desc, " . $SettingDate . " desc, num desc " ;
|
||||
}
|
||||
|
||||
if($cursort==6) // 구분 클릭시 주일/경동 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by root asc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by root asc, " . $SettingDate . " desc , num desc " ;
|
||||
}
|
||||
if($cursort==7) // 절곡 클릭시 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by steel desc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by steel desc, " . $SettingDate . " desc, num desc ";
|
||||
}
|
||||
if($cursort==8) // 절곡 클릭시 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by steel asc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by steel asc, " . $SettingDate . " desc, num desc ";
|
||||
}
|
||||
if($cursort==9) // 모터 클릭시 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by motor desc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by motor desc, " . $SettingDate . " desc, num desc " ;
|
||||
}
|
||||
if($cursort==10) // 모터 클릭시 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by motor asc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by motor asc, " . $SettingDate . " desc, num desc " ;
|
||||
}
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
try{
|
||||
$allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수
|
||||
$temp2=$allstmh->rowCount();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$temp1=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp2; // 전체 글수
|
||||
|
||||
$total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수
|
||||
$current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산
|
||||
// print "$page $total_page $current_page $search $mode";
|
||||
|
||||
?>
|
||||
|
||||
<body >
|
||||
<div id="wrap">
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="col2">
|
||||
<form name="board_form" id="board_form" method="post" action="list.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>">
|
||||
<div id="col2">
|
||||
<div id="title"> <h1> 절곡원가 분석자료 </h1> </div> <div id="top_board1"> 스크린 총 틀수 : </div> <div id="top_board2"> <?=$total_sum?> </div> <div id="top_board3"> 스크린 면적(㎡) 합 : </div> <div id="top_board4"> <?=$total_m2?> </div>
|
||||
<div class="clear"></div>
|
||||
<!-- <div id="title2">
|
||||
<div id class="blink" style="white-space:nowrap"> <font color=red> ***** AS 진행 현황 ***** </font> </div>
|
||||
</div> -->
|
||||
|
||||
<div id="list_search">
|
||||
<div id="list_search1"> <br> ▷ 총 <?= $total_row ?> 개의 자료 파일이 있습니다.</div>
|
||||
<div id="list_search111">
|
||||
<?php
|
||||
if($separate_date=="1") {
|
||||
?>
|
||||
출고일 <input type="radio" checked name="separate_date" value="1">
|
||||
접수일 <input type="radio" name="separate_date" value="2">
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if($separate_date=="2") {
|
||||
?>
|
||||
출고일 <input type="radio" name="separate_date" value="1">
|
||||
접수일 <input type="radio" checked name="separate_date" value="2">
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
<input id="preyear" type='button' onclick='pre_year()' value='전년도'>
|
||||
<input id ="premonth" type='button' onclick='pre_month()' value='전월'>
|
||||
<input type="text" id="fromdate" name="fromdate" size="12" value="<?=$fromdate?>" placeholder="기간 시작일">부터
|
||||
<input type="text" id="todate" name="todate" size="12" value="<?=$todate?>" placeholder="기간 끝">까지
|
||||
|
||||
<input id ="thistoday" type='button' onclick='this_today()' value='금일'>
|
||||
<input id ="tomorrow" type='button' onclick='this_tomorrow()' value='익일'>
|
||||
<input id ="Fromthistoday" type='button' onclick='Fromthis_today()' value='금일이후~'>
|
||||
<input id ="thismonth" type='button' onclick='this_month()' value='당월'>
|
||||
<!-- <input id ="thisyear" type='button' onclick='this_year()' value='당해년도'> -->
|
||||
</div>
|
||||
<div id="list_search2"> <img src="../img/select_search.gif"></div>
|
||||
<div id="list_search3">
|
||||
<select name="find">
|
||||
<?php
|
||||
if($find=="")
|
||||
{ ?>
|
||||
<option value='all'>전체</option>
|
||||
<option value='outworkplace'>현장명</option>
|
||||
<option value='firstord'>발주처</option>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if($find=="all")
|
||||
{ ?>
|
||||
<option value='all' selected>전체</option>
|
||||
<option value='outworkplace'>현장명</option>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if($find=="outworkplace")
|
||||
{ ?>
|
||||
<option value='all' >전체</option>
|
||||
<option value='outworkplace' selected>현장명</option>
|
||||
<?php
|
||||
} ?>
|
||||
</select>
|
||||
|
||||
</div> <!-- end of list_search3 -->
|
||||
|
||||
<div id="list_search4"><input type="text" name="search" id="search" value="<?=$search?>"> </div>
|
||||
|
||||
<div id="list_search5"><input type="image" src="../img/list_search_button.gif"></div>
|
||||
|
||||
</div> <!-- end of list_search -->
|
||||
<div class="clear"></div>
|
||||
<div id="make_output_top_title">
|
||||
<div id="make_output_title1"> 번호 </div>
|
||||
<div id="make_output_title2"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=1&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 출고일자 </a> </div> <!-- 출고일자 -->
|
||||
<div id="make_output_title3"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=2&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 접 수 일 </a> </div> <!-- 접수일 -->
|
||||
|
||||
<div id="make_output_title7"> 현 장 명 </div>
|
||||
<div id="make_output_title8"> 수신처 </div>
|
||||
<div id="make_output_title9"> 수신 주소 </div>
|
||||
<div id="make_output_title10"> 수신연락처 </div>
|
||||
<div id="make_output_title11"> 발주담당 </div>
|
||||
<div id="make_output_title16"> <b> 틀수 </b> </div>
|
||||
<div id="make_output_title14"> <b> 면적(㎡) </b> </div>
|
||||
<div id="make_output_title12"> 비 고 </div>
|
||||
</div>
|
||||
<div id="list_content">
|
||||
<?php
|
||||
if ($page<=1)
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
else
|
||||
$start_num=$total_row-($page-1) * $scale;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$item_num=$row["num"];
|
||||
$outdate=$row["outdate"];
|
||||
$item_indate=$row["indate"];
|
||||
$item_orderman=$row["orderman"];
|
||||
$item_outworkplace=$row["outworkplace"];
|
||||
$item_outputplace=$row["outputplace"];
|
||||
$item_receiver=$row["receiver"];
|
||||
$item_phone=$row["phone"];
|
||||
$item_comment=$row["comment"];
|
||||
|
||||
|
||||
$date_font="black"; // 현재일자 Red 색상으로 표기
|
||||
if($nowday==$outdate) {
|
||||
$date_font="red";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
// 면적구하는 부분
|
||||
$upnum=$item_num;
|
||||
$parentnum=$item_num;
|
||||
$sqlTemp="select * from chandj.make where upnum='$upnum' order by num desc"; // 처음 내림차순
|
||||
|
||||
try{
|
||||
$m_array=array();
|
||||
$stmh_temp = $pdo->query($sqlTemp); // 검색조건에 맞는글 stmh
|
||||
$counter=0;
|
||||
$m2=0;
|
||||
$sum=0;
|
||||
while($row_temp = $stmh_temp->fetch(PDO::FETCH_ASSOC)) {
|
||||
$upnum=$row_temp["upnum"];
|
||||
if((int)$upnum==(int)$parentnum)
|
||||
{
|
||||
$counter++;
|
||||
$number=$row_temp["number"];
|
||||
$x=(int)$row_temp["cutwidth"];
|
||||
$y=(int)$row_temp["cutheight"];
|
||||
$z=(int)$row_temp["number"];
|
||||
$m_array[$counter]=$x/1000 * $y/1000 * $z;
|
||||
$m2 += $m_array[$counter];
|
||||
$sum+=(int)$number;
|
||||
}
|
||||
}
|
||||
$total_sum+=$sum; // 화면누계작성
|
||||
$total_m2+=$m2;
|
||||
$total_m2=number_format((float)$total_m2, 2, '.', '');
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
$m2=number_format((float)$m2, 2, '.', '');
|
||||
|
||||
?>
|
||||
<div id="make_outlist_item" >
|
||||
<div id="make_outlist_item1"><a href="write_form.php?mode=modify&num=<?=$item_num?>&page=<?=$page?>&find=<?=$find?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&callback=1" >
|
||||
<?=$start_num ?></div>
|
||||
<div id="make_outlist_item2" style="color:<?=$date_font?>;">
|
||||
<b> <?=substr($outdate,0,15)?></b></div>
|
||||
|
||||
<?php // 접수일이 당일이면 깜빡이는 효과부여
|
||||
|
||||
if($item_indate==date("Y-m-d",time())) // 보라색 굵은 글씨체로 당일 해당 접수된 것...
|
||||
{
|
||||
// print '<div id class="blink" style="white-space:nowrap; color:green;" >';
|
||||
print '<div id="make_outlist_item3" style=" color:red;">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div id="make_outlist_item3">';
|
||||
}
|
||||
?>
|
||||
<?=substr($item_indate,0,10)?>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="make_outlist_item7">
|
||||
|
||||
<?=iconv_substr($item_outworkplace,0,14,"utf-8")?> </div>
|
||||
<div id="make_outlist_item8"><?=iconv_substr($item_receiver,0,15,"utf-8")?></div>
|
||||
|
||||
<div id="make_outlist_item9"><?=iconv_substr($item_outputplace,0,22,"utf-8")?></div>
|
||||
<div id="make_outlist_item10"><?=substr($item_phone,0,25)?></div>
|
||||
<div id="make_outlist_item11"><?=substr($item_orderman,0,10)?></div>
|
||||
<div id="make_outlist_item16"><?=substr($sum,0,3)?></div>
|
||||
<div id="make_outlist_item14"><?=substr($m2,0,10)?></div>
|
||||
<div id="make_outlist_item12"><?=iconv_substr($item_comment,0,50,"utf-8")?></a></div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
<div id="page_button">
|
||||
<div id="page_num">
|
||||
<?php
|
||||
if($page!=1 && $page>$page_scale)
|
||||
{
|
||||
$prev_page = $page - $page_scale;
|
||||
// 이전 페이지값은 해당 페이지 수에서 리스트에 표시될 페이지수 만큼 감소
|
||||
if($prev_page <= 0)
|
||||
$prev_page = 1; // 만약 감소한 값이 0보다 작거나 같으면 1로 고정
|
||||
print "<a href=list.php?page=$prev_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>◀ </a>";
|
||||
}
|
||||
for($i=$start_page; $i<=$end_page && $i<= $total_page; $i++)
|
||||
{ // [1][2][3] 페이지 번호 목록 출력
|
||||
if($page==$i) // 현재 위치한 페이지는 링크 출력을 하지 않도록 설정.
|
||||
print "<font color=red><b>[$i]</b></font>";
|
||||
else
|
||||
print "<a href=list.php?page=$i&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>[$i]</a>";
|
||||
}
|
||||
|
||||
if($page<$total_page)
|
||||
{
|
||||
$next_page = $page + $page_scale;
|
||||
if($next_page > $total_page)
|
||||
$next_page = $total_page;
|
||||
// netx_page 값이 전체 페이지수 보다 크면 맨 뒤 페이지로 이동시킴
|
||||
print "<a href=list.php?page=$next_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year> ▶</a><p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end of col2 -->
|
||||
</div> <!-- end of content -->
|
||||
</div> <!-- end of wrap -->
|
||||
<script>
|
||||
function blinker() {
|
||||
$('.blinking').fadeOut(500);
|
||||
$('.blinking').fadeIn(500);
|
||||
}
|
||||
setInterval(blinker, 1000);
|
||||
</script>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script>
|
||||
/* $(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
); */
|
||||
|
||||
$(function() {
|
||||
$( "#id_of_the_component" ).datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#fromdate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
$("#todate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
});
|
||||
|
||||
function pre_year(){ // 전년도 추출
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
today = mm+'/'+dd+'/'+yyyy;
|
||||
yyyy=yyyy-1;
|
||||
frompreyear = yyyy+'-01-01';
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function pre_month(){
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
mm=mm-1;
|
||||
if(mm<1) {
|
||||
mm='12';
|
||||
}
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
if(mm>=12) {
|
||||
yyyy=yyyy-1;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-01';
|
||||
topreyear = yyyy+'-'+mm+'-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_year(){ // 당해년도
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
today = mm+'/'+dd+'/'+yyyy;
|
||||
frompreyear = yyyy+'-01-01';
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
fromdate1=frompreyear;
|
||||
todate1=topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
function this_month(){ // 당해월
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-01';
|
||||
topreyear = yyyy+'-'+mm+'-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function Fromthis_today(){ // 금일이후
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_today(){ // 금일
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-'+mm+'-'+dd;
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_tomorrow(){ // 익일
|
||||
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate()+1;
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-'+mm+'-'+dd;
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function process_list(){ // 접수일 출고일 라디오버튼 클릭시
|
||||
document.getElementById('search').value=null;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
if($mode==""&&$fromdate==null)
|
||||
{
|
||||
echo ("<script language=javascript> this_year();</script>"); // 당해년도 화면에 초기세팅하기
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
<script>
|
||||
// 스크린합 구한값 화면에 출력하기
|
||||
var total_sum = '<?php echo $total_sum ;?>';
|
||||
var total_m2 = '<?php echo $total_m2 ;?>';
|
||||
$("#top_board2").text(total_sum);
|
||||
$("#top_board4").text(total_m2);
|
||||
</script>
|
||||
</html>
|
||||
191
analysis/insert.php
Normal file
191
analysis/insert.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<?php session_start(); ?>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<script src="/analysis/make.js"></script>
|
||||
<?php
|
||||
|
||||
$modify=$_REQUEST["modify"];
|
||||
|
||||
$ordercompany=$_REQUEST["ordercompany"]; // 발주처
|
||||
$parentnum=$_REQUEST["parentnum"]; // 리스트번호
|
||||
$upnum=$_REQUEST["upnum"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
$num=$_REQUEST["num"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
$outputnum=$_REQUEST["outputnum"];
|
||||
|
||||
$steeltype=$_REQUEST["steeltype"];
|
||||
$tmp_steeltype=$steeltype;
|
||||
|
||||
$steel_alias=$_REQUEST["steel_alias"];
|
||||
$tmp_steel_alias=$steel_alias;
|
||||
|
||||
$copied_file_name=$_REQUEST["copied_file_name"];
|
||||
$uploaded_file=$_REQUEST["uploaded_file"];
|
||||
|
||||
$length1=$_REQUEST["length1"];
|
||||
$length2=$_REQUEST["length2"];
|
||||
$length3=$_REQUEST["length3"];
|
||||
$length4=$_REQUEST["length4"];
|
||||
$length5=$_REQUEST["length5"];
|
||||
$amount1=$_REQUEST["amount1"];
|
||||
$amount2=$_REQUEST["amount2"];
|
||||
$amount3=$_REQUEST["amount3"];
|
||||
$amount4=$_REQUEST["amount4"];
|
||||
$amount5=$_REQUEST["amount5"];
|
||||
$material1=$_REQUEST["material1"];
|
||||
$material2=$_REQUEST["material2"];
|
||||
$material3=$_REQUEST["material3"];
|
||||
$material4=$_REQUEST["material4"];
|
||||
$material5=$_REQUEST["material5"];
|
||||
$material6=$_REQUEST["material6"];
|
||||
$material7=$_REQUEST["material7"];
|
||||
$material8=$_REQUEST["material8"];
|
||||
$sum1=$_REQUEST["sum1"];
|
||||
$sum2=$_REQUEST["sum2"];
|
||||
$sum3=$_REQUEST["sum3"];
|
||||
$sum4=$_REQUEST["sum4"];
|
||||
$sum5=$_REQUEST["sum5"];
|
||||
$sum6=$_REQUEST["sum6"];
|
||||
$sum7=$_REQUEST["sum7"];
|
||||
$sum8=$_REQUEST["sum8"];
|
||||
$total_text=$_REQUEST["total_text"];
|
||||
|
||||
$datanum=$_REQUEST["datanum"]; //절곡데이터 번호 기억
|
||||
|
||||
|
||||
// print "<script> alert($modify); </script>";
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
if($modify=='1')
|
||||
{
|
||||
try{
|
||||
$sql = "select * from chandj.bending_write where num=?"; // get target record
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "update chandj.bending_write set upnum=?, outputnum=? ,length1=?, length2=? , length3=?, length4=? , length5=? , amount1=? , amount2=? , amount3=? , amount4=? , amount5=? ,";
|
||||
$sql .= " material1=?, material2=?, material3=?, material4=?, material5=?, material6=?, material7=?, material8=?, sum1=?, sum2=?, sum3=?, sum4=?, sum5=?, sum6=?, sum7=?, sum8=?, total_text=?,";
|
||||
$sql .= " steeltype=?, steel_alias=?, copied_file_name=?, uploaded_file=?, datanum=? where num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $upnum, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $outputnum, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $length1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(4, $length2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(5, $length3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(6, $length4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(7, $length5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(8, $amount1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(9, $amount2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(10, $amount3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(11, $amount4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(12, $amount5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(13, $material1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(14, $material2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(15, $material3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(16, $material4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(17, $material5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(18, $material6, PDO::PARAM_STR);
|
||||
$stmh->bindValue(19, $material7, PDO::PARAM_STR);
|
||||
$stmh->bindValue(20, $material8, PDO::PARAM_STR);
|
||||
$stmh->bindValue(21, $sum1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(22, $sum2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(23, $sum3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(24, $sum4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(25, $sum5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(26, $sum6, PDO::PARAM_STR);
|
||||
$stmh->bindValue(27, $sum7, PDO::PARAM_STR);
|
||||
$stmh->bindValue(28, $sum8, PDO::PARAM_STR);
|
||||
$stmh->bindValue(29, $total_text, PDO::PARAM_STR);
|
||||
$stmh->bindValue(30, $steeltype, PDO::PARAM_STR);
|
||||
$stmh->bindValue(31, $steel_alias, PDO::PARAM_STR);
|
||||
$stmh->bindValue(32, $copied_file_name, PDO::PARAM_STR);
|
||||
$stmh->bindValue(33, $uploaded_file, PDO::PARAM_STR);
|
||||
$stmh->bindValue(34, $datanum, PDO::PARAM_STR);
|
||||
$stmh->bindValue(35, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
elseif($modify=='2') // sorting 요청
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
// 데이터 신규 등록하는 구간
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "insert into chandj.bending_write(upnum, outputnum,length1, length2, length3, length4, length5, amount1, amount2 , amount3 , amount4 , amount5,";
|
||||
$sql .= " material1, material2, material3, material4, material5, material6, material7, material8, sum1, sum2, sum3, sum4, sum5, sum6, sum7, sum8, total_text, steeltype, steel_alias, copied_file_name, uploaded_file, datanum) ";
|
||||
|
||||
$sql .= " values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ";
|
||||
$sql .= " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ";
|
||||
$sql .= " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"; // 33개 + num 1개
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $upnum, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $outputnum, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $length1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(4, $length2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(5, $length3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(6, $length4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(7, $length5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(8, $amount1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(9, $amount2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(10, $amount3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(11, $amount4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(12, $amount5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(13, $material1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(14, $material2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(15, $material3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(16, $material4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(17, $material5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(18, $material6, PDO::PARAM_STR);
|
||||
$stmh->bindValue(19, $material7, PDO::PARAM_STR);
|
||||
$stmh->bindValue(20, $material8, PDO::PARAM_STR);
|
||||
$stmh->bindValue(21, $sum1, PDO::PARAM_STR);
|
||||
$stmh->bindValue(22, $sum2, PDO::PARAM_STR);
|
||||
$stmh->bindValue(23, $sum3, PDO::PARAM_STR);
|
||||
$stmh->bindValue(24, $sum4, PDO::PARAM_STR);
|
||||
$stmh->bindValue(25, $sum5, PDO::PARAM_STR);
|
||||
$stmh->bindValue(26, $sum6, PDO::PARAM_STR);
|
||||
$stmh->bindValue(27, $sum7, PDO::PARAM_STR);
|
||||
$stmh->bindValue(28, $sum8, PDO::PARAM_STR);
|
||||
$stmh->bindValue(29, $total_text, PDO::PARAM_STR);
|
||||
$stmh->bindValue(30, $steeltype, PDO::PARAM_STR);
|
||||
$stmh->bindValue(31, $steel_alias, PDO::PARAM_STR);
|
||||
$stmh->bindValue(32, $copied_file_name, PDO::PARAM_STR);
|
||||
$stmh->bindValue(33, $uploaded_file, PDO::PARAM_STR);
|
||||
$stmh->bindValue(34, $datanum, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($modify=='update') $modify="1";
|
||||
header("Location:/analysis/write.php?num=$num&sort=$sort&upnum=$upnum&datanum=$datanum&outputnum=$outputnum&parentnum=$parentnum&ordercompany=$ordercompany&modify=$modify"); // 신규가입일때는 리스트로 이동
|
||||
|
||||
|
||||
?>
|
||||
186
analysis/insertlist.php
Normal file
186
analysis/insertlist.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
session_start();
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=8) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
$modify=$_REQUEST["modify"];
|
||||
$outputnum=$_REQUEST["outputnum"];
|
||||
$callback=$_REQUEST["callback"]; // 출고현황에서 호출했는지 체크함.
|
||||
|
||||
if(isset($_REQUEST["page"]))
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1; // 1로 설정해야 함
|
||||
if(isset($_REQUEST["mode"])) //modify_form에서 호출할 경우
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
if(isset($_REQUEST["num"]))
|
||||
$num=$_REQUEST["num"];
|
||||
else
|
||||
$num="";
|
||||
|
||||
if(isset($_REQUEST["sort"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$sort=$_REQUEST["sort"];
|
||||
else
|
||||
$sort="1";
|
||||
|
||||
if(isset($_REQUEST["upnum"]))
|
||||
$upnum=$_REQUEST["upnum"];
|
||||
else
|
||||
$upnum=0;
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
$ordercompany=$_REQUEST["ordercompany"];
|
||||
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
$outputnumint=(int)$outputnum;
|
||||
if($outputnumint>0) { // 출고번호의 레코드가 존재할 경우 수정모드로 전환
|
||||
$outputnum=$_REQUEST["outputnum"];
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
try{
|
||||
$sql = "select * from chandj.bendinglist where outputnum=?"; // get target record
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$outputnum,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$rowcount=$stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
if($rowcount==1)
|
||||
{
|
||||
$mode="modify";
|
||||
$num= $row["num"];
|
||||
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$item_outdate=$_REQUEST["outdate"];
|
||||
$item_indate=$_REQUEST["indate"];
|
||||
$item_orderman=$_REQUEST["orderman"];
|
||||
$item_outworkplace=$_REQUEST["outworkplace"];
|
||||
$item_outputplace=$_REQUEST["outputplace"];
|
||||
$item_phone=$_REQUEST["phone"];
|
||||
$item_receiver=$_REQUEST["receiver"];
|
||||
$item_comment=$_REQUEST["comment"];
|
||||
$item_delivery=$_REQUEST["delivery"];
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($mode=="modify" || ($mode=="modify" && $modify=="1")){ // 정렬버튼 선택시도 함께
|
||||
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.bendinglist where num=?"; // get target record
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
/* print "접속완료" ; */
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "update chandj.bendinglist set outdate=?, indate=?, orderman=?, outworkplace=?, outputplace=?, receiver=?, phone=?, comment=?, delivery=?, outputnum=? ";
|
||||
$sql .= " where num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $item_outdate, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $item_indate, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $item_orderman, PDO::PARAM_STR);
|
||||
|
||||
$stmh->bindValue(4, $item_outworkplace, PDO::PARAM_STR);
|
||||
$stmh->bindValue(5, $item_outputplace, PDO::PARAM_STR);
|
||||
$stmh->bindValue(6, $item_receiver, PDO::PARAM_STR);
|
||||
$stmh->bindValue(7, $item_phone, PDO::PARAM_STR);
|
||||
$stmh->bindValue(8, $item_comment, PDO::PARAM_STR);
|
||||
$stmh->bindValue(9, $item_delivery, PDO::PARAM_STR);
|
||||
$stmh->bindValue(10, $outputnum, PDO::PARAM_STR);
|
||||
|
||||
$stmh->bindValue(11, $num, PDO::PARAM_STR); //고유키값이 같나?의 의미로 ?로 num으로 맞춰야 합니다. where 구문
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// 데이터 신규 등록하는 구간
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "insert into chandj.bendinglist(outdate, indate, orderman, outworkplace, outputplace, receiver, phone, comment, outputnum, delivery)";
|
||||
|
||||
$sql .= " values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";// 총 10개 레코드 추가
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $item_outdate, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $item_indate, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $item_orderman, PDO::PARAM_STR);
|
||||
|
||||
$stmh->bindValue(4, $item_outworkplace, PDO::PARAM_STR);
|
||||
$stmh->bindValue(5, $item_outputplace, PDO::PARAM_STR);
|
||||
$stmh->bindValue(6, $item_receiver, PDO::PARAM_STR);
|
||||
$stmh->bindValue(7, $item_phone, PDO::PARAM_STR);
|
||||
$stmh->bindValue(8, $item_comment, PDO::PARAM_STR);
|
||||
$stmh->bindValue(9, $outputnum, PDO::PARAM_STR);
|
||||
$stmh->bindValue(10, $item_delivery, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($mode=="not"&&$modify!='1')
|
||||
{
|
||||
$sql = "select * from chandj.bendinglist order by num desc";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->execute();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
$num = $row["num"];
|
||||
$upnum = $num;
|
||||
header("Location:/analysis/write.php?num=$num&upnum=$upnum&outputnum=$outputnum&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date&outworkplace=$item_outworkplace&sort=$sort&parentnum=$num&callback=$callback&ordercompany=$ordercompany"); // 신규가입일때는 리스트로 이동
|
||||
}
|
||||
elseif($modify=='1') // 정렬만 보여줌
|
||||
header("Location:/analysis/write_form.php?num=$num&upnum=$upnum&outputnum=$outputnum&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date&outworkplace=$item_outworkplace&sort=$sort&indate=$item_indate&outdate=$item_outdate&orderman=$item_orderman&callback=$callback&mode=modify&ordercompany=$ordercompany");
|
||||
else
|
||||
header("Location:/analysis/write.php?num=$num&upnum=$upnum&outputnum=$outputnum&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date&outworkplace=$item_outworkplace&sort=$sort&parentnum=$num&callback=$callback&ordercompany=$ordercompany");
|
||||
|
||||
?>
|
||||
795
analysis/list.php
Normal file
795
analysis/list.php
Normal file
@@ -0,0 +1,795 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>5) {
|
||||
/* alert("관리자 승인이 필요합니다."); */
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
header("Expires: 0"); // rfc2616 - Section 14.21
|
||||
//header("Refresh:0"); // reload refresh
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/output.css">
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!--날짜 선택 창 UI 필요 -->
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
</head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
if(isset($_REQUEST["search"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$search=$_REQUEST["search"];
|
||||
if(isset($_REQUEST["separate_date"])) //출고일 접수일
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
|
||||
if(isset($_REQUEST["list"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$list=$_REQUEST["list"];
|
||||
else
|
||||
$list=0;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
// $find="firstord"; //검색할때 고정시킬 부분 저장 ex) 전체/공사담당/건설사 등
|
||||
if(isset($_REQUEST["page"])) // $_REQUEST["page"]값이 없을 때에는 1로 지정
|
||||
{
|
||||
$page=$_REQUEST["page"]; // 페이지 번호
|
||||
}
|
||||
else
|
||||
{
|
||||
$page=1;
|
||||
}
|
||||
|
||||
$scale = 20; // 한 페이지에 보여질 게시글 수
|
||||
$page_scale = 10; // 한 페이지당 표시될 페이지 수 10페이지
|
||||
$first_num = ($page-1) * $scale; // 리스트에 표시되는 게시글의 첫 순번.
|
||||
|
||||
if(isset($_REQUEST["mode"]))
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
$cursort=$_REQUEST["cursort"]; // 현재 정렬모드 지정
|
||||
if(isset($_REQUEST["sortof"]))
|
||||
{
|
||||
$sortof=$_REQUEST["sortof"]; // 클릭해서 넘겨준 값
|
||||
if($sortof==1) {
|
||||
|
||||
if($cursort!=1)
|
||||
$cursort=1;
|
||||
else
|
||||
$cursort=2;
|
||||
}
|
||||
if($sortof==2) { //접수일 클릭되었을때
|
||||
|
||||
if($cursort!=3)
|
||||
$cursort=3;
|
||||
else
|
||||
$cursort=4;
|
||||
}
|
||||
if($sortof==3) { //구분 클릭되었을때
|
||||
|
||||
if($cursort!=5)
|
||||
$cursort=5;
|
||||
else
|
||||
$cursort=6;
|
||||
}
|
||||
if($sortof==4) { //절곡 클릭되었을때
|
||||
|
||||
if($cursort!=7)
|
||||
$cursort=7;
|
||||
else
|
||||
$cursort=8;
|
||||
}
|
||||
if($sortof==5) { //모터 클릭되었을때
|
||||
|
||||
if($cursort!=9)
|
||||
$cursort=9;
|
||||
else
|
||||
$cursort=10;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortof=0;
|
||||
$cursort=0;
|
||||
}
|
||||
|
||||
if($separate_date=="") $separate_date="1";
|
||||
|
||||
// 기간을 정하는 구간
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
if($fromdate=="")
|
||||
{
|
||||
$fromdate=substr(date("Y-m-d",time()),0,4) ;
|
||||
$fromdate=$fromdate . "-01-01";
|
||||
}
|
||||
if($todate=="")
|
||||
{
|
||||
$todate=substr(date("Y-m-d",time()),0,4) . "-12-31" ;
|
||||
$Transtodate=strtotime($todate.'+1 days');
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
else
|
||||
{
|
||||
$Transtodate=strtotime($todate);
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["find"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$find=$_REQUEST["find"];
|
||||
|
||||
$process="전체"; // 기본 전체로 정한다.
|
||||
/*
|
||||
$a=" order by outdate desc limit $first_num, $scale";
|
||||
$b=" order by outdate desc"; */
|
||||
|
||||
if($separate_date=="1") $SettingDate="outdate ";
|
||||
else
|
||||
$SettingDate="indate ";
|
||||
|
||||
|
||||
$common=" where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') order by " . $SettingDate;
|
||||
$a= $common . " desc, num desc limit $first_num, $scale"; //내림차순
|
||||
$b= $common . " desc, num desc "; //내림차순 전체
|
||||
$c= $common . " asc, num desc limit $first_num, $scale"; //오름차순
|
||||
$d= $common . " asc, num desc "; //오름차순 전체
|
||||
|
||||
$where=" where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') ";
|
||||
$all=" limit $first_num, $scale";
|
||||
|
||||
if($mode=="search"){
|
||||
if($search==""){
|
||||
$sql="select * from chandj.bendinglist " . $a;
|
||||
$sqlcon = "select * from chandj.bendinglist " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
elseif($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
|
||||
$sql ="select * from chandj.bendinglist where (outdate like '%$search%') or (outworkplace like '%$search%') ";
|
||||
$sql .="or (orderman like '%$search%') or (outputplace like '%$search%') or (receiver like '%$search%') or";
|
||||
$sql .=" (phone like '%$search%') or (comment like '%$search%') order by " . $SettingDate . " desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.bendinglist where (outdate like '%$search%') or (outworkplace like '%$search%') ";
|
||||
$sqlcon .="or (orderman like '%$search%') or (outputplace like '%$search%') or (receiver like '%$search%') or";
|
||||
$sqlcon .=" (phone like '%$search%') or (comment like '%$search%') order by " . $SettingDate . " desc, num desc ";
|
||||
}
|
||||
|
||||
}
|
||||
if($mode=="") {
|
||||
$sql="select * from chandj.bendinglist " . $a;
|
||||
$sqlcon = "select * from chandj.bendinglist " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
|
||||
|
||||
if($cursort==1)
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $c;
|
||||
$sqlcon="select * from chandj.bendinglist " . $d;
|
||||
}
|
||||
|
||||
if($cursort==2)
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $a;
|
||||
$sqlcon="select * from chandj.bendinglist " . $b;
|
||||
}
|
||||
if($cursort==3) // 접수일 클릭시 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $where . " order by indate desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist " . $where . " order by indate desc, num desc " ;
|
||||
}
|
||||
if($cursort==4) // 접수일 클릭시 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $where . " order by indate asc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist " . $where . " order by indate asc, num desc " ;
|
||||
}
|
||||
if($cursort==5) // 구분 클릭시 주일/경동 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist " . $where . " order by root desc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist " . $where . " order by root desc, " . $SettingDate . " desc, num desc " ;
|
||||
}
|
||||
|
||||
if($cursort==6) // 구분 클릭시 주일/경동 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by root asc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by root asc, " . $SettingDate . " desc , num desc " ;
|
||||
}
|
||||
if($cursort==7) // 절곡 클릭시 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by steel desc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by steel desc, " . $SettingDate . " desc, num desc ";
|
||||
}
|
||||
if($cursort==8) // 절곡 클릭시 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by steel asc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by steel asc, " . $SettingDate . " desc, num desc ";
|
||||
}
|
||||
if($cursort==9) // 모터 클릭시 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by motor desc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by motor desc, " . $SettingDate . " desc, num desc " ;
|
||||
}
|
||||
if($cursort==10) // 모터 클릭시 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.bendinglist" . $where . " order by motor asc, " . $SettingDate . " desc, num desc " . $all;
|
||||
$sqlcon="select * from chandj.bendinglist" . $where . " order by motor asc, " . $SettingDate . " desc, num desc " ;
|
||||
}
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
try{
|
||||
$allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수
|
||||
$temp2=$allstmh->rowCount();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$temp1=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp2; // 전체 글수
|
||||
|
||||
$total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수
|
||||
$current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산
|
||||
// print "$page $total_page $current_page $search $mode";
|
||||
|
||||
$total_arr_sum=array();
|
||||
|
||||
for($j=1;$j<=9;$j++) // 총합계 배열 초기화
|
||||
{
|
||||
$total_arr_sum[$j] = null;
|
||||
}
|
||||
?>
|
||||
|
||||
<body >
|
||||
<div id="wrap">
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="col2">
|
||||
<form name="board_form" id="board_form" method="post" action="list.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>">
|
||||
<div id="col2">
|
||||
<div id="title"> <h1> 절곡원가 분석자료 </h1> </div> <div id="top_board_all" > </div>
|
||||
<!-- <div id="top_board0" > <a href="bendingdatalist.php" target="_blank" > <img src="../img/movetosteeldata.jpg"> </a> </div> -->
|
||||
<div class="clear"></div>
|
||||
<!-- <div id="title2">
|
||||
<div id class="blink" style="white-space:nowrap"> <font color=red> ***** AS 진행 현황 ***** </font> </div>
|
||||
</div> -->
|
||||
|
||||
<div id="list_search">
|
||||
<div id="list_search1"> <br> ▷ 총 <?= $total_row ?> 개의 자료 파일이 있습니다.</div>
|
||||
<div id="list_search111">
|
||||
<?php
|
||||
if($separate_date=="1") {
|
||||
?>
|
||||
출고일 <input type="radio" checked name="separate_date" value="1">
|
||||
접수일 <input type="radio" name="separate_date" value="2">
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if($separate_date=="2") {
|
||||
?>
|
||||
출고일 <input type="radio" name="separate_date" value="1">
|
||||
접수일 <input type="radio" checked name="separate_date" value="2">
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
<input id="preyear" type='button' onclick='pre_year()' value='전년도'>
|
||||
<input id ="premonth" type='button' onclick='pre_month()' value='전월'>
|
||||
<input type="text" id="fromdate" name="fromdate" size="12" value="<?=$fromdate?>" placeholder="기간 시작일">부터
|
||||
<input type="text" id="todate" name="todate" size="12" value="<?=$todate?>" placeholder="기간 끝">까지
|
||||
|
||||
<input id ="thistoday" type='button' onclick='this_today()' value='금일'>
|
||||
<input id ="tomorrow" type='button' onclick='this_tomorrow()' value='익일'>
|
||||
<input id ="Fromthistoday" type='button' onclick='Fromthis_today()' value='금일이후~'>
|
||||
<input id ="thismonth" type='button' onclick='this_month()' value='당월'>
|
||||
<!-- <input id ="thisyear" type='button' onclick='this_year()' value='당해년도'> -->
|
||||
</div>
|
||||
<div id="list_search2"> <img src="../img/select_search.gif"></div>
|
||||
<div id="list_search3">
|
||||
<select name="find">
|
||||
<?php
|
||||
if($find=="")
|
||||
{ ?>
|
||||
<option value='all'>전체</option>
|
||||
<option value='outworkplace'>현장명</option>
|
||||
<option value='firstord'>발주처</option>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if($find=="all")
|
||||
{ ?>
|
||||
<option value='all' selected>전체</option>
|
||||
<option value='outworkplace'>현장명</option>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if($find=="outworkplace")
|
||||
{ ?>
|
||||
<option value='all' >전체</option>
|
||||
<option value='outworkplace' selected>현장명</option>
|
||||
<?php
|
||||
} ?>
|
||||
</select>
|
||||
|
||||
</div> <!-- end of list_search3 -->
|
||||
|
||||
<div id="list_search4"><input type="text" name="search" id="search" value="<?=$search?>"> </div>
|
||||
|
||||
<div id="list_search5"><input type="image" src="../img/list_search_button.gif"></div>
|
||||
|
||||
</div> <!-- end of list_search -->
|
||||
<div class="clear"></div>
|
||||
<div id="make_output_top_title">
|
||||
<div id="make_output_title1"> 번호 </div>
|
||||
<div id="make_output_title2"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=1&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 출고일자 </a> </div> <!-- 출고일자 -->
|
||||
<div id="make_output_title3"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=2&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 접 수 일 </a> </div> <!-- 접수일 -->
|
||||
|
||||
<div id="make_output_title7"> 현 장 명 </div>
|
||||
<div id="make_output_title8"> 수신처 </div>
|
||||
<div id="make_output_title9"> 수신 주소 </div>
|
||||
<div id="make_output_title10"> 수신연락처 </div>
|
||||
<div id="make_output_title11"> 발주담당 </div>
|
||||
<div id="make_output_title21"> EGI1.6T(㎡) </div>
|
||||
<div id="make_output_title22"> EGI1.2T(㎡) </div>
|
||||
<div id="make_output_title23"> EGI0.8T(㎡) </div>
|
||||
<div id="make_output_title24"> H/L1.5T(㎡) </div>
|
||||
<div id="make_output_title25"> H/L1.2T(㎡) </div>
|
||||
<div id="make_output_title26"> GI0.45T(㎡) </div>
|
||||
<div id="make_output_title27"> GI0.8T(㎡) </div>
|
||||
|
||||
</div>
|
||||
<div id="list_content">
|
||||
<?php
|
||||
if ($page<=1)
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
else
|
||||
$start_num=$total_row-($page-1) * $scale;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$item_num=$row["num"];
|
||||
$outdate=$row["outdate"];
|
||||
$item_indate=$row["indate"];
|
||||
$item_orderman=$row["orderman"];
|
||||
$item_outworkplace=$row["outworkplace"];
|
||||
$item_outputplace=$row["outputplace"];
|
||||
$item_receiver=$row["receiver"];
|
||||
$item_phone=$row["phone"];
|
||||
$item_comment=$row["comment"];
|
||||
|
||||
|
||||
$date_font="black"; // 현재일자 Red 색상으로 표기
|
||||
if($nowday==$outdate) {
|
||||
$date_font="red";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
// 면적구하는 부분
|
||||
|
||||
$parentnum=$item_num;
|
||||
$sqlTemp="select * from chandj.bending_write where upnum='$item_num' order by num desc"; // 처음 내림차순
|
||||
|
||||
try{
|
||||
$m_array=array();
|
||||
$stmh_temp = $pdo->query($sqlTemp); // 검색조건에 맞는글 stmh
|
||||
$sum=0;
|
||||
|
||||
$counter=0;
|
||||
|
||||
$display_text="";
|
||||
|
||||
$options = array();
|
||||
$options[1] = 'EGI1.6T';
|
||||
$options[2] = 'EGI1.2T';
|
||||
$options[3] = 'EGI0.8T';
|
||||
$options[4] = 'SUS H/L 1.5T';
|
||||
$options[5] = 'SUS H/L 1.2T';
|
||||
$options[6] = 'GI0.45T';
|
||||
$options[7] = 'GI0.8T';
|
||||
$options[8] = 'Mirror 1.5';
|
||||
$options[9] = 'Mirror 1.2';
|
||||
|
||||
while($row_temp = $stmh_temp->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$counter++;
|
||||
$total_text=$row_temp["total_text"];
|
||||
|
||||
|
||||
$arr_count++;
|
||||
|
||||
$jb = explode( ',', $total_text );
|
||||
// print $jb[0] . " " . $jb[1]; // 분할된 것 화면에 보여주기 테스트용
|
||||
$total_count=count($jb); // 배열의 수를 파악해서 반복문을 만든다.
|
||||
|
||||
|
||||
for($i=1;$i<=$total_count;$i++)
|
||||
{
|
||||
$tmp = explode( '=', $jb[$i-1] );
|
||||
for($j=1;$j<=9;$j++) // 합계 배열에 누적
|
||||
{
|
||||
if($tmp[0]==$options[$j]) {
|
||||
$steel_arr_sum[$j] = $steel_arr_sum[$j] + (float)$tmp[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
// $m2=number_format((float)$m2, 2, '.', '');
|
||||
|
||||
?>
|
||||
<div id="make_outlist_item" >
|
||||
<div id="make_outlist_item1"><a href="write_form.php?mode=modify&num=<?=$item_num?>&page=<?=$page?>&find=<?=$find?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&callback=1" >
|
||||
<?=$start_num ?></div>
|
||||
<div id="make_outlist_item2" style="color:<?=$date_font?>;">
|
||||
<b> <?=substr($outdate,0,15)?></b></div>
|
||||
|
||||
<?php // 접수일이 당일이면 깜빡이는 효과부여
|
||||
|
||||
if($item_indate==date("Y-m-d",time())) // 보라색 굵은 글씨체로 당일 해당 접수된 것...
|
||||
{
|
||||
// print '<div id class="blink" style="white-space:nowrap; color:green;" >';
|
||||
print '<div id="make_outlist_item3" style=" color:red;">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div id="make_outlist_item3">';
|
||||
}
|
||||
?>
|
||||
<?=substr($item_indate,0,10)?>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="make_outlist_item7">
|
||||
|
||||
<?=iconv_substr($item_outworkplace,0,14,"utf-8")?> </div>
|
||||
<div id="make_outlist_item8"><?=iconv_substr($item_receiver,0,15,"utf-8")?></div>
|
||||
|
||||
<div id="make_outlist_item9"><?=iconv_substr($item_outputplace,0,22,"utf-8")?></div>
|
||||
<div id="make_outlist_item10"><?=substr($item_phone,0,25)?></div>
|
||||
<div id="make_outlist_item11"><?=substr($item_orderman,0,10)?></div>
|
||||
<div id="make_outlist_item21"><?=$steel_arr_sum[1]?></div>
|
||||
<div id="make_outlist_item22"><?=$steel_arr_sum[2]?></div>
|
||||
<div id="make_outlist_item23"><?=$steel_arr_sum[3]?></div>
|
||||
<div id="make_outlist_item24"><?=$steel_arr_sum[4]?></div>
|
||||
<div id="make_outlist_item25"><?=$steel_arr_sum[5]?></div>
|
||||
<div id="make_outlist_item26"><?=$steel_arr_sum[6]?></div>
|
||||
<div id="make_outlist_item27"><?=$steel_arr_sum[7]?></div>
|
||||
|
||||
</a>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
<?php
|
||||
$start_num--;
|
||||
for($j=1;$j<=9;$j++) // 합계 배열 초기화
|
||||
{
|
||||
$total_arr_sum[$j] += $steel_arr_sum[$j];
|
||||
$steel_arr_sum[$j] = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
<div id="page_button">
|
||||
<div id="page_num">
|
||||
<?php
|
||||
if($page!=1 && $page>$page_scale)
|
||||
{
|
||||
$prev_page = $page - $page_scale;
|
||||
// 이전 페이지값은 해당 페이지 수에서 리스트에 표시될 페이지수 만큼 감소
|
||||
if($prev_page <= 0)
|
||||
$prev_page = 1; // 만약 감소한 값이 0보다 작거나 같으면 1로 고정
|
||||
print "<a href=list.php?page=$prev_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>◀ </a>";
|
||||
}
|
||||
for($i=$start_page; $i<=$end_page && $i<= $total_page; $i++)
|
||||
{ // [1][2][3] 페이지 번호 목록 출력
|
||||
if($page==$i) // 현재 위치한 페이지는 링크 출력을 하지 않도록 설정.
|
||||
print "<font color=red><b>[$i]</b></font>";
|
||||
else
|
||||
print "<a href=list.php?page=$i&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>[$i]</a>";
|
||||
}
|
||||
|
||||
if($page<$total_page)
|
||||
{
|
||||
$next_page = $page + $page_scale;
|
||||
if($next_page > $total_page)
|
||||
$next_page = $total_page;
|
||||
// netx_page 값이 전체 페이지수 보다 크면 맨 뒤 페이지로 이동시킴
|
||||
print "<a href=list.php?page=$next_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year> ▶</a><p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end of col2 -->
|
||||
</div> <!-- end of content -->
|
||||
</div> <!-- end of wrap -->
|
||||
<script>
|
||||
function blinker() {
|
||||
$('.blinking').fadeOut(500);
|
||||
$('.blinking').fadeIn(500);
|
||||
}
|
||||
setInterval(blinker, 1000);
|
||||
</script>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script>
|
||||
/* $(document).ready(function() {
|
||||
$("input:radio[name=separate_date]").click(function() {
|
||||
process_list();
|
||||
})
|
||||
); */
|
||||
|
||||
$(function() {
|
||||
$( "#id_of_the_component" ).datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#fromdate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
$("#todate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
});
|
||||
|
||||
function pre_year(){ // 전년도 추출
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
today = mm+'/'+dd+'/'+yyyy;
|
||||
yyyy=yyyy-1;
|
||||
frompreyear = yyyy+'-01-01';
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function pre_month(){
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
mm=mm-1;
|
||||
if(mm<1) {
|
||||
mm='12';
|
||||
}
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
if(mm>=12) {
|
||||
yyyy=yyyy-1;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-01';
|
||||
topreyear = yyyy+'-'+mm+'-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_year(){ // 당해년도
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
today = mm+'/'+dd+'/'+yyyy;
|
||||
frompreyear = yyyy+'-01-01';
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
fromdate1=frompreyear;
|
||||
todate1=topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
function this_month(){ // 당해월
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-01';
|
||||
topreyear = yyyy+'-'+mm+'-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function Fromthis_today(){ // 금일이후
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-12-31';
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_today(){ // 금일
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-'+mm+'-'+dd;
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function this_tomorrow(){ // 익일
|
||||
|
||||
document.getElementById('search').value=null;
|
||||
var today = new Date();
|
||||
var dd = today.getDate()+1;
|
||||
var mm = today.getMonth()+1; //January is 0! 항상 1을 더해야 해당월을 구한다
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd='0'+dd;
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm='0'+mm;
|
||||
}
|
||||
|
||||
frompreyear = yyyy+'-'+mm+'-'+dd;
|
||||
topreyear = yyyy+'-'+mm+'-'+dd;
|
||||
|
||||
document.getElementById("fromdate").value = frompreyear;
|
||||
document.getElementById("todate").value = topreyear;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function process_list(){ // 접수일 출고일 라디오버튼 클릭시
|
||||
document.getElementById('search').value=null;
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
if($mode==""&&$fromdate==null)
|
||||
{
|
||||
echo ("<script language=javascript> this_year();</script>"); // 당해년도 화면에 초기세팅하기
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
<script>
|
||||
var options = new Array();
|
||||
options[1] = 'EGI1.6T';
|
||||
options[2] = 'EGI1.2T';
|
||||
options[3] = 'EGI0.8T';
|
||||
options[4] = 'H/L1.5T';
|
||||
options[5] = 'H/L1.2T';
|
||||
options[6] = 'GI0.45T';
|
||||
options[7] = 'GI0.8T';
|
||||
options[8] = 'Mirror 1.5';
|
||||
options[9] = 'Mirror 1.2';
|
||||
|
||||
var total_sum = new Array();
|
||||
total_sum[1] = '<?php echo $total_arr_sum[1] ;?>';
|
||||
total_sum[2] = '<?php echo $total_arr_sum[2] ;?>';
|
||||
total_sum[3] = '<?php echo $total_arr_sum[3] ;?>';
|
||||
total_sum[4] = '<?php echo $total_arr_sum[4] ;?>';
|
||||
total_sum[5] = '<?php echo $total_arr_sum[5] ;?>';
|
||||
total_sum[6] = '<?php echo $total_arr_sum[6] ;?>';
|
||||
total_sum[7] = '<?php echo $total_arr_sum[7] ;?>';
|
||||
var tmp="";
|
||||
|
||||
for(var i=1;i<=7;i++)
|
||||
{
|
||||
if(Number(total_sum[i])==0)
|
||||
{
|
||||
total_sum[i]="";
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp=tmp + options[i] +": " + total_sum[i] + "(㎡), ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#top_board_all").text(tmp);
|
||||
</script>
|
||||
</html>
|
||||
72
analysis/load.php
Normal file
72
analysis/load.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php session_start(); ?>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<script src="/analysis/make.js"></script>
|
||||
<?php
|
||||
|
||||
$num=$_REQUEST["num"]; // 번호만 불러오자
|
||||
$sort=$_REQUEST["sort"]; //
|
||||
$recallcal=$_REQUEST["recallcal"]; //
|
||||
$parentnum=$_REQUEST["parentnum"]; // 리스트번호
|
||||
$ordercompany=$_REQUEST["ordercompany"]; // 발주처
|
||||
$datanum=$_REQUEST["datanum"]; //절곡데이터 번호 기억
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
$sql="select * from chandj.bending_write where num='$num'"; // 처음 오름차순
|
||||
|
||||
try{
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
$num=$row["num"];
|
||||
|
||||
$parentnum=$row["parentnum"]; // 리스트번호
|
||||
$upnum=$row["upnum"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
$copied_file_name=$row["copied_file_name"];
|
||||
$uploaded_file=$row["uploaded_file"];
|
||||
|
||||
$outputnum=$row["outputnum"];
|
||||
$length1=$row["length1"];
|
||||
$length2=$row["length2"];
|
||||
$length3=$row["length3"];
|
||||
$length4=$row["length4"];
|
||||
$length5=$row["length5"];
|
||||
$amount1=$row["amount1"];
|
||||
$amount2=$row["amount2"];
|
||||
$amount3=$row["amount3"];
|
||||
$amount4=$row["amount4"];
|
||||
$amount5=$row["amount5"];
|
||||
$material1=$row["material1"];
|
||||
$material2=$row["material2"];
|
||||
$material3=$row["material3"];
|
||||
$material4=$row["material4"];
|
||||
$material5=$row["material5"];
|
||||
$material6=$row["material6"];
|
||||
$material7=$row["material7"];
|
||||
$material8=$row["material8"];
|
||||
$sum1=$row["sum1"];
|
||||
$sum2=$row["sum2"];
|
||||
$sum3=$row["sum3"];
|
||||
$sum4=$row["sum4"];
|
||||
$sum5=$row["sum5"];
|
||||
$sum6=$row["sum6"];
|
||||
$sum7=$row["sum7"];
|
||||
$sum8=$row["sum8"];
|
||||
$total_text=$row["total_text"];
|
||||
$datanum=$row["datanum"];
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
$tmp = "Location:/analysis/write.php?upnum=$upnum&num=$num&outputnum=$outputnum&ordercompany=$ordercompany&parentnum=$parentnum&modify=update";
|
||||
$tmp .="&steeltype=$steeltype&steel_alias=$steel_alias&copied_file_name=$copied_file_name&uploaded_file=$uploaded_file&length1=$length1&length2=$length2&length3=$length3&length4=$length4&length5=$length5";
|
||||
$tmp .="&amount1=$amount1&amount2=$amount2&amount3=$amount3&amount4=$amount4&amount5=$amount5";
|
||||
$tmp .="&material1=$material1&material2=$material2&material3=$material3&material4=$material4&material5=$material5&material6=$material6&material7=$material7&material8=$material8";
|
||||
$tmp .="&sum1=$sum1&sum2=$sum2&sum3=$sum3&sum4=$sum4&sum5=$sum5&sum6=$sum6&sum7=$sum7&sum8=$sum8&total_text=$total_text&datanum=$datanum";
|
||||
|
||||
header($tmp); //
|
||||
?>
|
||||
602
analysis/make.js
Normal file
602
analysis/make.js
Normal file
@@ -0,0 +1,602 @@
|
||||
|
||||
// 브라우저 호환(크로스브라우징)을 체크한후 페이지 로딩후 selectEvent() 함수를 실행 합니다. 셔터박스/린텔선택 창
|
||||
if ( window.addEventListener ) {
|
||||
window.addEventListener("load",selectEvent2,false);
|
||||
} else if ( window.attachEvent ) {
|
||||
window.attachEvent("onload",selectEvent2);
|
||||
} else {
|
||||
window.onload = selectEvent2;
|
||||
}
|
||||
function selectEvent2() {
|
||||
// 폼이름,셀렉트박스이름 으로 셀렉트박스에 접근합니다.
|
||||
// onchange 이벤트를 적용해줍니다.
|
||||
document.selectForm2.ceilingbar.onchange = selectFun2;
|
||||
|
||||
}
|
||||
// this.value 로 이벤트가 발생한 곳,자신(this)의 value값을 출력 합니다.
|
||||
function selectFun2() {
|
||||
if ( this.value == '마감선택' ) {
|
||||
$("#block1").hide();
|
||||
$("#guiderail_area").hide();
|
||||
$("#block4").hide();
|
||||
return false;
|
||||
}
|
||||
if ( this.value == '셔터박스' ) {
|
||||
show_box();
|
||||
$("#block4").hide();
|
||||
}
|
||||
if ( this.value == '린텔' ) {
|
||||
$("#block4").show();
|
||||
show_lintel();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function reload_box() {
|
||||
|
||||
var tmp = $("#item_sel option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var tmp2 = $("#ceilingbar option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
|
||||
if ( tmp2 == '마감선택' ) {
|
||||
$("#block1").hide();
|
||||
$("#guiderail_area").hide();
|
||||
$("#block4").hide();
|
||||
return false;
|
||||
}
|
||||
if ( tmp2 == '셔터박스' ) {
|
||||
show_box();
|
||||
$("#block4").hide();
|
||||
}
|
||||
if ( tmp2 == '린텔' ) {
|
||||
$("#block4").show();
|
||||
show_lintel();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
var imgs;
|
||||
var img_count;
|
||||
var img_position = 1;
|
||||
|
||||
|
||||
/* $("#order_title3").hide(); // 처음실행했을때 비상문 문자 없앰
|
||||
$("#order_input3").hide(); // 처음실행했을때 비상문 입력창 */
|
||||
imgs = $(".slide ul");
|
||||
img_count = imgs.children().length;
|
||||
FSSrail();
|
||||
$("#block5").show();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
// 검색 버튼
|
||||
$("#searchitem").on("click", function() {
|
||||
exe_search();
|
||||
});
|
||||
|
||||
// 자재 출고 전화번호 검색 버튼
|
||||
$("#searchtel").on("click", function() {
|
||||
exe_searchTel();
|
||||
});
|
||||
|
||||
$("#gunbbang").on("click", function() {
|
||||
$("#material_list").hide();
|
||||
$("#guiderail_area").hide();
|
||||
$("#detail").load("./gunbbang.php");
|
||||
});
|
||||
$("#screenexitmake").on("click", function() {
|
||||
$("#material_list").hide();
|
||||
$("#guiderail_area").hide();
|
||||
$("#detail").load("./screenexitmake.php");
|
||||
});
|
||||
$("#egimake").on("click", function() { // 철재방화 사이즈 산출 클릭시
|
||||
$("#material_list").hide();
|
||||
$("#guiderail_area").hide();
|
||||
$("#detail").load("./egimake.php");
|
||||
});
|
||||
$("#makeguiderail").on("click", function() { // 가이드레일 제작 메뉴얼 클릭시
|
||||
$("#material_list").hide();
|
||||
$("#guiderail_area").hide();
|
||||
$("#detail").load("./makeguiderail.php");
|
||||
});
|
||||
|
||||
$("#menu1").on("click", function() { // 공사진행현황
|
||||
$("*").load("./work/list.php");
|
||||
});
|
||||
$("#menus1").on("click", function() { // 공사진행현황
|
||||
$("*").load("../work/list.php");
|
||||
});
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////// 자재산출 클릭시
|
||||
$("#show_list").on("click", function() { // 자재산출 클릭시
|
||||
show_one(); // 자재산출 클릭
|
||||
});
|
||||
|
||||
function show_one() {
|
||||
hide_object();
|
||||
$("#material_list").show();
|
||||
var target = document.getElementById("item_sel");
|
||||
var sendData = target.options[target.selectedIndex].value ;
|
||||
|
||||
var ua = window.navigator.userAgent;
|
||||
var postData;
|
||||
|
||||
|
||||
var text2= document.getElementById("stwidth").value;
|
||||
var text3= document.getElementById("stheight").value;
|
||||
var text4= document.getElementById("motormaker").value;
|
||||
var ceilingbar= document.getElementById("ceilingbar").value;
|
||||
|
||||
if (ua.indexOf('MSIE') > 0 || ua.indexOf('Trident') > 0) {
|
||||
postData = encodeURI(sendData);
|
||||
ceilingbar=encodeURI(ceilingbar);
|
||||
text4=encodeURI(text4);
|
||||
} else {
|
||||
postData = sendData;
|
||||
}
|
||||
|
||||
var text1 = postData;
|
||||
text2=uncomma(text2); // 콤마가 있어서 숫자 변환이 안된다.
|
||||
text3=uncomma(text3); // 콤마가 있어서 숫자 변환이 안된다.
|
||||
|
||||
document.getElementById("railheight").value = Number(text3) + 150;
|
||||
document.getElementById("railheight").value = comma(document.getElementById("railheight").value);
|
||||
|
||||
$("#material_list").load("./show_list.php?text1="+text1 +"&text2="+text2+"&text3="+text3+"&text4="+text4+"&ceilingbar="+ceilingbar);
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////// 스크린 기본 클릭
|
||||
$("#show_basic_screen").on("click", function() {
|
||||
|
||||
$("#item_sel").val("스크린방화").prop("selected", true); // 선택사항 변경
|
||||
$("#motormaker").val("경동").prop("selected", true); // 선택사항 변경
|
||||
$("#power").val("220V").prop("selected", true); // 선택사항 변경
|
||||
$("#guiderailmaterial").val("SUS H/L 1.5T").prop("selected", true); // 선택사항 변경
|
||||
|
||||
$("#wa6").show(); // 가이드레일 이미지
|
||||
|
||||
$("#wa6").html("<img src='../img/guiderail/fss/rail1.jpg' class='maxsmall'>");
|
||||
$("#wa7").show(); // 양쪽레일 이미지
|
||||
|
||||
$("#ceilingbar").val("셔터박스").prop("selected", true); // 선택사항 변경
|
||||
$("#ceilingmaterial").val("전면EGI1.6T+1.2T").prop("selected", true); // 천장마감재질 변경
|
||||
$("#lin5").html("<img src='../img/box/fss/box1.jpg' class='maxsmall'>");
|
||||
$("#wr5").html("<img src='../img/Rmolding/Rmolding1.jpg' class='maxsmall2'>");
|
||||
$("#wr10").html("<img src='../img/Rcase/Rcase1.jpg' class='maxsmall3'>");
|
||||
$("#block5").show(); // 엘바
|
||||
$("#block6").show(); // T바
|
||||
$("#we5").html("<img src='../img/Lbar/Lbar1.jpg' class='maxsmall1'>");
|
||||
$("#we10").html("<img src='../img/Tbar/fssTbar1.jpg' class='maxsmall1'>");
|
||||
$("#Tbar").val("SUS H/L 1.2T").prop("selected", true); // T바 재질
|
||||
$("#Lbar").val("EGI 1.6T").prop("selected", true); // L바 재질
|
||||
|
||||
show_one(); // 자재산출 클릭
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////// 철재방화 기본 세팅 클릭
|
||||
$("#show_basic_egi").on("click", function() {
|
||||
|
||||
$("#item_sel").val("철재방화EGI1.6T").prop("selected", true); // 셔터형태 선택사항 변경
|
||||
$("#motormaker").val("경동").prop("selected", true); // 선택사항 변경
|
||||
$("#power").val("220V").prop("selected", true); // 선택사항 변경
|
||||
$("#guiderailmaterial").val("SUS H/L 1.5T").prop("selected", true); // 선택사항 변경
|
||||
|
||||
$("#wa6").show(); // 가이드레일 이미지
|
||||
|
||||
$("#wa6").html("<img src='../img/guiderail/fst/rail1.jpg' class='maxsmall'>"); // 레일 이미지 불러오기
|
||||
$("#wa7").show(); // 양쪽레일 선택박스
|
||||
|
||||
$("#ceilingbar").val("셔터박스").prop("selected", true); // 선택사항 변경
|
||||
$("#ceilingmaterial").val("전면EGI1.6T+1.2T").prop("selected", true); // 천장마감재질 변경
|
||||
$("#lin5").html("<img src='../img/box/fst/box1.jpg' class='maxsmall'>");
|
||||
// $("#wr5").html("<img src='../img/Rmolding/Rmolding1.jpg' class='maxsmall2'>");
|
||||
// $("#wr10").html("<img src='../img/Rcase/Rcase1.jpg' class='maxsmall3'>");
|
||||
// $("#block5").show(); // 엘바
|
||||
$("#block6").show(); // T바
|
||||
// $("#we5").html("<img src='../img/Lbar/Lbar1.jpg' class='maxsmall1'>");
|
||||
$("#we10").html("<img src='../img/Tbar/fstTbar1.jpg' class='maxsmall1'>"); // T바 이미지
|
||||
$("#Tbar").val("SUS H/L 1.2T").prop("selected", true); // T바 재질
|
||||
// $("#Lbar").val("EGI 1.6T").prop("selected", true); // L바 재질
|
||||
|
||||
$("#block5").hide(); // L바 숨기기
|
||||
show_one(); // 자재산출 클릭
|
||||
});
|
||||
|
||||
|
||||
$("#setenvbutton").on("click", function() {
|
||||
hide_object();
|
||||
$("#material_list").show();
|
||||
$("#material_list").load("./setenv.php");
|
||||
});
|
||||
$("#viewkdmotor").on("click", function() {
|
||||
window.open("../img/kdmotor.png",'경동모터 제원표',width=880,height=500);
|
||||
return false;
|
||||
});
|
||||
$("#viewcontroler").on("click", function() {
|
||||
window.open("../img/kdcontroler.jpg",'연동제어기 치수',width=880,height=500);
|
||||
return false;
|
||||
});
|
||||
$("#viewworkerlist").on("click", function() {
|
||||
|
||||
window.open("../list/workerlist.xlsx");
|
||||
return false;
|
||||
});
|
||||
$("#gotorail").on("click", function() {
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var target = document.getElementById("item_sel");
|
||||
// alert(target.options[target.selectedIndex].value);
|
||||
var sendData = target.options[target.selectedIndex].value ;
|
||||
var ua = window.navigator.userAgent;
|
||||
var postData;
|
||||
sendData = "./rail.php?rail=" + sendData +"&sel=1"; // 첫번째 레일선택
|
||||
|
||||
// 윈도우라면 ?
|
||||
if (ua.indexOf('MSIE') > 0 || ua.indexOf('Trident') > 0) {
|
||||
postData = encodeURI(sendData);
|
||||
} else {
|
||||
postData = sendData;
|
||||
}
|
||||
$("#guiderail_area").load(postData);
|
||||
});
|
||||
$("#gotorailanother").on("click", function() {
|
||||
show_rail();
|
||||
});
|
||||
$("#gotoRmolding").on("click", function() { // GotoRmolding 버튼 클릭시
|
||||
show_Rmolding();
|
||||
});
|
||||
$("#gotoRcase").on("click", function() { // GotoRcase 버튼 클릭시
|
||||
show_Rcase();
|
||||
});
|
||||
$("#gotoLbar").on("click", function() { // GotoLbar 버튼 클릭시
|
||||
show_Lbar();
|
||||
});
|
||||
$("#gotoTbar").on("click", function() { // GotoTbar 버튼 클릭시
|
||||
show_Tbar();
|
||||
});
|
||||
});
|
||||
|
||||
/* function openExcelFile(strFilePath) {
|
||||
if (window.ActiveXObject) {
|
||||
try {
|
||||
var objExcel;
|
||||
objExcel = new ActiveXObject("Excel.Application");
|
||||
objExcel.Visible = true;
|
||||
objExcel.Workbooks.Open(strLocation, false, [readonly: true|false]);
|
||||
}
|
||||
catch (e) {
|
||||
alert (e.message);
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert ("Your browser does not support this.");
|
||||
}
|
||||
} */
|
||||
|
||||
function show_Lbar() { // L바 버튼
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var tmp = $("#item_sel option:selected").val(); // 서터종류 선택값
|
||||
var tmp2 = $("#ceilingbar option:selected").val(); // 천장마감 선택값
|
||||
var sendData;
|
||||
sendData = "./Lbar.php"; // L바
|
||||
$("#guiderail_area").load(sendData);
|
||||
}
|
||||
|
||||
function show_Tbar() { // T바 버튼
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var target = document.getElementById("item_sel");
|
||||
// alert(target.options[target.selectedIndex].value);
|
||||
var sendData = target.options[target.selectedIndex].value ;
|
||||
var ua = window.navigator.userAgent;
|
||||
var postData;
|
||||
sendData = "./Tbar.php?rail=" + sendData ; // 셔터 종류 전달
|
||||
|
||||
// 윈도우라면 ?
|
||||
if (ua.indexOf('MSIE') > 0 || ua.indexOf('Trident') > 0) {
|
||||
postData = encodeURI(sendData);
|
||||
} else {
|
||||
postData = sendData;
|
||||
}
|
||||
$("#guiderail_area").load(sendData);
|
||||
}
|
||||
|
||||
function show_rail() {
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var target = document.getElementById("item_sel");
|
||||
// alert(target.options[target.selectedIndex].value);
|
||||
var sendData = target.options[target.selectedIndex].value ;
|
||||
var ua = window.navigator.userAgent;
|
||||
var postData;
|
||||
sendData = "./rail.php?rail=" + sendData +"&sel=2"; // 두번째 레일선택
|
||||
|
||||
// 윈도우라면 ?
|
||||
if (ua.indexOf('MSIE') > 0 || ua.indexOf('Trident') > 0) {
|
||||
postData = encodeURI(sendData);
|
||||
} else {
|
||||
postData = sendData;
|
||||
}
|
||||
|
||||
$("#guiderail_area").load(postData);
|
||||
}
|
||||
|
||||
function show_lintel() {
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
|
||||
var sendData;
|
||||
sendData = "./lintel.php"; // 린텔선택
|
||||
$("#guiderail_area").load(sendData);
|
||||
}
|
||||
function show_box() { // 셔터박스 선택하면 실행
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var tmp = $("#item_sel option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var tmp2 = $("#ceilingbar option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var sendData;
|
||||
|
||||
if(tmp=='스크린방화' || tmp=='제연커튼')
|
||||
|
||||
sendData = "./box.php"; // 스크린용 셔터박스
|
||||
else
|
||||
sendData = "./stbox.php"; // 철재용 셔터박스
|
||||
|
||||
$("#guiderail_area").load(sendData);
|
||||
}
|
||||
function show_Rmolding() { // R몰딩 선택하면 실행
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var tmp = $("#item_sel option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var tmp2 = $("#ceilingbar option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var sendData;
|
||||
sendData = "./Rmolding.php"; // 몰딩이미지
|
||||
$("#guiderail_area").load(sendData);
|
||||
}
|
||||
|
||||
function show_Rcase() { // R케이스 버튼
|
||||
hide_object();
|
||||
$("#guiderail_area").show();
|
||||
var tmp = $("#item_sel option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var tmp2 = $("#ceilingbar option:selected").val(); //jQuery로 선택된 값 읽기
|
||||
var sendData;
|
||||
sendData = "./Rcase.php"; // R케이스
|
||||
$("#guiderail_area").load(sendData);
|
||||
}
|
||||
|
||||
// 브라우저 호환(크로스브라우징)을 체크한후 페이지 로딩후 selectEvent() 함수를 실행 합니다. // 셔터 종류 선택시
|
||||
if ( window.addEventListener ) {
|
||||
window.addEventListener("load",selectEvent,false);
|
||||
} else if ( window.attachEvent ) {
|
||||
window.attachEvent("onload",selectEvent);
|
||||
} else {
|
||||
window.onload = selectEvent;
|
||||
}
|
||||
function selectEvent() {
|
||||
// 폼이름,셀렉트박스이름 으로 셀렉트박스에 접근합니다.
|
||||
// onchange 이벤트를 적용해줍니다.
|
||||
document.selectForm.item_sel.onchange = selectFun;
|
||||
|
||||
}
|
||||
// this.value 로 이벤트가 발생한 곳,자신(this)의 value값을 출력 합니다.
|
||||
function selectFun() {
|
||||
$("#order_title3").hide();
|
||||
$("#order_input3").hide();
|
||||
$("#block2").hide(); // 삼각쫄대 감추기
|
||||
$("#block3").hide(); // 짜부가스켓 감추기
|
||||
$("#block5").hide(); // 엘바
|
||||
$("#block6").hide(); // T바
|
||||
// $("#block4").hide(); // R몰딩 R케이스 화면
|
||||
if ( this.value == '셔터종류선택' ) {
|
||||
return false;
|
||||
}
|
||||
if ( this.value == '스크린방화' ) {
|
||||
FSSrail();
|
||||
}
|
||||
if ( this.value == '철재방화EGI1.6T' ) {
|
||||
FSTrail();
|
||||
}
|
||||
if ( this.value != '철재방화EGI1.6T' && this.value != '스크린방화' && this.value != '셔터종류선택') { // 방화셔터가 아닐때
|
||||
$("#block6").show(); // T바 보여주기
|
||||
}
|
||||
}
|
||||
function FSSrail() {
|
||||
$("#order_title3").show();
|
||||
$("#order_input3").show();
|
||||
$("#block2").show(); // 삼각쫄대 보이기
|
||||
$("#block3").show(); // 짜부가스켓 보이기
|
||||
$("#block5").show(); // 엘바
|
||||
$("#block6").show(); // T바
|
||||
}
|
||||
function FSTrail() {
|
||||
$("#order_title3").show();
|
||||
$("#order_input3").show();
|
||||
$("#block3").show(); // 짜부가스켓 보이기
|
||||
$("#block6").show(); // T바
|
||||
}
|
||||
|
||||
function hide_object() {
|
||||
// $("#material_list").hide();
|
||||
$("#guiderail_area").hide();
|
||||
}
|
||||
|
||||
function transData(sendData) {
|
||||
var ua = window.navigator.userAgent;
|
||||
var postData;
|
||||
|
||||
if (ua.indexOf('MSIE') > 0 || ua.indexOf('Trident') > 0) {
|
||||
postData = encodeURI(sendData);
|
||||
} else {
|
||||
postData = sendData;
|
||||
}
|
||||
return postData;
|
||||
}
|
||||
|
||||
|
||||
function inputNumberFormat(obj) {
|
||||
obj.value = comma(uncomma(obj.value));
|
||||
}
|
||||
function comma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
function uncomma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/[^\d]+/g, '');
|
||||
}
|
||||
|
||||
|
||||
|
||||
function previewImage(targetObj, previewId) {
|
||||
var preview = document.getElementById(previewId); //div id
|
||||
var ua = window.navigator.userAgent;
|
||||
if (ua.indexOf("MSIE") > -1) {//ie일때
|
||||
targetObj.select();
|
||||
try {
|
||||
var src = document.selection.createRange().text; // get file full path
|
||||
var ie_preview_error = document
|
||||
.getElementById("ie_preview_error_" + previewId);
|
||||
if (ie_preview_error) {
|
||||
preview.removeChild(ie_preview_error); //error가 있으면 delete
|
||||
}
|
||||
|
||||
var img = document.getElementById(previewId); //이미지가 뿌려질 곳
|
||||
|
||||
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
|
||||
+ src + "', sizingMethod='scale')"; //이미지 로딩, sizingMethod는 div에 맞춰서 사이즈를 자동조절 하는 역할
|
||||
} catch (e) {
|
||||
if (!document.getElementById("ie_preview_error_" + previewId)) {
|
||||
var info = document.createElement("<p>");
|
||||
info.id = "ie_preview_error_" + previewId;
|
||||
info.innerHTML = "a";
|
||||
preview.insertBefore(info, null);
|
||||
}
|
||||
}
|
||||
} else { //ie가 아닐때
|
||||
var files = targetObj.files;
|
||||
for ( var i = 0; i < files.length; i++) {
|
||||
var file = files[i];
|
||||
var imageType = /image.*/; //이미지 파일일경우만.. 뿌려준다.
|
||||
if (!file.type.match(imageType))
|
||||
continue;
|
||||
var prevImg = document.getElementById("prev_" + previewId); //이전에 미리보기가 있다면 삭제
|
||||
if (prevImg) {
|
||||
preview.removeChild(prevImg);
|
||||
}
|
||||
var img = document.createElement("img"); //크롬은 div에 이미지가 뿌려지지 않는다. 그래서 자식Element를 만든다.
|
||||
|
||||
img.id = "prev_" + previewId;
|
||||
|
||||
img.classList.add("obj");
|
||||
|
||||
img.file = file;
|
||||
|
||||
img.style.width = '50px'; //기본설정된 div의 안에 뿌려지는 효과를 주기 위해서 div크기와 같은 크기를 지정해준다.
|
||||
|
||||
img.style.height = '50px';
|
||||
|
||||
preview.appendChild(img);
|
||||
if (window.FileReader) { // FireFox, Chrome, Opera 확인.
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = (function(aImg) {
|
||||
return function(e) {
|
||||
aImg.src = e.target.result;
|
||||
};
|
||||
})(img);
|
||||
reader.readAsDataURL(file);
|
||||
} else { // safari is not supported FileReader
|
||||
//alert('not supported FileReader');
|
||||
if (!document.getElementById("sfr_preview_error_"
|
||||
+ previewId)) {
|
||||
var info = document.createElement("p");
|
||||
info.id = "sfr_preview_error_" + previewId;
|
||||
info.innerHTML = "not supported FileReader";
|
||||
preview.insertBefore(info, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function drawbracket() {
|
||||
|
||||
var brX = Number($("#brX").val());
|
||||
var brY = Number($("#brY").val());
|
||||
var spaceX = 200; // 초기 x좌표 좌측 띄움
|
||||
var spaceY = 100; // 초기 y좌표 좌측 띄움
|
||||
var boxspaceX = 100;
|
||||
var boxspaceY = 150;
|
||||
var axis = brY/2 ; // Arc radius
|
||||
|
||||
var radius = brY/2/2 ; // Arc radius
|
||||
var startAngle = 0; // Starting point on circle
|
||||
var endAngle = Math.PI + (Math.PI * 2) / 2; // End point on circle
|
||||
var anticlockwise = true; // clockwise or anticlockwise
|
||||
// var anticlockwise = i % 2 == 0 ? false : true; // clockwise or anticlockwise
|
||||
|
||||
|
||||
var boxwidth = brX+boxspaceX; // sutter box width
|
||||
var boxheight = brY+boxspaceY; // sutter box height
|
||||
|
||||
// bracket 형상 그림
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = "blue";
|
||||
ctx.moveTo(spaceX,spaceY);
|
||||
ctx.lineTo(spaceX+brX,spaceY);
|
||||
ctx.lineTo(spaceX+brX,spaceY+brY);
|
||||
ctx.lineTo(spaceX,spaceY+brY);
|
||||
ctx.lineTo(spaceX,spaceY);
|
||||
ctx.stroke();
|
||||
|
||||
// bracket 텍스트 넣기
|
||||
ctx.font = 'italic 22px Calibri';
|
||||
ctx.fillText(brX + 'X'+brY +" Bracket",spaceX+brX*3/5,spaceY+brY/2);
|
||||
|
||||
// 샤프트 그리기
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = "red";
|
||||
ctx.arc(spaceX+axis,spaceY+axis, radius, startAngle, endAngle, anticlockwise);
|
||||
ctx.stroke();
|
||||
|
||||
//셔터박스 그리기
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.moveTo(spaceX-boxspaceX*0.35,spaceY);
|
||||
ctx.lineTo(spaceX+boxwidth,spaceY);
|
||||
ctx.lineTo(spaceX+boxwidth,spaceY+boxheight);
|
||||
ctx.lineTo(spaceX-boxspaceX*0.35,spaceY+boxheight);
|
||||
ctx.lineTo(spaceX-boxspaceX*0.35,spaceY);
|
||||
ctx.stroke();
|
||||
|
||||
}
|
||||
//enter키로 form submit 막기
|
||||
$('input[type="text"]').keydown(function() {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
function changeUri(tmpdata)
|
||||
{
|
||||
var ua = window.navigator.userAgent;
|
||||
var postData;
|
||||
|
||||
if (ua.indexOf('MSIE') > 0 || ua.indexOf('Trident') > 0) {
|
||||
postData = encodeURI(tmpdata);
|
||||
} else {
|
||||
postData = tmpdata;
|
||||
}
|
||||
|
||||
return postData;
|
||||
}
|
||||
200
analysis/print.php
Normal file
200
analysis/print.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<!doctype html>
|
||||
<?php
|
||||
session_start();
|
||||
$img_name="/img/screenorder.jpg";
|
||||
|
||||
$num=$_REQUEST["num"];
|
||||
$upnum=$_REQUEST["upnum"];
|
||||
$sort=$_REQUEST["sort"]; //정렬 1번 내림차순, 2번 오름차순
|
||||
$find=$_REQUEST["find"]; // 검색항목
|
||||
$page=$_REQUEST["page"]; //페이지번호
|
||||
$process=$_REQUEST["process"]; // 진행현황
|
||||
$asprocess=$_REQUEST["asprocess"]; // as진행현황
|
||||
$m2=$_REQUEST["m2"]; // m2 면적
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
try{
|
||||
$sql = "select * from chandj.orderlist where num=?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $num, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$outdate=$row["outdate"];
|
||||
$indate=$row["indate"];
|
||||
$orderman=$row["orderman"];
|
||||
$outworkplace=$row["outworkplace"];
|
||||
$outputplace=$row["outputplace"];
|
||||
$receiver=$row["receiver"];
|
||||
$phone=$row["phone"];
|
||||
$comment=$row["comment"];
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
$pagenum=1;
|
||||
// 발주서 레코드 수량 파악해서 8개 이상이면 2페이지 이상 출력토록 만드는 서브루틴
|
||||
if($sort=='1')
|
||||
$sql="select * from chandj.make where upnum='$upnum' order by num asc"; // 처음 오름차순
|
||||
else
|
||||
$sql="select * from chandj.make where upnum='$upnum' order by num desc"; // 처음 내림차순
|
||||
|
||||
|
||||
try{
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_count=$stmh->rowCount();
|
||||
// print "<script> alert($total_count) </script>";
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 배열선언
|
||||
$text1=[];
|
||||
$text2=[];
|
||||
$memo=[];
|
||||
$draw=[];
|
||||
$drawbottom1=[];
|
||||
$drawbottom2=[];
|
||||
|
||||
if($sort=='1')
|
||||
$sql="select * from chandj.make where upnum='$upnum' order by num asc"; // 처음 오름차순
|
||||
else
|
||||
$sql="select * from chandj.make where upnum='$upnum' order by num desc"; // 처음 내림차순
|
||||
|
||||
try{
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$counter=0;
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$upnum=$row["upnum"];
|
||||
if((int)$upnum==(int)$num)
|
||||
{
|
||||
|
||||
$text1[$counter]=$row["text1"];
|
||||
$text2[$counter]=$row["text2"];
|
||||
|
||||
$memo[$counter]=$row["memo"];
|
||||
$draw[$counter]=$row["draw"];
|
||||
$drawbottom1[$counter]=$row["drawbottom1"];
|
||||
$drawbottom2[$counter]=$row["drawbottom2"];
|
||||
$start_num--;
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
$recnum=8; //레코드수가 8개 넘으면 다음페이지로 출력
|
||||
$limit=ceil($total_count/$recnum);
|
||||
// print "<script> alert($limit) </script>";
|
||||
?>
|
||||
|
||||
|
||||
<html lang="ko">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" media="print" href="../css/print2.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/screenlist.css">
|
||||
<!-- <link rel="stylesheet" type="text/css" href="../css/orderprint.css"> 발주서 인쇄에 맞게 수정하기 위한 css -->
|
||||
<title>발주서 출력</title>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<?php
|
||||
for($j=0;$j<$limit;$j++)
|
||||
{
|
||||
$pagenum=$j+1; // 페이지번호 산출
|
||||
?>
|
||||
<div id="print">
|
||||
<div id="outlineprint">
|
||||
<div class="img">
|
||||
<div id="row1"> 페이지번호 : <?=$pagenum?> / <?=$limit?> </div> <!-- end of row1 -->
|
||||
<div class="clear"> </div>
|
||||
<div id="row2">
|
||||
<div id="col1"> <?=$outdate?>
|
||||
|
||||
</div> <!-- end of row2 col1-->
|
||||
<div id="col2"> <?=$indate?> (면적 : <?=$m2?>㎡)
|
||||
|
||||
</div> <!-- end of row2 col2-->
|
||||
</div> <!-- end of row2 -->
|
||||
<div class="clear"> </div>
|
||||
<div id="row3">
|
||||
<div id="col1"> <?=$receiver?>
|
||||
|
||||
</div> <!-- end of row3 col1-->
|
||||
<div id="col2"> <?=$outworkplace?>
|
||||
|
||||
</div> <!-- end of row3 col2-->
|
||||
</div> <!-- end of row3 -->
|
||||
<div class="clear"> </div>
|
||||
<div id="row4">
|
||||
<div id="col1"> <?=$phone?>
|
||||
|
||||
</div> <!-- end of row4 col1-->
|
||||
<div id="col2"> <?=$outputplace?>
|
||||
|
||||
</div> <!-- end of row4 col2-->
|
||||
</div> <!-- end of row4 -->
|
||||
<div id="row5"> " <?=$comment?> "
|
||||
</div> <!-- end of row5 -->
|
||||
|
||||
<div id="containers" >
|
||||
<div id="display_result" >
|
||||
<div id="ares1"> 번호 </div>
|
||||
<div id="ares2"> 부호 </div>
|
||||
<div id="ares3"> 스크린제작 치수 너비(W) x 높이(H) , 수량(EA) </div>
|
||||
<div class="clear"> </div>
|
||||
|
||||
<?php
|
||||
$repeat=$total_count-$j*$recnum;
|
||||
if($repeat>=8)
|
||||
$repeat=8;
|
||||
for($i=$j*$recnum;$i<=$j*$recnum+$repeat-1;$i++)
|
||||
{
|
||||
?>
|
||||
<div id="res1"> <?=$i+1?> </div>
|
||||
<div id="res2"> <?=$text1[$i]?> </div>
|
||||
<div id="firstoutline">
|
||||
<div id="fres1"> <?=$text2[$i]?> </div>
|
||||
<div id="fres2"> <?=$memo[$i]?> </div>
|
||||
</div>
|
||||
<div id="outline">
|
||||
<div id="res4"> <?=$draw[$i]?> </div>
|
||||
<div class="clear"> </div>
|
||||
<div id="res5"> <?=$drawbottom1[$i]?> </div>
|
||||
<div id="res7"> <?=$drawbottom3[$i]?> </div>
|
||||
<div id="res6"> <?=$drawbottom2[$i]?> </div>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div> <!-- end of display_result -->
|
||||
</div> <!-- end of containers -->
|
||||
|
||||
</div>
|
||||
</div> <!-- end of outline -->
|
||||
</div> <!-- end of print -->
|
||||
<?php
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
173
analysis/print_list.php
Normal file
173
analysis/print_list.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
// 기간을 정하는 구간
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
if($fromdate=="")
|
||||
{
|
||||
$fromdate=substr(date("Y-m-d",time()),0,4) ;
|
||||
$fromdate=$fromdate . "-01-01";
|
||||
}
|
||||
if($todate=="")
|
||||
{
|
||||
$todate=substr(date("Y-m-d",time()),0,4) . "-12-31" ;
|
||||
$Transtodate=strtotime($todate.'+1 days');
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
else
|
||||
{
|
||||
$Transtodate=strtotime($todate);
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
|
||||
$common=" where outdate between date('$fromdate') and date('$Transtodate') order by outdate ";
|
||||
$find1="경동";
|
||||
$find2="대신";
|
||||
$con1 =" where (delivery like '%$find1%') and (outdate between date('$fromdate') and date('$Transtodate')) order by outdate ";
|
||||
$con2 =" where (delivery like '%$find2%') and (outdate between date('$fromdate') and date('$Transtodate')) order by outdate ";
|
||||
$a= $con1 . "desc "; //경동화물/화물
|
||||
$b= $con2 . "desc "; //대신화물/화물
|
||||
|
||||
$ksql = "select * from chandj.output " . $a; //경동
|
||||
$dsql = "select * from chandj.output " . $b; //대신
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
?>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/output.css">
|
||||
<link rel="stylesheet" type="text/css" media="print" href="../css/print.css">
|
||||
|
||||
<title>화물 당일 출고 리스트</title>
|
||||
</head>
|
||||
<body onload="pagePrintPreview();" >
|
||||
|
||||
<div id="print">
|
||||
<div class="img">
|
||||
<div class="menu">
|
||||
<div class="print1"> <?=$Transtodate?> </div>
|
||||
<div class="clear"> </div>
|
||||
|
||||
<?php
|
||||
|
||||
try{
|
||||
$stmh = $pdo->query($ksql); // 경동화물 가는 것들
|
||||
$temp=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp; // 전체 글수
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$num=$row["num"];
|
||||
$outdate=$row["outdate"];
|
||||
$indate=$row["indate"];
|
||||
$orderman=$row["orderman"];
|
||||
$outworkplace=$row["outworkplace"];
|
||||
$outputplace=$row["outputplace"];
|
||||
$receiver=$row["receiver"];
|
||||
$phone=$row["phone"];
|
||||
$comment=$row["comment"];
|
||||
$root=$row["root"];
|
||||
$steel=$row["steel"];
|
||||
$motor=$row["motor"];
|
||||
$delivery=$row["delivery"];
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="print1_1"> 경동 </div>
|
||||
<div class="print2"> <?=$receiver?> </div>
|
||||
<div class="print3"> <?=substr($comment,0,105)?> </div>
|
||||
<div class="print4"> <?=substr($outputplace,0,90)?> </div>
|
||||
<div class="print5"> <?=substr($phone,0,13)?> </div>
|
||||
<div class="print6"> <?=$delivery?> </div>
|
||||
|
||||
<div class="clear"> </div>
|
||||
<?php
|
||||
} // end of while
|
||||
} // end of try
|
||||
catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
<div class="print1_1"> </div> <!--중간에 공백한칸 만들기 -->
|
||||
<div class="print2"> </div>
|
||||
<div class="print3"> </div>
|
||||
<div class="print4"> </div>
|
||||
<div class="print5"> </div>
|
||||
<div class="print6"> </div>
|
||||
|
||||
<div class="clear"> </div>
|
||||
|
||||
<div class="print1_1"> </div> <!--중간에 공백한칸 만들기 -->
|
||||
<div class="print2"> </div>
|
||||
<div class="print3"> </div>
|
||||
<div class="print4"> </div>
|
||||
<div class="print5"> </div>
|
||||
<div class="print6"> </div>
|
||||
|
||||
<div class="clear"> </div>
|
||||
|
||||
<?php
|
||||
///////////////////////////////////////////// 대신화물 처리부분
|
||||
try{
|
||||
$stmh = $pdo->query($dsql);
|
||||
$temp=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$num=$row["num"];
|
||||
$outdate=$row["outdate"];
|
||||
$indate=$row["indate"];
|
||||
$orderman=$row["orderman"];
|
||||
$outworkplace=$row["outworkplace"];
|
||||
$outputplace=$row["outputplace"];
|
||||
$receiver=$row["receiver"];
|
||||
$phone=$row["phone"];
|
||||
$comment=$row["comment"];
|
||||
$root=$row["root"];
|
||||
$steel=$row["steel"];
|
||||
$motor=$row["motor"];
|
||||
$delivery=$row["delivery"];
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="print1_1"> 대신 </div>
|
||||
<div class="print2"> <?=$receiver?> </div>
|
||||
<div class="print3"> <?=substr($comment,0,105)?> </div>
|
||||
<div class="print4"> <?=substr($outputplace,0,90)?> </div>
|
||||
<div class="print5"> <?=substr($phone,0,13)?> </div>
|
||||
<div class="print6"> <?=$delivery?> </div>
|
||||
|
||||
<div class="clear"> </div>
|
||||
<?php
|
||||
} // end of while
|
||||
} // end of try
|
||||
catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- end of menu -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
78
analysis/process_DB.php
Normal file
78
analysis/process_DB.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
session_start();
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=8) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["page"]))
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1; // 1로 설정해야 함
|
||||
if(isset($_REQUEST["mode"])) //modify_form에서 호출할 경우
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
if(isset($_REQUEST["num"]))
|
||||
$num=$_REQUEST["num"];
|
||||
else
|
||||
$num="";
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
// code는 접수완료, 처리완료를 표시해 준다.
|
||||
$code=$_REQUEST["code"];
|
||||
|
||||
if($code=="1")
|
||||
$regist_state="2";
|
||||
else
|
||||
$regist_state="3";
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$sql = "select regist_state from chandj.output where num=?"; // get target record
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "update chandj.output set regist_state=? where num=? LIMIT 1";
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $regist_state, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $num, PDO::PARAM_STR); //고유키값이 같나?의 의미로 ?로 num으로 맞춰야 합니다. where 구문
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
header("Location:/output/view.php?num=$num&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date");
|
||||
?>
|
||||
257
analysis/savefile.php
Normal file
257
analysis/savefile.php
Normal file
@@ -0,0 +1,257 @@
|
||||
<!doctype html>
|
||||
|
||||
<?php
|
||||
session_start();
|
||||
$img_name="/img/screenorder.jpg";
|
||||
|
||||
$num=$_REQUEST["num"];
|
||||
$upnum=$_REQUEST["upnum"];
|
||||
$sort=$_REQUEST["sort"]; //정렬 1번 내림차순, 2번 오름차순
|
||||
$receiver=$_REQUEST["receiver"]; //수신처
|
||||
$find=$_REQUEST["find"]; // 검색항목
|
||||
$page=$_REQUEST["page"]; //페이지번호
|
||||
$m2=$_REQUEST["m2"]; // m2 면적
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
try{
|
||||
$sql = "select * from chandj.orderlist where num=?";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1, $num, PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$outdate=$row["outdate"];
|
||||
$indate=$row["indate"];
|
||||
$orderman=$row["orderman"];
|
||||
$outworkplace=$row["outworkplace"];
|
||||
$outputplace=$row["outputplace"];
|
||||
$receiver=$row["receiver"];
|
||||
$phone=$row["phone"];
|
||||
$comment=$row["comment"];
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
$pagenum=1;
|
||||
// 발주서 레코드 수량 파악해서 8개 이상이면 2페이지 이상 출력토록 만드는 서브루틴
|
||||
|
||||
if($sort=='1')
|
||||
$sql="select * from chandj.make where upnum='$upnum' order by num asc"; // 처음 오름차순
|
||||
else
|
||||
$sql="select * from chandj.make where upnum='$upnum' order by num desc"; // 처음 내림차순
|
||||
|
||||
try{
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$total_count=$stmh->rowCount();
|
||||
// print "<script> alert($total_count) </script>";
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 배열선언
|
||||
$text1=[];
|
||||
$text2=[];
|
||||
$memo=[];
|
||||
$draw=[];
|
||||
$drawbottom1=[];
|
||||
$drawbottom2=[];
|
||||
|
||||
|
||||
|
||||
try{
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$counter=0;
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$upnum=$row["upnum"];
|
||||
if((int)$upnum==(int)$num)
|
||||
{
|
||||
$text1[$counter]=$row["text1"];
|
||||
$text2[$counter]=$row["text2"];
|
||||
|
||||
$memo[$counter]=$row["memo"];
|
||||
$draw[$counter]=$row["draw"];
|
||||
$drawbottom1[$counter]=$row["drawbottom1"];
|
||||
$drawbottom2[$counter]=$row["drawbottom2"];
|
||||
$start_num--;
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
$recnum=8; //레코드수가 8개 넘으면 다음페이지로 출력
|
||||
$limit=ceil($total_count/$recnum);
|
||||
// print "<script> alert($limit) </script>";
|
||||
?>
|
||||
|
||||
|
||||
<html lang="ko">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" media="print" href="../css/print2.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/screenlist.css">
|
||||
<!-- <link rel="stylesheet" type="text/css" href="../css/orderprint.css"> 발주서 인쇄에 맞게 수정하기 위한 css -->
|
||||
<title>발주서 출력</title>
|
||||
</head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="../js/html2canvas.js"></script> <!-- 스크린샷을 위한 자바스크립트 함수 불러오기 -->
|
||||
<script>
|
||||
|
||||
function partShot(number) {
|
||||
var d = new Date();
|
||||
var currentDate = ( d.getMonth() + 1 ) + "-" + d.getDate() + "_" ;
|
||||
var currentTime = d.getHours() + "_" + d.getMinutes() +"_" + d.getSeconds() ;
|
||||
var result = 'screen' + currentDate + currentTime + '__' + number +'.jpg';
|
||||
|
||||
//특정부분 스크린샷
|
||||
html2canvas(document.getElementById("outlineprint"+number))
|
||||
//id outlineprint 부분만 스크린샷
|
||||
.then(function (canvas) {
|
||||
//jpg 결과값
|
||||
drawImg(canvas.toDataURL('image/jpeg'));
|
||||
//이미지 저장
|
||||
saveAs(canvas.toDataURL(), result);
|
||||
}).catch(function (err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
function drawImg(imgData) {
|
||||
console.log(imgData);
|
||||
//imgData의 결과값을 console 로그롤 보실 수 있습니다.
|
||||
return new Promise(function reslove() {
|
||||
//내가 결과 값을 그릴 canvas 부분 설정
|
||||
var canvas = document.getElementById('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
//canvas의 뿌려진 부분 초기화
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
var imageObj = new Image();
|
||||
imageObj.onload = function () {
|
||||
ctx.drawImage(imageObj, 10, 10);
|
||||
//canvas img를 그리겠다.
|
||||
};
|
||||
imageObj.src = imgData;
|
||||
//그릴 image데이터를 넣어준다.
|
||||
|
||||
}, function reject() { });
|
||||
|
||||
}
|
||||
function saveAs(uri, filename) {
|
||||
var link = document.createElement('a');
|
||||
if (typeof link.download === 'string') {
|
||||
link.href = uri;
|
||||
link.download = filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
window.open(uri);
|
||||
}
|
||||
}
|
||||
function cleardiv() {
|
||||
$('#outlineprint').empty();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<body>
|
||||
<?php
|
||||
for($j=0;$j<$limit;$j++)
|
||||
{
|
||||
$pagenum=$j+1; // 페이지번호 산출
|
||||
?>
|
||||
<div id="print">
|
||||
<div id="outlineprint<?=$pagenum?>">
|
||||
<div class="img">
|
||||
<div id="row1"> 페이지번호 : <?=$pagenum?> / <?=$limit?> </div> <!-- end of row1 -->
|
||||
<div class="clear"> </div>
|
||||
<div id="row2">
|
||||
<div id="col1"> <?=$outdate?>
|
||||
|
||||
</div> <!-- end of row2 col1-->
|
||||
<div id="col2"> <?=$indate?> (면적 : <?=$m2?>㎡)
|
||||
|
||||
</div> <!-- end of row2 col2-->
|
||||
</div> <!-- end of row2 -->
|
||||
<div class="clear"> </div>
|
||||
<div id="row3">
|
||||
<div id="col1"> <?=$receiver?>
|
||||
|
||||
</div> <!-- end of row3 col1-->
|
||||
<div id="col2"> <?=$outworkplace?>
|
||||
|
||||
</div> <!-- end of row3 col2-->
|
||||
</div> <!-- end of row3 -->
|
||||
<div class="clear"> </div>
|
||||
<div id="row4">
|
||||
<div id="col1"> <?=$phone?>
|
||||
|
||||
</div> <!-- end of row4 col1-->
|
||||
<div id="col2"> <?=$outputplace?>
|
||||
|
||||
</div> <!-- end of row4 col2-->
|
||||
</div> <!-- end of row4 -->
|
||||
<div id="row5"> " <?=$comment?> "
|
||||
</div> <!-- end of row5 -->
|
||||
|
||||
<div id="containers" >
|
||||
<div id="display_result" >
|
||||
<div id="ares1"> 번호 </div>
|
||||
<div id="ares2"> 부호 </div>
|
||||
<div id="ares3"> 스크린제작 치수 너비(W) x 높이(H) , 수량(EA) </div>
|
||||
<div class="clear"> </div>
|
||||
|
||||
<?php
|
||||
$repeat=$total_count-$j*$recnum;
|
||||
if($repeat>=8)
|
||||
$repeat=8;
|
||||
for($i=$j*$recnum;$i<=$j*$recnum+$repeat-1;$i++)
|
||||
{
|
||||
?>
|
||||
<div id="printres1"> <?=$i+1?> </div>
|
||||
<div id="printres2"> <?=$text1[$i]?> </div>
|
||||
<div id="firstoutline">
|
||||
<div id="fprintres1"> <?=$text2[$i]?> </div>
|
||||
<div id="fprintres2"> <?=$memo[$i]?> </div>
|
||||
</div>
|
||||
<div id="outline">
|
||||
<div id="res4"> <?=$draw[$i]?> </div>
|
||||
<div class="clear"> </div>
|
||||
<div id="res5"> <?=$drawbottom1[$i]?> </div>
|
||||
<div id="res7"> <?=$drawbottom3[$i]?> </div>
|
||||
<div id="res6"> <?=$drawbottom2[$i]?> </div>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div> <!-- end of display_result -->
|
||||
</div> <!-- end of containers -->
|
||||
|
||||
</div>
|
||||
</div> <!-- end of outline -->
|
||||
</div> <!-- end of print -->
|
||||
<?php
|
||||
print "<script> partShot($pagenum); </script>";
|
||||
}
|
||||
?>
|
||||
<canvas id="canvas" width="1200" height="1600"style="border:1px solid #d3d3d3; display:none;"></canvas>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
499
analysis/search.php
Normal file
499
analysis/search.php
Normal file
@@ -0,0 +1,499 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>5) {
|
||||
/* alert("관리자 승인이 필요합니다."); */
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
header("Expires: 0"); // rfc2616 - Section 14.21
|
||||
//header("Refresh:0"); // reload refresh
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="../css/bending_write_search.css">
|
||||
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!--날짜 선택 창 UI 필요 -->
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
</head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_REQUEST["search"]))
|
||||
$search=$_REQUEST["search"];
|
||||
|
||||
if(isset($_REQUEST["mode"]))
|
||||
$mode=$_REQUEST["mode"];
|
||||
|
||||
if(isset($_REQUEST["steeltype"]))
|
||||
$steeltype=$_REQUEST["steeltype"];
|
||||
|
||||
if(isset($_REQUEST["search_word"]))
|
||||
$search_word=$_REQUEST["search_word"];
|
||||
|
||||
if(isset($_REQUEST["separate_date"])) //출고일 접수일
|
||||
$separate_date=$_REQUEST["separate_date"];
|
||||
|
||||
if(isset($_REQUEST["list"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$list=$_REQUEST["list"];
|
||||
else
|
||||
$list=0;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
// $find="firstord"; //검색할때 고정시킬 부분 저장 ex) 전체/공사담당/건설사 등
|
||||
if(isset($_REQUEST["page"])) // $_REQUEST["page"]값이 없을 때에는 1로 지정
|
||||
{
|
||||
$page=$_REQUEST["page"]; // 페이지 번호
|
||||
}
|
||||
else
|
||||
{
|
||||
$page=1;
|
||||
}
|
||||
|
||||
$scale = 500; // 한 페이지에 보여질 게시글 수
|
||||
$page_scale = 10; // 한 페이지당 표시될 페이지 수 10페이지
|
||||
$first_num = ($page-1) * $scale; // 리스트에 표시되는 게시글의 첫 순번.
|
||||
|
||||
$find=$search_word;
|
||||
$search=$search_word;
|
||||
|
||||
$process="전체"; // 기본 전체로 정한다.
|
||||
|
||||
$common=" order by indate ";
|
||||
$a= $common . " desc, num desc limit $first_num, $scale"; //내림차순
|
||||
$b= $common . " desc, num desc "; //내림차순 전체
|
||||
$c= $common . " asc, num desc limit $first_num, $scale"; //오름차순
|
||||
$d= $common . " asc, num desc "; //오름차순 전체
|
||||
|
||||
$where="";
|
||||
$all=" limit $first_num, $scale";
|
||||
|
||||
if($mode=="search"){
|
||||
if($steeltype==""){
|
||||
$sql="select * from chandj.atbending " . $a;
|
||||
$sqlcon = "select * from chandj.atbending " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
elseif($search_word=="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
|
||||
$sql ="select * from chandj.atbending where steeltype ='$steeltype' order by indate desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.atbending where steeltype ='$steeltype' order by indate desc, num desc ";
|
||||
}
|
||||
elseif($search_word!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
|
||||
$sql ="select * from chandj.atbending where (steeltype ='$steeltype') and (steel_alias like '%$search%') order by indate desc, num desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.atbending where (steeltype ='$steeltype') and (steel_alias like '%$search%') order by indate desc, num desc ";
|
||||
}
|
||||
|
||||
}
|
||||
if($mode=="") {
|
||||
$sql="select * from chandj.atbending " . $a;
|
||||
$sqlcon = "select * from chandj.atbending " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
try{
|
||||
$allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수
|
||||
$temp2=$allstmh->rowCount();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$temp1=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp2; // 전체 글수
|
||||
|
||||
$total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수
|
||||
$current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산
|
||||
// print "$page $total_page $current_page $search $mode";
|
||||
|
||||
?>
|
||||
|
||||
<form name="board_form" id="board_form" method="post" action="bendingdatalist.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>">
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="list_search">
|
||||
<div id="list_search1"> <br> ▷ 총 <?= $total_row ?> 개의 자료 파일이 있습니다.</div>
|
||||
|
||||
</div> <!-- end of list_search -->
|
||||
<div class="clear"></div>
|
||||
<div id="top_title">
|
||||
|
||||
<div id="title1"> 번호 </div>
|
||||
<div id="title22"> 이미지 </div>
|
||||
<div id="title2"> 절곡 품명 </div>
|
||||
<div id="title12"> 별칭(상세내역) </div>
|
||||
<div id="title3"> 등록(수정)일 </div>
|
||||
|
||||
<div id="title4"> 1행합 </div>
|
||||
<div id="title5"> 2행합 </div>
|
||||
<div id="title6"> 3행합 </div>
|
||||
<div id="title7"> 4행합 </div>
|
||||
<div id="title8"> 5행합 </div>
|
||||
<div id="title8"> 6행합 </div>
|
||||
<div id="title9"> 7행합 </div>
|
||||
<div id="title10"> 8행합 </div>
|
||||
<div id="title11"> 총합 </div>
|
||||
|
||||
</div>
|
||||
<div id="list_content">
|
||||
<?php
|
||||
if ($page<=1)
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
else
|
||||
$start_num=$total_row-($page-1) * $scale;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$num=$row["num"];
|
||||
$indate=$row["indate"];
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
$copied_file_name=$row["copied_file_name"];
|
||||
$uploaded_file=$row["uploaded_file"];
|
||||
|
||||
$a1=$row["a1"];
|
||||
$a2=$row["a2"];
|
||||
$a3=$row["a3"];
|
||||
$a4=$row["a4"];
|
||||
$a5=$row["a5"];
|
||||
$a6=$row["a6"];
|
||||
$a7=$row["a7"];
|
||||
$a8=$row["a8"];
|
||||
$a9=$row["a9"];
|
||||
$a10=$row["a10"];
|
||||
$a11=$row["a11"];
|
||||
$a12=$row["a12"];
|
||||
$a13=$row["a13"];
|
||||
$a14=$row["a14"];
|
||||
$a15=$row["a15"];
|
||||
$a16=$row["a16"];
|
||||
$a17=$row["a17"];
|
||||
$a18=$row["a18"];
|
||||
$a19=$row["a19"];
|
||||
$a20=$row["a20"];
|
||||
$a21=$row["a21"];
|
||||
$a22=$row["a22"];
|
||||
$a23=$row["a23"];
|
||||
$a24=$row["a24"];
|
||||
$a25=$row["a25"];
|
||||
$b1=$row["b1"];
|
||||
$b2=$row["b2"];
|
||||
$b3=$row["b3"];
|
||||
$b4=$row["b4"];
|
||||
$b5=$row["b5"];
|
||||
$b6=$row["b6"];
|
||||
$b7=$row["b7"];
|
||||
$b8=$row["b8"];
|
||||
$b9=$row["b9"];
|
||||
$b10=$row["b10"];
|
||||
$b11=$row["b11"];
|
||||
$b12=$row["b12"];
|
||||
$b13=$row["b13"];
|
||||
$b14=$row["b14"];
|
||||
$b15=$row["b15"];
|
||||
$b16=$row["b16"];
|
||||
$b17=$row["b17"];
|
||||
$b18=$row["b18"];
|
||||
$b19=$row["b19"];
|
||||
$b20=$row["b20"];
|
||||
$b21=$row["b21"];
|
||||
$b22=$row["b22"];
|
||||
$b23=$row["b23"];
|
||||
$b24=$row["b24"];
|
||||
$b25=$row["b25"];
|
||||
$c1=$row["c1"];
|
||||
$c2=$row["c2"];
|
||||
$c3=$row["c3"];
|
||||
$c4=$row["c4"];
|
||||
$c5=$row["c5"];
|
||||
$c6=$row["c6"];
|
||||
$c7=$row["c7"];
|
||||
$c8=$row["c8"];
|
||||
$c9=$row["c9"];
|
||||
$c10=$row["c10"];
|
||||
$c11=$row["c11"];
|
||||
$c12=$row["c12"];
|
||||
$c13=$row["c13"];
|
||||
$c14=$row["c14"];
|
||||
$c15=$row["c15"];
|
||||
$c16=$row["c16"];
|
||||
$c17=$row["c17"];
|
||||
$c18=$row["c18"];
|
||||
$c19=$row["c19"];
|
||||
$c20=$row["c20"];
|
||||
$c21=$row["c21"];
|
||||
$c22=$row["c22"];
|
||||
$c23=$row["c23"];
|
||||
$c24=$row["c24"];
|
||||
$c25=$row["c25"];
|
||||
$d1=$row["d1"];
|
||||
$d2=$row["d2"];
|
||||
$d3=$row["d3"];
|
||||
$d4=$row["d4"];
|
||||
$d5=$row["d5"];
|
||||
$d6=$row["d6"];
|
||||
$d7=$row["d7"];
|
||||
$d8=$row["d8"];
|
||||
$d9=$row["d9"];
|
||||
$d10=$row["d10"];
|
||||
$d11=$row["d11"];
|
||||
$d12=$row["d12"];
|
||||
$d13=$row["d13"];
|
||||
$d14=$row["d14"];
|
||||
$d15=$row["d15"];
|
||||
$d16=$row["d16"];
|
||||
$d17=$row["d17"];
|
||||
$d18=$row["d18"];
|
||||
$d19=$row["d19"];
|
||||
$d20=$row["d20"];
|
||||
$d21=$row["d21"];
|
||||
$d22=$row["d22"];
|
||||
$d23=$row["d23"];
|
||||
$d24=$row["d24"];
|
||||
$d25=$row["d25"];
|
||||
$e1=$row["e1"];
|
||||
$e2=$row["e2"];
|
||||
$e3=$row["e3"];
|
||||
$e4=$row["e4"];
|
||||
$e5=$row["e5"];
|
||||
$e6=$row["e6"];
|
||||
$e7=$row["e7"];
|
||||
$e8=$row["e8"];
|
||||
$e9=$row["e9"];
|
||||
$e10=$row["e10"];
|
||||
$e11=$row["e11"];
|
||||
$e12=$row["e12"];
|
||||
$e13=$row["e13"];
|
||||
$e14=$row["e14"];
|
||||
$e15=$row["e15"];
|
||||
$e16=$row["e16"];
|
||||
$e17=$row["e17"];
|
||||
$e18=$row["e18"];
|
||||
$e19=$row["e19"];
|
||||
$e20=$row["e20"];
|
||||
$e21=$row["e21"];
|
||||
$e22=$row["e22"];
|
||||
$e23=$row["e23"];
|
||||
$e24=$row["e24"];
|
||||
$e25=$row["e25"];
|
||||
$f1=$row["f1"];
|
||||
$f2=$row["f2"];
|
||||
$f3=$row["f3"];
|
||||
$f4=$row["f4"];
|
||||
$f5=$row["f5"];
|
||||
$f6=$row["f6"];
|
||||
$f7=$row["f7"];
|
||||
$f8=$row["f8"];
|
||||
$f9=$row["f9"];
|
||||
$f10=$row["f10"];
|
||||
$f11=$row["f11"];
|
||||
$f12=$row["f12"];
|
||||
$f13=$row["f13"];
|
||||
$f14=$row["f14"];
|
||||
$f15=$row["f15"];
|
||||
$f16=$row["f16"];
|
||||
$f17=$row["f17"];
|
||||
$f18=$row["f18"];
|
||||
$f19=$row["f19"];
|
||||
$f20=$row["f20"];
|
||||
$f21=$row["f21"];
|
||||
$f22=$row["f22"];
|
||||
$f23=$row["f23"];
|
||||
$f24=$row["f24"];
|
||||
$f25=$row["f25"];
|
||||
$g1=$row["g1"];
|
||||
$g2=$row["g2"];
|
||||
$g3=$row["g3"];
|
||||
$g4=$row["g4"];
|
||||
$g5=$row["g5"];
|
||||
$g6=$row["g6"];
|
||||
$g7=$row["g7"];
|
||||
$g8=$row["g8"];
|
||||
$g9=$row["g9"];
|
||||
$g10=$row["g10"];
|
||||
$g11=$row["g11"];
|
||||
$g12=$row["g12"];
|
||||
$g13=$row["g13"];
|
||||
$g14=$row["g14"];
|
||||
$g15=$row["g15"];
|
||||
$g16=$row["g16"];
|
||||
$g17=$row["g17"];
|
||||
$g18=$row["g18"];
|
||||
$g19=$row["g19"];
|
||||
$g20=$row["g20"];
|
||||
$g21=$row["g21"];
|
||||
$g22=$row["g22"];
|
||||
$g23=$row["g23"];
|
||||
$g24=$row["g24"];
|
||||
$g25=$row["g25"];
|
||||
$h1=$row["h1"];
|
||||
$h2=$row["h2"];
|
||||
$h3=$row["h3"];
|
||||
$h4=$row["h4"];
|
||||
$h5=$row["h5"];
|
||||
$h6=$row["h6"];
|
||||
$h7=$row["h7"];
|
||||
$h8=$row["h8"];
|
||||
$h9=$row["h9"];
|
||||
$h10=$row["h10"];
|
||||
$h11=$row["h11"];
|
||||
$h12=$row["h12"];
|
||||
$h13=$row["h13"];
|
||||
$h14=$row["h14"];
|
||||
$h15=$row["h15"];
|
||||
$h16=$row["h16"];
|
||||
$h17=$row["h17"];
|
||||
$h18=$row["h18"];
|
||||
$h19=$row["h19"];
|
||||
$h20=$row["h20"];
|
||||
$h21=$row["h21"];
|
||||
$h22=$row["h22"];
|
||||
$h23=$row["h23"];
|
||||
$h24=$row["h24"];
|
||||
$h25=$row["h25"];
|
||||
|
||||
$arr_sum=compact("a_sum","b_sum","c_sum","d_sum","e_sum","f_sum","g_sum","h_sum","total_sum");
|
||||
for ($j=0;$j<8;$j++) {
|
||||
|
||||
switch ($j) {
|
||||
case 0:
|
||||
$str='A';
|
||||
break;
|
||||
case 1:
|
||||
$str='B';
|
||||
break;
|
||||
case 2:
|
||||
$str='C';
|
||||
break;
|
||||
case 3:
|
||||
$str='D';
|
||||
break;
|
||||
case 4:
|
||||
$str='E';
|
||||
break;
|
||||
case 5:
|
||||
$str='F';
|
||||
break;
|
||||
case 6:
|
||||
$str='G';
|
||||
break;
|
||||
case 7:
|
||||
$str='H';
|
||||
break;
|
||||
}
|
||||
|
||||
$str=strtolower($str);
|
||||
$arr=compact($str."1",$str."2",$str."3",$str."4",$str."5",$str."6",$str."7",$str."8",$str."9",$str."10",$str."11",$str."12",$str."13",$str."14",$str."15",$str."16",$str."17",$str."18",$str."19",$str."20",$str."21",$str."21",$str."22",$str."23",$str."24",$str."25");
|
||||
$arr_row_tmp=$str."_sum";
|
||||
|
||||
for($i=0;$i<25;$i++) {
|
||||
$temp= $str . ($i+1);
|
||||
$cc=($j*25)+$i+4;
|
||||
$arr_sum[$arr_row_tmp] += $arr[$temp];
|
||||
// print $arr_sum[$arr_row_tmp];
|
||||
}
|
||||
|
||||
$arr_sum["total_sum"] += $arr_sum[$arr_row_tmp];
|
||||
|
||||
}
|
||||
|
||||
|
||||
$date_font="black"; // 현재일자 Red 색상으로 표기
|
||||
if($nowday==$outdate) {
|
||||
$date_font="red";
|
||||
}
|
||||
|
||||
if($indate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$indate = $indate . $week[ date('w', strtotime($indate) ) ] ;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="list_item" >
|
||||
<div id="list_item1">
|
||||
<a href="#" onclick="intoval('<?=$uploaded_file?>','<?=$steeltype?>','<?=$steel_alias?>','<?=$arr_sum["a_sum"]?>','<?=$arr_sum["b_sum"]?>','<?=$arr_sum["c_sum"]?>','<?=$arr_sum["d_sum"]?>','<?=$arr_sum["e_sum"]?>','<?=$arr_sum["f_sum"]?>','<?=$arr_sum["g_sum"]?>','<?=$arr_sum["h_sum"]?>','<?=$num?>'); return false;" style="font-size=10px;" ><?=$num ?>
|
||||
</div>
|
||||
<div id="list_item22" > <img src="<?=$uploaded_file?>" class="maxsmall"> </div>
|
||||
<div id="list_item2" style="color:<?=$date_font?>;">
|
||||
<b> <?=$steeltype?></b></div>
|
||||
<div id="list_item13" > <?=iconv_substr($steel_alias,0,28,"utf-8")?></div>
|
||||
<div id="list_item3" >
|
||||
<b> <?=substr($indate,0,15)?></b></div>
|
||||
<div id="list_item4" > <?=$arr_sum["a_sum"]?></div>
|
||||
<div id="list_item5" > <?=$arr_sum["b_sum"]?> </div>
|
||||
<div id="list_item6" > <?=$arr_sum["c_sum"]?> </div>
|
||||
<div id="list_item7" > <?=$arr_sum["d_sum"]?> </div>
|
||||
<div id="list_item8" > <?=$arr_sum["e_sum"]?> </div>
|
||||
<div id="list_item9" > <?=$arr_sum["f_sum"]?></div>
|
||||
<div id="list_item10" > <?=$arr_sum["g_sum"]?></div>
|
||||
<div id="list_item11" > <?=$arr_sum["h_sum"]?> </div>
|
||||
<div id="list_item12" > <?=$arr_sum["total_sum"]?> </div>
|
||||
<div class="clear"> </div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end of col2 -->
|
||||
</div> <!-- end of content -->
|
||||
</div> <!-- end of wrap -->
|
||||
|
||||
<script>
|
||||
|
||||
function intoval(uploaded_file, steeltype, steel_alias, a_sum, b_sum, c_sum, d_sum, e_sum, f_sum, g_sum, h_sum, datanum)
|
||||
{
|
||||
$("#displaysearch").hide();
|
||||
$("#input_field").show();
|
||||
|
||||
$("#display_img").html("<img src='" + uploaded_file + "'>");
|
||||
$("#dis_steeltype").text(steeltype);
|
||||
$("#dis_steel_alias").text(steel_alias);
|
||||
$("#uploaded_file").val(uploaded_file);
|
||||
$("#search_word").val(steel_alias);
|
||||
$("#steel_alias").val(steel_alias);
|
||||
$("#sum1").text(a_sum);
|
||||
$("#sum2").text(b_sum);
|
||||
$("#sum3").text(c_sum);
|
||||
$("#sum4").text(d_sum);
|
||||
$("#sum5").text(e_sum);
|
||||
$("#sum6").text(f_sum);
|
||||
$("#sum7").text(g_sum);
|
||||
$("#sum8").text(h_sum);
|
||||
$("#datanum").val(datanum);
|
||||
|
||||
// $("#searchtel").trigger("click"); // 제이쿼리 클릭 이벤트 발생 전화번호 클릭한 효과발생하기
|
||||
}
|
||||
|
||||
$("#search_directinput").on("click", function() {
|
||||
$("#displaysearch").hide();
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
447
analysis/searchkd.php
Normal file
447
analysis/searchkd.php
Normal file
@@ -0,0 +1,447 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>8) {
|
||||
/* alert("관리자 승인이 필요합니다."); */
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
header("Expires: 0"); // rfc2616 - Section 14.21
|
||||
//header("Refresh:0"); // reload refresh
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/screenmake.css">
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!--날짜 선택 창 UI 필요 -->
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
</head>
|
||||
<script>
|
||||
window.history.forward(0);
|
||||
history.navigationMode = 'compatible'; // 오페라, 사파리 뒤로가기 막기
|
||||
function _no_Back(){
|
||||
window.history.forward(0);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
if(isset($_REQUEST["search"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$search=$_REQUEST["search"];
|
||||
if(isset($_REQUEST["list"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$list=$_REQUEST["list"];
|
||||
else
|
||||
$list=0;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
// $find="firstord"; //검색할때 고정시킬 부분 저장 ex) 전체/공사담당/건설사 등
|
||||
if(isset($_REQUEST["page"])) // $_REQUEST["page"]값이 없을 때에는 1로 지정
|
||||
{
|
||||
$page=$_REQUEST["page"]; // 페이지 번호
|
||||
}
|
||||
else
|
||||
{
|
||||
$page=1;
|
||||
}
|
||||
|
||||
$scale = 15; // 한 페이지에 보여질 게시글 수
|
||||
$page_scale = 10; // 한 페이지당 표시될 페이지 수 10페이지
|
||||
$first_num = ($page-1) * $scale; // 리스트에 표시되는 게시글의 첫 순번.
|
||||
|
||||
if(isset($_REQUEST["mode"]))
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
$cursort=$_REQUEST["cursort"]; // 현재 정렬모드 지정
|
||||
if(isset($_REQUEST["sortof"]))
|
||||
{
|
||||
$sortof=$_REQUEST["sortof"]; // 클릭해서 넘겨준 값
|
||||
if($sortof==1) {
|
||||
|
||||
if($cursort!=1)
|
||||
$cursort=1;
|
||||
else
|
||||
$cursort=2;
|
||||
}
|
||||
if($sortof==2) { //접수일 클릭되었을때
|
||||
|
||||
if($cursort!=3)
|
||||
$cursort=3;
|
||||
else
|
||||
$cursort=4;
|
||||
}
|
||||
if($sortof==3) { //구분 클릭되었을때
|
||||
|
||||
if($cursort!=5)
|
||||
$cursort=5;
|
||||
else
|
||||
$cursort=6;
|
||||
}
|
||||
if($sortof==4) { //절곡 클릭되었을때
|
||||
|
||||
if($cursort!=7)
|
||||
$cursort=7;
|
||||
else
|
||||
$cursort=8;
|
||||
}
|
||||
if($sortof==5) { //모터 클릭되었을때
|
||||
|
||||
if($cursort!=9)
|
||||
$cursort=9;
|
||||
else
|
||||
$cursort=10;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortof=0;
|
||||
$cursort=0;
|
||||
}
|
||||
|
||||
// 기간을 정하는 구간
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
|
||||
if($fromdate=="")
|
||||
{
|
||||
$fromdate=substr(date("Y-m-d",time()),0,4) ;
|
||||
$fromdate=$fromdate . "-01-01";
|
||||
}
|
||||
if($todate=="")
|
||||
{
|
||||
$todate=substr(date("Y-m-d",time()),0,4) . "-12-31" ;
|
||||
$Transtodate=strtotime($todate.'+1 days');
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
else
|
||||
{
|
||||
$Transtodate=strtotime($todate);
|
||||
$Transtodate=date("Y-m-d",$Transtodate);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["find"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$find=$_REQUEST["find"];
|
||||
|
||||
$process="전체"; // 기본 전체로 정한다.
|
||||
/*
|
||||
$a=" order by outdate desc limit $first_num, $scale";
|
||||
$b=" order by outdate desc"; */
|
||||
$common=" where outdate between date('$fromdate') and date('$Transtodate') order by outdate ";
|
||||
$a= $common . " desc limit $first_num, $scale"; //내림차순
|
||||
$b= $common . " desc "; //내림차순 전체
|
||||
$c= $common . " asc limit $first_num, $scale"; //오름차순
|
||||
$d= $common . " asc "; //오름차순 전체
|
||||
|
||||
$where=" where outdate between date('$fromdate') and date('$Transtodate') ";
|
||||
$all=" limit $first_num, $scale";
|
||||
|
||||
if($mode=="search"){
|
||||
if($search==""){
|
||||
$sql="select * from chandj.output " . $a;
|
||||
$sqlcon = "select * from chandj.output " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
elseif($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
|
||||
$sql ="select * from chandj.output where (outdate like '%$search%') or (outworkplace like '%$search%') ";
|
||||
$sql .="or (orderman like '%$search%') or (outputplace like '%$search%') or (receiver like '%$search%') or";
|
||||
$sql .=" (phone like '%$search%') or (comment like '%$search%') order by outdate desc limit $first_num, $scale ";
|
||||
$sqlcon ="select * from chandj.output where (outdate like '%$search%') or (outworkplace like '%$search%') ";
|
||||
$sqlcon .="or (orderman like '%$search%') or (outputplace like '%$search%') or (receiver like '%$search%') or";
|
||||
$sqlcon .=" (phone like '%$search%') or (comment like '%$search%') order by outdate desc";
|
||||
}
|
||||
|
||||
}
|
||||
if($mode=="") {
|
||||
$sql="select * from chandj.output " . $a;
|
||||
$sqlcon = "select * from chandj.output " . $b; // 전체 레코드수를 파악하기 위함.
|
||||
}
|
||||
|
||||
|
||||
if($cursort==1)
|
||||
{
|
||||
$sql="select * from chandj.output " . $c;
|
||||
$sqlcon="select * from chandj.output " . $d;
|
||||
}
|
||||
|
||||
if($cursort==2)
|
||||
{
|
||||
$sql="select * from chandj.output " . $a;
|
||||
$sqlcon="select * from chandj.output " . $b;
|
||||
}
|
||||
if($cursort==3) // 접수일 클릭시 정렬
|
||||
{
|
||||
$sql="select * from chandj.output " . $where . " order by indate desc " . $all;
|
||||
$sqlcon="select * from chandj.output " . $where . " order by indate desc " ;
|
||||
}
|
||||
if($cursort==4) // 접수일 클릭시 정렬
|
||||
{
|
||||
$sql="select * from chandj.output " . $where . " order by indate asc " . $all;
|
||||
$sqlcon="select * from chandj.output " . $where . " order by indate asc " ;
|
||||
}
|
||||
if($cursort==5) // 구분 클릭시 주일/경동 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.output " . $where . " order by root desc, outdate desc " . $all;
|
||||
$sqlcon="select * from chandj.output " . $where . " order by root desc, outdate desc " ;
|
||||
}
|
||||
|
||||
if($cursort==6) // 구분 클릭시 주일/경동 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.output" . $where . " order by root asc, outdate desc " . $all;
|
||||
$sqlcon="select * from chandj.output" . $where . " order by root asc, outdate desc " ;
|
||||
}
|
||||
if($cursort==7) // 절곡 클릭시 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.output" . $where . " order by steel desc, outdate desc " . $all;
|
||||
$sqlcon="select * from chandj.output" . $where . " order by steel desc, outdate desc ";
|
||||
}
|
||||
if($cursort==8) // 절곡 클릭시 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.output" . $where . " order by steel asc, outdate desc " . $all;
|
||||
$sqlcon="select * from chandj.output" . $where . " order by steel asc, outdate desc ";
|
||||
}
|
||||
if($cursort==9) // 모터 클릭시 내림 정렬
|
||||
{
|
||||
$sql="select * from chandj.output" . $where . " order by motor desc, outdate desc " . $all;
|
||||
$sqlcon="select * from chandj.output" . $where . " order by motor desc, outdate desc " ;
|
||||
}
|
||||
if($cursort==10) // 모터 클릭시 오름차순 정렬
|
||||
{
|
||||
$sql="select * from chandj.output" . $where . " order by motor asc, outdate desc " . $all;
|
||||
$sqlcon="select * from chandj.output" . $where . " order by motor asc, outdate desc " ;
|
||||
}
|
||||
|
||||
$nowday=date("Y-m-d"); // 현재일자 변수지정
|
||||
|
||||
try{
|
||||
$allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수
|
||||
$temp2=$allstmh->rowCount();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$temp1=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp2; // 전체 글수
|
||||
|
||||
$total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수
|
||||
$current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산
|
||||
// print "$page $total_page $current_page $search $mode";
|
||||
|
||||
?>
|
||||
|
||||
<body >
|
||||
|
||||
<div id="content">
|
||||
<div id="col2">
|
||||
<form name="board_form" id="board_form" method="post" >
|
||||
|
||||
<div id="list_search">
|
||||
<div id="list_search1">▷ 총 <?= $total_row ?> 개의 자료 파일이 있습니다. 검색어 : <?= $search ?>
|
||||
|
||||
<?php
|
||||
if($total_row==0)
|
||||
{
|
||||
print "<button type='button' id='search_directinput' class='button button2' > 직접입력 </button>";
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div> <!-- end of list_search3 -->
|
||||
<br><br><br>
|
||||
<div id="output_top_title">
|
||||
<div id="output_title1"> 번호 </div>
|
||||
<div id="output_title2"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=1&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 출고일자 </a> </div> <!-- 출고일자 -->
|
||||
<div id="output_title3"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=2&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 접 수 일 </a> </div> <!-- 접수일 -->
|
||||
<div id="output_title4"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=3&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>">구분 </a> </div> <!-- 주일/경동 -->
|
||||
<div id="output_title5"> <a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=4&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>">절곡발주 </a> </div> <!-- 절곡발주 -->
|
||||
<div id="output_title6"><a href="list.php?&page=<?=$page?>&search=<?=$search?>&find=<?=$find?>&list=1&sortof=5&cursort=<?=$cursort?>&process=<?=$process?>&year=<?=$year?>"> 모터발주 </a> </div>
|
||||
<div id="output_title7"> 현 장 명 </div>
|
||||
<div id="output_title8"> 수신처 </div>
|
||||
<div id="output_title13"> 운송방식 </div>
|
||||
<div id="output_title9"> 수신 주소 </div>
|
||||
<div id="output_title10"> 수신연락처 </div>
|
||||
<div id="output_title11"> 발주담당 </div>
|
||||
<div id="output_title12"> 비 고 </div>
|
||||
</div>
|
||||
<div id="list_content">
|
||||
<?php
|
||||
if ($page<=1)
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
else
|
||||
$start_num=$total_row-($page-1) * $scale;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$item_num=$row["num"];
|
||||
$outdate=$row["outdate"];
|
||||
$item_indate=$row["indate"];
|
||||
$item_orderman=$row["orderman"];
|
||||
$item_outworkplace=$row["outworkplace"];
|
||||
$item_outputplace=$row["outputplace"];
|
||||
$item_receiver=$row["receiver"];
|
||||
$item_phone=$row["phone"];
|
||||
$item_comment=$row["comment"];
|
||||
$root=$row["root"];
|
||||
$steel=$row["steel"];
|
||||
$motor=$row["motor"];
|
||||
$delivery=$row["delivery"];
|
||||
if($steel=="1")
|
||||
$steel="절곡";
|
||||
if($motor=="1")
|
||||
$motor="모터";
|
||||
|
||||
if($root=="주일")
|
||||
$root_font="black";
|
||||
else
|
||||
$root_font="blue";
|
||||
|
||||
$date_font="black"; // 현재일자 Red 색상으로 표기
|
||||
if($nowday==$outdate) {
|
||||
$date_font="red";
|
||||
}
|
||||
|
||||
|
||||
$font="black";
|
||||
switch ($delivery) {
|
||||
case "상차(선불)" : $font="black"; break;
|
||||
case "상차(착불)" :$font="grey" ; break;
|
||||
case "경동화물(선불)" :$font="brown"; break;
|
||||
case "경동화물(착불)" :$font="brown"; break;
|
||||
case "경동택배(선불)" :$font="brown"; break;
|
||||
case "경동택배(착불)" :$font="brown"; break;
|
||||
case "직접수령" :$font="red"; break;
|
||||
case "대신화물(선불)" :$font="blue"; break;
|
||||
case "대신화물(착불)" :$font="blue"; break;
|
||||
case "대신택배(선불)" :$font="blue"; break;
|
||||
case "대신택배(착불)" :$font="blue"; break;
|
||||
}
|
||||
|
||||
if($outdate!="") {
|
||||
$week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ;
|
||||
$outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="outlist_item" >
|
||||
<div id="outlist_item1"> <?=$start_num ?></div>
|
||||
<div id="outlist_item2" style="color:<?=$date_font?>;">
|
||||
<b> <?=substr($outdate,0,15)?></b></div>
|
||||
|
||||
<?php // 접수일이 당일이면 깜빡이는 효과부여
|
||||
|
||||
if($item_indate==date("Y-m-d",time())) // 보라색 굵은 글씨체로 당일 해당 접수된 것...
|
||||
{
|
||||
print '<div id="outlist_item3" style="font-weight: bold; color:purple;">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div id="outlist_item3">';
|
||||
}
|
||||
?>
|
||||
<?=substr($item_indate,0,10)?>
|
||||
|
||||
</div>
|
||||
<div id="outlist_item4"style="color:<?=$root_font?>;" ><b> <?=$root?></b> </div>
|
||||
<div id="outlist_item5" style="color:green"><b> <?=$steel?></b></div>
|
||||
<div id="outlist_item6" style="color:purple"><b> <?=$motor?> </b></div>
|
||||
<div id="outlist_item7"> <?=substr($item_outworkplace,0,36)?> </div>
|
||||
<div id="outlist_item8"> <a href="#" onclick="intovalkd('<?=$item_outworkplace?>','<?=$item_receiver?>','<?=$delivery?>','<?=$item_phone?>','<?=$item_outputplace?>');"> <?=substr($item_receiver,0,25)?> </a> </div>
|
||||
<div id="outlist_item13" style="color:<?=$font?>;" ><?=substr($delivery,0,20)?></div>
|
||||
<div id="outlist_item9"><?=substr($item_outputplace,0,46)?></div>
|
||||
<div id="outlist_item10"><?=substr($item_phone,0,25)?></div>
|
||||
<div id="outlist_item11"><?=substr($item_orderman,0,25)?></div>
|
||||
<div id="outlist_item12"><?=substr($item_comment,0,60)?></a></div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
<div id="page_button">
|
||||
<div id="page_num">
|
||||
<?php
|
||||
if($page!=1 && $page>$page_scale)
|
||||
{
|
||||
$prev_page = $page - $page_scale;
|
||||
// 이전 페이지값은 해당 페이지 수에서 리스트에 표시될 페이지수 만큼 감소
|
||||
if($prev_page <= 0)
|
||||
$prev_page = 1; // 만약 감소한 값이 0보다 작거나 같으면 1로 고정
|
||||
print "<a href=list.php?page=$prev_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>◀ </a>";
|
||||
}
|
||||
for($i=$start_page; $i<=$end_page && $i<= $total_page; $i++)
|
||||
{ // [1][2][3] 페이지 번호 목록 출력
|
||||
if($page==$i) // 현재 위치한 페이지는 링크 출력을 하지 않도록 설정.
|
||||
print "<font color=red><b>[$i]</b></font>";
|
||||
else
|
||||
print "<a href=list.php?page=$i&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year>[$i]</a>";
|
||||
}
|
||||
|
||||
if($page<$total_page)
|
||||
{
|
||||
$next_page = $page + $page_scale;
|
||||
if($next_page > $total_page)
|
||||
$next_page = $total_page;
|
||||
// netx_page 값이 전체 페이지수 보다 크면 맨 뒤 페이지로 이동시킴
|
||||
print "<a href=list.php?page=$next_page&search=$search&find=$find&list=1&process=$process&asprocess=$asprocess&yearcheckbox=$yearcheckbox&year=$year> ▶</a><p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end of col2 -->
|
||||
</div> <!-- end of col2 -->
|
||||
</div> <!-- end of col2 -->
|
||||
|
||||
<script>
|
||||
function blinker() {
|
||||
$('.blinking').fadeOut(500);
|
||||
$('.blinking').fadeIn(500);
|
||||
}
|
||||
setInterval(blinker, 1000);
|
||||
|
||||
function intovalkd(workplace,receiver,delivery,phone,address)
|
||||
{
|
||||
$("#displaysearch").hide();
|
||||
document.getElementById("outworkplace").value = workplace;
|
||||
document.getElementById("outputplace").value = address;
|
||||
document.getElementById("receiver").value = receiver;
|
||||
document.getElementById("phone").value = phone;
|
||||
// 라디오버튼 값을 바꾸는 방법 예시로 사용할 것
|
||||
$("input:radio[name='delivery']:radio[value='" + delivery + "']").prop("checked",true);
|
||||
|
||||
|
||||
|
||||
}
|
||||
$("#search_directinput").on("click", function() {
|
||||
$("#displaysearch").hide();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<?php
|
||||
if($mode==""&&$fromdate==null)
|
||||
{
|
||||
echo ("<script language=javascript> this_year();</script>"); // 당해년도 화면에 초기세팅하기
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
216
analysis/workerlist.php
Normal file
216
analysis/workerlist.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php
|
||||
session_start();
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>5) {
|
||||
/* alert("관리자 승인이 필요합니다."); */
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
header("Expires: 0"); // rfc2616 - Section 14.21
|
||||
//header("Refresh:0"); // reload refresh
|
||||
?>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/work.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/special.css">
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
</head>
|
||||
<script>
|
||||
window.history.forward(0);
|
||||
history.navigationMode = 'compatible'; // 오페라, 사파리 뒤로가기 막기
|
||||
function _no_Back(){
|
||||
window.history.forward(0);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
if(isset($_REQUEST["search"])) //목록표에 제목,이름 등 나오는 부분
|
||||
$search=$_REQUEST["search"];
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
// $find="firstord"; //검색할때 고정시킬 부분 저장 ex) 전체/공사담당/건설사 등
|
||||
if(isset($_REQUEST["page"])) // $_REQUEST["page"]값이 없을 때에는 1로 지정
|
||||
{
|
||||
$page=$_REQUEST["page"]; // 페이지 번호
|
||||
}
|
||||
else
|
||||
{
|
||||
$page=1;
|
||||
}
|
||||
|
||||
$scale = 20; // 한 페이지에 보여질 게시글 수
|
||||
$page_scale = 10; // 한 페이지당 표시될 페이지 수 10페이지
|
||||
$first_num = ($page-1) * $scale; // 리스트에 표시되는 게시글의 첫 순번.
|
||||
|
||||
if(isset($_REQUEST["mode"]))
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="";
|
||||
|
||||
$a=" order by num desc limit $first_num, $scale";
|
||||
$b=" order by num desc";
|
||||
|
||||
|
||||
$sql ="select * from chandj.workerlist where ((name like '%$search%' ) or (comment1 like '%$search%' ) or (comment2 like '%$search%' ) or (comment3 like '%$search%' ) or (comment4 like '%$search%' ) or";
|
||||
$sql .=" (comment5 like '%$search%' ) or (company like '%$search%' )) " . $a;
|
||||
|
||||
$sqlcon ="select * from chandj.workerlist where ((name like '%$search%' ) or (comment1 like '%$search%' ) or (comment2 like '%$search%' ) or (comment3 like '%$search%' ) or (comment4 like '%$search%' ) or";
|
||||
$sqlcon .=" (comment5 like '%$search%' ) or (company like '%$search%' )) " . $b;
|
||||
|
||||
try{
|
||||
$allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수
|
||||
$temp2=$allstmh->rowCount();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$temp1=$stmh->rowCount();
|
||||
|
||||
$total_row = $temp2; // 전체 글수
|
||||
|
||||
$total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수
|
||||
$current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산
|
||||
// print "$page $total_page $current_page $search $mode";
|
||||
?>
|
||||
|
||||
<body onload="_no_Back();" onpageshow="if(event.persisted)_no_Back();">
|
||||
<div id="wrap">
|
||||
<div id="content">
|
||||
<form name="board_form" method="post" action="search.php?mode=search&search=<?=$search?>&find=<?=$find?>&process=<?=$process?>&yearcheckbox=<?=$yearcheckbox?>&year=<?=$year?>">
|
||||
<div id="col2">
|
||||
<div id="list_search">
|
||||
<div id="list_search1">▷ 총 <?= $total_row ?> 개의 자료 파일이 있습니다. 검색어 : <?= $search ?>
|
||||
|
||||
<?php
|
||||
if($total_row==0)
|
||||
{
|
||||
print "<button type='button' id='directinput' class='button button2' > 직접입력 </button>";
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- end of list_search3 -->
|
||||
|
||||
<br>
|
||||
<div id="outlist_top_title">
|
||||
<ul>
|
||||
<li id="outlist_title1">번호</li>
|
||||
<li id="outlist_title2">수신처(반장) 이름</li>
|
||||
<li id="outlist_title3">연락처</li>
|
||||
<li id="outlist_title4">분야</li>
|
||||
<li id="outlist_title5">회사</li>
|
||||
<li id="outlist_title6">비고1</li>
|
||||
<li id="outlist_title7">비고2</li>
|
||||
<li id="outlist_title8">비고3</li>
|
||||
</ul>
|
||||
</div> <!-- end of list_top_title -->
|
||||
<br><br>
|
||||
<div id="list_content">
|
||||
<?php
|
||||
if ($page<=1)
|
||||
$start_num=$total_row; // 페이지당 표시되는 첫번째 글순번
|
||||
else
|
||||
$start_num=$total_row-($page-1) * $scale;
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$num=$row["num"];
|
||||
$con_num=$row["con_num"];
|
||||
$name=$row["name"];
|
||||
$tel=$row["tel"];
|
||||
$item=$row["item"];
|
||||
$company=$row["company"];
|
||||
$comment1=$row["comment1"];
|
||||
$comment2=$row["comment2"];
|
||||
$comment3=$row["comment3"];
|
||||
|
||||
// $item_subject=mb_substr($item_subject,0,20,'utf-8');
|
||||
/// if(mb_strlen($item_subject,'utf-8')>=20)
|
||||
// $item_subject=$item_subject . "..."; // 글자수가 초과하면 ...으로 표기됨
|
||||
|
||||
|
||||
?>
|
||||
<div id="sub_item">
|
||||
<div id="sub_item1"><?= $start_num ?> </div>
|
||||
<div id="sub_item2"> <a href="#" onclick="intovaltel('<?=$tel?>','<?=$name?>'); return false;" style="font-size=10px;" ><?= $name ?> </a>
|
||||
</div>
|
||||
<div id="sub_item3"><?=substr($tel,0,25)?> </div>
|
||||
<div id="sub_item4"><?=substr($item,0,25)?> </div>
|
||||
<div id="sub_item5"><?= $company?> </div>
|
||||
<div id="sub_item6"><?= $comment1?> </div>
|
||||
<div id="sub_item7"><?= $comment2?> </div>
|
||||
<div id="sub_item8"><?= $comment3?> </div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
<div id="page_button">
|
||||
<div id="page_num">
|
||||
<?php
|
||||
if($page!=1 && $page>$page_scale)
|
||||
{
|
||||
$prev_page = $page - $page_scale;
|
||||
// 이전 페이지값은 해당 페이지 수에서 리스트에 표시될 페이지수 만큼 감소
|
||||
if($prev_page <= 0)
|
||||
$prev_page = 1; // 만약 감소한 값이 0보다 작거나 같으면 1로 고정
|
||||
print "<a href=workerlist.php?page=$prev_page&search=$search&find=$find&list=1&process=$process&yearcheckbox=$yearcheckbox&year=$year>◀ </a>";
|
||||
}
|
||||
for($i=$start_page; $i<=$end_page && $i<= $total_page; $i++)
|
||||
{ // [1][2][3] 페이지 번호 목록 출력
|
||||
if($page==$i) // 현재 위치한 페이지는 링크 출력을 하지 않도록 설정.
|
||||
print "<font color=red><b>[$i]</b></font>";
|
||||
else
|
||||
print "<a href=workerlist.php?page=$i&search=$search&find=$find&list=1&process=$process&yearcheckbox=$yearcheckbox&year=$year>[$i]</a>";
|
||||
}
|
||||
|
||||
if($page<$total_page)
|
||||
{
|
||||
$next_page = $page + $page_scale;
|
||||
if($next_page > $total_page)
|
||||
$next_page = $total_page;
|
||||
// netx_page 값이 전체 페이지수 보다 크면 맨 뒤 페이지로 이동시킴
|
||||
print "<a href=workerlist.php?page=$next_page&search=$search&find=$find&list=1&process=$process&yearcheckbox=$yearcheckbox&year=$year> ▶</a><p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- end of col2 -->
|
||||
</form>
|
||||
</div> <!-- end of content -->
|
||||
</div> <!-- end of wrap -->
|
||||
<script>
|
||||
|
||||
function intovaltel(tel,name)
|
||||
{
|
||||
$("#displaysearchworker").hide();
|
||||
document.getElementById("phone").value = tel;
|
||||
document.getElementById("receiver").value = name;
|
||||
}
|
||||
|
||||
// 자재 출고 직접입력버튼 클릭
|
||||
$("#directinput").on("click", function() {
|
||||
$("#displaysearchworker").hide();
|
||||
// alert("dkajflasd");
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1219
analysis/write.php
Normal file
1219
analysis/write.php
Normal file
File diff suppressed because it is too large
Load Diff
613
analysis/write_form.php
Normal file
613
analysis/write_form.php
Normal file
@@ -0,0 +1,613 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$level= $_SESSION["level"];
|
||||
if(!isset($_SESSION["level"]) || $level>=8) {
|
||||
echo "<script> alert('관리자 승인이 필요합니다.') </script>";
|
||||
sleep(2);
|
||||
header ("Location:/login/logout.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["mode"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$mode=$_REQUEST["mode"];
|
||||
else
|
||||
$mode="not";
|
||||
$outputnum=$_REQUEST["outputnum"]; // 출고현황에서 넘어온 출고번호
|
||||
$callback=$_REQUEST["callback"]; // 출고현황에서 체크번호
|
||||
|
||||
if((int)$outputnum>=1)
|
||||
{
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
try{
|
||||
$sql = "select * from chandj.bendinglist where outputnum = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$outputnum,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$counter = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
|
||||
if($counter>=1) {
|
||||
$mode="modify"; //수정모드로 전환
|
||||
$num=$row["num"];
|
||||
// print "번호를 찾았습니다.<br>" . $num;
|
||||
}
|
||||
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($_REQUEST["num"])) //수정 버튼을 클릭해서 호출했는지 체크 출고현황에서 부르지 않았을때
|
||||
$num=$_REQUEST["num"];
|
||||
else
|
||||
$num=1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$upnum=$num; // 번호를 부모번호로 넣음
|
||||
|
||||
if(isset($_REQUEST["page"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$page=$_REQUEST["page"];
|
||||
else
|
||||
$page=1;
|
||||
|
||||
if(isset($_REQUEST["search"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$search=$_REQUEST["search"];
|
||||
else
|
||||
$search="";
|
||||
|
||||
if(isset($_REQUEST["find"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$find=$_REQUEST["find"];
|
||||
else
|
||||
$find="";
|
||||
|
||||
if(isset($_REQUEST["process"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$process=$_REQUEST["process"];
|
||||
else
|
||||
$process="전체";
|
||||
|
||||
if(isset($_REQUEST["sort"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$sort=$_REQUEST["sort"];
|
||||
else
|
||||
$sort="1";
|
||||
|
||||
if(isset($_REQUEST["outdate"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$outdate=$_REQUEST["outdate"];
|
||||
else
|
||||
$outdate="";
|
||||
|
||||
if(isset($_REQUEST["item_indate"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_indate=$_REQUEST["item_indate"];
|
||||
else
|
||||
$item_indate="";
|
||||
|
||||
if(isset($_REQUEST["item_outworkplace"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_outworkplace=$_REQUEST["item_outworkplace"];
|
||||
else
|
||||
$item_outworkplace="";
|
||||
|
||||
if(isset($_REQUEST["item_receiver"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_receiver=$_REQUEST["item_receiver"];
|
||||
else
|
||||
$item_receiver="";
|
||||
|
||||
if(isset($_REQUEST["item_orderman"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_orderman=$_REQUEST["item_orderman"];
|
||||
else
|
||||
$item_orderman="";
|
||||
|
||||
if(isset($_REQUEST["item_outputplace"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_outputplace=$_REQUEST["item_outputplace"];
|
||||
else
|
||||
$item_outputplace="";
|
||||
|
||||
if(isset($_REQUEST["item_phone"])) //수정 버튼을 클릭해서 호출했는지 체크
|
||||
$item_phone=$_REQUEST["item_phone"];
|
||||
else
|
||||
$item_phone="";
|
||||
|
||||
if(isset($_REQUEST["item_comment"]))
|
||||
$item_comment=$_REQUEST["item_comment"];
|
||||
else
|
||||
$item_comment="";
|
||||
|
||||
if(isset($_REQUEST["delivery"]))
|
||||
$item_delivery=$_REQUEST["delivery"];
|
||||
else
|
||||
$item_delivery="";
|
||||
|
||||
$modify="0"; // 정렬모드 초기화
|
||||
|
||||
$fromdate=$_REQUEST["fromdate"];
|
||||
$todate=$_REQUEST["todate"];
|
||||
$outputnumint=(int)$outputnum;
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if ($mode=="modify"){
|
||||
try{
|
||||
$sql = "select * from chandj.bendinglist where num = ? ";
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$count = $stmh->rowCount();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
|
||||
if($count<1){
|
||||
print "검색결과가 없습니다.<br>";
|
||||
}else{
|
||||
|
||||
if($callback==1) {
|
||||
$outputnum=$row["outputnum"];
|
||||
$outdate=$row["outdate"];
|
||||
$item_indate=$row["indate"];
|
||||
$item_orderman=$row["orderman"];
|
||||
$item_outworkplace=$row["outworkplace"];
|
||||
$item_outputplace=$row["outputplace"];
|
||||
$item_receiver=$row["receiver"];
|
||||
$item_phone=$row["phone"];
|
||||
$item_comment=$row["comment"];
|
||||
$item_delivery=$row["delivery"];
|
||||
|
||||
|
||||
if($item_indate!="0000-00-00") $item_indate = date("Y-m-d", strtotime( $item_indate) );
|
||||
else $item_indate="";
|
||||
if($outdate!="0000-00-00") $outdate = date("Y-m-d", strtotime( $outdate) );
|
||||
else $outdate="";
|
||||
}
|
||||
|
||||
}
|
||||
}catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode=="not"){ // 수정모드가 아닐때 신규 자료일때는 변수 초기화 한다.
|
||||
|
||||
$outdate=date("Y-m-d");
|
||||
$outputnum=null;
|
||||
$item_indate=date("Y-m-d");
|
||||
$item_orderman=$_SESSION["name"];
|
||||
$item_outworkplace=null;
|
||||
$item_outputplace=null;
|
||||
$item_receiver=null;
|
||||
$item_phone=null;
|
||||
$item_comment=null;
|
||||
$item_delivery=null;
|
||||
|
||||
if($_SESSION["name"] =="안미희")
|
||||
$root="경동";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
if($sort=='1')
|
||||
$sql="select * from chandj.bending_write where upnum='$upnum' order by num asc"; // 처음 오름차순
|
||||
else
|
||||
$sql="select * from chandj.bending_write where upnum='$upnum' order by num desc"; // 처음 내림차순
|
||||
|
||||
try{
|
||||
$m_array=array();
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
$counter=0;
|
||||
$m2=0;
|
||||
$sum=0;
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$upnum=$row["upnum"];
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
$m2=number_format((float)$m2, 2, '.', '');
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title> 주일기업 통합정보시스템 </title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/bendingmake.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bending_write_form.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="/order/order.js"></script>
|
||||
|
||||
<div id="wrap">
|
||||
|
||||
<div id="header">
|
||||
<?php include "../lib/top_login2.php"; ?>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<?php include "../lib/top_menu2.php"; ?>
|
||||
</div>
|
||||
<div id="content">
|
||||
<br><br>
|
||||
<?php
|
||||
if($mode=="modify"){
|
||||
?>
|
||||
<form name="board_form" method="post" onkeydown="return captureReturnKey(event)" action="insertlist.php?mode=modify&num=<?=$num?>&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>" >
|
||||
<?php }
|
||||
else {
|
||||
?>
|
||||
<form name="board_form" method="post" onkeydown="return captureReturnKey(event)" action="insertlist.php?mode=not&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>&upnum=<?=$upnum?>&parentnum=<?=$upnum?>&callback=1">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="work_col3"> <h2> 절곡원가분석 발주번호: <?=$upnum?> 출고 고유번호: <?=$outputnum?> </h2>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div id="sero1"> 출 고 일 : </div>
|
||||
<div id="sero2"> <input type="date" id="outdate" name="outdate" value="<?=$outdate?>" size="14" placeholder="출 고 일" > </div>
|
||||
<div id="sero3"> 접 수 일 : </div>
|
||||
<div id="sero4"> <input type="date" id="indate" name="indate" value="<?=$item_indate?>" size="14" placeholder="접수일" > </div>
|
||||
<div id="sero3"> 발주처현장 : </div>
|
||||
<div id="sero5"> <input type="text" id="outworkplace" name="outworkplace" value="<?=$item_outworkplace?>" size="40" placeholder="발주처명">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="displaysearch" style="display:none">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="sero32"> 수신처 : </div>
|
||||
<div id="sero7"> <input type="text" id="receiver" name="receiver" value="<?=$item_receiver?>" size="20" placeholder="발주처" >
|
||||
</div>
|
||||
|
||||
<div id="sero31"> 발주자 : </div>
|
||||
<div id="sero6"> <input type="text" id="orderman" name="orderman" value="<?=$item_orderman?>" size="14" placeholder="발주자(주일/경동 직원)" > </div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<div id="displaysearchworker" style="display:none">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="sero3"> 수신처주소 : </div>
|
||||
<div id="sero8"> <input type="text" id="outputplace" name="outputplace" value="<?=$item_outputplace?>" size="60" placeholder="현장주소 또는 납품처 주소 or 화물 영업소" >
|
||||
</div> <div id="sero88" > <input type="text" id="delivery" name="delivery" value="<?=$item_delivery?>" size="15" placeholder="배송방식" > </div>
|
||||
|
||||
<div id="sero3"> 연락처 : </div>
|
||||
<div id="sero9"> <input type="text" id="phone" name="phone" value="<?=$item_phone?>" size="20" placeholder="작업반장 또는 업체 연락처"> </div>
|
||||
<div class="clear"></div>
|
||||
<div id="sero3"> 비 고 : </div>
|
||||
<div id="sero10"> <textarea rows="2" cols="130" name="comment" placeholder="기타 코멘트 남겨주세요."
|
||||
><?=$item_comment?></textarea></div>
|
||||
<input type="hidden" id="upnum" name="upnum" value="<?=$upnum?>" size="5" >
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>" size="5" >
|
||||
<input type="hidden" id="modify" name="modify" value="<?=$modify?>" size="5" >
|
||||
<input type="hidden" id="outputnum" name="outputnum" value="<?=$outputnum?>" size="5" >
|
||||
<input type="hidden" id="ordercompany" name="ordercompany" value="<?=$item_outworkplace?>" size="5" >
|
||||
<div class="clear"></div>
|
||||
</form>
|
||||
|
||||
<div id="write_button_renew" style="float:center;" ><input type="image" src="../img/bending_write.jpg">
|
||||
|
||||
<a href="javascript:del('deletelist.php?num=<?=$num?>&page=<?=$page?>')"><img src="../img/delete.png"></a>
|
||||
<a href="list.php?mode=search&search=<?=$search?>&find=<?=$find?>&year=<?=$year?>&search=<?=$search?>&process=<?=$process?>&asprocess=<?=$asprocess?>&fromdate=<?=$fromdate?>&todate=<?=$todate?>&separate_date=<?=$separate_date?>"><img src="../img/list.png"></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="containers" >
|
||||
<div id="display_result">
|
||||
<div id="display_text"> </div>
|
||||
<div id="res1"> 번호 </div>
|
||||
<div id="res2"> 품명 </div>
|
||||
<div id="res3"> 세부사항 </div>
|
||||
<div id="res4"> 절곡면적 내역 </div>
|
||||
<div class="clear"> </div>
|
||||
<?php
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
|
||||
if($sort=='1')
|
||||
$sql="select * from chandj.bending_write where upnum='$num' order by num desc"; // 처음 내림차순
|
||||
else
|
||||
$sql="select * from chandj.bending_write where upnum='$num' order by num asc"; // 처음 오름차순
|
||||
try{
|
||||
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
|
||||
|
||||
$sum=0;
|
||||
|
||||
$counter=0;
|
||||
|
||||
$display_text="";
|
||||
|
||||
$options = array();
|
||||
$options[1] = 'EGI1.6T';
|
||||
$options[2] = 'EGI1.2T';
|
||||
$options[3] = 'EGI0.8T';
|
||||
$options[4] = 'SUS H/L 1.5T';
|
||||
$options[5] = 'SUS H/L 1.2T';
|
||||
$options[6] = 'GI0.45T';
|
||||
$options[7] = 'GI0.8T';
|
||||
$options[8] = 'Mirror 1.5';
|
||||
$options[9] = 'Mirror 1.2';
|
||||
|
||||
while($row = $stmh->fetch(PDO::FETCH_ASSOC)) {
|
||||
$upnum=$row["upnum"];
|
||||
$counter++;
|
||||
|
||||
$num=$row["num"];
|
||||
|
||||
$steeltype=$row["steeltype"];
|
||||
$steel_alias=$row["steel_alias"];
|
||||
|
||||
// print $steeltype;
|
||||
// print $upnum . " " . $tempnum;
|
||||
|
||||
$parentnum=$row["parentnum"]; // 리스트번호
|
||||
$num=$row["num"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
$outputnum=$row["outputnum"];
|
||||
$length1=$row["length1"];
|
||||
$length2=$row["length2"];
|
||||
$length3=$row["length3"];
|
||||
$length4=$row["length4"];
|
||||
$length5=$row["length5"];
|
||||
$amount1=$row["amount1"];
|
||||
$amount2=$row["amount2"];
|
||||
$amount3=$row["amount3"];
|
||||
$amount4=$row["amount4"];
|
||||
$amount5=$row["amount5"];
|
||||
$material1=$row["material1"];
|
||||
$material2=$row["material2"];
|
||||
$material3=$row["material3"];
|
||||
$material4=$row["material4"];
|
||||
$material5=$row["material5"];
|
||||
$material6=$row["material6"];
|
||||
$material7=$row["material7"];
|
||||
$material8=$row["material8"];
|
||||
$sum1=$row["sum1"];
|
||||
$sum2=$row["sum2"];
|
||||
$sum3=$row["sum3"];
|
||||
$sum4=$row["sum4"];
|
||||
$sum5=$row["sum5"];
|
||||
$sum6=$row["sum6"];
|
||||
$sum7=$row["sum7"];
|
||||
$sum8=$row["sum8"];
|
||||
$total_text=$row["total_text"];
|
||||
$datanum=$row["datanum"];
|
||||
|
||||
$arr_count++;
|
||||
|
||||
$jb = explode( ',', $total_text );
|
||||
// print $jb[0] . " " . $jb[1]; // 분할된 것 화면에 보여주기 테스트용
|
||||
$total_count=count($jb); // 배열의 수를 파악해서 반복문을 만든다.
|
||||
|
||||
|
||||
for($i=1;$i<=$total_count;$i++)
|
||||
{
|
||||
$tmp = explode( '=', $jb[$i-1] );
|
||||
for($j=1;$j<=9;$j++) // 합계 배열에 누적
|
||||
{
|
||||
if($tmp[0]==$options[$j]) {
|
||||
$steel_arr_sum[$j] = $steel_arr_sum[$j] + (float)$tmp[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//print "--->" . (count($jbexplode)-1);
|
||||
|
||||
// echo '<script type="text/javascript"> changeUri(); </script>';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div id="dis1"> <?=$counter?> </div>
|
||||
<div id="dis2"> <?=$steeltype?> </div>
|
||||
<div id="dis3"> <?=$steel_alias?>
|
||||
</div>
|
||||
<div id="dis4"> <?=$total_text?> </div>
|
||||
<div class="clear"> </div>
|
||||
|
||||
|
||||
<?php
|
||||
$start_num--;
|
||||
}
|
||||
} catch (PDOException $Exception) {
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
// 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page)
|
||||
$start_page = ($current_page - 1) * $page_scale + 1;
|
||||
// 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page)
|
||||
$end_page = $start_page + $page_scale - 1;
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end of containers -->
|
||||
</div> <!-- end of col3 -->
|
||||
</div> <!-- end of wrap -->
|
||||
|
||||
|
||||
<?php
|
||||
for($j=1;$j<=9;$j++) // 합계 배열 초기화
|
||||
{
|
||||
// print " " . $steel_arr_sum[$j] . " ";
|
||||
if($steel_arr_sum[$j]!=0) {
|
||||
$display_text = $display_text . $options[$j] . ' ==> ' . $steel_arr_sum[$j] . '(㎡), ';
|
||||
}
|
||||
}
|
||||
// print '<div class="clear"> </div>';
|
||||
// print $display_text;
|
||||
?>
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
/* var exititem = "<? echo $exititem; ?>"; // php변수를 자바스크립트에서 사용하는 방법 echo 이용
|
||||
if(exititem=='0')
|
||||
$("#exityesno").hide();
|
||||
else
|
||||
$("#exityesno").show(); */
|
||||
cal_display(); //your code here
|
||||
}, 500);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("fromdate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
$("#todate").datepicker({ dateFormat: 'yy-mm-dd'});
|
||||
|
||||
});
|
||||
|
||||
function inputNumberFormat(obj) {
|
||||
obj.value = comma(uncomma(obj.value));
|
||||
}
|
||||
function comma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
function uncomma(str) {
|
||||
str = String(str);
|
||||
return str.replace(/[^\d]+/g, '');
|
||||
}
|
||||
|
||||
|
||||
function date_mask(formd, textid) {
|
||||
|
||||
/*
|
||||
input onkeyup에서
|
||||
formd == this.form.name
|
||||
textid == this.name
|
||||
*/
|
||||
|
||||
var form = eval("document."+formd);
|
||||
var text = eval("form."+textid);
|
||||
|
||||
var textlength = text.value.length;
|
||||
|
||||
if (textlength == 4) {
|
||||
text.value = text.value + "-";
|
||||
} else if (textlength == 7) {
|
||||
text.value = text.value + "-";
|
||||
} else if (textlength > 9) {
|
||||
//날짜 수동 입력 Validation 체크
|
||||
var chk_date = checkdate(text);
|
||||
|
||||
if (chk_date == false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkdate(input) {
|
||||
var validformat = /^\d{4}\-\d{2}\-\d{2}$/; //Basic check for format validity
|
||||
var returnval = false;
|
||||
|
||||
if (!validformat.test(input.value)) {
|
||||
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
|
||||
} else { //Detailed check for valid date ranges
|
||||
var yearfield = input.value.split("-")[0];
|
||||
var monthfield = input.value.split("-")[1];
|
||||
var dayfield = input.value.split("-")[2];
|
||||
var dayobj = new Date(yearfield, monthfield - 1, dayfield);
|
||||
}
|
||||
|
||||
if ((dayobj.getMonth() + 1 != monthfield)
|
||||
|| (dayobj.getDate() != dayfield)
|
||||
|| (dayobj.getFullYear() != yearfield)) {
|
||||
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
|
||||
} else {
|
||||
//alert ('Correct date');
|
||||
returnval = true;
|
||||
}
|
||||
if (returnval == false) {
|
||||
input.select();
|
||||
}
|
||||
return returnval;
|
||||
}
|
||||
|
||||
function input_Text(){
|
||||
document.getElementById("test").value = comma(Math.floor(uncomma(document.getElementById("test").value)*1.1)); // 콤마를 계산해 주고 다시 붙여주고
|
||||
var copyText = document.getElementById("test"); // 클립보드 복사
|
||||
copyText.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
|
||||
function captureReturnKey(e) {
|
||||
if(e.keyCode==13 && e.srcElement.type != 'textarea')
|
||||
return false;
|
||||
}
|
||||
|
||||
function recaptureReturnKey(e) {
|
||||
if (e.keyCode==13)
|
||||
exe_search();
|
||||
}
|
||||
function Enter_Check(){
|
||||
// 엔터키의 코드는 13입니다.
|
||||
if(event.keyCode == 13){
|
||||
exe_search(); // 실행할 이벤트
|
||||
}
|
||||
}
|
||||
function Enter_CheckTel(){
|
||||
// 엔터키의 코드는 13입니다.
|
||||
if(event.keyCode == 13){
|
||||
exe_searchTel(); // 실행할 이벤트
|
||||
}
|
||||
}
|
||||
|
||||
function exe_search()
|
||||
{
|
||||
var postData = changeUri(document.getElementById("outworkplace").value);
|
||||
var sendData = $(":input:radio[name=root]:checked").val();
|
||||
|
||||
$("#displaysearch").show();
|
||||
// if(sendData=='주일')
|
||||
// $("#displaysearch").load("./search.php?mode=search&search=" + postData);
|
||||
// if(sendData=='경동')
|
||||
$("#displaysearch").load("./searchkd.php?mode=search&search=" + postData);
|
||||
}
|
||||
function exe_searchTel()
|
||||
{
|
||||
var postData = changeUri(document.getElementById("receiver").value);
|
||||
$("#displaysearchworker").show();
|
||||
$("#displaysearchworker").load("./workerlist.php?mode=search&search=" + postData);
|
||||
}
|
||||
function del(href)
|
||||
{
|
||||
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
|
||||
document.location.href = href;
|
||||
}
|
||||
}
|
||||
|
||||
function sortall(){
|
||||
var sort;
|
||||
sort=$("#sort").val();
|
||||
if(sort=='1')
|
||||
$("#sort").val("2");
|
||||
else
|
||||
$("#sort").val("1");
|
||||
$("#modify").val("1"); // 소팅할 것
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function saveit() {
|
||||
// $("#modify").val("1"); // 이전화면 유지
|
||||
document.getElementById('board_form').submit(); // form의 검색버튼 누른 효과
|
||||
}
|
||||
|
||||
function cal_display() { // 화면용 절곡면적 계산
|
||||
var tmp="<? echo $display_text; ?>"; // php변수 불러오는 방법
|
||||
$("#display_text").text(tmp);
|
||||
} // end of function
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user