This commit is contained in:
2018-01-09 19:54:49 +09:00
commit 7b3201548a
518 changed files with 174188 additions and 0 deletions
+96
View File
@@ -0,0 +1,96 @@
function EntranceDonation_Import() {
}
function EntranceDonation_Init() {
$("#EntranceDonation_0001").click(EntranceDonation_Back);
$("#EntranceDonation_000200").click(function() { EntranceDonation_Calculate(); });
$("#EntranceDonation_000308").click(function() { EntranceDonation_Donate(); });
}
function EntranceDonation_Update() {
EntranceDonation_UpdateDonation();
}
function EntranceDonation_Back() {
$("#EntranceDonation_00").hide();
$("#Entrance_00").show();
Entrance_Update();
}
function EntranceDonation_UpdateDonation() {
Popup_Wait(function() {
GetJSON(
HOME+I+ENTRANCE+W+DONATION+W+GET, {
},
function(response, textStatus) {
if(response.result == "SUCCESS") {
$("#EntranceDonation_0005").html(response.donations);
$("#EntranceDonation_000301").val(response.date);
Popup_WaitHide();
} else {
Popup_WaitShow("처리 실패!");
}
}
)
});
}
function EntranceDonation_Calculate() {
Popup_Wait(function() {
PostJSON(
HOME+I+ENTRANCE+W+DONATION+W+"calculate"+POST, {
},
function(response, textStatus) {
if(response.result == "SUCCESS") {
$("#EntranceDonation_000301").val("");
$("#EntranceDonation_000302").val("");
$("#EntranceDonation_000303").val("");
$("#EntranceDonation_000304").val("");
$("#EntranceDonation_000305").val("");
$("#EntranceDonation_000306").val("");
Popup_WaitHide();
EntranceDonation_UpdateDonation();
} else {
Popup_WaitShow("처리 실패!");
}
}
)
});
}
function EntranceDonation_Donate() {
var date = $("#EntranceDonation_000301").val();
var id = $("#EntranceDonation_000302").val();
var name = $("#EntranceDonation_000303").val();
var rname = $("#EntranceDonation_000304").val();
var subname = $("#EntranceDonation_000305").val();
var amount = $("#EntranceDonation_000306").val();
Popup_Wait(function() {
PostJSON(
HOME+I+ENTRANCE+W+DONATION+W+POST, {
date: date,
id: id,
name: name,
rname: rname,
subname: subname,
amount: amount
},
function(response, textStatus) {
if(response.result == "SUCCESS") {
$("#EntranceDonation_000301").val("");
$("#EntranceDonation_000302").val("");
$("#EntranceDonation_000303").val("");
$("#EntranceDonation_000304").val("");
$("#EntranceDonation_000305").val("");
$("#EntranceDonation_000306").val("");
Popup_WaitHide();
EntranceDonation_UpdateDonation();
} else {
Popup_WaitShow("처리 실패!");
}
}
)
});
}
+44
View File
@@ -0,0 +1,44 @@
<?
require_once('_common.php');
?>
<script type="text/javascript">
ImportStyle("<?=ROOT;?>"+W+I+ENTRANCE+W+DONATION+W+STYLE);
ImportAction("<?=ROOT;?>"+W+I+ENTRANCE+W+DONATION+W+ACTION);
EntranceDonation_Import();
EntranceDonation_Init();
</script>
<div id="EntranceDonation_00">
<div id="EntranceDonation_0000" class="bg2 font4">
참 여 기 록
</div>
<input id="EntranceDonation_0001" type="button" value="돌아가기">
<div id="EntranceDonation_0002" class="bg0">
<input id="EntranceDonation_000200" type="button" value="통계계산">
</div>
<div id="EntranceDonation_0003" class="bg0">
<div id="EntranceDonation_000300">-</div>
<input id="EntranceDonation_000301" type="text">
<input id="EntranceDonation_000302" type="text">
<input id="EntranceDonation_000303" type="text">
<input id="EntranceDonation_000304" type="text">
<input id="EntranceDonation_000305" type="text">
<input id="EntranceDonation_000306" type="text">
<div id="EntranceDonation_000307">-</div>
<input id="EntranceDonation_000308" type="button" value="기록">
</div>
<div id="EntranceDonation_0004" class="bg1">
<div id="EntranceDonation_000400">순번</div>
<div id="EntranceDonation_000401">일자</div>
<div id="EntranceDonation_000402">ID</div>
<div id="EntranceDonation_000403">이름</div>
<div id="EntranceDonation_000404">입금자</div>
<div id="EntranceDonation_000405">닉네임</div>
<div id="EntranceDonation_000406">금액</div>
<div id="EntranceDonation_000407">개인누적</div>
<div id="EntranceDonation_000408">총누적</div>
</div>
<div id="EntranceDonation_0005">
</div>
</div>
+45
View File
@@ -0,0 +1,45 @@
<?
// 외부 파라미터
require_once('_common.php');
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
require_once(ROOT.W.F_FUNC.W.'class._Time.php');
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
$member = $DB->Get($rs);
if($member['GRADE'] < 6) {
$response['result'] = 'FAIL';
$response['msg'] = '운영자 권한이 없습니다.';
} else {
$response['donations'] = '<table id="EntranceDonation_000500" class="bg0">';
$rs = $DB->Select('NO, ID, NAME, RNAME, SUBNAME, DATE, AMOUNT, CUMUL, TOTAL', 'DONATION', '1 ORDER BY DATE DESC, NO DESC');
while($DB->HasNext($rs)) {
$donation = $DB->Next($rs);
$response['donations'] .= "
<tr>
<td class='EntranceDonation_00050000'>{$donation['NO']}</td>
<td class='EntranceDonation_00050001'>{$donation['DATE']}</td>
<td class='EntranceDonation_00050002'>{$donation['ID']}</td>
<td class='EntranceDonation_00050003'>{$donation['NAME']}</td>
<td class='EntranceDonation_00050004'>{$donation['RNAME']}</td>
<td class='EntranceDonation_00050005'>{$donation['SUBNAME']}</td>
<td class='EntranceDonation_00050006'>{$donation['AMOUNT']}</td>
<td class='EntranceDonation_00050007'>{$donation['CUMUL']}</td>
<td class='EntranceDonation_00050008'>{$donation['TOTAL']}</td>
</tr>";
}
$response['donations'] .= '</table>';
$response['date'] = _Time::DateToday();
$response['result'] = 'SUCCESS';
}
sleep(1);
echo json_encode($response);
?>
+58
View File
@@ -0,0 +1,58 @@
<?
// 외부 파라미터
// $_POST['date'] : 일자
// $_POST['id'] : ID
// $_POST['name'] : 이름
// $_POST['rname'] : 입금자
// $_POST['subname'] : 닉네임
// $_POST['amount'] : 금액
$date = $_POST['date'];
$id = $_POST['id'];
$name = $_POST['name'];
$rname = $_POST['rname'];
$subname = $_POST['subname'];
$amount = $_POST['amount'];
require_once('_common.php');
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
$member = $DB->Get($rs);
if($member['GRADE'] < 6) {
$response['result'] = 'FAIL';
$response['msg'] = '운영자 권한이 없습니다.';
} else {
if($subname == "") {
$rs = $DB->Select('NAME', 'MEMBER', "ID='{$id}'");
$donator = $DB->Get($rs);
$subname = $donator['NAME'];
}
$rs = $DB->Select('SUM(AMOUNT) AS CUM', 'DONATION', "ID='{$id}'");
$donator = $DB->Get($rs);
$cumul = $donator['CUM'] + $amount;
$rs = $DB->Select('SUM(AMOUNT) AS TOT', 'DONATION');
$donator = $DB->Get($rs);
$total = $donator['TOT'] + $amount;
$DB->InsertArray('DONATION', array(
ID => $id,
NAME => $name,
RNAME => $rname,
SUBNAME => $subname,
DATE => $date,
AMOUNT => $amount,
CUMUL => $cumul,
TOTAL => $total
));
$response['result'] = 'SUCCESS';
}
echo json_encode($response);
?>
+178
View File
@@ -0,0 +1,178 @@
@charset "utf-8";
#EntranceDonation_00 {
width: 800px; height: 20px;
border: none;
position: absolute;
top: 20px; left: 50%;
margin-left: -400px; /* DIV박스 크기의 1/2로 마진을 잡아줍니다. */
display: none;
z-index: 2;
}
#EntranceDonation_0000 {
width: 800px; height: 50px;
position: absolute; top: 0px; left: 0px;
}
#EntranceDonation_0001 {
width: 100px; height: 30px;
position: absolute; top: 10px; left: 650px;
}
#EntranceDonation_0002 {
width: 800px; height: 20px;
position: absolute; top: 52px; left: 0px;
}
#EntranceDonation_000200 {
width: 100px; height: 20px;
}
#EntranceDonation_0003 {
width: 800px; height: 20px;
position: absolute; top: 74px; left: 0px;
border: none;
}
#EntranceDonation_000300 {
width: 48px; height: 20px;
float: left;
}
#EntranceDonation_000301 {
width: 96px; height: 16px;
float: left;
}
#EntranceDonation_000302 {
width: 96px; height: 16px;
float: left;
}
#EntranceDonation_000303 {
width: 96px; height: 16px;
float: left;
}
#EntranceDonation_000304 {
width: 96px; height: 16px;
float: left;
}
#EntranceDonation_000305 {
width: 96px; height: 16px;
float: left;
}
#EntranceDonation_000306 {
width: 66px; height: 16px;
float: left;
}
#EntranceDonation_000307 {
width: 78px; height: 20px;
float: left;
}
#EntranceDonation_000308 {
width: 100px; height: 20px;
float: left;
}
#EntranceDonation_0004 {
width: 800px; height: 20px;
position: absolute; top: 96px; left: 0px;
border: none;
}
#EntranceDonation_000400 {
width: 48px; height: 20px;
float: left;
}
#EntranceDonation_000401 {
width: 98px; height: 20px;
float: left;
}
#EntranceDonation_000402 {
width: 98px; height: 20px;
float: left;
}
#EntranceDonation_000403 {
width: 98px; height: 20px;
float: left;
}
#EntranceDonation_000404 {
width: 98px; height: 20px;
float: left;
}
#EntranceDonation_000405 {
width: 98px; height: 20px;
float: left;
}
#EntranceDonation_000406 {
width: 68px; height: 20px;
float: left;
}
#EntranceDonation_000407 {
width: 78px; height: 20px;
float: left;
}
#EntranceDonation_000408 {
width: 98px; height: 20px;
float: left;
}
#EntranceDonation_0005 {
width: 800px; height: 20px;
position: absolute; top: 118px; left: 0px;
border: none;
}
#EntranceDonation_000500 {
border: none;
}
.EntranceDonation_00050000 {
width: 48px;
}
.EntranceDonation_00050001 {
width: 98px;
}
.EntranceDonation_00050002 {
width: 98px;
}
.EntranceDonation_00050003 {
width: 98px;
}
.EntranceDonation_00050004 {
width: 98px;
}
.EntranceDonation_00050005 {
width: 98px;
}
.EntranceDonation_00050006 {
width: 68px;
}
.EntranceDonation_00050007 {
width: 78px;
}
.EntranceDonation_00050008 {
width: 98px;
}
+8
View File
@@ -0,0 +1,8 @@
<?
define(ROOT, '../..');
require_once(ROOT.'/f_config/config.php');
require_once(ROOT.W.F_CONFIG.W.APP.PHP);
require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
CustomHeader();
?>
+46
View File
@@ -0,0 +1,46 @@
<?
// 외부 파라미터
require_once('_common.php');
require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
require_once(ROOT.W.F_CONFIG.W.DB.PHP);
require_once(ROOT.W.F_CONFIG.W.SESSION.PHP);
$rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
$member = $DB->Get($rs);
if($member['GRADE'] < 6) {
$response['result'] = 'FAIL';
$response['msg'] = '운영자 권한이 없습니다.';
} else {
//개인누적계산
$rs = $DB->Select('ID', 'DONATION', '1', 'ID');
while($DB->HasNext($rs)) {
$donator = $DB->Next($rs);
$cumul = 0;
$rs2 = $DB->Select('NO, AMOUNT', 'DONATION', "ID='{$donator['ID']}' ORDER BY DATE, NO");
while($DB->HasNext($rs2)) {
$donation = $DB->Next($rs2);
$cumul += $donation['AMOUNT'];
$DB->Update('DONATION', "CUMUL='{$cumul}'", "NO='{$donation['NO']}'");
}
}
$total = 0;
//총누적계산
$rs = $DB->Select('NO, AMOUNT', 'DONATION', '1 ORDER BY DATE, NO');
while($DB->HasNext($rs)) {
$donation = $DB->Next($rs);
$total += $donation['AMOUNT'];
$DB->Update('DONATION', "TOTAL='{$total}'", "NO='{$donation['NO']}'");
}
$response['result'] = 'SUCCESS';
}
echo json_encode($response);
?>