⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addprog.jsp

📁 HomePlayer is an extention of the FreePlayer software provided by the french internet provider Free
💻 JSP
字号:
<%@page contentType="text/html; charset=ISO-8859-15" pageEncoding="UTF-8"%>
<%@page import="org.homeplayer.util.*"%>
<%@page import="org.homeplayer.recorder.*"%>
<jsp:useBean id="hppc" class="org.homeplayer.web.HPPageContext" scope="request">
	<jsp:setProperty name="hppc" property="request" 		value="<%=request%>"/>
</jsp:useBean> 
<%
	String channel = WebUtil.getParam( request, "channel", "2" ) ;
	TVRecord record = null ;
	if( request.getParameter( "start") != null ) {
		String start = request.getParameter( "start") ;
		String stop  = request.getParameter( "stop") ;
		int type = new Integer(request.getParameter("typeEnreg")).intValue();
		record = TVRecord.makeRecord( channel, start, stop, type ) ;
		record.setTitle( request.getParameter( "title") ) ;
	} else {
		String day     = TVRecord.format(WebUtil.getParam( request, "day", 0 )) ;
		String month   = TVRecord.format(WebUtil.getParam( request, "month", 0 )) ;
		String year    = "20"+TVRecord.format(WebUtil.getParam( request, "year", 0 )) ;
		String hbeg    = TVRecord.format(WebUtil.getParam( request, "hbeg", 0 )) ;
		String mbeg    = TVRecord.format(WebUtil.getParam( request, "mbeg", 0 )) ;
		String hend    = TVRecord.format(WebUtil.getParam( request, "hend", 0 )) ;
		String mend    = TVRecord.format(WebUtil.getParam( request, "mend", 0 )) ;
		int type       = new Integer(WebUtil.getParam( request, "typeEnreg", 0)).intValue();
		
		int heureDebut = (new Integer(hbeg)).intValue();
		int heureFin   = (new Integer(hend)).intValue();
		String dayEnd  = day;
		if(heureFin<heureDebut) {
			int jourDebut = (new Integer(day)).intValue()+1;
			dayEnd = TVRecord.format(jourDebut);
		}
		
		record = TVRecord.makeRecord( channel, year+month+day+hbeg+mbeg, year+month+dayEnd+hend+mend, type ) ;
		record.setTitle( record.getChannel() + " - " + record.getStart() + "-" + record.getStop() ) ;
	}
	if( RecorderManager.shareInstance().canAddRecord(record) ) {
		RecorderManager.shareInstance().addRecord( record ) ;
		try {
			RecorderManager.shareInstance().save();
		} catch (Exception e) {
			System.out.println("Impossible to save the records");
		}
	} else {
		System.out.println("The record could not be added");
	}
	hppc.setRefresh("record.jsp");
%>
<jsp:include page="/WEB-INF/jsp/empty.jsp"/>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -