<%@ LANGUAGE="Jscript" %>
<!-- #include file="../../include/jwheader-js.asp" -->
<%Patt=0;%>
<!--#include file="../../Include/Security.INC"-->
<%}%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>JMSS</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" type="text/css" href="../../include/jmss.css">
<script src="../../include/functions.js"></script>
</head>
<%
	modef=0;
	result=0;
	strParam = "";
	jwbmenv = Server.CreateObject("JWBMEnv.Env.1");
	if (Request("mode") == "machine")
	{ //XV
		strParam="/m /s:"+Request("jobMachineName")+" /u M:"+Request("jobMachineMulti")+" ";
		jwbmenv.EnvqSet(strParam,4,jsrvDef);
		if(jwbmenv.resultCode){result=1;
%>
<script>
          alert("o^ł܂B");
</script>
<%		}
	}
	else if (Request("mode") == "machineadd")
	{ //ǉ
		modef=1;
		//Default Job Queue Create
//		strParam="/q /s:"+Request("jobMachineName")+" /j:0 /n open M:100 P:8 C:5 T:1 ";

//		jwbmenv.EnvqSet(strParam,9,jsrvDef);
//		if(jwbmenv.resultCode){result=1;
%>
<script>
//        alert("o^ł܂B");
</script>
<%//		}
		//Machine Create
		strParam="/m /s:"+Request("jobMachineName")+" /n M:"+Request("jobMachineMulti")+" ";
		jwbmenv.EnvqSet(strParam,4,jsrvDef);
		if(jwbmenv.resultCode){result=1;
%>
<script>
          alert("ǉł܂B");
</script>
<%		}
		else {
%>
<script>
//        alert("ǉ܂B");
</script>
<%		}
	}
	else if (Request("mode") == "machinedel")
	{ //폜
		modef=2;
		strParam="/m /s:"+Request("jobMachineName")+" /x ";
		jwbmenv.EnvqSet(strParam,3,jsrvDef);
		if(jwbmenv.resultCode){result=1;
%>
<script>
          alert("폜ł܂B");
</script>
<%		}
	}
	else if (Request("mode") == "jobqueue")
	{ //XV
        QSecSvr = Request("qsecJmssSv");
		modef=3;
		Pcnt=8;
		strParam="/q /s:"+Request("jobQueueName");
		if(Request("R1")==0) {
			strParam += " /t:0";   //[U
        }
		else {
			strParam += " /t:1";   //O[v
        }
		Pcnt++;
		strParam += " /V:" + QSecSvr;
		Pcnt++;
		if(Request("belongUser").Count){
			strParam += " /U:";
			for(i=0;i<Request("belongUser").Count;i++){
       			strbelong = Request("belongUser")(i+1);
                // " "̌" ""?"ɕϊ
				for (;;) {
					if(strbelong.match(" ")) {
	       			    strbelong = strbelong.replace(" ","?");
                    }
                    else {
                        break;
                    }
				}
       			strParam += strbelong;
				strParam += "|";
			}
			Pcnt++;
		}
		if(Request("relMachines").Count){
			strParam += " /M:";
			for(i=0;i<Request("relMachines").Count;i++){
       			strParam += Request("relMachines")(i+1);
				strParam += "|";
			}
			Pcnt++;
		}
		if(Request("jobQueueStatus")==0)
			strParam +=" /u open";
		else
			strParam +=" /u close";
		strParam += " M:"+Request("jobQueueMulti")+" P:"+Request("jobQueuePriority")+" C:"+Request("jobQueueRetryCount")+" T:"+Request("jobQueueRetryInterval")+" ";
%>
<script>
//alert("<%=strParam%>,<%=Pcnt%>");
</script>
<%
		jwbmenv.EnvqSet(strParam,Pcnt,jsrvDef);
		if(jwbmenv.resultCode){result=1;
%>
<script>
          alert("o^ł܂B");
</script>
<%		}
	}
	else if (Request("mode") == "jobqueueadd")
	{ //ǉ
		modef=4;
		strParam="/q /s:"+Request("jobQueueName")+" /j:1 /n ";
		strParam="/q /s:"+Request("jobQueueName")+" /V:"+Request("qsecJmssSv")+" /U:"+SUser+" /n ";
		if(Request("jobQueueStatus")==0)
			strParam +="open";
		else
			strParam +="close";
		strParam += " M:"+Request("jobQueueMulti")+" P:"+Request("jobQueuePriority")+" C:"+Request("jobQueueRetryCount")+" T:"+Request("jobQueueRetryInterval")+" ";
%>
<script>
//alert("<%=strParam%>");
</script>
<%
		jwbmenv.EnvqSet(strParam,10,jsrvDef);
		if(jwbmenv.resultCode){result=1;
%>
<script>
          alert("ǉł܂B");
</script>
<%		}
	}
	else if (Request("mode") == "jobqueuedel")
	{ //폜
		modef=5;
		strParam="/q /s:"+Request("jobQueueName")+" /x ";
%>
<script>
//alert("<%=strParam%>");
</script>
<%
		jwbmenv.EnvqSet(strParam,3,jsrvDef);
		if(jwbmenv.resultCode){result=1;
%>
<script>
          alert("폜ł܂B");
</script>
<%		}
	}
%>
<body class="data">

<!-- menu -->
<!--
<table border="0" width="100%" cellspacing="0" cellpadding="4">
  <tr>
    <td class="menu" width="100%">
      <table border="0">
        <tr>
          <td>
			<% switch (modef){ case 0:case 1:%>
            Wuғ}Vݒ 
		    <% break; case 2: %>
            Wuғ}V폜 
		    <% break; case 3:case 4: %>
            WuL[ݒ 
		    <% break; case 5: %>
            WuL[폜 
			<% break;} %>
          </td>
          <td><a href="default.asp">WuL[ݒ֖߂B</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
-->

<!-- main -->
<table border="0" width="100%" cellspacing="0" cellpadding="4">
  <tr>
    <td valign="top" bgcolor="white">
		<% switch (modef){ case 0:case 1: if(result==0){ %>
      <p>Wuғ}Vo^܂B</p>
		<% }else{ %>
      <p>Wuғ}Vo^ł܂łB</p>
		<% } %>
      <table border="0">
        <tr>
          <td nowrap>}V</td>
          <td nowrap><%= Request("jobMachineName") %></td>
        </tr>
        <tr>
          <td nowrap>}Vdx</td>
          <td nowrap><%= Request("jobMachineMulti") %></td>
        </tr>
      </table>
		<% break; case 2: if(result==0){ %>
      <p>Wuғ}V폜܂B</p>
		<% }else{ %>
      <p>Wuғ}V폜ł܂łB</p>
		<% } %>
      <table border="0">
        <tr>
          <td nowrap>}V</td>
          <td nowrap><%= Request("jobMachineName") %></td>
        </tr>
      </table>
		<% break; case 3:case 4: if(result==0){ %>
      <p>WuL[o^܂B</p>
		<% }else{ %>
      <p>WuL[o^ł܂łB</p>
		<% } %>
      <table border="0">
        <tr>
          <td nowrap>WuL[</td>
          <td nowrap><%= Request("jobQueueName") %></td>
        </tr>
        <tr>
          <td nowrap></td>
<%if (Request("jobQueueStatus")==0){ %>
          <td nowrap>J</td>
<% }else{ %>
          <td nowrap></td>
<% } %>
        </tr>
        <tr>
          <td nowrap>WuL[dx</td>
          <td nowrap><%= Request("jobQueueMulti") %></td>
        </tr>
        <tr>
          <td nowrap>WuL[Dx</td>
          <td nowrap><%= Request("jobQueuePriority") %></td>
        </tr>
        <tr>
          <td nowrap>gC</td>
          <td nowrap><%= Request("jobQueueRetryCount") %></td>
        </tr>
        <tr>
          <td nowrap>gCԊu</td>
          <td nowrap><%= Request("jobQueueRetryInterval") %></td>
        </tr>
<%if (modef==3){ %>
<!--User Info-->
        <tr>
          <td nowrap>T[o</td>
          <td nowrap><%=Request("qsecJmssSv") %></td>
        </tr>
        <tr>
<% if(Request("R1")==0){ %>
          <td nowrap>[U</td>
<% } else { %>
          <td nowrap>O[v</td>
<% }
   if(Request("belongUser").Count) {
		for(i=0;i<Request("belongUser").Count;i++){ 
			if(i!=0)
			Response.Write("</tr><tr><td>          </td>");
%>
          <td nowrap><%= Request("belongUser")(i+1) %></td>
<%      }
   } else { %>
          <td nowrap>Ȃ</td>
<% } %>
        </tr>
<!--Machine Info-->
        <tr>
          <td nowrap>֘A}V</td>
<%	if(Request("relMachines").Count){
		for(i=0;i<Request("relMachines").Count;i++){
			if(i!=0)
			Response.Write("</tr><tr><td>          </td>");
%>
          <td nowrap><%= Request("relMachines")(i+1) %></td>
<%		}
	}else{ %>
          <td nowrap>Ȃ</td>
<%	}} %>
        </tr>
<!--END-->
      </table>
		<% break; case 5: if(result==0){ %>
      <p>WuL[폜܂B</p>
		<% }else{ %>
      <p>WuL[폜ł܂łB</p>
		<% } %>
      <table border="0">
        <tr>
          <td nowrap>WuL[</td>
          <td nowrap><%= Request("jobQueueName") %></td>
        </tr>
      </table>
      <% } %>
      
    </td>
  </tr>
</table>

<P>
<table border="0" width="100%" cellspacing="0" cellpadding="4">
  <tr>
    <td width="100%">
      <table border="0">
        <tr>
          <td nowrap><a href="default.asp">WuL[ݒ֖߂B</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>
<%
//	Session.Abandon;
%>

</html>
