apiTest.php 9.7 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiStatic.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBoard.php" ?>
<?
	$obj = new ApiStatic($_REQUEST, "") ;
	$obj2= new ApiBoard($req) ;
	
	$kcsInfo = $obj->getKCSpecialVehicleInfo();
	$organizationCert = $obj->getListOfOrganizationCert();
	$notice	= $obj2->getListOfNotice();
	$event	= $obj2->getListOfEvent();
	$board	= $obj2->getListOfBoard();
	$comment= $obj2->getInfoOfBoard();
	$CS		= $obj2->getListOfCS();
	$CSInfo = $obj2->getInfoOfCS();
	$AS		= $obj2->getListOfCompany();
	$ASInfo	= $obj2->getInfoOfCompany();
	$myProductionSpec=$obj2->getListOfMyProductionSpec();
	$productionSpec=$obj2->getListOfProductionSpec();
	$productionSpecInfo=$obj2->getInfoOfProductionSpec();
	$vehicleList=$obj->getListOfVehicle();
	$vehicleInfo=$obj->getInfoOfVehicle();
	

	//$vnum = $obj->virtualNum ;
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/admin/inc/css/base.css">
<link rel="stylesheet" type="text/css" href="/admin/inc/css/layout.css">
<link rel="stylesheet" type="text/css" href="/admin/inc/css/common.css">
<link rel="stylesheet" type="text/css" href="/admin/inc/css/btn.css">

<script type="text/javascript" src="/common/js/common.js"></script>
<script type="text/javascript" src="/common/js/jsMap.js"></script>
<script type="text/javascript" src="/common/js/jquery-1.7.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/common/js/jquery.cookie.js"></script>



<!-- 리치 js -->
<script type="text/javascript" src="/common/js/jquery_rich/RichBaseExtends.js"></script>
<script type="text/javascript" src="/common/js/jquery_rich/RichBaseElementObject-1.0.js"></script>
<!-- 
<script type="text/javascript" src="/common/js/jquery_rich/RichFramework-1.0.js"></script>
<script type="text/javascript" src="/common/js/jquery_rich/RichElement-1.0.js"></script>
<script type="text/javascript" src="/common/js/jquery_rich/RHForm-1.0.js"></script>
 -->
<script type="text/javascript" src="/common/js/ajaxupload.3.6.js"></script>
<script type="text/javascript" src="/common/js/imgPreview.js"></script>
<script type="text/javascript" src="/common/js/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	var FORM_TARGET_CLS_NM		= ".data"	;		// 폼을 동적 wrap 할 타겟 ID이름
	var FORM_NAME				= "alf"		;		// 폼이름
	var FORM_METHOD				= "POST"		;		// 폼 메쏘드
	var FORM_USE_FILE			= false		;		// 파일폼 사용 여부
	var FORM_ACTION				= "/action_front.php" ; 
	
	
	var NEXT_CMD				= ""		;		// 다은 수행 할 cmd
	

	$(".saveComment").click2(function(){
		$.ajax({
			type: 'post',
			url : "/action_front.php?cmd=ApiBoard.saveComment",
			async : false,
			cache : false,
			data:{
				"commentType" : "CS",
				"targetFk" : 2,
				"userFk" : 1,
				"content" : "test 대댓글2",
				"parentNo" : 62 
			},
			success : function(data){
				alert(data.returnmessage);
			},
			error : function(req, res, error){
				alert(req+res+error);
			}
		});
	}) ;

	$(".saveBoard").click2(function(){
		$.ajax({
			type: 'post',
			url : "/action_front.php?cmd=ApiBoard.saveBoard",
			async : false,
			cache : false,
			data:{
				"title" : "제목제목제목",
				"userFk" : 1,
				"imgPathBoard1" : "경로1",
				"imgPathBoard2" : "경로2",
				"imgPathBoard3" : "경로3",
				"content" : "내용내용내용" 
			},
			success : function(data){
				alert(data.returnmessage);
			},
			error : function(req, res, error){
				alert(req+res+error);
			}
		});
	}) ;
	
	$(".saveCS").click2(function(){
		$.ajax({
			type: 'post',
			url : "/action_front.php?cmd=ApiBoard.saveCS",
			async : false,
			cache : false,
			data:{
				"title" : "제목제목제목",
				"userFk" : 1,
				"imgPathBoard1" : "경로1",
				"imgPathBoard2" : "경로2",
				"imgPathBoard3" : "경로3",
				"content" : "내용내용내용" 
			},
			success : function(data){
				alert(data.returnmessage);
			},
			error : function(req, res, error){
				alert(req+res+error);
			}
		});
	}) ;

	$(".saveProductionSpec").click2(function(){
		$.ajax({
			type: 'post',
			url : "/action_front.php?cmd=ApiBoard.saveProductionSpec",
			async : false,
			cache : false,
			data:{
				"userFk" : 1,
				"requestDate" : "2017-10-18",
				"companyName" : "리치",
				"vehicleTON" : "123123",
				"vehicleText" : "vehicleText",
				"vehicleType" : "HY",
				"productName" : "wtf",
				"telephone" : "01001011",
				"managerFk" : "1",
				"type" : "R",
				"internalLength" : 108,
				"internalHeight" : 120,
				"internalWidth" : 32,
				"alCoil" : "G",
				"floor" : "C",
				"floorValue" : 22,
				"tent" : 0,
				"sideBoard" : 1,
				"windStopper" : 1,
				"freezer" : 0,
				"gate" : 2,
				"load" : "S",
				"eTrackGate" : 0,
				"eTrackWing" : 1,
				"turnBuckle" : "rkskek",
				"toolBucket" : 2,
				"bumberFootHold" : 1,
				"wingProtector" : 2,
				"axis" : 1,
				"axisValue" : "302",
				"specialAddition" : "special" 
			},
			success : function(data){
				alert(data.returnmessage);
			},
			error : function(req, res, error){
				alert(req+res+error);
			}
		});
	}) ;
	
	$("#subm").click2(function(){
        var val1 = $("#name1").val().toString();
        var val2 = $("#name2").val();
        var val3 = $("#name3").val();
        var val4 = $("#name4").val();
        var val5 = $("#name5").val();
        var val6 = $("#name6").val();
        var val7 = $("#name7").val();
        var val1v = $("#name1v").val();
        var val2v = $("#name2v").val();
        var val3v = $("#name3v").val();
        var val4v = $("#name4v").val();
        var val5v = $("#name5v").val();
        var val6v = $("#name6v").val();
        var val7v = $("#name7v").val();
		$.ajax({
			url : "/action_front.php?cmd=ApiBoard.saveComment",
			async : false,
			cache : false,
			dataType: 'json',
			data:{
				val1 : $("#name1v").val(),
                val2 : parseInt($("#name2v").val()),
                val3 : parseInt($("#name3v").val()),
                val4 : $("#name4v").val(),
                val5 : parseInt($("#name5v").val()),
                val6 : $("#name6v").val(),
                val7 : $("#name7v").val()
			},
			success : function(data){
				alert(data.returnmessage);
			},
			error : function(req, res, error){
				alert(req+res+error);
			}
		});
	}) ;

	
	
}) ;
</script>

<html>
	<head>
		<title>API 테스트 ㅋ</title>
	</head>
	<body>
	<div id="Contents"  class="notice" style="width:1000px;" >
	<form name=test1 method=POST>
	<span class="button bigrounded blue saveComment btnleft_y">댓글 저장 </span>
	<span class="button bigrounded blue saveBoard btnleft_y">게시물 저장 </span>
	<span class="button bigrounded blue saveCS btnleft_y">고객센터 게시물 저장 </span>
	<span class="button bigrounded blue saveProductionSpec btnleft_y">제작사양서 저장 </span>
	</form>
	    <div class="data">
			<table class="datacList" id="datacList">
			<thead>
                <tr class="datacLists">
                    <th width="8%">이름</th>
                    <th width="50%">내용</th>
                </tr>
            </thead>
			<tr>
			<td class="center" class="center"> KCSInfo</td>
			<td class=""><?echo $kcsInfo;?></td>
			</tr>
			<tr>
			<td class="center">OrganizationCert</td>
			<td class=""><?echo $organizationCert;?></td>
			</tr>
			<tr>
			<td class="center">Notice</td>
			<td class=""><?echo $notice;?></td>
			</tr>
			<tr>
			<td class="center">Event</td>
			<td class=""><?echo $event;?></td>
			</tr>
			<tr>
			<td class="center">Board</td>
			<td class=""><?echo $board;?></td>
			</tr>
			<tr>
			<td class="center">Comment</td>
			<td class=""><?echo $comment;?></td>
			</tr>
			<tr>
			<td class="center">CS</td>
			<td class=""><?echo $CS;?></td>
			</tr>
			<tr>
			<td class="center">CSInfo</td>
			<td class=""><?echo $CSInfo;?></td>
			</tr>
			<tr>
			<td class="center">AS</td>
			<td class=""><?echo $AS;?></td>
			</tr>
			<tr>
			<td class="center">ASInfo</td>
			<td class=""><?echo $ASInfo;?></td>
			</tr>

			<tr>
			<td class="center">MyProductionSpec</td>
			<td class=""><?echo $myProductionSpec;?></td>
			</tr>
			<tr>
			<td class="center">ProductionSpecList</td>
			<td class=""><?echo $productionSpec;?></td>
			</tr>
			<tr>
			<td class="center">ProductionSpecInfo</td>
			<td class=""><?echo $productionSpecInfo;?></td>
			</tr>
			<tr>
			<td class="center">vehicleList</td>
			<td class=""><?echo $vehicleList;?></td>
			</tr>
			<tr>
			<td class="center">vehicleInfo</td>
			<td class=""><?echo $vehicleInfo;?></td>
			</tr>
			</table>	
		</div>	
		<br>
		<form name="test" id="test" method=GET>
            <input type="text" id="name1" name="name1" />  : <input type="text" id="name1v" name="name1v" />
            <br>
            <input type="text" id="name2" name="name2" />  : <input type="text" id="name2v" name="name2v" />
            <br>
            <input type="text" id="name3" name="name3" />  : <input type="text" id="name3v" name="name3v" />
            <br>
            <input type="text" id="name4" name="name4" />  : <input type="text" id="name4v" name="name4v" />
            <br>
            <input type="text" id="name5" name="name5" />  : <input type="text" id="name5v" name="name5v" />
            <br>
            <input type="text" id="name6" name="name6" />  : <input type="text" id="name6v" name="name6v" />
            <br>
            <input type="text" id="name7" name="name7" />  : <input type="text" id="name7v" name="name7v" />
            <br>
            <a href="#" id="subm" name="subm">Submit</a>
            <input type="reset" value="지우기" />
    </form>
	</div>	
	
	
	</body>
</html>