code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
package util;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
public class chinese extends HttpServlet implements Filter {
public void doFilter(ServletRequest re, ServletResponse rs,
FilterChain fc) throws IOException, ServletException {
re.setCharacterEncoding("utf-8");
fc.doFilter(re, rs);
}
public void init(FilterConfig fc) throws ServletException {
fc.getInitParameter("encoding");
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
}
| zzprojects | trunk/zzprojects/zzClub/src/util/chinese.java | Java | asf20 | 837 |
package util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
public class ComUtil {
//获取用户真实的IP地址
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
return ip;
}
/**
* 获取N天日�?
* @return
*/
public static List getDateList(Integer dateNum) {
List dateList = new ArrayList();
Map dateMap;
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd�?");
SimpleDateFormat sdfHasTime = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
Calendar c = Calendar.getInstance();
c.setTime(date);
String nowDate = sdf.format(date);
String nowDateVale = sdfHasTime.format(date);
dateMap = new HashMap();
dateMap.put("dateValue", nowDateVale);
dateMap.put("dateFormat", nowDate);
dateList.add(dateMap);
for (int i = 0; i < dateNum -1 ; i++) {
dateMap = new HashMap();
c.add(Calendar.DAY_OF_MONTH, 1);
Date aa = c.getTime();
String roomDateVale = sdfHasTime.format(aa);
String roomDate = sdf.format(aa);
dateMap.put("dateValue", roomDateVale);
dateMap.put("dateFormat", roomDate);
dateList.add(dateMap);
}
return dateList;
}
/**
* 获取N天以后的日期
* @return
*/
public static String getAfterDaysDate(String dateStr, Integer dateNum,
String dateFormat) {
SimpleDateFormat strToDate = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
Date date = null;
try {
date = strToDate.parse(dateStr);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DAY_OF_MONTH, dateNum );
date = c.getTime();
String roomDateVale = sdf.format(date);
return roomDateVale;
}
/**
* 获取N天以后的日期
* @return
*/
public static String getAfterHoursDate(String dateStr, Integer hour,
String dateFormat) {
SimpleDateFormat strToDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
Date date = null;
try {
date = strToDate.parse(dateStr);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.HOUR_OF_DAY, hour);
date = c.getTime();
String roomDateVale = sdf.format(date);
return roomDateVale;
}
public static String getFmtDate(String dateStr) {
String speakDated = dateStr.substring(0, 10);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd�?");
SimpleDateFormat sdfa = new SimpleDateFormat("yyyy-MM-dd");
Date goDate = null;
try {
goDate = sdfa.parse(speakDated);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String goDateStr = sdf.format(goDate);
return goDateStr;
}
public static String getFmtDateTM(String dateStr) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd�? HH时mm�?");
SimpleDateFormat sdfa = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date goDate = null;
try {
goDate = sdfa.parse(dateStr);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String goDateStr = sdf.format(goDate);
return goDateStr;
}
public static String getDateToStr(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String goDateStr = sdf.format(date);
return goDateStr;
}
/**
* get the kind format of date
* @param flag
* @return
*/
public static String getNowDate(Integer flag) {
Date date = new Date();
String nowDate = null;
switch (flag) {
case 1:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
nowDate = sdf.format(date);
break;
case 2:
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd�?");
nowDate = sdf1.format(date);
break;
case 3:
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd�? HH时mm�?");
nowDate = sdf2.format(date);
break;
default:
break;
}
return nowDate;
}
public static String getResourceId(String kind) {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String resourceId = kind + sdf.format(date);
return resourceId;
}
public static String getResourceName(String kind) {
String resourceName = null;
if (kind.equals("rm")) {
resourceName = "房间";
} else if (kind.equals("dnrm")) {
resourceName = "包房";
} else if (kind.equals("dntb")) {
resourceName = "餐桌";
}
return resourceName;
}
public static Date getNowDate() {
Date date = new Date();
String nowDate = null;
Date nowTime = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
nowDate = sdf.format(date);
try {
nowTime = sdf.parse(nowDate);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return nowTime;
}
public static Date getFmtDateTMM(String dateStr) {
SimpleDateFormat sdfa = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date goDate = null;
try {
goDate = sdfa.parse(dateStr);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return goDate;
}
public static String getNo() {
Calendar cal = Calendar.getInstance();
// 此处取年后产生的随机数的冲突几率会比较大。所以考虑用别的代替
String v_strDate = String.valueOf(cal.get(Calendar.YEAR));
int v_intMonth = cal.get(Calendar.MONTH) + 1;
int v_intDAY = cal.get(Calendar.DAY_OF_MONTH);
int v_intHOUR = cal.get(Calendar.HOUR_OF_DAY);
int v_intMINUTE = cal.get(Calendar.MINUTE);
int v_intSECOND = cal.get(Calendar.SECOND);
if (v_intMonth < 10) {
v_strDate = v_strDate + "0" + v_intMonth;
} else {
v_strDate = v_strDate + v_intMonth;
}
if (v_intDAY < 10) {
v_strDate = v_strDate + "0" + v_intDAY;
} else {
v_strDate = v_strDate + v_intDAY;
}
if (v_intHOUR < 10) {
v_strDate = v_strDate + "0" + v_intHOUR;
} else {
v_strDate = v_strDate + v_intHOUR;
}
if (v_intMINUTE < 10) {
v_strDate = v_strDate + "0" + v_intMINUTE;
} else {
v_strDate = v_strDate + v_intMINUTE;
}
if (v_intSECOND < 10) {
v_strDate = v_strDate + "0" + v_intSECOND;
} else {
v_strDate = v_strDate + v_intSECOND;
}
return v_strDate;
}
public static String getShortNo() {
double d = Math.random();
String temp = Double.toString(d);
int t = temp.indexOf(".");
temp = temp.substring(t + 1, t + 9);
String s = getNo().substring(0, 8) + temp;
return s;
}
public static void main(String args[]) {
ComUtil aa = new ComUtil();
String bb = aa.getAfterHoursDate("2009-01-04 13:00:00", 3,
"yyyy-MM-dd HH:mm:ss");
// List bb = aa.getDateList(7);
// for(int i=0;i<bb.size();i++) {
// Map cc = (Map)bb.get(i);
// System.out.println(cc.get("dateValue"));
// System.out.println(cc.get("dateFormat"));
// }
}
}
| zzprojects | trunk/zzprojects/zzClub/src/util/ComUtil.java | Java | asf20 | 7,927 |
package util;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class EntityManagerHelper {
private static final EntityManagerFactory emf;
private static final ThreadLocal<EntityManager> threadLocal;
static {
emf = Persistence.createEntityManagerFactory("student");
threadLocal = new ThreadLocal<EntityManager>();
}
public static EntityManager getEntityManager() {
EntityManager manager = threadLocal.get();
if (manager == null || !manager.isOpen()) {
manager = emf.createEntityManager();
threadLocal.set(manager);
}
return manager;
}
public static void closeEntityManager() {
EntityManager em = threadLocal.get();
threadLocal.set(null);
if (em != null)
em.close();
}
public static void beginTransaction() {
getEntityManager().getTransaction().begin();
}
public void commit() {
getEntityManager().getTransaction().commit();
}
public static void createQuery(String query) {
getEntityManager().createQuery(query);
}
}
| zzprojects | trunk/zzprojects/zzClub/src/util/EntityManagerHelper.java | Java | asf20 | 1,100 |
package util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Vector;
import org.apache.log4j.Logger;
public class FileUtil {
private static Logger logger = Logger.getLogger(FileUtil.class);
public FileUtil() {
}
/**
*
*/
public static boolean writeFile(String fileContent, String targetFile,
String encode, boolean append) {
Writer stdOut = null;
FileOutputStream fout = null;
OutputStreamWriter oout = null;
File file = null;
try {
System.out.println("存放文本开始");
file = new File(targetFile);
file.getParentFile().mkdirs();
fout = new FileOutputStream(file, append);
oout = new OutputStreamWriter(fout, encode);
stdOut = new BufferedWriter(oout);
stdOut.write(fileContent);
System.out.println("存入文本结束");
} catch (IOException e) {
logger.error(e);
return false;
} finally {
try {
if (stdOut != null) {
stdOut.close();
stdOut = null;
}
if (oout != null) {
oout.close();
oout = null;
}
if (fout != null) {
fout.close();
fout = null;
}
if (file != null) {
file = null;
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
return true;
}
/**
*/
public static boolean writeFileByLine(String fileContent,
String targetFile, String encode, boolean append) {
Writer stdOut = null;
FileOutputStream fout = null;
OutputStreamWriter oout = null;
File file = null;
try {
file = new File(targetFile);
file.getParentFile().mkdirs();
fout = new FileOutputStream(file, append);
oout = new OutputStreamWriter(fout, encode);
stdOut = new BufferedWriter(oout);
stdOut.write(fileContent + "\r\n");
} catch (IOException e) {
logger.error(e);
return false;
} finally {
try {
if (stdOut != null) {
stdOut.close();
stdOut = null;
}
if (oout != null) {
oout.close();
oout = null;
}
if (fout != null) {
fout.close();
fout = null;
}
if (file != null) {
file = null;
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
return true;
}
/**
* @param bytes
* @param targetFilel
* @return
*/
public static boolean writeFile(byte[] bytes, String targetFile) {
FileOutputStream fout = null;
BufferedOutputStream os = null;
try {
fout = new FileOutputStream(targetFile);
os = new BufferedOutputStream(fout);
os.write(bytes);
} catch (FileNotFoundException e) {
logger.error(e);
return false;
} catch (IOException e) {
logger.error(e);
return false;
}
return true;
}
/**
* @param bytes
* @param targetFilel
* @return
*/
public static boolean writeUTF8File(byte[] bytes, String oldEncode,
String targetFile) {
String context;
boolean isSuccess = false;
try {
context = new String(bytes, oldEncode);
isSuccess = writeFile(context, targetFile, "UTF-8", false);
} catch (UnsupportedEncodingException e) {
logger.error(e);
}
return isSuccess;
}
/**
* @param in
* @param targetFile
*/
public static void writeFile(InputStream in, String targetFile) {
FileOutputStream fout = null;
BufferedOutputStream os = null;
try {
fout = new FileOutputStream(targetFile);
os = new BufferedOutputStream(fout);
int b = 0;
while ((b = in.read()) != -1) {
os.write(b);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (os != null) {
os.close();
os = null;
}
if (fout != null) {
fout.close();
fout = null;
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
}
/**
*
* @param fileName
* @return
*/
public static byte[] readFile(String fileName) {
try {
BufferedInputStream in = new BufferedInputStream(
new FileInputStream(fileName));
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int ch;
while ((ch = in.read()) != -1)
buffer.write(ch);
return buffer.toByteArray();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* @param romatefilename
*/
public String readRomateFile(String romatefilename) {
URL urlfile;
BufferedReader in;
String content = "";
String inputLine;
try {
urlfile = new URL(romatefilename);
in = new BufferedReader(new InputStreamReader(urlfile.openStream()));
inputLine = in.readLine();
while (inputLine != null) {
content += inputLine;
inputLine = in.readLine();
}
System.out.println(content);
in.close();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return content;
}
/**
*
* @param fileName
* @return
*/
public static byte[] readFile(File file) {
try {
BufferedInputStream in = new BufferedInputStream(
new FileInputStream(file));
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int ch;
while ((ch = in.read()) != -1)
buffer.write(ch);
return buffer.toByteArray();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
public static Vector getFileList(String path) {
File file = new File(path);
Vector fileList = new Vector();
File[] tmp = file.listFiles();
for (int i = 0; i < tmp.length; i++) {
if (tmp[i].isFile()) {
fileList.add(tmp[i]);
} else if (tmp[i].isDirectory()) {
fileList.addAll(getFileList(tmp[i].getAbsolutePath()));
}
}
return fileList;
}
public static String LoadContentByInputStream(InputStream is) {
String content = "";
try {
String s1 = new String();
BufferedReader bufferedreader = new BufferedReader(
new InputStreamReader(is, "utf-8"));
while ((s1 = bufferedreader.readLine()) != null) {
content += s1;
}
bufferedreader.close();
} catch (IOException e) {
e.printStackTrace();
}
return content;
}
public static String transformUTF(String str) {
try {
if ((str == null) || str.equals("")) {
return "";
}
byte[] temp = str.getBytes("GBK");
str = new String(temp, "UTF-8");
return str;
} catch (Exception e) {
return "";
}
}
public static String[] getFileNameBySuffix(String dirPath,
final String suffix) {
File f = new File(dirPath);
String[] fileName = f.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
if (name.endsWith(suffix)) {
return true;
}
return false;
}
});
return fileName;
}
public static void main(String[] args) {
String path = "F:\\rss\\70";
Vector list = FileUtil.getFileList(path);
for (int i = 0; i < list.size(); i++) {
File file = (File) list.get(i);
System.out.println(file.getAbsolutePath());
}
}
}
| zzprojects | trunk/zzprojects/zzClub/src/util/FileUtil.java | Java | asf20 | 7,652 |
package security;
public class Base64
{
private static char Base64Code[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '+', '/'
};
private static byte Base64Decode[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 62, -1, 63, -1, 63, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, -1, -1,
-1, 0, -1, -1, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, -1, -1, -1, -1, -1, -1, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, -1, -1, -1, -1, -1
};
private Base64()
{
}
public static String encode(byte b[])
{
int code = 0;
StringBuffer sb = new StringBuffer((b.length - 1) / 3 << 6);
for (int i = 0; i < b.length; i++)
{
code |= b[i] << 16 - (i % 3) * 8 & 255 << 16 - (i % 3) * 8;
if (i % 3 == 2 || i == b.length - 1)
{
sb.append(Base64Code[(code & 0xfc0000) >>> 18]);
sb.append(Base64Code[(code & 0x3f000) >>> 12]);
sb.append(Base64Code[(code & 0xfc0) >>> 6]);
sb.append(Base64Code[code & 0x3f]);
code = 0;
}
}
if (b.length % 3 > 0)
sb.setCharAt(sb.length() - 1, '=');
if (b.length % 3 == 1)
sb.setCharAt(sb.length() - 2, '=');
return sb.toString();
}
public static byte[] decode(String code)
{
if (code == null)
return null;
int len = code.length();
if (len % 4 != 0)
throw new IllegalArgumentException("Base64 string length must be 4*n");
if (code.length() == 0)
return new byte[0];
int pad = 0;
if (code.charAt(len - 1) == '=')
pad++;
if (code.charAt(len - 2) == '=')
pad++;
int retLen = (len / 4) * 3 - pad;
byte ret[] = new byte[retLen];
for (int i = 0; i < len; i += 4)
{
int j = (i / 4) * 3;
char ch1 = code.charAt(i);
char ch2 = code.charAt(i + 1);
char ch3 = code.charAt(i + 2);
char ch4 = code.charAt(i + 3);
int tmp = Base64Decode[ch1] << 18 | Base64Decode[ch2] << 12 | Base64Decode[ch3] << 6 | Base64Decode[ch4];
ret[j] = (byte)((tmp & 0xff0000) >> 16);
if (i < len - 4)
{
ret[j + 1] = (byte)((tmp & 0xff00) >> 8);
ret[j + 2] = (byte)(tmp & 0xff);
} else
{
if (j + 1 < retLen)
ret[j + 1] = (byte)((tmp & 0xff00) >> 8);
if (j + 2 < retLen)
ret[j + 2] = (byte)(tmp & 0xff);
}
}
return ret;
}
}
| zzprojects | trunk/zzprojects/zzClub/src/security/Base64.java | Java | asf20 | 2,836 |
package security;
/**
* MD5 算法的Java Bean
*/
/**
* md5 类实现了RSA Data Security, Inc.在提交给IETF 的RFC1321中的MD5 message-digest 算法。
*/
public final class MD5 {
//~ Static fields/initializers =============================================
/* 下面这些S11-S44实际上是一个4*4的矩阵,在原始的C实现中是用#define 实现的,
这里把它们实现成为static final是表示了只读,切能在同一个进程空间内的多个
Instance间共享*/
/** DOCUMENT ME! */
private static final int S11 = 7;
/** DOCUMENT ME! */
private static final int S12 = 12;
/** DOCUMENT ME! */
private static final int S13 = 17;
/** DOCUMENT ME! */
private static final int S14 = 22;
/** DOCUMENT ME! */
private static final int S21 = 5;
/** DOCUMENT ME! */
private static final int S22 = 9;
/** DOCUMENT ME! */
private static final int S23 = 14;
/** DOCUMENT ME! */
private static final int S24 = 20;
/** DOCUMENT ME! */
private static final int S31 = 4;
/** DOCUMENT ME! */
private static final int S32 = 11;
/** DOCUMENT ME! */
private static final int S33 = 16;
/** DOCUMENT ME! */
private static final int S34 = 23;
/** DOCUMENT ME! */
private static final int S41 = 6;
/** DOCUMENT ME! */
private static final int S42 = 10;
/** DOCUMENT ME! */
private static final int S43 = 15;
/** DOCUMENT ME! */
private static final int S44 = 21;
/** DOCUMENT ME! */
private static final byte[] PADDING = {
-128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
//~ Instance fields ========================================================
/* digestHexStr是MD5的唯一一个公共成员,是最新一次计算结果的
16进制ASCII表示.
*/
/** DOCUMENT ME! */
private String digestHexStr;
// number of bits, modulo 2^64 (lsb first)
/** DOCUMENT ME! */
private byte[] buffer = new byte[64]; // input buffer
/** DOCUMENT ME! */
private long[] count = new long[2];
/* digest,是最新一次计算结果的2进制内部表示,表示128bit的MD5值.
*/
/** DOCUMENT ME! */
private byte[] digest = new byte[16];
/* 下面的三个成员是MD5计算过程中用到的3个核心数据,在原始的C实现中
被定义到MD5_CTX结构中
*/
/** DOCUMENT ME! */
private long[] state = new long[4]; // state (ABCD)
//~ Constructors ===========================================================
// 这是MD5这个类的标准构造函数,JavaBean要求有一个public的并且没有参数的构造函数
public MD5() {
md5Init();
return;
}
//~ Methods ================================================================
/**
* DOCUMENT ME!
*
* @param source DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static String toMD5(String source) {
MD5 md5 = new MD5();
return md5.getMD5ofStr(source);
}
/*
getMD5ofStr是类MD5最主要的公共方法,入口参数是你想要进行MD5变换的字符串
返回的是变换完的结果,这个结果是从公共成员digestHexStr取得的.
*/
private String getMD5ofStr(String inbuf) {
md5Init();
md5Update(inbuf.getBytes(), inbuf.length());
md5Final();
digestHexStr = "";
for (int i = 0; i < 16; i++) {
digestHexStr += byteHEX(digest[i]);
}
return digestHexStr;
}
/*Decode把byte数组按顺序合成成long数组,因为java的long类型是64bit的,
只合成低32bit,高32bit清零,以适应原始C实现的用途
*/
private void Decode(long[] output, byte[] input, int len) {
int i;
int j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[i] = b2iu(input[j]) | (b2iu(input[j + 1]) << 8)
| (b2iu(input[j + 2]) << 16) | (b2iu(input[j + 3]) << 24);
}
return;
}
/*Encode把long数组按顺序拆成byte数组,因为java的long类型是64bit的,
只拆低32bit,以适应原始C实现的用途
*/
private void Encode(byte[] output, long[] input, int len) {
int i;
int j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (byte) (input[i] & 0xffL);
output[j + 1] = (byte) ((input[i] >>> 8) & 0xffL);
output[j + 2] = (byte) ((input[i] >>> 16) & 0xffL);
output[j + 3] = (byte) ((input[i] >>> 24) & 0xffL);
}
}
/* F, G, H ,I 是4个基本的MD5函数,在原始的MD5的C实现中,由于它们是
简单的位运算,可能出于效率的考虑把它们实现成了宏,在java中,我们把它们
实现成了private方法,名字保持了原来C中的。 */
private long F(long x, long y, long z) {
return (x & y) | ((~x) & z);
}
/*
FF,GG,HH和II将调用F,G,H,I进行近一步变换
FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
Rotation is separate from addition to prevent recomputation.
*/
private long FF(long a, long b, long c, long d, long x, long s, long ac) {
a += (F(b, c, d) + x + ac);
a = ((int) a << s) | ((int) a >>> (32 - s));
a += b;
return a;
}
/**
* DOCUMENT ME!
*
* @param x DOCUMENT ME!
* @param y DOCUMENT ME!
* @param z DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
private long G(long x, long y, long z) {
return (x & z) | (y & (~z));
}
/**
* DOCUMENT ME!
*
* @param a DOCUMENT ME!
* @param b DOCUMENT ME!
* @param c DOCUMENT ME!
* @param d DOCUMENT ME!
* @param x DOCUMENT ME!
* @param s DOCUMENT ME!
* @param ac DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
private long GG(long a, long b, long c, long d, long x, long s, long ac) {
a += (G(b, c, d) + x + ac);
a = ((int) a << s) | ((int) a >>> (32 - s));
a += b;
return a;
}
/**
* DOCUMENT ME!
*
* @param x DOCUMENT ME!
* @param y DOCUMENT ME!
* @param z DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
private long H(long x, long y, long z) {
return x ^ y ^ z;
}
/**
* DOCUMENT ME!
*
* @param a DOCUMENT ME!
* @param b DOCUMENT ME!
* @param c DOCUMENT ME!
* @param d DOCUMENT ME!
* @param x DOCUMENT ME!
* @param s DOCUMENT ME!
* @param ac DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
private long HH(long a, long b, long c, long d, long x, long s, long ac) {
a += (H(b, c, d) + x + ac);
a = ((int) a << s) | ((int) a >>> (32 - s));
a += b;
return a;
}
/**
* DOCUMENT ME!
*
* @param x DOCUMENT ME!
* @param y DOCUMENT ME!
* @param z DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
private long I(long x, long y, long z) {
return y ^ (x | (~z));
}
/**
* DOCUMENT ME!
*
* @param a DOCUMENT ME!
* @param b DOCUMENT ME!
* @param c DOCUMENT ME!
* @param d DOCUMENT ME!
* @param x DOCUMENT ME!
* @param s DOCUMENT ME!
* @param ac DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
private long II(long a, long b, long c, long d, long x, long s, long ac) {
a += (I(b, c, d) + x + ac);
a = ((int) a << s) | ((int) a >>> (32 - s));
a += b;
return a;
}
/*
b2iu是我写的一个把byte按照不考虑正负号的原则的"升位"程序,因为java没有unsigned运算
*/
private static long b2iu(byte b) {
return (b < 0) ? (b & (0x7F + 128)) : b;
}
/*byteHEX(),用来把一个byte类型的数转换成十六进制的ASCII表示,
因为java中的byte的toString无法实现这一点,我们又没有C语言中的
sprintf(outbuf,"%02X",ib)
*/
private static String byteHEX(byte ib) {
char[] Digit = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',
'D', 'E', 'F'
};
char[] ob = new char[2];
ob[0] = Digit[(ib >>> 4) & 0X0F];
ob[1] = Digit[ib & 0X0F];
String s = new String(ob);
return s;
}
/*
md5Final整理和填写输出结果
*/
private void md5Final() {
byte[] bits = new byte[8];
int index;
int padLen;
///* Save number of bits */
Encode(bits, count, 8);
///* Pad out to 56 mod 64.
index = (int) (count[0] >>> 3) & 0x3f;
padLen = (index < 56) ? (56 - index) : (120 - index);
md5Update(PADDING, padLen);
///* Append length (before padding) */
md5Update(bits, 8);
///* Store state in digest */
Encode(digest, state, 16);
}
/* md5Init是一个初始化函数,初始化核心变量,装入标准的幻数 */
private void md5Init() {
count[0] = 0L;
count[1] = 0L;
///* Load magic initialization constants.
state[0] = 0x67452301L;
state[1] = 0xefcdab89L;
state[2] = 0x98badcfeL;
state[3] = 0x10325476L;
return;
}
/* md5Memcpy是一个内部使用的byte数组的块拷贝函数,从input的inpos开始把len长度的
字节拷贝到output的outpos位置开始
*/
private void md5Memcpy(byte[] output, byte[] input, int outpos, int inpos,
int len) {
int i;
for (i = 0; i < len; i++) {
output[outpos + i] = input[inpos + i];
}
}
/*
md5Transform是MD5核心变换程序,有md5Update调用,block是分块的原始字节
*/
private void md5Transform(byte[] block) {
long a = state[0];
long b = state[1];
long c = state[2];
long d = state[3];
long[] x = new long[16];
Decode(x, block, 64);
/* Round 1 */
a = FF(a, b, c, d, x[0], S11, 0xd76aa478L); /* 1 */
d = FF(d, a, b, c, x[1], S12, 0xe8c7b756L); /* 2 */
c = FF(c, d, a, b, x[2], S13, 0x242070dbL); /* 3 */
b = FF(b, c, d, a, x[3], S14, 0xc1bdceeeL); /* 4 */
a = FF(a, b, c, d, x[4], S11, 0xf57c0fafL); /* 5 */
d = FF(d, a, b, c, x[5], S12, 0x4787c62aL); /* 6 */
c = FF(c, d, a, b, x[6], S13, 0xa8304613L); /* 7 */
b = FF(b, c, d, a, x[7], S14, 0xfd469501L); /* 8 */
a = FF(a, b, c, d, x[8], S11, 0x698098d8L); /* 9 */
d = FF(d, a, b, c, x[9], S12, 0x8b44f7afL); /* 10 */
c = FF(c, d, a, b, x[10], S13, 0xffff5bb1L); /* 11 */
b = FF(b, c, d, a, x[11], S14, 0x895cd7beL); /* 12 */
a = FF(a, b, c, d, x[12], S11, 0x6b901122L); /* 13 */
d = FF(d, a, b, c, x[13], S12, 0xfd987193L); /* 14 */
c = FF(c, d, a, b, x[14], S13, 0xa679438eL); /* 15 */
b = FF(b, c, d, a, x[15], S14, 0x49b40821L); /* 16 */
/* Round 2 */
a = GG(a, b, c, d, x[1], S21, 0xf61e2562L); /* 17 */
d = GG(d, a, b, c, x[6], S22, 0xc040b340L); /* 18 */
c = GG(c, d, a, b, x[11], S23, 0x265e5a51L); /* 19 */
b = GG(b, c, d, a, x[0], S24, 0xe9b6c7aaL); /* 20 */
a = GG(a, b, c, d, x[5], S21, 0xd62f105dL); /* 21 */
d = GG(d, a, b, c, x[10], S22, 0x2441453L); /* 22 */
c = GG(c, d, a, b, x[15], S23, 0xd8a1e681L); /* 23 */
b = GG(b, c, d, a, x[4], S24, 0xe7d3fbc8L); /* 24 */
a = GG(a, b, c, d, x[9], S21, 0x21e1cde6L); /* 25 */
d = GG(d, a, b, c, x[14], S22, 0xc33707d6L); /* 26 */
c = GG(c, d, a, b, x[3], S23, 0xf4d50d87L); /* 27 */
b = GG(b, c, d, a, x[8], S24, 0x455a14edL); /* 28 */
a = GG(a, b, c, d, x[13], S21, 0xa9e3e905L); /* 29 */
d = GG(d, a, b, c, x[2], S22, 0xfcefa3f8L); /* 30 */
c = GG(c, d, a, b, x[7], S23, 0x676f02d9L); /* 31 */
b = GG(b, c, d, a, x[12], S24, 0x8d2a4c8aL); /* 32 */
/* Round 3 */
a = HH(a, b, c, d, x[5], S31, 0xfffa3942L); /* 33 */
d = HH(d, a, b, c, x[8], S32, 0x8771f681L); /* 34 */
c = HH(c, d, a, b, x[11], S33, 0x6d9d6122L); /* 35 */
b = HH(b, c, d, a, x[14], S34, 0xfde5380cL); /* 36 */
a = HH(a, b, c, d, x[1], S31, 0xa4beea44L); /* 37 */
d = HH(d, a, b, c, x[4], S32, 0x4bdecfa9L); /* 38 */
c = HH(c, d, a, b, x[7], S33, 0xf6bb4b60L); /* 39 */
b = HH(b, c, d, a, x[10], S34, 0xbebfbc70L); /* 40 */
a = HH(a, b, c, d, x[13], S31, 0x289b7ec6L); /* 41 */
d = HH(d, a, b, c, x[0], S32, 0xeaa127faL); /* 42 */
c = HH(c, d, a, b, x[3], S33, 0xd4ef3085L); /* 43 */
b = HH(b, c, d, a, x[6], S34, 0x4881d05L); /* 44 */
a = HH(a, b, c, d, x[9], S31, 0xd9d4d039L); /* 45 */
d = HH(d, a, b, c, x[12], S32, 0xe6db99e5L); /* 46 */
c = HH(c, d, a, b, x[15], S33, 0x1fa27cf8L); /* 47 */
b = HH(b, c, d, a, x[2], S34, 0xc4ac5665L); /* 48 */
/* Round 4 */
a = II(a, b, c, d, x[0], S41, 0xf4292244L); /* 49 */
d = II(d, a, b, c, x[7], S42, 0x432aff97L); /* 50 */
c = II(c, d, a, b, x[14], S43, 0xab9423a7L); /* 51 */
b = II(b, c, d, a, x[5], S44, 0xfc93a039L); /* 52 */
a = II(a, b, c, d, x[12], S41, 0x655b59c3L); /* 53 */
d = II(d, a, b, c, x[3], S42, 0x8f0ccc92L); /* 54 */
c = II(c, d, a, b, x[10], S43, 0xffeff47dL); /* 55 */
b = II(b, c, d, a, x[1], S44, 0x85845dd1L); /* 56 */
a = II(a, b, c, d, x[8], S41, 0x6fa87e4fL); /* 57 */
d = II(d, a, b, c, x[15], S42, 0xfe2ce6e0L); /* 58 */
c = II(c, d, a, b, x[6], S43, 0xa3014314L); /* 59 */
b = II(b, c, d, a, x[13], S44, 0x4e0811a1L); /* 60 */
a = II(a, b, c, d, x[4], S41, 0xf7537e82L); /* 61 */
d = II(d, a, b, c, x[11], S42, 0xbd3af235L); /* 62 */
c = II(c, d, a, b, x[2], S43, 0x2ad7d2bbL); /* 63 */
b = II(b, c, d, a, x[9], S44, 0xeb86d391L); /* 64 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
}
/*
md5Update是MD5的主计算过程,inbuf是要变换的字节串,inputlen是长度,这个
函数由getMD5ofStr调用,调用之前需要调用md5init,因此把它设计成private的
*/
private void md5Update(byte[] inbuf, int inputLen) {
int i;
int index;
int partLen;
byte[] block = new byte[64];
index = (int) (count[0] >>> 3) & 0x3F;
// /* Update number of bits */
if ((count[0] += (inputLen << 3)) < (inputLen << 3)) {
count[1]++;
}
count[1] += (inputLen >>> 29);
partLen = 64 - index;
// Transform as many times as possible.
if (inputLen >= partLen) {
md5Memcpy(buffer, inbuf, index, 0, partLen);
md5Transform(buffer);
for (i = partLen; (i + 63) < inputLen; i += 64) {
md5Memcpy(block, inbuf, 0, i, 64);
md5Transform(block);
}
index = 0;
} else {
i = 0;
}
///* Buffer remaining input */
md5Memcpy(buffer, inbuf, index, i, inputLen - i);
}
}
| zzprojects | trunk/zzprojects/zzClub/src/security/MD5.java | Java | asf20 | 16,122 |
package security;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
/**
*AES security
*/
public class AES {
public static String keys="sdjnhhxkjyxgsthisisvsktiantianhappy";
/**
* AES加密算法
*/
public AES() {
}
/**
* 加密
* @param content 需要加密的内容
* @param keyWord 加密密钥
* @return byte[] 加密后的字节数组
*/
public static byte[] encrypt(String content, String keyWord) {
try {
KeyGenerator kgen = KeyGenerator.getInstance("AES");
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG" );
secureRandom.setSeed(keyWord.getBytes());
kgen.init(128,secureRandom);
SecretKey secretKey = kgen.generateKey();
byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");// 创建密码器
byte[] byteContent = content.getBytes("utf-8");
cipher.init(Cipher.ENCRYPT_MODE, key);// 初始化
byte[] result = cipher.doFinal(byteContent);
return result; // 加密
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
}
return null;
}
/**
* @param content 需要加密的内容
* @param password 加密密钥
* @return String 加密后的字符串
*/
public static String encrypttoStr(String content, String password){
return parseByte2HexStr(encrypt(content,password));
}
/**解密
* @param content 待解密内容
* @param keyWord 解密密钥
* @return byte[]
*/
public static byte[] decrypt(byte[] content, String keyWord) {
try {
KeyGenerator kgen = KeyGenerator.getInstance("AES");
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG" );
secureRandom.setSeed(keyWord.getBytes());
kgen.init(128,secureRandom);
SecretKey secretKey = kgen.generateKey();
byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");// 创建密码器
cipher.init(Cipher.DECRYPT_MODE, key);// 初始化
byte[] result = cipher.doFinal(content);
return result; // 加密
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
}
return null;
}
/**
* @param content 待解密内容(字符串)
* @param keyWord 解密密钥
* @return byte[]
*/
public static byte[] decrypt(String content, String keyWord) {
return decrypt(parseHexStr2Byte(content),keyWord);
}
/**将二进制转换成16进制
* @param buf
* @return String
*/
public static String parseByte2HexStr(byte buf[]) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < buf.length; i++) {
String hex = Integer.toHexString(buf[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}
/**将16进制转换为二进制
* @param hexStr
* @return byte[]
*/
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1)
return null;
byte[] result = new byte[hexStr.length()/2];
for (int i = 0;i< hexStr.length()/2; i++) {
int high = Integer.parseInt(hexStr.substring(i*2, i*2+1), 16);
int low = Integer.parseInt(hexStr.substring(i*2+1, i*2+2), 16);
result[i] = (byte) (high * 16 + low);
}
return result;
}
public static void main(String[] args) {
String content = "guest";
String Key = keys;
//加密
System.out.println("加密前:" + content);
String encryptResult = encrypttoStr(content, Key);
System.out.println("加密后:" + encryptResult);
//解密
byte[] decryptResult = decrypt(encryptResult,Key);
System.out.println("解密后:" + new String(decryptResult));
}//end main
}//end class
| zzprojects | trunk/zzprojects/zzClub/src/security/AES.java | Java | asf20 | 5,739 |
<%@ page language="java" import="java.util.*,util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.bean.*,com.UserModule.dao.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<%
TbUserBean tbUser=(TbUserBean)session.getAttribute("User");
String inFormName=request.getParameter("inFormName");
String tabIndex=request.getParameter("tabIndex");
String tiaojian=" userId="+tbUser.getUserId();
List<TbCommonPhrase> SelectSmsTemplateList =new ArrayList();;
TbSmsTemplateDAO smstemplate=new TbSmsTemplateDAO();
SelectSmsTemplateList=smstemplate.getTbCommonPhraseAll("tb_CommonPhrase", tiaojian, "createTime");
request.getSession().setAttribute("SelectSmsTemplateList",SelectSmsTemplateList);
if(request.getParameter("s")!=null)
SelectSmsTemplateList=(ArrayList) session.getAttribute("SelectSmsTemplateList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
SelectSmsTemplateList=(ArrayList) session.getAttribute("SelectSmsTemplateList");
currentPage=Integer.parseInt(request.getParameter("Page"));
}
%>
<body>
<form action="" method="post" id="formthis" name="formthis" >
<table width="95%" class="datalist" id="tbTCP" >
<thead>
<tr>
<td width="10%" class="tc">
请选择
</td>
<td width="90%" class="tc">
短语内容
</td>
</tr>
</thead>
<%
if(SelectSmsTemplateList!=null){
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
SelectSmsTemplateList=mPage.getInitPage(SelectSmsTemplateList,currentPage,10);
if (SelectSmsTemplateList != null && SelectSmsTemplateList.size() > 0) {
for(int index=0;index<SelectSmsTemplateList.size();index++)
{
TbCommonPhrase tcp=SelectSmsTemplateList.get(index);
out.print("<tr><td class='tc'> <input type='radio' name='radioCommonPhrase' value='"+tcp.getPhraseContent()+"' /></td>");
out.print("<td>"+tcp.getPhraseContent()+"</td></tr>");
}
}
%>
<tr>
<td colspan="2" class="tc">
<%=mPage.printCtrl("./SmsModule/SelectSmsTemplate.jsp",currentPage,"&inFormName="+inFormName+"&tabIndex="+tabIndex) %>
</td>
</tr>
<tr>
<%} %>
<td colspan="2" class="tc">
<input type="button" id="butsub" name="butsub" value="选择" onclick="checkformSM('<%=inFormName %>',<%=tabIndex %>)"/>
</td>
</tr>
</table>
</form>
</body>
</html> | zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SelectSmsTemplate.jsp | Java Server Pages | asf20 | 2,764 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<%
if(session.getAttribute("mp")!=null){
%>
<script type="text/javascript">
function ckSMSCode() {
if(trims(form1.smsCode.value)=="")
{
alertmess("验证码不能为空");
return false;
}
return true;
}
</script>
<div id="loginer">
<div id="loginbox">
<form name="form1" id="form1" method="post" action="TbUsersServlet" onsubmit="return ckSMSCode();">
<input type="hidden" name="method" value="checksmscode">
<table class="form">
<tr>
<td>
请输入验证码:
<input type="text" name="smsCode" id="smsCode" >
<input type="submit" value="提交" />
<input type="button" value="重新登陆" onclick="window.location='../UserModule/Login.jsp';" />
</td>
</tr>
</table>
</form>
<script type="text/javascript">
form1.smsCode.focus();
</script>
</div>
</div>
<%
}
%>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsCheckCode.jsp | Java Server Pages | asf20 | 1,106 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(request.getParameter("smsSendStyle")!=null)
{
%>
<aside id="aside">
<ul>
<li><a href="TbSmsServlet?method=look" class="nm11 <% if ("11".equals(request.getParameter("smsSendStyle"))){out.print(" current");} else out.print(""); %>">短信发送</a></li>
<li><a href="TbSmsServlet?method=smsSend&startTime=&endTime=&phone=&content=" class="nm13 <% if ("13".equals(request.getParameter("smsSendStyle"))){out.print(" current");} else out.print(""); %>">短信发件箱</a></li>
<li><a href="TbSmsServlet?method=smsSendRece&startTime=&endTime=&phone=&content=" class="nm14 <% if ("14".equals(request.getParameter("smsSendStyle"))){out.print(" current");} else out.print(""); %>">短信收件箱</a></li>
<li><a href="TbSmsServlet?method=smsUpload&startTime=&endTime=&phone=&content=" class="nm15 <% if ("15".equals(request.getParameter("smsSendStyle"))){out.print(" current");} else out.print(""); %>">分拣信息</a></li>
</ul>
</aside>
<%
}
%>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/leftSms.jsp | Java Server Pages | asf20 | 1,204 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.dati.bean.*,com.dianbo.bean.*" %>
<%
List<DianboType> dianboTypeList = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
List<DatiType> datiTypeList = (ArrayList<DatiType>)session.getAttribute("datiTypeList");
String sendPhone = session.getAttribute("sendPhone").toString();
String startTime = session.getAttribute("startTime").toString();
String endTime = session.getAttribute("endTime").toString();
String content = session.getAttribute("content").toString();
String oldPhone = session.getAttribute("oldPhone").toString();
String smsId = request.getParameter("smsId");
String smsType = request.getParameter("smsType");
String totalJifen = request.getParameter("totalJifen");
System.out.println("smsType==="+smsType);
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<ul class="tabs-nav clearfix">
<li>短信分拣</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="form">
<%
if(smsType.equals("0")){
%>
<tr style="display:block" id="dianbo">
<td><table>
<tr>
<th scope="row">手机号码 </th><td>
<input type="text" name="dianboPhone" id="dianboPhone" value="<%=sendPhone%>" readonly="readonly"/>
</td></tr>
<tr>
<th scope="row">当前积分 </th><td>
<input type="text" name="" id="" value="<%=totalJifen %>" readonly="readonly"/><font color="red">分</font>
</td></tr>
<tr><td colspan="2"><input type="radio" name="addJifen" id="addJifen" onclick="selectJifenType('0')" value="0" checked="checked"/>自动加分
<input type="radio" name="addJifen" id="addJifen" onclick="selectJifenType('1')" value="1"/>手动加分</td></tr>
<tr><th scope="row">类型</th><td>
<select id="dianboId" onChange="selectDianbo(dianboId.value)">
<option value="0">选择分拣类型</option>
<%
if(dianboTypeList!=null&&dianboTypeList.size()>0){
for(DianboType dianbo:dianboTypeList){
%>
<option value="<%=dianbo.getTypeId() %>"><%=dianbo.getTypeName() %></option>
<%
}
}
%>
</select>
<input type="hidden" name="dianbo_Type" id="dianbo_Type" value="0"/>
</td>
</tr>
<tr style="display:block" id="0"><th scope="row">自动加分</th><td> <input type="text" readonly="readonly" name="dianboValue" id="dianboValue" value=""/></td></td></tr>
<tr style="display:none" id="1"><th scope="row">手动加分</th><td> <input type="text" name="newDianboValue" id="newDianboValue" value=""/></td></td></tr>
</table></td>
</tr>
<%
}else if(smsType.equals("1")){
%>
<tr style="display:block" id="dati">
<td><table><tr>
<th scope="row">手机号码 </th><td>
<input type="text" name="datiPhone" id="datiPhone" value="<%=sendPhone%>" readonly="readonly"/>
</td></tr>
<tr>
<th scope="row">当前积分 </th><td>
<input type="text" name="" id="" value="<%=totalJifen %>" readonly="readonly"/><font color="red">分</font>
</td></tr>
<tr><td colspan="2"><input type="radio" name="addJifen" id="addJifen" onclick="selectJifenType('0')" value="0" checked="checked"/>自动加分
<input type="radio" name="addJifen" id="addJifen" onclick="selectJifenType('1')" value="1"/>手动加分</td></tr>
<tr><th scope="row">类型</th><td>
<select id="datiId" onChange="selectDati(datiId.value)">
<option value="0">请选择类型</option>
<%
if(datiTypeList!=null&&datiTypeList.size()>0){
for(DatiType datiType:datiTypeList){
%>
<option value="<%=datiType.getAnswerTypeId() %>"><%=datiType.getTypeName() %></option>
<%
}
}
%>
</select>
<input type="hidden" name="dati_Type" id="dati_Type" value="0">
</td></tr>
<tr style="display:none" id="xilie"><th scope="row">系列</th><td><div id="xilieList"></div>
</td></tr>
<tr style="display:block" id="0"><th scope="row">自动加分</th><td> <input type="text" readonly="readonly" name="datiValue" id="datiValue" value=""/></td></td></tr>
<tr style="display:none" id="1"><th scope="row">手动加分</th><td> <input type="text" name="newDatiValue" id="newDatiValue" value=""/></td></td></tr>
</table></td>
</tr>
<%
}
%>
<tr><td class="tl"><div align="center">
<input type="button" value="确定" onClick="fenjiansubmit('../TbSmsServlet?method=fenjianSubmit&smsId=<%=smsId %>&startTime=<%=startTime %>&endTime=<%=endTime %>&content=<%=content %>&phone=<%=sendPhone %>&oldPhone=<%=oldPhone %>');"/>
<input type="button" value="关闭" onClick="form1.msg.close();"/>
<input type="hidden" name="dianboOrDati" id="dianboOrDati" value="<%=smsType %>"/>
</div></td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/fenjianSms.jsp | Java Server Pages | asf20 | 7,672 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*"%>
<%@ page import="util.*" %>
<%
String startTime = session.getAttribute("startTime").toString();
System.out.println("startTime==" + startTime);
String endTime = session.getAttribute("endTime").toString();
String content=session.getAttribute("content").toString();
String phone=session.getAttribute("phone").toString();
List<TbSmsSend> SmsSendList = (ArrayList) session.getAttribute("SmsSendList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsContentList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="leftSms.jsp">
<jsp:param name="smsSendStyle" value="13" /></jsp:include>
<section id="container">
<div id="crumbs">
短信管理 » 短信发件箱
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
短信发件箱
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("resultSM").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("resultSM");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="7" class="tl">
开始时间
<input type="text" id="startTime" size="25" name="startTime" class="Wdate" value="<%=startTime%>" readonly onclick="WdatePicker({el:'startTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间
<input type="text" id="endTime" size="25" name="endTime" class="Wdate" value="<%=endTime%>" readonly onclick="WdatePicker({el:'endTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
短信内容
<input type="text" id="content" name="content" value="<%=content %>" />
发送号码
<input type="text" id="phone" name="phone" maxlength="11" value="<%=phone %>" />
<input type="button" value="查询" onclick="searcherSM('../TbSmsServlet?method=look&looksms=1')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../TbSmsServlet?method=deleteAll&looksms=1&startTime=<%=startTime%>&endTime=<%=endTime%>&content=<%=content %>&phone=<%=phone %>')" />
<input type="button" value="导出" onclick="window.location='../upload/export3.xls'" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
短信内容
</td>
<td>
发送时间
</td>
<td>
发送人
</td>
<td>
发送状态
</td>
<td>
操作
</td>
</tr>
</thead>
<%
int i=0;
//--------------分页
//--excel start
if(SmsSendList!=null)
{
String[][] exportArray=new String[SmsSendList.size()+1][3];
exportArray[0][0]="短信内容";
exportArray[0][1]="(定时)发送时间";
exportArray[0][2]="发送人";
for(int rowIndex=1;rowIndex<SmsSendList.size()+1;rowIndex++)
{
TbSmsSend ts=SmsSendList.get(rowIndex-1);
exportArray[rowIndex][0]=""+ts.getSmsContent();
exportArray[rowIndex][1]=""+ts.getSendTime().substring(0,19);
exportArray[rowIndex][2]=""+ts.getDestAdd();
}
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);
//---excel end
MyPagination mPages=new MyPagination();
SmsSendList=mPages.getInitPage(SmsSendList,currentPage,10);
if (SmsSendList != null && SmsSendList.size() > 0){
for (TbSmsSend smsSendBean : SmsSendList){
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=smsSendBean.getSmsId() %>"/>
</td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
});
</script>
<td><%=((10*(currentPage-1))+i) %></td>
<td><a id="demo-basic<%=i%>" title="<%=smsSendBean.getSmsContent() %>" href="#"><%=new UtilDAO().sub_String(smsSendBean.getSmsContent()) %></a></td>
<td><%=smsSendBean.getSendTime().substring(0,19)%></td>
<td><%=smsSendBean.getDestAdd()%></td>
<td>
<%
if(smsSendBean.getSmsSendState()==0){//未发送
%>
未发送
<%
}else if(smsSendBean.getSmsSendState()==1){//发送成功
%>
发送成功
<%
}else{//发送失败
%>
发送失败
<%
}
%>
</td>
<td class="tc">
<a title="删除该短信" class="duanyu_del" style="cursor:hand"
onClick="deleteOneSM('../TbSmsServlet?method=deleteOne&looksms=1&smsId=<%=smsSendBean.getSmsId() %>')" >
删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPages.printCtrl("SmsModule/SmsSendList.jsp",currentPage,"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone) %>
<%
}else{
String[][] exportArray=new String[1][3];
exportArray[0][0]="短信内容";
exportArray[0][1]="(定时)发送时间";
exportArray[0][2]="发送人";
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);
}
%>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsSendList.jsp | Java Server Pages | asf20 | 6,986 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*"%>
<%@ page import="util.*" %>
<%
String startTime = session.getAttribute("startTime").toString();
System.out.println("sta页面rtTime==" + startTime);
String endTime = session.getAttribute("endTime").toString();
String content=session.getAttribute("content").toString();
String phone=session.getAttribute("phone").toString();
List<TbSmsReceive> SmsReceiveList = (ArrayList) session.getAttribute("receiveList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsContentList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="leftSms.jsp">
<jsp:param name="smsSendStyle" value="14" /></jsp:include>
<section id="container">
<div id="crumbs">
短信管理 » 短信收件箱
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
短信收件箱
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="8" class="tl">
开始时间
<input type="text" id="startTime" size="25" name="startTime" class="Wdate" value="<%=startTime%>" readonly="readonly" onclick="WdatePicker({el:'startTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间
<input type="text" id="endTime" size="25" name="endTime" class="Wdate" value="<%=endTime%>" readonly="readonly" onclick="WdatePicker({el:'endTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
短信内容
<input type="text" id="content" name="content" value="<%=content %>" />
发送号码
<input type="text" id="phone" name="phone" maxlength="11" value="<%=phone %>" />
<input type="button" value="查询" onclick="searcherSM('../TbSmsServlet?method=searchRec')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../TbSmsServlet?method=deleteAllRec&looksms=2&startTime=<%=startTime%>&endTime=<%=endTime%>&content=<%=content %>&phone=<%=phone %>')" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
短信内容
</td>
<td>
接收时间
</td>
<td>
手机号码
</td>
<td>
操作
</td>
</tr>
</thead>
<%
if(SmsReceiveList!=null)
{
//---excel end
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
SmsReceiveList=mPage.getInitPage(SmsReceiveList,currentPage,10);
if (SmsReceiveList != null && SmsReceiveList.size() > 0) {
for (TbSmsReceive smsReceiveBean : SmsReceiveList) {
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=smsReceiveBean.getReceiveId()%>"/>
</td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
})
</script>
<td><%=((10*(currentPage-1))+i) %></td>
<td><a id="demo-basic<%=i%>" title="<%=smsReceiveBean.getReceiveContent()%>" href="#"><%=new UtilDAO().sub_String(smsReceiveBean.getReceiveContent())%></a></td>
<td><%=smsReceiveBean.getReceiveTime().substring(0,19)%></td>
<td><%=smsReceiveBean.getSendPhone() %></td>
<td class="tc">
<a title="删除该短信" class="duanyu_del" style="cursor:hand" onClick="deleteOneSM('../TbSmsServlet?method=deleteOneRec&smsId=<%=smsReceiveBean.getReceiveId() %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("SmsModule/SmsReceiveList.jsp",currentPage,"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone) %>
<%
}
%>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsReceiveList.jsp | Java Server Pages | asf20 | 5,088 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*"%>
<%@ page import="util.*" %>
<%
String startTime = session.getAttribute("startTime").toString();
String endTime = session.getAttribute("endTime").toString();
String content=session.getAttribute("content").toString();
String phone=session.getAttribute("phone").toString();
System.out.println("startTime---"+startTime+"endTime==="+endTime);
List<TbSmsSend> SmsSendList = (ArrayList) session.getAttribute("smsSendList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsContentList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="leftSms.jsp">
<jsp:param name="smsSendStyle" value="13" /></jsp:include>
<section id="container">
<div id="crumbs">
短信管理 » 短信发件箱
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
短信发件箱
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="7" class="tl">
开始时间
<input type="text" id="startTime" size="25" name="startTime" class="Wdate" value="<%=startTime%>" readonly="readonly" onclick="WdatePicker({el:'startTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间
<input type="text" id="endTime" size="25" name="endTime" class="Wdate" value="<%=endTime%>" readonly="readonly" onclick="WdatePicker({el:'endTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
短信内容
<input type="text" id="content" name="content" value="<%=content %>" />
发送号码
<input type="text" id="phone" name="phone" maxlength="11" value="<%=phone %>" />
<input type="button" value="查询" onclick="searcherSM('../TbSmsServlet?method=search')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../TbSmsServlet?method=deleteAll&startTime=<%=startTime%>&endTime=<%=endTime%>&content=<%=content %>&phone=<%=phone %>')" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
短信内容
</td>
<td>
发送时间
</td>
<td>
接收人
</td>
<td>
发送状态
</td>
<td>
操作
</td>
</tr>
</thead>
<%
int i=0;
//--------------分页
//--excel start
if(SmsSendList!=null)
{
//---excel end
MyPagination mPages=new MyPagination();
SmsSendList=mPages.getInitPage(SmsSendList,currentPage,10);
if (SmsSendList != null && SmsSendList.size() > 0){
for (TbSmsSend smsSendBean : SmsSendList){
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=smsSendBean.getSmsId() %>"/>
</td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
});
</script>
<td><%=((10*(currentPage-1))+i) %></td>
<td><a id="demo-basic<%=i%>" title="<%=smsSendBean.getSmsContent() %>" href="#"><%=new UtilDAO().sub_String(smsSendBean.getSmsContent()) %></a></td>
<td><%=smsSendBean.getSendTime()%></td>
<td><%=smsSendBean.getDestAdd()%></td>
<td>
<%
if(smsSendBean.getSmsSendState()==0){//未发送
%>
未发送
<%
}else if(smsSendBean.getSmsSendState()==1){//发送成功
%>
发送成功
<%
}else{//发送失败
%>
发送失败
<%
}
%>
</td>
<td class="tc">
<%
if(smsSendBean.getSmsSendState()>1){
%>
<a title="重发短信" class="duanyu_edit" style="cursor:hand" onclick="confirmmess('你确定重发吗?','../TbSmsServlet?method=sendAgin&smsId=<%=smsSendBean.getSmsId() %>')">重发</a>
<%
}
%>
<a title="删除该短信" class="duanyu_del" style="cursor:hand"
onClick="deleteOneSM('../TbSmsServlet?method=deleteOne&smsId=<%=smsSendBean.getSmsId() %>')" >
删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPages.printCtrl("SmsModule/SmsList.jsp",currentPage,"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone) %>
<%
}
%>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsList.jsp | Java Server Pages | asf20 | 5,730 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<!-- 你们要修改 start -->
<aside id="aside">
<ul>
<li><a href="#" class="nm11 current">短信发送</a></li>
<li><a href="#" class="nm12">短信审核</a></li>
<li><a href="13.html" class="nm13">短信发件箱</a></li>
<li><a href="13.html" class="nm14">短信收件箱<em>(13)</em></a></li>
<li><a href="13.html" class="nm15">垃圾箱</a></li>
</ul>
</aside>
<!-- 你们要修改 end -->
<section id="container">
<div id="crumbs">
短信管理 » 短信发送
</div>
<input type="text" />
<input type="button" value="按钮" />
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>选项1</li>
<li>选项2</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="$('input[name=id]').attr('checked',$(this).attr('checked'));" />
</td>
<td class="tc">列1</td>
</tr>
</thead>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="$('input[name=id]').attr('checked',$(this).attr('checked'));" />
</td>
<td class="tc"> 列1内容b</td>
</tr>
</table>
</div>
<div class="tabs-panel">
内容2
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html> | zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/template.jsp | Java Server Pages | asf20 | 2,347 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*,com.dati.dao.*,com.dianbo.dao.*,com.dati.bean.*,com.dianbo.bean.*"%>
<%@ page import="util.*" %>
<%
String startTime = session.getAttribute("startTime").toString();
String endTime = session.getAttribute("endTime").toString();
System.out.println("endTime==" + endTime);
String content=session.getAttribute("content").toString();
String phone=session.getAttribute("phone").toString();
List<TbSmsSc> SmsReceiveList = (ArrayList) session.getAttribute("receiveList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsContentList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="leftSms.jsp">
<jsp:param name="smsSendStyle" value="15" /></jsp:include>
<section id="container">
<div id="crumbs">
短信管理 » 上传短信
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
上传短信
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="9" class="tl">
开始时间
<input type="text" id="startTime" size="25" name="startTime" class="Wdate" value="<%=startTime%>" readonly="readonly" onclick="WdatePicker({el:'startTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间
<input type="text" id="endTime" size="25" name="endTime" class="Wdate" value="<%=endTime%>" readonly="readonly" onclick="WdatePicker({el:'endTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
短信内容
<input type="text" id="content" name="content" value="<%=content %>" />
发送号码
<input type="text" id="phone" name="phone" maxlength="11" value="<%=phone %>" />
<input type="button" value="查询" onclick="searcherSM('../TbSmsServlet?method=searchRecSc')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../TbSmsServlet?method=deleteAllRecSc&looksms=2&startTime=<%=startTime%>&endTime=<%=endTime%>&content=<%=content %>&phone=<%=phone %>')" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
短信内容
</td>
<td>
接收时间
</td>
<td>
手机号码
</td>
<td>
类型
</td>
<td>
现属类型
</td>
<td>
分拣
</td>
<td>
操作
</td>
</tr>
</thead>
<%
if(SmsReceiveList!=null)
{
//---excel end
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
SmsReceiveList=mPage.getInitPage(SmsReceiveList,currentPage,10);
if (SmsReceiveList != null && SmsReceiveList.size() > 0) {
for (TbSmsSc smsReceiveBean : SmsReceiveList) {
i++;
int smsType = smsReceiveBean.getSmsType();
String smsTypeName = "";
String smsTypeNameT="";//已经分拣后的类型
if(smsType==-1){
smsTypeName="未分拣";
}else if(smsType==0){
smsTypeName="点播";
String condition="receiveId="+smsReceiveBean.getSmsId();
List<Dianbo>dianboList = new DianboDao().getDianboList("tb_qs_info","",condition);
String dianboTypeCondition="";
try{
dianboTypeCondition="typeId='"+dianboList.get(0).getTypeId()+"'";
}catch(Exception ex){
}
List<DianboType>dianboTypeList = new DianboTypeDao().getDianboList("tb_qsType_answer",dianboTypeCondition,"");
smsTypeNameT = dianboTypeList.get(0).getTypeName();
}else if(smsType==1){
smsTypeName="答题";
String condition="receiveId="+smsReceiveBean.getSmsId();
List<Answer> answerList = new DatiDao().getAnswerList("tb_answer","",condition);
if(answerList!=null&&answerList.size()>0){
String middleCondition = "answerMiddleId='"+answerList.get(0).getAnswerMiddleId()+"'";
List<DatiMiddle> middleList = new DatiDao().getDatiMiddle("tb_answer_middle","",middleCondition);
if(middleList!=null&&middleList.size()>0){
String seriseCondition = "seriseId='"+middleList.get(0).getSeriseId()+"'";
List<Xulie> xilieList = new DatiTypeDao().getXulieByTypeId("tb_serise","",seriseCondition);
if(xilieList!=null&&xilieList.size()>0){
String typeCondition="answerTypeId='"+xilieList.get(0).getAnswerTypeId()+"'";
List<DatiType> datiType= new DatiTypeDao().getAllDaTiType("tb_answer_type","",typeCondition);
if(datiType!=null&&datiType.size()>0){
smsTypeNameT = datiType.get(0).getTypeName();
}
}
}
}
}
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=smsReceiveBean.getSmsId()%>"/>
</td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
})
</script>
<td><%=((10*(currentPage-1))+i) %></td>
<td><a id="demo-basic<%=i%>" title="<%=smsReceiveBean.getSmscontent()%>" href="#"><%=new UtilDAO().sub_String(smsReceiveBean.getSmscontent())%></a></td>
<td><%=smsReceiveBean.getCreateTime()%></td>
<td><%=smsReceiveBean.getSendPhone() %></td>
<td><%=smsTypeName %></td>
<td><%=smsTypeNameT %></td>
<td><a style="cursor:hand" onclick="fenjian('./TbSmsServlet?method=fenjian&smsId=<%=smsReceiveBean.getSmsId() %>&sendPhone=<%=smsReceiveBean.getSendPhone() %>&smsType=<%=smsReceiveBean.getSmsType() %>&endTime=<%=endTime %>&startTime=<%=startTime %>&content=<%=content %>&phone=<%=phone %>&num=<%=new Random().nextInt(10000000) %>')">分拣</a></td>
<td class="tc">
<a title="删除该短信" class="duanyu_del" style="cursor:hand" onClick="deleteOneSM('../TbSmsServlet?method=deleteOneRecSc&smsId=<%=smsReceiveBean.getSmsId() %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("SmsModule/SmsReceiveList.jsp",currentPage,"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone) %>
<%
}
%>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsSCList.jsp | Java Server Pages | asf20 | 7,864 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*"%>
<%@ page import="util.*" %>
<%
List<TbCommonPhrase> SmsTemplateList =new ArrayList();
if(request.getParameter("s")!=null)
SmsTemplateList=(ArrayList) session.getAttribute("SmsTemplateList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
SmsTemplateList=(ArrayList) session.getAttribute("SmsTemplateList");
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsTemplateList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="6" /></jsp:include>
<jsp:include page="leftSms.jsp">
<jsp:param name="smsSendStyle" value="11" /></jsp:include>
<section id="container">
<div id="crumbs">
常用短语 » 常用短语列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
常用短语列表
</li>
<li>
新增常用短语
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("resultSM").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("resultSM");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
短语内容
</td>
<td>
创建人
</td>
<td>
创建时间
</td>
<td>
操作
</td>
</tr>
</thead>
<%
if(SmsTemplateList!=null){
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
SmsTemplateList=mPage.getInitPage(SmsTemplateList,currentPage,10);
if (SmsTemplateList != null && SmsTemplateList.size() > 0) {
for (TbCommonPhrase tbCommonPhraseBean : SmsTemplateList) {
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=tbCommonPhraseBean.getPhraseId()%>"/>
</td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
})
</script>
<td><%=((10*(currentPage-1))+i) %></td>
<td><a id="demo-basic<%=i%>" title="<%=tbCommonPhraseBean.getPhraseContent()%>" href="#"><%=new UtilDAO().sub_String(tbCommonPhraseBean.getPhraseContent())%></a></td>
<td><%=(new TbUserDAO().getTbUsersByUserId(tbCommonPhraseBean.getUserId())).getUserName()%></td>
<td><%=tbCommonPhraseBean.getCreateTime().substring(0,19)%></td>
<td class="tc">
<a title="删除该记录" class="duanyu_del" style="cursor:hand" onClick="deleteOneSM('../TbSmsTemplateServlet?method=deleteOne&PhraseId=<%=tbCommonPhraseBean.getPhraseId() %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("SmsModule/SmsTemplate.jsp",currentPage) %>
<%}
%>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formtemplate" name="formtemplate" method="post">
<table width="100%" class="form">
<tr>
<th scope="row">常用短语:</th>
<td>
<textarea cols="80" rows="5" id="message" name="message" onmousemove="return checkoverflowSM(formtemplate,70)" onKeyUp="return checkoverflowSM(formtemplate,70)"></textarea>
<span>还剩<strong style="color:red;"><font color="#FF0000">
<input id="counterMsg" name="counterMsg" style="border:0;color:red;valign:center; background-color:#FFFFFF;background-image:url()" value="70" size="2" type='text' readonly></font></strong>字</span>
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="insertTemplateSM(formtemplate,'../TbSmsTemplateServlet?method=add')" value=" 提 交 " /></td>
</tr>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsTemplate.jsp | Java Server Pages | asf20 | 4,964 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page
import="com.AddressListModule.bean.*,com.AddressListModule.dao.*"%>
<%
StringBuffer sb = (StringBuffer)session.getAttribute("sb");
String selectPhone = request.getParameter("selectPhone");
String formName = request.getParameter("formName");
%>
<jsp:include page="../head.jsp"></jsp:include>
<script type="text/javascript">
$(document).ready(function(){
$('.treeview').treeview();
//$('.treeview li a').after('<span title="添加子节点" class="addnode"><a href="javascript:alert(1);">添加子节点</a></span><span title="编辑该节点" class="editnode"><a href="javascript:alert(2);">编辑该节点</a></span><span title="删除该节点" class="delnode"><a href="javascript:alert(3);">删除该节点</a></span>');
$('.treeview li span').hide();
$('.treeview li').hover(function(){
$(this).children('span').show();
},function(){
$(this).children('span').hide();
});
});
</script>
<script type="text/javascript">
function doClose(va){
eval("top.frmMessage.mb.close();");
}
function selectZhiwu(va){
document.getElementById("zhiwu").value=va;
}
function getV(va){
var inp = document.getElementsByTagName("select");
var str="";
var lastStr="";
if(inp.length>0){
for(var i = 0;i<inp.length-1;i++){
var oldValue=document.getElementById("box"+(i+1)).value
var newValue=inp[i].value;
if(va.id==(i+1)){
str+=inp[i].id+"/"+newValue+",";
}else{
str+=inp[i].id+"/"+oldValue+",";
}
}
lastStr=encodeURI(str);
lastStr=encodeURI(lastStr);
window.location="../AddressServlet?method=selectDir&formName=<%=formName%>&selectPhone=<%=selectPhone%>&lastStr="+lastStr;
}
}
</script>
</head>
<body>
<div id="sstc">
<ul class="tabs-nav clearfix">
<li>通讯录管理</li>
</ul>
<div class="tabs-panel">
<table class="datalist">
<tr>
<td>
<ul class="treeview" id="headerIndex">
<%=sb %>
</ul>
</td>
</tr>
</table>
</div>
<div align="center">
<input type="button" name="doSubmit" id="doSubmit" value="提交" onclick="do_Submit('<%=formName %>','<%=selectPhone %>');">
<input type="hidden" name="zhiwu" id="zhiwu" value=""/>
<input type="button" name="close" id="close" value="取消" onclick="doClose('<%=formName %>');">
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/selectDirectory.jsp | Java Server Pages | asf20 | 2,657 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*"%>
<%@ page import="util.*" %>
<%
String startTime = session.getAttribute("startTime").toString();
String endTime = session.getAttribute("endTime").toString();
String content=session.getAttribute("content").toString();
String shenhestatus=session.getAttribute("phone").toString();
List<TbSmsSendContent> SmsContentList = (ArrayList) session.getAttribute("SmsContentList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsContentList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="leftSms.jsp">
<jsp:param name="smsSendStyle" value="12" /></jsp:include>
<section id="container">
<div id="crumbs">
短信管理 » 短信审核列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
短信审核列表
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("resultSM").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("resultSM");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="9" class="tl">
开始时间
<input type="text" id="startTime" name="startTime" size="25" class="Wdate" value="<%=startTime %>" readonly onclick="WdatePicker({el:'startTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间
<input type="text" id="endTime" name="endTime" class="Wdate" size="25" value="<%=endTime%>" readonly onclick="WdatePicker({el:'endTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
短信内容
<input type="text" id="content" name="content" value="<%=content %>" />
审核状态
<select id="phone" name="phone">
<option value="-2">请选择...</option>
<option value="0"
<%
if("0".equals(shenhestatus)){
%>
selected="selected"
<%
}
%>
>未审核</option>
<option value="1" <%
if("1".equals(shenhestatus)){
%>
selected="selected"
<%
}
%>>审核通过</option>
<option value="2" <%
if("2".equals(shenhestatus)){
%>
selected="selected"
<%
}
%>>审核不通过</option>
</select>
<input type="button" value="查询" onclick="searcherSM('../TbSmsServlet?method=look&looksms=0')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../TbSmsServlet?method=deleteAll&looksms=0&startTime=<%=startTime%>&endTime=<%=endTime%>&content=<%=content %>&phone=<%=shenhestatus %>')" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
短信内容
</td>
<td>
发送时间
</td>
<td>
发送人
</td>
<td>
短信类型
</td>
<td>
审核状态
</td>
<td>
审核
</td>
<td>
删除
</td>
</tr>
</thead>
<%
if(SmsContentList!=null){
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
SmsContentList=mPage.getInitPage(SmsContentList,currentPage,10);
if (SmsContentList != null && SmsContentList.size() > 0) {
for (TbSmsSendContent smsSendContentBean : SmsContentList) {
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=smsSendContentBean.getSmsSendContentId() %>"/>
</td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
})
</script>
<td><%=((10*(currentPage-1))+i) %></td>
<td><a id="demo-basic<%=i%>" title="<%=smsSendContentBean.getSmsSendContent()%>" href="#"><%=new UtilDAO().sub_String(smsSendContentBean.getSmsSendContent())%></a></td>
<td><%=smsSendContentBean.getCreateTime().substring(0,19)%></td>
<td><%=(new TbUserDAO().getTbUsersByUserId(smsSendContentBean.getUserId())).getUserName()%></td>
<td><%=(new TbSendTypeDAO().getTbSendTypeByTypeId(smsSendContentBean.getTypeId())).getTypeName()%></td>
<td>
<%
if(smsSendContentBean.getReviewState()==0){
%>
未审核
<%
}else if(smsSendContentBean.getReviewState()==1){
%>
审核成功
<%
}else if(smsSendContentBean.getReviewState()==2)
{
%>
审核失败
<%
}
%>
</td>
<td class="tc">
<%
if(smsSendContentBean.getReviewState()==0){
%>
<a title="审核通过" class="duanyu_edit" style="cursor:hand" onClick="shenheSM('../TbSmsServlet?method=shenhe&isshenhe=1&looksms=0&smsId=<%=smsSendContentBean.getSmsSendContentId() %>')">审核通过</a>
<a title="审核不通过" class="duanyu_edit" style="cursor:hand" onClick="shenheSM('../TbSmsServlet?method=shenhe&isshenhe=2&looksms=0&smsId=<%=smsSendContentBean.getSmsSendContentId() %>')">审核不通过</a>
<%
}else{
%>
已经过审核
<%}
%>
</td>
<td>
<a title="删除该短信" class="duanyu_del" style="cursor:hand" onClick="deleteOneSM('../TbSmsServlet?method=deleteOne&looksms=0&smsId=<%=smsSendContentBean.getSmsSendContentId() %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("SmsModule/SmsContentList.jsp",currentPage,"&startTime="+startTime+"&endTime="+endTime+"&content="+content) %>
<%
}
%>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsContentList.jsp | Java Server Pages | asf20 | 7,047 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="leftSms.jsp"> <jsp:param name="smsSendStyle" value="11" /></jsp:include>
<section id="container">
<div id="crumbs">
短信管理 » 短信发送
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>普通短信</li>
<li>点点通</li>
</ul>
<div class="tabs-panel">
<form id="frmMessage" name="frmMessage" method="post">
<%
try{
String result = session.getAttribute("result").toString();
if(!result.equals("")){
out.println("<script>alertmess('"+result+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<table width="100%" class="form">
<tr>
<th scope="row">接收方:</th>
<td>
<input type="text" id="mobile" maxlength="11" name="mobile" value="" size="30" /> <input type="button" onclick="addNumberSM(7,frmMessage,'select1')" value="添加联系人" >
<input type="button" value="通讯录"
onclick="selectDirPhone(frmMessage,'frmMessage',select1)"/>
</td>
</tr>
<tr>
<th scope="row">接收人:</th>
<td>
<input type="hidden" id="txtArea" name="txtArea" value=""/>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select id="select1" name="select1" size="6" multiple="multiple" style="width:150px;">
</select><font color="#FF0000">*</font>
</td>
<td>
<input name="addGroupSelf" type="button" id="addGroupSelf2" class="from_button" onClick="deletePhone('select1')" value="删除联系人">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th scope="row">信息内容:</th>
<td>
<textarea cols="80" rows="5" id="message" name="message" onmousemove="return checkoverflowSM(frmMessage,300)" onKeyUp="return checkoverflowSM(frmMessage,300)"></textarea>
<span>还剩<strong style="color:red;"><font color="#FF0000">
<input id="counterMsg" name="counterMsg" style="border:0;color:red;valign:center; background-color:#FFFFFF;background-image:url()" value="300" size="2" type='text' readonly></font></strong>字</span>
<br>
<input type="button" onClick="frmMessage.mb=$.msgbox({
height:500,
width:700,
content:{type:'iframe',content:'SmsModule/SelectSmsTemplate.jsp?tabIndex=1&inFormName=frmMessage'},
title: '常用短语',
onClose: function(v){
frmMessage.message.value+=(frmMessage.mb.rtVl==undefined?'':frmMessage.mb.rtVl);
frmMessage.message.focus();
}
});" value="选择常用短语" />
</td>
</tr>
<tr>
<th scope="row">是否定时发送:</th>
<td>
<input type="radio" id="time" name="time" value="thistime" checked="checked" onclick="isReceveSM(frmMessage,true,'isReceve1');">否
<input type="radio" id="time" name="time" onclick="isReceveSM(frmMessage,false,'isReceve1');" value="time">是
</td>
</tr>
<tr id="isReceve1" style="display:none;">
<th scope="row">选择时间:</th>
<td>
<input type="text" id="sendTime" name="sendTime" class="Wdate" size="26" readonly="readonly" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="insertallSM(frmMessage)" value=" 提 交 " /></td>
</tr>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="fileForm" name="fileForm" enctype="multipart/form-data" method="post" action="./TbSmsServlet?method=upLoad"
onsubmit="return startStatusCheck();" >
<table width="100%" class="form">
<tr>
<td class="tc">xls导入模版:</td>
<td>
<a href="./module/qunfa.xls" >点击这里下载导入模板</a>
</td>
</tr>
<tr>
<th>文件名:</th>
<td style="width: 662px">
<input type="file" name="fileName" id="fileName" value=""/> <input type="button" onclick="upLoad()" value="发送" ><br/>
<p><img src="images/one-one.gif"> <img src="images/one-one-txt.gif"></p>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html> | zzprojects | trunk/zzprojects/zzClub/WebRoot/SmsModule/SmsSend.jsp | Java Server Pages | asf20 | 6,257 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(session.getAttribute("User")==null)
{
response.sendRedirect("UserModule/Login.jsp");
}else{
%>
<jsp:include page="head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="smsSendStyle" value="11" /></jsp:include>
<div id="pager">
<section id="container">
<div id="main">
<div class="tabs">
</div>
<div class="tabs-panel" align="center">
<font size="20">欢迎使用枣庄俱乐部信息化平台</font>
</div>
</div>
</section>
<jsp:include page="foot.jsp"></jsp:include>
</div>
</div>
</body>
</html>
<%} %>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/index.jsp | Java Server Pages | asf20 | 954 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*,com.dati.dao.*,com.dianbo.bean.*,com.dianbo.dao.*" %>
<%
String orderType = request.getParameter("orderType");
String formName= request.getParameter("formName");
List<DianboType> lastDianboTypeList = (ArrayList<DianboType>)session.getAttribute("lastDianboTypeList");
List<DatiType> lastDatiTypeList = (ArrayList<DatiType>)session.getAttribute("lastDatiTypeList");
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<ul class="tabs-nav clearfix">
<li>新增指令</li>
</ul>
<div class="tabs-panel">
<form action="">
<table width="100%" class="datalist" border="1">
<%
if(orderType.equals("0")){//点播
%>
<tr>
<td>类型:</td>
<td>
<select id="db" name="db" onchange="selectOrder(db.value)">
<option value="0">请选择</option>
<%
if(lastDianboTypeList!=null&&lastDianboTypeList.size()>0){
for(DianboType dianbo:lastDianboTypeList){
%>
<option value="<%=dianbo.getTypeId() %>"><%=dianbo.getTypeName() %></option>
<%
}
}
%>
</select>
</td>
</tr>
<%
}else if(orderType.equals("1")){//答题
%>
<tr>
<td>类型:</td>
<td>
<select id="dt" name="dt" onchange="selectOrder(dt.value)">
<option value="0">请选择</option>
<%
if(lastDatiTypeList!=null&&lastDatiTypeList.size()>0){
for(DatiType dati:lastDatiTypeList){
%>
<option value="<%=dati.getAnswerTypeId() %>"><%=dati.getTypeName() %></option>
<%
}
}
%>
</select>
</td>
</tr>
<%
}
%>
<tr>
<td class="t1">名称:</td><td><input type="text" name="orderName" id="orderName" value=""/>
<input type="hidden" name="orderType" id="orderType" value="<%=orderType %>"/>
<input type="hidden" name="typeId" id="typeId" value="0"/></td>
</tr>
<tr><td class="tc"><input type="button" value="确定" onclick="addOrder('../TbOrderServlet?method=addOrderSubmit');"/></td>
<td class="tc"><input type="button" value="关闭" onclick="<%=formName %>.mb.close();"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/addOrder.jsp | Java Server Pages | asf20 | 3,844 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dianbo.bean.*,com.dianbo.dao.*,com.UserModule.bean.*"%>
<%@ page import="util.*" %>
<%
List<Dianbo> dianboList =new ArrayList();
if(request.getParameter("s")!=null)
dianboList=(ArrayList) session.getAttribute("dianboList");
String content=session.getAttribute("content").toString();
String selectdianbotype=session.getAttribute("selectdianbotype").toString();
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
dianboList=(ArrayList) session.getAttribute("dianboList");
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsTemplateList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="2" /></jsp:include>
<jsp:include page="Left.jsp">
<jsp:param name="um" value="12" /></jsp:include>
<section id="container">
<div id="crumbs">
点播资源库 » 点播列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
点播列表
</li>
<li>
导入点播信息
</li>
<li>
新增点播信息
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("resultSM").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("resultSM");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="7" class="tl">
点播类型
<select id="dianbotype" name="dianbotype">
<option value="0">
请选择
</option>
<%
TbUserBean user = (TbUserBean)request.getSession().getAttribute("User");
List list = new AllTypeList().getLastValue(user.getUserId());
List<DianboType> dianboTypeList = (ArrayList<DianboType>)list.get(0);
if(dianboTypeList!=null&&dianboTypeList.size()>0){
for(int t=0;t<dianboTypeList.size();t++){
DianboType diaobotype=dianboTypeList.get(t);
%>
<option value="<%=diaobotype.getTypeId() %>"
<%
if(selectdianbotype.equals(diaobotype.getTypeId())){
%>
selected="selected"
<%}
%>
>
<%=diaobotype.getTypeName() %>
</option>
<%
} }
%>
</select>
内容
<input type="text" id="content" name="content" value="<%=content %>" />
<input type="button" value="查询" onclick="searcherByDianbo('../DianboServlet?method=looksearch')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../DianboServlet?method=deleteAll&content=<%=content %>&dianbotype=<%=selectdianbotype %>')" />
<input type="button" value="导出" onclick="window.location='../upload/export3.xls'" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td width="4%">
序号
</td>
<td width="6%">
点播类型
</td>
<td width="60%">
点播内容
</td>
<td width="10%">
上传号码
</td>
<td width="12%">
创建时间
</td>
<td width="8%">
操作
</td>
</tr>
</thead>
<%
if(dianboList!=null){
String[][] exportArray=new String[dianboList.size()+1][4];
exportArray[0][0]="点播类型";
exportArray[0][1]="点播内容";
exportArray[0][2]="上传号码";
exportArray[0][3]="创建时间";
for(int rowIndex=1;rowIndex<dianboList.size()+1;rowIndex++)
{
Dianbo db=dianboList.get(rowIndex-1);
exportArray[rowIndex][0]=""+new DianboTypeDao().getDianboType(db.getTypeId());
exportArray[rowIndex][1]=""+db.getQsContent();
if(db.getQsUpPhone()==null){
exportArray[rowIndex][2]="";
}else{
exportArray[rowIndex][2]=""+db.getQsUpPhone();
}
exportArray[rowIndex][3]=""+db.getQsUpTime().substring(0,19);
}
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
dianboList=mPage.getInitPage(dianboList,currentPage,10);
if (dianboList != null && dianboList.size() > 0) {
for (Dianbo dianboBean : dianboList) {
System.out.println(dianboBean.getTypeId()+"||"+dianboBean.getQsContent());
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=dianboBean.getQsInfoId()%>"/>
</td>
<td><%=((10*(currentPage-1))+i) %></td>
<td><%=new DianboTypeDao().getDianboType(dianboBean.getTypeId()).getTypeName()%></td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
})
</script>
<td><a id="demo-basic<%=i%>" title="<%=dianboBean.getQsContent()%>"><%=new UtilDAO().sub_String(dianboBean.getQsContent())%></a></td>
<%
if(dianboBean.getQsUpPhone()==null || dianboBean.getQsUpPhone().equals("")){
%>
<td>人工录入</td>
<%
}else{
%>
<td><%=dianboBean.getQsUpPhone() %></td>
<%
}
%>
<td><%=dianboBean.getQsUpTime().substring(0,19)%></td>
<td class="tc">
<a title="删除该记录" class="duanyu_del" style="cursor:hand" onClick="deleteOneSM('../DianboServlet?method=deleteOne&qsInfoId=<%=dianboBean.getQsInfoId() %>&content=<%=content %>&dianbotype=<%=selectdianbotype %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("hudong/dianboList.jsp",currentPage,"&content="+content+"&selectdianbotype="+selectdianbotype) %>
<%}
else{
String[][] exportArray=new String[1][4];
exportArray[0][0]="手机号码";
exportArray[0][1]="创建人";
exportArray[0][2]="创建时间";
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);
}
%>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formimport" name="formimport" enctype="multipart/form-data" method="post" action="">
<table width="100%" class="datalist">
<tr>
<td class="tc">导入模版:</td>
<td>
<a href="./module/dianbo.xls" >点击这里下载导入模板</a>
</td>
</tr>
<tr>
<td class="tc">导入点播信息:</td>
<td>
<input type="file" id="daoru" name="daoru" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="insertImport()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function insertImport(){
var fileName = document.getElementById("daoru").value;
var lastFileName = encodeURI(fileName);
lastFileName = encodeURI(lastFileName);
var file_Name = fileName.split(".")[fileName.split(".").length-1];
if(file_Name=="xls"||file_Name=="XLS")
{
}else
{
alert("上传文件格式不对,请重新导入!");
return ;
}
formimport.action="./DianboServlet?method=importDianboSubmit&realImagePath="+lastFileName;
formimport.submit();
}
</script>
</tr>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formadd" name="formadd" method="post" action="">
<table width="100%" class="datalist">
<tr>
<td class="tc">选择点播类型</td>
<td>
<select id="dianbotypeadd" name="dianbotypeadd">
<option value="0">
请选择
</option>
<%
if(dianboTypeList!=null&&dianboTypeList.size()>0){
for(int t=0;t<dianboTypeList.size();t++){
DianboType diaobotype=dianboTypeList.get(t);
%>
<option value="<%=diaobotype.getTypeId() %>">
<%=diaobotype.getTypeName() %>
</option>
<%
}
}
%>
</select>
</td>
</tr>
<tr>
<td class="tc">新增点播信息:</td>
<td>
<input type="text" id="Dianbocontent" size="50" name="Dianbocontent" value="" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="addDianbo()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function addDianbo(){
var Dianbocontent = document.getElementById("Dianbocontent").value;
var dianbotypeadd=document.getElementById("dianbotypeadd");
var selText= dianbotypeadd.options[dianbotypeadd.selectedIndex].text;
if(Dianbocontent.length==0)
{
alert("点播信息内容不能为空,请重新添加!");
return;
}
if(selText=='请选择'){
alert("请选择点播类型,再进行添加数据!");
return;
}
formadd.action="./DianboServlet?method=addDianboSubmit";
formadd.submit();
}
</script>
</tr>
</table>
</form>
</div>
</div>
</div>
</section>
</div>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/dianboList.jsp | Java Server Pages | asf20 | 12,431 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*,com.order.bean.*,com.dati.bean.*,com.dati.dao.*,com.dianbo.bean.*,com.dianbo.dao.*"%>
<%@ page import="util.*" %>
<%
List<TbOrder> orderDatiList = (ArrayList<TbOrder>) session.getAttribute("orderDatiList");
List<TbOrder> orderDianboList = (ArrayList<TbOrder>) session.getAttribute("orderDianboList");
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsContentList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="2" /></jsp:include>
<jsp:include page="Left.jsp">
<jsp:param name="um" value="11" /></jsp:include>
<script type="text/javascript">
var inNum=1;
var tabArray=$('.tabs>.tabs-panel');
var liArray=$('.tabs>.tabs-nav>li');
for(var i=0;i<tabArray.length;i++){
if(inNum==i){
liArray[i].className='tabs-selected';
tabArray[i].style.display='block';
}else{
liArray[i].className='';
tabArray[i].style.display='none';
}
}
</script>
<section id="container">
<div id="crumbs">
指令管理 » 指令设置
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
点播指令设置
</li>
<li>
答题指令设置
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form1">
<table width="100%" class="datalist">
<thead>
<tr><td></td><td><input type="button" name="addOrder" id = "addOrder" value="新建指令" onclick="form1.mb=$.msgbox({
height:400,
width:500,
content:{type:'ajax', content:'TbOrderServlet?method=addOrder&orderType=0&formName=form1'},
title: '新建指令'
});"/>
</td><td colspan="4"></td></tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
类型名称
</td>
<td>
指令
</td>
<td>
时间
</td>
<td>
操作
</td>
</tr>
</thead>
<%
int i=0;
//--------------分页
//--excel start
if(orderDianboList!=null)
{
//---excel end
MyPagination mPages=new MyPagination();
orderDianboList=mPages.getInitPage(orderDianboList,currentPage,10);
if (orderDianboList != null && orderDianboList.size() > 0){
for (TbOrder tborder : orderDianboList){
i++;
String typeId=tborder.getTypeId();
String orderName = "";
DianboType dianboType = new DianboTypeDao().getDianboType(typeId);
if(dianboType!=null){
orderName = dianboType.getTypeName();
}
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=tborder.getOrderId() %>"/>
</td>
<td><%=orderName %></td>
<td><%=tborder.getOrderValue() %></td>
<td><%=tborder.getCreateTime() %></td>
<td class="tc"> <a href="javascript:void(0);" class="duanyu_edit" onclick="form1.mb=$.msgbox({
height:350,
width:450,
content:{type:'ajax',content:'TbOrderServlet?method=modifyOrder&id=<%=tborder.getOrderId() %>&formName=form1'},
title: '修改指令'
});">修改</a>
<a title="删除指令" class="duanyu_del" style="cursor:hand"
onClick="delOrder('../TbOrderServlet?method=del&id=<%=tborder.getOrderId() %>')" >
删除</a></td>
<%
}
}
%>
<%=mPages.printCtrl("hudong/orderList.jsp",currentPage) %>
</tr>
<%
}
%>
</table>
</form>
</div>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form2" name="form2">
<table width="100%" class="datalist">
<thead>
<tr><td></td><td><input type="button" name="addOrder" id = "addOrder" value="新建指令" onclick="form2.mb=$.msgbox({
height:400,
width:500,
content:{type:'ajax', content:'TbOrderServlet?method=addOrder&orderType=1&formName=form2'},
title: '新建指令'
});"/>
</td><td colspan="4"></td></tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
类型名称
</td>
<td>
指令
</td>
<td>
时间
</td>
<td>
操作
</td>
</tr>
</thead>
<%
int j=0;
//--------------分页
//--excel start
if(orderDatiList!=null)
{
//---excel end
MyPagination mPages=new MyPagination();
orderDatiList=mPages.getInitPage(orderDatiList,currentPage,10);
if (orderDatiList != null && orderDatiList.size() > 0){
for (TbOrder tborder : orderDatiList){
j++;
String typeId=tborder.getTypeId();
String orderName = "";
DatiType datiType = new DatiTypeDao().getDatiType(typeId);
if(datiType!=null){
orderName = datiType.getTypeName();
}
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=tborder.getOrderId() %>"/>
</td>
<td><%=orderName %></td>
<td><%=tborder.getOrderValue() %></td>
<td><%=tborder.getCreateTime() %></td>
<td class="tc"> <a href="javascript:void(0);" class="duanyu_edit" onclick="form2.mb=$.msgbox({
height:350,
width:450,
content:{type:'ajax',content:'TbOrderServlet?method=modifyOrder&id=<%=tborder.getOrderId() %>&formName=form2'},
title: '修改指令'
});">修改</a>
<a title="删除指令" class="duanyu_del" style="cursor:hand"
onClick="delOrder('../TbOrderServlet?method=del&id=<%=tborder.getOrderId() %>')" >
删除</a></td></tr>
<%
}
}
%>
<%=mPages.printCtrl("hudong/orderList.jsp",currentPage) %>
<%
}
%>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/orderList.jsp | Java Server Pages | asf20 | 7,891 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*,com.dati.dao.*,com.UserModule.bean.*"%>
<%@ page import="util.*" %>
<%
//---------分页
List<Answer> datiList=(ArrayList<Answer>) session.getAttribute("datiList");
int currentPage=1;
if(request.getParameter("Page")!=null)
{
datiList=(ArrayList) session.getAttribute("datiList");
currentPage=Integer.parseInt(request.getParameter("Page"));
}
List<DatiType> datiTypeList = (ArrayList<DatiType>)session.getAttribute("datiTypeList");
String datiSelected = session.getAttribute("datiSelected").toString();
String content = session.getAttribute("content").toString();
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="6" /></jsp:include>
<jsp:include page="Left.jsp">
<jsp:param name="um" value="13" /></jsp:include>
<section id="container">
<div id="crumbs">
答题资源库 » 答题列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
答题列表
</li>
<li>
导入答题信息
</li>
<li>
新增答题信息
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="8" class="tl">
答题类型
<select id="datitype" name="datitype">
<option value="0">
请选择
</option>
<%
if(datiTypeList!=null&&datiTypeList.size()>0){
for(DatiType datiType:datiTypeList){
%>
<option value="<%=datiType.getAnswerTypeId() %>"
<%
if(datiSelected.equals(datiType.getAnswerTypeId())){
%>
selected="selected"
<%}
%>
>
<%=datiType.getTypeName() %>
</option>
<%
} }
%>
</select>
内容
<input type="text" id="content" name="content" value="<%=content %>" />
<input type="button" value="查询" onclick="searcherByDati('../DatiServlet?method=looksearch')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../DatiServlet?method=deleteAll&content=<%=content %>&datiSelected=<%=datiSelected %>')" />
<!-- <input type="button" value="导出" onclick="window.location='../upload/export3.xls'" /> -->
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td width="5%">
序号
</td>
<td width="10%">
答题类型
</td>
<td width="35%">
答题内容
</td>
<td width="12%">
正确答案
</td>
<td width="10%">
上传号码
</td>
<td width="20%">
创建时间
</td>
<td width="8%">
操作
</td>
</tr>
</thead>
<%
if(datiList!=null){
/**String[][] exportArray=new String[dianboList.size()+1][4];
exportArray[0][0]="答题类型";
exportArray[0][1]="答题内容";
exportArray[0][2]="上传号码";
exportArray[0][3]="创建时间";
for(int rowIndex=1;rowIndex<dianboList.size()+1;rowIndex++)
{
Dianbo db=dianboList.get(rowIndex-1);
exportArray[rowIndex][0]=""+new DianboTypeDao().getDianboType(db.getTypeId());
exportArray[rowIndex][1]=""+db.getQsContent();
if(db.getQsUpPhone()==null){
exportArray[rowIndex][2]="";
}else{
exportArray[rowIndex][2]=""+db.getQsUpPhone();
}
exportArray[rowIndex][3]=""+db.getQsUpTime().substring(0,19);
}
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);*/
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
datiList=mPage.getInitPage(datiList,currentPage,10);
if (datiList != null && datiList.size() > 0) {
for (Answer answer : datiList) {
String datiTypeName = "";
String middleId = answer.getAnswerMiddleId();//中间表中的ID
String contentT = "";
String seriseId="";//系列ID
String upPhone="";
String rightAnswer="";
String conditionMidd="answerMiddleId ='"+middleId+"'";
List<DatiMiddle> datiMiddleList = new DatiDao().getDatiMiddle("tb_answer_middle","",conditionMidd);
if(datiMiddleList!=null&&datiMiddleList.size()>0){
contentT=datiMiddleList.get(0).getAnswerContent();
rightAnswer=datiMiddleList.get(0).getRightAnswer();
seriseId = datiMiddleList.get(0).getSeriseId();
Xulie xulie = new DatiTypeDao().getXulie(seriseId);
String datiType = xulie.getAnswerTypeId();//得到类型的ID
String conditionDati = "answerTypeId='"+datiType+"'";
List<DatiType> datiTypeListT = new DatiTypeDao().getAllDaTiType("tb_answer_type","",conditionDati);
if(datiTypeListT!=null&&datiTypeListT.size()>0){
datiTypeName = datiTypeListT.get(0).getTypeName();
}
}
if(answer.getAnswerUpPhone().equals("")){
upPhone="人工导入";
}else{
upPhone=answer.getAnswerUpPhone();
}
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=answer.getAnswerId()%>"/>
</td>
<td><%=((10*(currentPage-1))+i) %></td>
<td><%=datiTypeName%></td>
<script type="text/javascript">
$(function(){
$('#demo-basic<%=i%>').poshytip();
})
</script>
<td><a id="demo-basic<%=i%>" title="<%=contentT%>"><%=new UtilDAO().sub_String(contentT)%></a></td>
<td><%=rightAnswer %></td>
<td><%=upPhone%></td>
<td><%=answer.getAnswerUpTime().substring(0,19)%></td>
<td class="tc">
<a title="删除该记录" class="duanyu_del" style="cursor:hand" onClick="deleteOneDati('../DatiServlet?method=deleteOneDati&datiId=<%=answer.getAnswerId() %>&content=<%=content %>&datiSelected=<%=datiSelected %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("hudong/datiList.jsp",currentPage,"&content="+content) %>
<%}
else{
/** String[][] exportArray=new String[1][4];
exportArray[0][0]="手机号码";
exportArray[0][1]="创建人";
exportArray[0][2]="创建时间";
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);*/
}
%>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formimport" name="formimport" enctype="multipart/form-data" method="post" action="">
<table width="100%" class="datalist">
<tr>
<td class="tc">导入模版:</td>
<td>
<a href="./module/dati.xls" >点击这里下载导入模板</a>
</td>
</tr>
<tr>
<td class="tc">导入答题信息:</td>
<td>
<input type="file" id="daoru" name="daoru" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="insertImport()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function insertImport(){
var fileName = document.getElementById("daoru").value;
var lastFileName = encodeURI(fileName);
lastFileName = encodeURI(lastFileName);
var file_Name = fileName.split(".")[fileName.split(".").length-1];
if(file_Name=="xls"||file_Name=="XLS")
{
}else
{
alert("上传文件格式不对,请重新导入!");
return ;
}
formimport.action="./DatiServlet?method=importDati&realImagePath="+lastFileName;
formimport.submit();
}
</script>
</tr>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formadd" name="formadd" method="post" action="">
<table width="100%" class="datalist">
<tr>
<td class="tc">选择答题类型</td>
<td>
<select id="datitypeadd" name="datitypeadd" onclick="selectDati(datitypeadd.value)">
<option value="0">
请选择
</option>
<%
if(datiTypeList!=null&&datiTypeList.size()>0){
for(DatiType dtType:datiTypeList){
%>
<option value="<%=dtType.getAnswerTypeId() %>">
<%=dtType.getTypeName() %>
</option>
<%
}
}
%>
</select>
<input type="hidden" name="dati_Type" id="dati_Type" value="0">
</td>
</tr>
<tr style="display:none" id="xilie"><th scope="row">系列</th><td><div id="xilieList"></div>
<input type="hidden" name="datiValue" id="datiValue" value=""/>
</td></tr>
<tr>
<td class="tc">新增答题信息:</td>
<td>
<input type="text" id="daticontent" size="50" name="daticontent" value="" />
</td>
</tr>
<tr>
<td class="tc">正确答案:</td>
<td>
<input type="text" id="datianswer" size="20" name="datianswer" value="" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="addDati()" value=" 提 交 " /></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</section>
</div>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/datiList.jsp | Java Server Pages | asf20 | 12,378 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*,com.order.bean.*,com.dati.bean.*,com.dati.dao.*,com.dianbo.bean.*,com.dianbo.dao.*"%>
<%@ page import="util.*" %>
<%
setTime st = (setTime)session.getAttribute("setTime");
String content = "";
if(st!=null){
content = st.getSetTime();
}
%>
<jsp:include page="../head.jsp"></jsp:include>
<script>
//设置答题 的时间
function setTime(){
var minutes = $("#minutes").val();
window.location="../DatiServlet?method=setTimeSubmit&minutes="+minutes;
}
</script>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="1" /></jsp:include>
<jsp:include page="Left.jsp">
<jsp:param name="um" value="15" /></jsp:include>
<section id="container">
<div id="crumbs">
时间管理 » 答题时间设置
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
答题时间设置
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}%>
<form action="">
<table width="100%" class="datalist" border="1">
<tr id="isReceve">
<td width="30%" class="t1" align="right">时间设置:</td>
<td width="70%">
<input type="text" size="30" id="minutes" name="minutes" value="<%=content %>">分
</td>
</tr>
<tr><td class="tc" colspan="2"><input type="button" value="设置" onclick="setTime()"/></td>
</td>
</tr>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/setTime.jsp | Java Server Pages | asf20 | 2,333 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.dao.*,com.order.bean.*,com.dati.bean.*,com.dati.dao.*,com.dianbo.bean.*,com.dianbo.dao.*"%>
<%@ page import="util.*" %>
<%
List<TbWuxiaoOrder> wuxiaoList = (ArrayList<TbWuxiaoOrder>)session.getAttribute("wuxiaoList");
String content = "";
int status=0;
if(wuxiaoList!=null&&wuxiaoList.size()>0){
content = wuxiaoList.get(0).getInvalidContent();
status=wuxiaoList.get(0).getStatus();
}
System.out.println("content=="+content);
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="2" /></jsp:include>
<jsp:include page="Left.jsp">
<jsp:param name="um" value="14" /></jsp:include>
<section id="container">
<div id="crumbs">
指令管理 » 无效指令设置
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
无效指令设置
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("result").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("result");
}
}catch(Exception ex){
}%>
<form action="">
<table width="100%" class="datalist" border="1">
<tr>
<td class="t1" width="30%" align="right">回复信息设置: </td>
<td width="70%">
<input id="isreply" name="isreply" type="radio" value="0" onclick="isReceve(true);" <%if(status==0){%> checked="checked" <% } %> />否
<input id="isreply" name="isreply" type="radio" value="1" onclick="isReceve(false);" <%if(status==1){%> checked="checked" <% } %> />是
<input type="hidden" id="thischeck" name="thischeck" value="0"/>
</td>
</tr>
<tr id="isReceve" <%if(status==0){%> style="display:none;" <% } %>>
<td width="30%" class="t1" align="right">回复内容:</td>
<td width="70%">
<input type="text" size="50" id="wuxiao" name="wuxiao" value="<%=content %>">
</td>
</tr>
<tr><td class="tc" colspan="2"><input type="button" value="设置" onclick="setWuxiao()"/></td>
</td>
</tr>
<script type="text/javascript">
function isReceve(bl)
{
if(bl)
{
document.getElementById('isReceve').style.display='none';
document.getElementById('thischeck').value="0";
}else{
document.getElementById('isReceve').style.display='block';
document.getElementById('thischeck').value="1";
}
}
</script>
</table>
</form>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/setWuxiao.jsp | Java Server Pages | asf20 | 3,748 |
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(request.getParameter("um")!=null){
%>
<aside id="aside">
<ul>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>TbOrderServlet?method=look'" href="javascript:void(0);" class="nm11 <% if ("11".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">指令管理</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>TbOrderServlet?method=lookWuxiao'" href="javascript:void(0);" class="nm14 <% if ("14".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">无效指令</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>DianboServlet?method=lookdianbo&startTime=&endTime=&content=';" href="javascript:void(0);" class="nm12 <% if ("12".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">点播资源库</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>DatiServlet?method=lookdati&datiType=&content=';" href="javascript:void(0);" class="nm13 <% if ("13".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">答题资源库</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>DatiServlet?method=setTime';" href="javascript:void(0);" class="nm15 <% if ("15".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">答题时间设置</a></li>
</ul>
</aside>
<%
}
%> | zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/Left.jsp | Java Server Pages | asf20 | 2,093 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*,com.order.bean.*,com.order.dao.*" %>
<%
TbOrder tbOrder = (TbOrder) session.getAttribute("tbOrder");
String formName = request.getParameter("formName");
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<ul class="tabs-nav clearfix">
<li>修改指令</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="orderName" id="orderName" value="<%=tbOrder.getOrderValue() %>"/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="modifyOrder('../TbOrderServlet?method=modifyOrderSubmit&id=<%=tbOrder.getOrderId() %>');<%=formName %>.mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="<%=formName %>.mb.close();"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/hudong/modifyOrder.jsp | Java Server Pages | asf20 | 1,347 |
<%--
jsp File browser 1.2
Copyright (C) 2003-2006 Boris von Loesch
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the
Free Software Foundation, Inc.,
59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
- Description: jsp File browser v1.2 -- This JSP program allows remote web-based
file access and manipulation. You can copy, create, move and delete files.
Text files can be edited and groups of files and folders can be downloaded
as a single zip file that's created on the fly.
- Credits: Taylor Bastien, David Levine, David Cowan, Lieven Govaerts
--%>
<%@page import="java.util.*,
java.net.*,
java.text.*,
java.util.zip.*,
java.io.*"
%>
<%!
//FEATURES
private static final boolean NATIVE_COMMANDS = true;
/**
*If true, all operations (besides upload and native commands)
*which change something on the file system are permitted
*/
private static final boolean READ_ONLY = false;
//If true, uploads are allowed even if READ_ONLY = true
private static final boolean ALLOW_UPLOAD = true;
//Allow browsing and file manipulation only in certain directories
private static final boolean RESTRICT_BROWSING = false;
//If true, the user is allowed to browse only in RESTRICT_PATH,
//if false, the user is allowed to browse all directories besides RESTRICT_PATH
private static final boolean RESTRICT_WHITELIST = false;
//Paths, sperated by semicolon
//private static final String RESTRICT_PATH = "C:\\CODE;E:\\"; //Win32: Case important!!
private static final String RESTRICT_PATH = "/etc;/var";
//The refresh time in seconds of the upload monitor window
private static final int UPLOAD_MONITOR_REFRESH = 2;
//The number of colums for the edit field
private static final int EDITFIELD_COLS = 85;
//The number of rows for the edit field
private static final int EDITFIELD_ROWS = 30;
//Open a new window to view a file
private static final boolean USE_POPUP = true;
/**
* If USE_DIR_PREVIEW = true, then for every directory a tooltip will be
* created (hold the mouse over the link) with the first DIR_PREVIEW_NUMBER entries.
* This can yield to performance issues. Turn it off, if the directory loads to slow.
*/
private static final boolean USE_DIR_PREVIEW = false;
private static final int DIR_PREVIEW_NUMBER = 10;
/**
* The name of an optional CSS Stylesheet file
*/
private static final String CSS_NAME = "Browser.css";
/**
* The compression level for zip file creation (0-9)
* 0 = No compression
* 1 = Standard compression (Very fast)
* ...
* 9 = Best compression (Very slow)
*/
private static final int COMPRESSION_LEVEL = 1;
/**
* The FORBIDDEN_DRIVES are not displayed on the list. This can be usefull, if the
* server runs on a windows platform, to avoid a message box, if you try to access
* an empty removable drive (See KNOWN BUGS in Readme.txt).
*/
private static final String[] FORBIDDEN_DRIVES = {"a:\\"};
/**
* Command of the shell interpreter and the parameter to run a programm
*/
private static final String[] COMMAND_INTERPRETER = {"cmd", "/C"}; // Dos,Windows
//private static final String[] COMMAND_INTERPRETER = {"/bin/sh","-c"}; // Unix
/**
* Max time in ms a process is allowed to run, before it will be terminated
*/
private static final long MAX_PROCESS_RUNNING_TIME = 30 * 1000; //30 seconds
//Button names
private static final String SAVE_AS_ZIP = "Download selected files as (z)ip";
private static final String RENAME_FILE = "(R)ename File";
private static final String DELETE_FILES = "(Del)ete selected files";
private static final String CREATE_DIR = "Create (D)ir";
private static final String CREATE_FILE = "(C)reate File";
private static final String MOVE_FILES = "(M)ove Files";
private static final String COPY_FILES = "Cop(y) Files";
private static final String LAUNCH_COMMAND = "(L)aunch external program";
private static final String UPLOAD_FILES = "Upload";
//Normally you should not change anything after this line
//----------------------------------------------------------------------------------
//Change this to locate the tempfile directory for upload (not longer needed)
private static String tempdir = ".";
private static String VERSION_NR = "1.2";
private static DateFormat dateFormat = DateFormat.getDateTimeInstance();
public class UplInfo {
public long totalSize;
public long currSize;
public long starttime;
public boolean aborted;
public UplInfo() {
totalSize = 0l;
currSize = 0l;
starttime = System.currentTimeMillis();
aborted = false;
}
public UplInfo(int size) {
totalSize = size;
currSize = 0;
starttime = System.currentTimeMillis();
aborted = false;
}
public String getUprate() {
long time = System.currentTimeMillis() - starttime;
if (time != 0) {
long uprate = currSize * 1000 / time;
return convertFileSize(uprate) + "/s";
}
else return "n/a";
}
public int getPercent() {
if (totalSize == 0) return 0;
else return (int) (currSize * 100 / totalSize);
}
public String getTimeElapsed() {
long time = (System.currentTimeMillis() - starttime) / 1000l;
if (time - 60l >= 0){
if (time % 60 >=10) return time / 60 + ":" + (time % 60) + "m";
else return time / 60 + ":0" + (time % 60) + "m";
}
else return time<10 ? "0" + time + "s": time + "s";
}
public String getTimeEstimated() {
if (currSize == 0) return "n/a";
long time = System.currentTimeMillis() - starttime;
time = totalSize * time / currSize;
time /= 1000l;
if (time - 60l >= 0){
if (time % 60 >=10) return time / 60 + ":" + (time % 60) + "m";
else return time / 60 + ":0" + (time % 60) + "m";
}
else return time<10 ? "0" + time + "s": time + "s";
}
}
public class FileInfo {
public String name = null, clientFileName = null, fileContentType = null;
private byte[] fileContents = null;
public File file = null;
public StringBuffer sb = new StringBuffer(100);
public void setFileContents(byte[] aByteArray) {
fileContents = new byte[aByteArray.length];
System.arraycopy(aByteArray, 0, fileContents, 0, aByteArray.length);
}
}
public static class UploadMonitor {
static Hashtable uploadTable = new Hashtable();
static void set(String fName, UplInfo info) {
uploadTable.put(fName, info);
}
static void remove(String fName) {
uploadTable.remove(fName);
}
static UplInfo getInfo(String fName) {
UplInfo info = (UplInfo) uploadTable.get(fName);
return info;
}
}
// A Class with methods used to process a ServletInputStream
public class HttpMultiPartParser {
//private final String lineSeparator = System.getProperty("line.separator", "\n");
private final int ONE_MB = 1024 * 1;
public Hashtable processData(ServletInputStream is, String boundary, String saveInDir,
int clength) throws IllegalArgumentException, IOException {
if (is == null) throw new IllegalArgumentException("InputStream");
if (boundary == null || boundary.trim().length() < 1) throw new IllegalArgumentException(
"\"" + boundary + "\" is an illegal boundary indicator");
boundary = "--" + boundary;
StringTokenizer stLine = null, stFields = null;
FileInfo fileInfo = null;
Hashtable dataTable = new Hashtable(5);
String line = null, field = null, paramName = null;
boolean saveFiles = (saveInDir != null && saveInDir.trim().length() > 0);
boolean isFile = false;
if (saveFiles) { // Create the required directory (including parent dirs)
File f = new File(saveInDir);
f.mkdirs();
}
line = getLine(is);
if (line == null || !line.startsWith(boundary)) throw new IOException(
"Boundary not found; boundary = " + boundary + ", line = " + line);
while (line != null) {
if (line == null || !line.startsWith(boundary)) return dataTable;
line = getLine(is);
if (line == null) return dataTable;
stLine = new StringTokenizer(line, ";\r\n");
if (stLine.countTokens() < 2) throw new IllegalArgumentException(
"Bad data in second line");
line = stLine.nextToken().toLowerCase();
if (line.indexOf("form-data") < 0) throw new IllegalArgumentException(
"Bad data in second line");
stFields = new StringTokenizer(stLine.nextToken(), "=\"");
if (stFields.countTokens() < 2) throw new IllegalArgumentException(
"Bad data in second line");
fileInfo = new FileInfo();
stFields.nextToken();
paramName = stFields.nextToken();
isFile = false;
if (stLine.hasMoreTokens()) {
field = stLine.nextToken();
stFields = new StringTokenizer(field, "=\"");
if (stFields.countTokens() > 1) {
if (stFields.nextToken().trim().equalsIgnoreCase("filename")) {
fileInfo.name = paramName;
String value = stFields.nextToken();
if (value != null && value.trim().length() > 0) {
fileInfo.clientFileName = value;
isFile = true;
}
else {
line = getLine(is); // Skip "Content-Type:" line
line = getLine(is); // Skip blank line
line = getLine(is); // Skip blank line
line = getLine(is); // Position to boundary line
continue;
}
}
}
else if (field.toLowerCase().indexOf("filename") >= 0) {
line = getLine(is); // Skip "Content-Type:" line
line = getLine(is); // Skip blank line
line = getLine(is); // Skip blank line
line = getLine(is); // Position to boundary line
continue;
}
}
boolean skipBlankLine = true;
if (isFile) {
line = getLine(is);
if (line == null) return dataTable;
if (line.trim().length() < 1) skipBlankLine = false;
else {
stLine = new StringTokenizer(line, ": ");
if (stLine.countTokens() < 2) throw new IllegalArgumentException(
"Bad data in third line");
stLine.nextToken(); // Content-Type
fileInfo.fileContentType = stLine.nextToken();
}
}
if (skipBlankLine) {
line = getLine(is);
if (line == null) return dataTable;
}
if (!isFile) {
line = getLine(is);
if (line == null) return dataTable;
dataTable.put(paramName, line);
// If parameter is dir, change saveInDir to dir
if (paramName.equals("dir")) saveInDir = line;
line = getLine(is);
continue;
}
try {
UplInfo uplInfo = new UplInfo(clength);
UploadMonitor.set(fileInfo.clientFileName, uplInfo);
OutputStream os = null;
String path = null;
if (saveFiles) os = new FileOutputStream(path = getFileName(saveInDir,
fileInfo.clientFileName));
else os = new ByteArrayOutputStream(ONE_MB);
boolean readingContent = true;
byte previousLine[] = new byte[2 * ONE_MB];
byte temp[] = null;
byte currentLine[] = new byte[2 * ONE_MB];
int read, read3;
if ((read = is.readLine(previousLine, 0, previousLine.length)) == -1) {
line = null;
break;
}
while (readingContent) {
if ((read3 = is.readLine(currentLine, 0, currentLine.length)) == -1) {
line = null;
uplInfo.aborted = true;
break;
}
if (compareBoundary(boundary, currentLine)) {
os.write(previousLine, 0, read - 2);
line = new String(currentLine, 0, read3);
break;
}
else {
os.write(previousLine, 0, read);
uplInfo.currSize += read;
temp = currentLine;
currentLine = previousLine;
previousLine = temp;
read = read3;
}//end else
}//end while
os.flush();
os.close();
if (!saveFiles) {
ByteArrayOutputStream baos = (ByteArrayOutputStream) os;
fileInfo.setFileContents(baos.toByteArray());
}
else fileInfo.file = new File(path);
dataTable.put(paramName, fileInfo);
uplInfo.currSize = uplInfo.totalSize;
}//end try
catch (IOException e) {
throw e;
}
}
return dataTable;
}
/**
* Compares boundary string to byte array
*/
private boolean compareBoundary(String boundary, byte ba[]) {
if (boundary == null || ba == null) return false;
for (int i = 0; i < boundary.length(); i++)
if ((byte) boundary.charAt(i) != ba[i]) return false;
return true;
}
/** Convenience method to read HTTP header lines */
private synchronized String getLine(ServletInputStream sis) throws IOException {
byte b[] = new byte[1024];
int read = sis.readLine(b, 0, b.length), index;
String line = null;
if (read != -1) {
line = new String(b, 0, read);
if ((index = line.indexOf('\n')) >= 0) line = line.substring(0, index - 1);
}
return line;
}
public String getFileName(String dir, String fileName) throws IllegalArgumentException {
String path = null;
if (dir == null || fileName == null) throw new IllegalArgumentException(
"dir or fileName is null");
int index = fileName.lastIndexOf('/');
String name = null;
if (index >= 0) name = fileName.substring(index + 1);
else name = fileName;
index = name.lastIndexOf('\\');
if (index >= 0) fileName = name.substring(index + 1);
path = dir + File.separator + fileName;
if (File.separatorChar == '/') return path.replace('\\', File.separatorChar);
else return path.replace('/', File.separatorChar);
}
} //End of class HttpMultiPartParser
/**
* This class is a comparator to sort the filenames and dirs
*/
class FileComp implements Comparator {
int mode;
int sign;
FileComp() {
this.mode = 1;
this.sign = 1;
}
/**
* @param mode sort by 1=Filename, 2=Size, 3=Date, 4=Type
* The default sorting method is by Name
* Negative mode means descending sort
*/
FileComp(int mode) {
if (mode < 0) {
this.mode = -mode;
sign = -1;
}
else {
this.mode = mode;
this.sign = 1;
}
}
public int compare(Object o1, Object o2) {
File f1 = (File) o1;
File f2 = (File) o2;
if (f1.isDirectory()) {
if (f2.isDirectory()) {
switch (mode) {
//Filename or Type
case 1:
case 4:
return sign
* f1.getAbsolutePath().toUpperCase().compareTo(
f2.getAbsolutePath().toUpperCase());
//Filesize
case 2:
return sign * (new Long(f1.length()).compareTo(new Long(f2.length())));
//Date
case 3:
return sign
* (new Long(f1.lastModified())
.compareTo(new Long(f2.lastModified())));
default:
return 1;
}
}
else return -1;
}
else if (f2.isDirectory()) return 1;
else {
switch (mode) {
case 1:
return sign
* f1.getAbsolutePath().toUpperCase().compareTo(
f2.getAbsolutePath().toUpperCase());
case 2:
return sign * (new Long(f1.length()).compareTo(new Long(f2.length())));
case 3:
return sign
* (new Long(f1.lastModified()).compareTo(new Long(f2.lastModified())));
case 4: { // Sort by extension
int tempIndexf1 = f1.getAbsolutePath().lastIndexOf('.');
int tempIndexf2 = f2.getAbsolutePath().lastIndexOf('.');
if ((tempIndexf1 == -1) && (tempIndexf2 == -1)) { // Neither have an extension
return sign
* f1.getAbsolutePath().toUpperCase().compareTo(
f2.getAbsolutePath().toUpperCase());
}
// f1 has no extension
else if (tempIndexf1 == -1) return -sign;
// f2 has no extension
else if (tempIndexf2 == -1) return sign;
// Both have an extension
else {
String tempEndf1 = f1.getAbsolutePath().toUpperCase()
.substring(tempIndexf1);
String tempEndf2 = f2.getAbsolutePath().toUpperCase()
.substring(tempIndexf2);
return sign * tempEndf1.compareTo(tempEndf2);
}
}
default:
return 1;
}
}
}
}
/**
* Wrapperclass to wrap an OutputStream around a Writer
*/
class Writer2Stream extends OutputStream {
Writer out;
Writer2Stream(Writer w) {
super();
out = w;
}
public void write(int i) throws IOException {
out.write(i);
}
public void write(byte[] b) throws IOException {
for (int i = 0; i < b.length; i++) {
int n = b[i];
//Convert byte to ubyte
n = ((n >>> 4) & 0xF) * 16 + (n & 0xF);
out.write(n);
}
}
public void write(byte[] b, int off, int len) throws IOException {
for (int i = off; i < off + len; i++) {
int n = b[i];
n = ((n >>> 4) & 0xF) * 16 + (n & 0xF);
out.write(n);
}
}
} //End of class Writer2Stream
static Vector expandFileList(String[] files, boolean inclDirs) {
Vector v = new Vector();
if (files == null) return v;
for (int i = 0; i < files.length; i++)
v.add(new File(URLDecoder.decode(files[i])));
for (int i = 0; i < v.size(); i++) {
File f = (File) v.get(i);
if (f.isDirectory()) {
File[] fs = f.listFiles();
for (int n = 0; n < fs.length; n++)
v.add(fs[n]);
if (!inclDirs) {
v.remove(i);
i--;
}
}
}
return v;
}
/**
* Method to build an absolute path
* @param dir the root dir
* @param name the name of the new directory
* @return if name is an absolute directory, returns name, else returns dir+name
*/
static String getDir(String dir, String name) {
if (!dir.endsWith(File.separator)) dir = dir + File.separator;
File mv = new File(name);
String new_dir = null;
if (!mv.isAbsolute()) {
new_dir = dir + name;
}
else new_dir = name;
return new_dir;
}
/**
* This Method converts a byte size in a kbytes or Mbytes size, depending on the size
* @param size The size in bytes
* @return String with size and unit
*/
static String convertFileSize(long size) {
int divisor = 1;
String unit = "bytes";
if (size >= 1024 * 1024) {
divisor = 1024 * 1024;
unit = "MB";
}
else if (size >= 1024) {
divisor = 1024;
unit = "KB";
}
if (divisor == 1) return size / divisor + " " + unit;
String aftercomma = "" + 100 * (size % divisor) / divisor;
if (aftercomma.length() == 1) aftercomma = "0" + aftercomma;
return size / divisor + "." + aftercomma + " " + unit;
}
/**
* Copies all data from in to out
* @param in the input stream
* @param out the output stream
* @param buffer copy buffer
*/
static void copyStreams(InputStream in, OutputStream out, byte[] buffer) throws IOException {
copyStreamsWithoutClose(in, out, buffer);
in.close();
out.close();
}
/**
* Copies all data from in to out
* @param in the input stream
* @param out the output stream
* @param buffer copy buffer
*/
static void copyStreamsWithoutClose(InputStream in, OutputStream out, byte[] buffer)
throws IOException {
int b;
while ((b = in.read(buffer)) != -1)
out.write(buffer, 0, b);
}
/**
* Returns the Mime Type of the file, depending on the extension of the filename
*/
static String getMimeType(String fName) {
fName = fName.toLowerCase();
if (fName.endsWith(".jpg") || fName.endsWith(".jpeg") || fName.endsWith(".jpe")) return "image/jpeg";
else if (fName.endsWith(".gif")) return "image/gif";
else if (fName.endsWith(".pdf")) return "application/pdf";
else if (fName.endsWith(".htm") || fName.endsWith(".html") || fName.endsWith(".shtml")) return "text/html";
else if (fName.endsWith(".avi")) return "video/x-msvideo";
else if (fName.endsWith(".mov") || fName.endsWith(".qt")) return "video/quicktime";
else if (fName.endsWith(".mpg") || fName.endsWith(".mpeg") || fName.endsWith(".mpe")) return "video/mpeg";
else if (fName.endsWith(".zip")) return "application/zip";
else if (fName.endsWith(".tiff") || fName.endsWith(".tif")) return "image/tiff";
else if (fName.endsWith(".rtf")) return "application/rtf";
else if (fName.endsWith(".mid") || fName.endsWith(".midi")) return "audio/x-midi";
else if (fName.endsWith(".xl") || fName.endsWith(".xls") || fName.endsWith(".xlv")
|| fName.endsWith(".xla") || fName.endsWith(".xlb") || fName.endsWith(".xlt")
|| fName.endsWith(".xlm") || fName.endsWith(".xlk")) return "application/excel";
else if (fName.endsWith(".doc") || fName.endsWith(".dot")) return "application/msword";
else if (fName.endsWith(".png")) return "image/png";
else if (fName.endsWith(".xml")) return "text/xml";
else if (fName.endsWith(".svg")) return "image/svg+xml";
else if (fName.endsWith(".mp3")) return "audio/mp3";
else if (fName.endsWith(".ogg")) return "audio/ogg";
else return "text/plain";
}
/**
* Converts some important chars (int) to the corresponding html string
*/
static String conv2Html(int i) {
if (i == '&') return "&";
else if (i == '<') return "<";
else if (i == '>') return ">";
else if (i == '"') return """;
else return "" + (char) i;
}
/**
* Converts a normal string to a html conform string
*/
static String conv2Html(String st) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < st.length(); i++) {
buf.append(conv2Html(st.charAt(i)));
}
return buf.toString();
}
/**
* Starts a native process on the server
* @param command the command to start the process
* @param dir the dir in which the process starts
*/
static String startProcess(String command, String dir) throws IOException {
StringBuffer ret = new StringBuffer();
String[] comm = new String[3];
comm[0] = COMMAND_INTERPRETER[0];
comm[1] = COMMAND_INTERPRETER[1];
comm[2] = command;
long start = System.currentTimeMillis();
try {
//Start process
Process ls_proc = Runtime.getRuntime().exec(comm, null, new File(dir));
//Get input and error streams
BufferedInputStream ls_in = new BufferedInputStream(ls_proc.getInputStream());
BufferedInputStream ls_err = new BufferedInputStream(ls_proc.getErrorStream());
boolean end = false;
while (!end) {
int c = 0;
while ((ls_err.available() > 0) && (++c <= 1000)) {
ret.append(conv2Html(ls_err.read()));
}
c = 0;
while ((ls_in.available() > 0) && (++c <= 1000)) {
ret.append(conv2Html(ls_in.read()));
}
try {
ls_proc.exitValue();
//if the process has not finished, an exception is thrown
//else
while (ls_err.available() > 0)
ret.append(conv2Html(ls_err.read()));
while (ls_in.available() > 0)
ret.append(conv2Html(ls_in.read()));
end = true;
}
catch (IllegalThreadStateException ex) {
//Process is running
}
//The process is not allowed to run longer than given time.
if (System.currentTimeMillis() - start > MAX_PROCESS_RUNNING_TIME) {
ls_proc.destroy();
end = true;
ret.append("!!!! Process has timed out, destroyed !!!!!");
}
try {
Thread.sleep(50);
}
catch (InterruptedException ie) {}
}
}
catch (IOException e) {
ret.append("Error: " + e);
}
return ret.toString();
}
/**
* Converts a dir string to a linked dir string
* @param dir the directory string (e.g. /usr/local/httpd)
* @param browserLink web-path to Browser.jsp
*/
static String dir2linkdir(String dir, String browserLink, int sortMode) {
File f = new File(dir);
StringBuffer buf = new StringBuffer();
while (f.getParentFile() != null) {
if (f.canRead()) {
String encPath = URLEncoder.encode(f.getAbsolutePath());
buf.insert(0, "<a href=\"" + browserLink + "?sort=" + sortMode + "&dir="
+ encPath + "\">" + conv2Html(f.getName()) + File.separator + "</a>");
}
else buf.insert(0, conv2Html(f.getName()) + File.separator);
f = f.getParentFile();
}
if (f.canRead()) {
String encPath = URLEncoder.encode(f.getAbsolutePath());
buf.insert(0, "<a href=\"" + browserLink + "?sort=" + sortMode + "&dir=" + encPath
+ "\">" + conv2Html(f.getAbsolutePath()) + "</a>");
}
else buf.insert(0, f.getAbsolutePath());
return buf.toString();
}
/**
* Returns true if the given filename tends towards a packed file
*/
static boolean isPacked(String name, boolean gz) {
return (name.toLowerCase().endsWith(".zip") || name.toLowerCase().endsWith(".jar")
|| (gz && name.toLowerCase().endsWith(".gz")) || name.toLowerCase()
.endsWith(".war"));
}
/**
* If RESTRICT_BROWSING = true this method checks, whether the path is allowed or not
*/
static boolean isAllowed(File path, boolean write) throws IOException{
if (READ_ONLY && write) return false;
if (RESTRICT_BROWSING) {
StringTokenizer stk = new StringTokenizer(RESTRICT_PATH, ";");
while (stk.hasMoreTokens()){
if (path!=null && path.getCanonicalPath().startsWith(stk.nextToken()))
return RESTRICT_WHITELIST;
}
return !RESTRICT_WHITELIST;
}
else return true;
}
//---------------------------------------------------------------------------------------------------------------
%>
<%
//Get the current browsing directory
request.setAttribute("dir", request.getParameter("dir"));
// The browser_name variable is used to keep track of the URI
// of the jsp file itself. It is used in all link-backs.
final String browser_name = request.getRequestURI();
final String FOL_IMG = "";
boolean nohtml = false;
boolean dir_view = true;
//Get Javascript
if (request.getParameter("Javascript") != null) {
dir_view = false;
nohtml = true;
//Tell the browser that it should cache the javascript
response.setHeader("Cache-Control", "public");
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.US);
response.setHeader("Expires", sdf.format(new Date(now.getTime() + 1000 * 60 * 60 * 24*2)));
response.setHeader("Content-Type", "text/javascript");
%>
<%// This section contains the Javascript used for interface elements %>
var check = false;
<%// Disables the checkbox feature %>
function dis(){check = true;}
var DOM = 0, MS = 0, OP = 0, b = 0;
<%// Determine the browser type %>
function CheckBrowser(){
if (b == 0){
if (window.opera) OP = 1;
// Moz or Netscape
if(document.getElementById) DOM = 1;
// Micro$oft
if(document.all && !OP) MS = 1;
b = 1;
}
}
<%// Allows the whole row to be selected %>
function selrow (element, i){
var erst;
CheckBrowser();
if ((OP==1)||(MS==1)) erst = element.firstChild.firstChild;
else if (DOM==1) erst = element.firstChild.nextSibling.firstChild;
<%// MouseIn %>
if (i==0){
if (erst.checked == true) element.className='mousechecked';
else element.className='mousein';
}
<%// MouseOut %>
else if (i==1){
if (erst.checked == true) element.className='checked';
else element.className='mouseout';
}
<% // MouseClick %>
else if ((i==2)&&(!check)){
if (erst.checked==true) element.className='mousein';
else element.className='mousechecked';
erst.click();
}
else check=false;
}
<%// Filter files and dirs in FileList%>
function filter (begriff){
var suche = begriff.value.toLowerCase();
var table = document.getElementById("filetable");
var ele;
for (var r = 1; r < table.rows.length; r++){
ele = table.rows[r].cells[1].innerHTML.replace(/<[^>]+>/g,"");
if (ele.toLowerCase().indexOf(suche)>=0 )
table.rows[r].style.display = '';
else table.rows[r].style.display = 'none';
}
}
<%//(De)select all checkboxes%>
function AllFiles(){
for(var x=0;x < document.FileList.elements.length;x++){
var y = document.FileList.elements[x];
var ytr = y.parentNode.parentNode;
var check = document.FileList.selall.checked;
if(y.name == 'selfile' && ytr.style.display != 'none'){
if (y.disabled != true){
y.checked = check;
if (y.checked == true) ytr.className = 'checked';
else ytr.className = 'mouseout';
}
}
}
}
function shortKeyHandler(_event){
if (!_event) _event = window.event;
if (_event.which) {
keycode = _event.which;
} else if (_event.keyCode) {
keycode = _event.keyCode;
}
var t = document.getElementById("text_Dir");
//z
if (keycode == 122){
document.getElementById("but_Zip").click();
}
//r, F2
else if (keycode == 113 || keycode == 114){
var path = prompt("Please enter new filename", "");
if (path == null) return;
t.value = path;
document.getElementById("but_Ren").click();
}
//c
else if (keycode == 99){
var path = prompt("Please enter filename", "");
if (path == null) return;
t.value = path;
document.getElementById("but_NFi").click();
}
//d
else if (keycode == 100){
var path = prompt("Please enter directory name", "");
if (path == null) return;
t.value = path;
document.getElementById("but_NDi").click();
}
//m
else if (keycode == 109){
var path = prompt("Please enter move destination", "");
if (path == null) return;
t.value = path;
document.getElementById("but_Mov").click();
}
//y
else if (keycode == 121){
var path = prompt("Please enter copy destination", "");
if (path == null) return;
t.value = path;
document.getElementById("but_Cop").click();
}
//l
else if (keycode == 108){
document.getElementById("but_Lau").click();
}
//Del
else if (keycode == 46){
document.getElementById("but_Del").click();
}
}
function popUp(URL){
fname = document.getElementsByName("myFile")[0].value;
if (fname != "")
window.open(URL+"?first&uplMonitor="+encodeURIComponent(fname),"","width=400,height=150,resizable=yes,depend=yes")
}
document.onkeypress = shortKeyHandler;
<% }
// View file
else if (request.getParameter("file") != null) {
File f = new File(request.getParameter("file"));
if (!isAllowed(f, false)) {
request.setAttribute("dir", f.getParent());
request.setAttribute("error", "You are not allowed to access "+f.getAbsolutePath());
}
else if (f.exists() && f.canRead()) {
if (isPacked(f.getName(), false)) {
//If zipFile, do nothing here
}
else{
String mimeType = getMimeType(f.getName());
response.setContentType(mimeType);
if (mimeType.equals("text/plain")) response.setHeader(
"Content-Disposition", "inline;filename=\"temp.txt\"");
else response.setHeader("Content-Disposition", "inline;filename=\""
+ f.getName() + "\"");
BufferedInputStream fileInput = new BufferedInputStream(new FileInputStream(f));
byte buffer[] = new byte[8 * 1024];
out.clearBuffer();
OutputStream out_s = new Writer2Stream(out);
copyStreamsWithoutClose(fileInput, out_s, buffer);
fileInput.close();
out_s.flush();
nohtml = true;
dir_view = false;
}
}
else {
request.setAttribute("dir", f.getParent());
request.setAttribute("error", "File " + f.getAbsolutePath()
+ " does not exist or is not readable on the server");
}
}
// Download selected files as zip file
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(SAVE_AS_ZIP))) {
Vector v = expandFileList(request.getParameterValues("selfile"), false);
//Check if all files in vector are allowed
String notAllowedFile = null;
for (int i = 0;i < v.size(); i++){
File f = (File) v.get(i);
if (!isAllowed(f, false)){
notAllowedFile = f.getAbsolutePath();
break;
}
}
if (notAllowedFile != null){
request.setAttribute("error", "You are not allowed to access " + notAllowedFile);
}
else if (v.size() == 0) {
request.setAttribute("error", "No files selected");
}
else {
File dir_file = new File("" + request.getAttribute("dir"));
int dir_l = dir_file.getAbsolutePath().length();
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment;filename=\"rename_me.zip\"");
out.clearBuffer();
ZipOutputStream zipout = new ZipOutputStream(new Writer2Stream(out));
zipout.setComment("Created by jsp File Browser v. " + VERSION_NR);
zipout.setLevel(COMPRESSION_LEVEL);
for (int i = 0; i < v.size(); i++) {
File f = (File) v.get(i);
if (f.canRead()) {
zipout.putNextEntry(new ZipEntry(f.getAbsolutePath().substring(dir_l + 1)));
BufferedInputStream fr = new BufferedInputStream(new FileInputStream(f));
byte buffer[] = new byte[0xffff];
copyStreamsWithoutClose(fr, zipout, buffer);
/* int b;
while ((b=fr.read())!=-1) zipout.write(b);*/
fr.close();
zipout.closeEntry();
}
}
zipout.finish();
out.flush();
nohtml = true;
dir_view = false;
}
}
// Download file
else if (request.getParameter("downfile") != null) {
String filePath = request.getParameter("downfile");
File f = new File(filePath);
if (!isAllowed(f, false)){
request.setAttribute("dir", f.getParent());
request.setAttribute("error", "You are not allowed to access " + f.getAbsoluteFile());
}
else if (f.exists() && f.canRead()) {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=\"" + f.getName()
+ "\"");
response.setContentLength((int) f.length());
BufferedInputStream fileInput = new BufferedInputStream(new FileInputStream(f));
byte buffer[] = new byte[8 * 1024];
out.clearBuffer();
OutputStream out_s = new Writer2Stream(out);
copyStreamsWithoutClose(fileInput, out_s, buffer);
fileInput.close();
out_s.flush();
nohtml = true;
dir_view = false;
}
else {
request.setAttribute("dir", f.getParent());
request.setAttribute("error", "File " + f.getAbsolutePath()
+ " does not exist or is not readable on the server");
}
}
if (nohtml) return;
//else
// If no parameter is submitted, it will take the path from jsp file browser
if (request.getAttribute("dir") == null) {
String path = null;
if (application.getRealPath(request.getRequestURI()) != null) {
File f = new File(application.getRealPath(request.getRequestURI())).getParentFile();
//This is a hack needed for tomcat
while (f != null && !f.exists())
f = f.getParentFile();
if (f != null)
path = f.getAbsolutePath();
}
if (path == null) { // handle the case where we are not in a directory (ex: war file)
path = new File(".").getAbsolutePath();
}
//Check path
if (!isAllowed(new File(path), false)){
//TODO Blacklist
if (RESTRICT_PATH.indexOf(";")<0) path = RESTRICT_PATH;
else path = RESTRICT_PATH.substring(0, RESTRICT_PATH.indexOf(";"));
}
request.setAttribute("dir", path);
}%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="robots" content="noindex">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<%
//If a cssfile exists, it will take it
String cssPath = null;
if (application.getRealPath(request.getRequestURI()) != null) cssPath = new File(
application.getRealPath(request.getRequestURI())).getParent()
+ File.separator + CSS_NAME;
if (cssPath == null) cssPath = application.getResource(CSS_NAME).toString();
if (new File(cssPath).exists()) {
%>
<link rel="stylesheet" type="text/css" href="<%=CSS_NAME%>">
<%}
else if (request.getParameter("uplMonitor") == null) {%>
<style type="text/css">
input.button {background-color: #c0c0c0; color: #666666;
border: 1px solid #999999; margin: 5px 1px 5px 1px;}
input.textfield {margin: 5px 1px 5px 1px;}
input.button:Hover { color: #444444 }
table.filelist {background-color:#666666; width:100%; border:0px none #ffffff}
.formular {margin: 1px; background-color:#ffffff; padding: 1em; border:1px solid #000000;}
.formular2 {margin: 1px;}
th { background-color:#c0c0c0 }
tr.mouseout { background-color:#ffffff; }
tr.mousein { background-color:#eeeeee; }
tr.checked { background-color:#cccccc }
tr.mousechecked { background-color:#c0c0c0 }
td { font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; color: #666666;}
td.message { background-color: #FFFF00; color: #000000; text-align:center; font-weight:bold}
td.error { background-color: #FF0000; color: #000000; text-align:center; font-weight:bold}
A { text-decoration: none; }
A:Hover { color : Red; text-decoration : underline; }
BODY { font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; color: #666666;}
</style>
<%}
//Check path
if (!isAllowed(new File((String)request.getAttribute("dir")), false)){
request.setAttribute("error", "You are not allowed to access " + request.getAttribute("dir"));
}
//Upload monitor
else if (request.getParameter("uplMonitor") != null) {%>
<style type="text/css">
BODY { font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; color: #666666;}
</style><%
String fname = request.getParameter("uplMonitor");
//First opening
boolean first = false;
if (request.getParameter("first") != null) first = true;
UplInfo info = new UplInfo();
if (!first) {
info = UploadMonitor.getInfo(fname);
if (info == null) {
//Windows
int posi = fname.lastIndexOf("\\");
if (posi != -1) info = UploadMonitor.getInfo(fname.substring(posi + 1));
}
if (info == null) {
//Unix
int posi = fname.lastIndexOf("/");
if (posi != -1) info = UploadMonitor.getInfo(fname.substring(posi + 1));
}
}
dir_view = false;
request.setAttribute("dir", null);
if (info.aborted) {
UploadMonitor.remove(fname);
%>
</head>
<body>
<b>Upload of <%=fname%></b><br><br>
Upload aborted.</body>
</html><%
}
else if (info.totalSize != info.currSize || info.currSize == 0) {
%>
<META HTTP-EQUIV="Refresh" CONTENT="<%=UPLOAD_MONITOR_REFRESH%>;URL=<%=browser_name %>?uplMonitor=<%=URLEncoder.encode(fname)%>">
</head>
<body>
<b>Upload of <%=fname%></b><br><br>
<center>
<table height="20px" width="90%" bgcolor="#eeeeee" style="border:1px solid #cccccc"><tr>
<td bgcolor="blue" width="<%=info.getPercent()%>%"></td><td width="<%=100-info.getPercent()%>%"></td>
</tr></table></center>
<%=convertFileSize(info.currSize)%> from <%=convertFileSize(info.totalSize)%>
(<%=info.getPercent()%> %) uploaded (Speed: <%=info.getUprate()%>).<br>
Time: <%=info.getTimeElapsed()%> from <%=info.getTimeEstimated()%>
</body>
</html><%
}
else {
UploadMonitor.remove(fname);
%>
</head>
<body onload="javascript:window.close()">
<b>Upload of <%=fname%></b><br><br>
Upload finished.
</body>
</html><%
}
}
//Comandwindow
else if (request.getParameter("command") != null) {
if (!NATIVE_COMMANDS){
request.setAttribute("error", "Execution of native commands is not allowed!");
}
else if (!"Cancel".equalsIgnoreCase(request.getParameter("Submit"))) {
%>
<title>Launch commands in <%=request.getAttribute("dir")%></title>
</head>
<body><center>
<h2><%=LAUNCH_COMMAND %></h2><br />
<%
out.println("<form action=\"" + browser_name + "\" method=\"Post\">\n"
+ "<textarea name=\"text\" wrap=\"off\" cols=\"" + EDITFIELD_COLS
+ "\" rows=\"" + EDITFIELD_ROWS + "\" readonly>");
String ret = "";
if (!request.getParameter("command").equalsIgnoreCase(""))
ret = startProcess(
request.getParameter("command"), (String) request.getAttribute("dir"));
out.println(ret);
%></textarea>
<input type="hidden" name="dir" value="<%= request.getAttribute("dir")%>">
<br /><br />
<table class="formular">
<tr><td title="Enter your command">
Command: <input size="<%=EDITFIELD_COLS-5%>" type="text" name="command" value="">
</td></tr>
<tr><td><input class="button" type="Submit" name="Submit" value="Launch">
<input type="hidden" name="sort" value="<%=request.getParameter("sort")%>">
<input type="Submit" class="button" name="Submit" value="Cancel"></td></tr>
</table>
</form>
<br />
<hr>
<center>
<small>jsp File Browser version <%= VERSION_NR%> by <a href="http://www.vonloesch.de">www.vonloesch.de</a></small>
</center>
</center>
</body>
</html>
<%
dir_view = false;
request.setAttribute("dir", null);
}
}
//Click on a filename, special viewer (zip+jar file)
else if (request.getParameter("file") != null) {
File f = new File(request.getParameter("file"));
if (!isAllowed(f, false)){
request.setAttribute("error", "You are not allowed to access " + f.getAbsolutePath());
}
else if (isPacked(f.getName(), false)) {
//ZipFile
try {
ZipFile zf = new ZipFile(f);
Enumeration entries = zf.entries();
%>
<title><%= f.getAbsolutePath()%></title>
</head>
<body>
<h2>Content of <%=conv2Html(f.getName())%></h2><br />
<table class="filelist" cellspacing="1px" cellpadding="0px">
<th>Name</th><th>Uncompressed size</th><th>Compressed size</th><th>Compr. ratio</th><th>Date</th>
<%
long size = 0;
int fileCount = 0;
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
if (!entry.isDirectory()) {
fileCount++;
size += entry.getSize();
long ratio = 0;
if (entry.getSize() != 0) ratio = (entry.getCompressedSize() * 100)
/ entry.getSize();
out.println("<tr class=\"mouseout\"><td>" + conv2Html(entry.getName())
+ "</td><td>" + convertFileSize(entry.getSize()) + "</td><td>"
+ convertFileSize(entry.getCompressedSize()) + "</td><td>"
+ ratio + "%" + "</td><td>"
+ dateFormat.format(new Date(entry.getTime())) + "</td></tr>");
}
}
zf.close();
//No directory view
dir_view = false;
request.setAttribute("dir", null);
%>
</table>
<p align=center>
<b><%=convertFileSize(size)%> in <%=fileCount%> files in <%=f.getName()%>. Compression ratio: <%=(f.length() * 100) / size%>%
</b></p>
</body></html>
<%
}
catch (ZipException ex) {
request.setAttribute("error", "Cannot read " + f.getName()
+ ", no valid zip file");
}
catch (IOException ex) {
request.setAttribute("error", "Reading of " + f.getName() + " aborted. Error: "
+ ex);
}
}
}
// Upload
else if ((request.getContentType() != null)
&& (request.getContentType().toLowerCase().startsWith("multipart"))) {
if (!ALLOW_UPLOAD){
request.setAttribute("error", "Upload is forbidden!");
}
response.setContentType("text/html");
HttpMultiPartParser parser = new HttpMultiPartParser();
boolean error = false;
try {
int bstart = request.getContentType().lastIndexOf("oundary=");
String bound = request.getContentType().substring(bstart + 8);
int clength = request.getContentLength();
Hashtable ht = parser
.processData(request.getInputStream(), bound, tempdir, clength);
if (!isAllowed(new File((String)ht.get("dir")), false)){
//This is a hack, cos we are writing to this directory
request.setAttribute("error", "You are not allowed to access " + ht.get("dir"));
error = true;
}
else if (ht.get("myFile") != null) {
FileInfo fi = (FileInfo) ht.get("myFile");
File f = fi.file;
UplInfo info = UploadMonitor.getInfo(fi.clientFileName);
if (info != null && info.aborted) {
f.delete();
request.setAttribute("error", "Upload aborted");
}
else {
// Move file from temp to the right dir
String path = (String) ht.get("dir");
if (!path.endsWith(File.separator)) path = path + File.separator;
if (!f.renameTo(new File(path + f.getName()))) {
request.setAttribute("error", "Cannot upload file.");
error = true;
f.delete();
}
}
}
else {
request.setAttribute("error", "No file selected for upload");
error = true;
}
request.setAttribute("dir", (String) ht.get("dir"));
}
catch (Exception e) {
request.setAttribute("error", "Error " + e + ". Upload aborted");
error = true;
}
if (!error) request.setAttribute("message", "File upload correctly finished.");
}
// The form to edit a text file
else if (request.getParameter("editfile") != null) {
File ef = new File(request.getParameter("editfile"));
if (!isAllowed(ef, true)){
request.setAttribute("error", "You are not allowed to access " + ef.getAbsolutePath());
}
else{
%>
<title>Edit <%=conv2Html(request.getParameter("editfile"))%></title>
</head>
<body>
<center>
<h2>Edit <%=conv2Html(request.getParameter("editfile"))%></h2><br />
<%
BufferedReader reader = new BufferedReader(new FileReader(ef));
String disable = "";
if (!ef.canWrite()) disable = " readonly";
out.println("<form action=\"" + browser_name + "\" method=\"Post\">\n"
+ "<textarea name=\"text\" wrap=\"off\" cols=\"" + EDITFIELD_COLS
+ "\" rows=\"" + EDITFIELD_ROWS + "\"" + disable + ">");
String c;
// Write out the file and check if it is a win or unix file
int i;
boolean dos = false;
boolean cr = false;
while ((i = reader.read()) >= 0) {
out.print(conv2Html(i));
if (i == '\r') cr = true;
else if (cr && (i == '\n')) dos = true;
else cr = false;
}
reader.close();
//No File directory is shown
request.setAttribute("dir", null);
dir_view = false;
%></textarea><br /><br />
<table class="formular">
<input type="hidden" name="nfile" value="<%= request.getParameter("editfile")%>">
<input type="hidden" name="sort" value="<%=request.getParameter("sort")%>">
<tr><td colspan="2"><input type="radio" name="lineformat" value="dos" <%= dos?"checked":""%>>Ms-Dos/Windows
<input type="radio" name="lineformat" value="unix" <%= dos?"":"checked"%>>Unix
<input type="checkbox" name="Backup" checked>Write backup</td></tr>
<tr><td title="Enter the new filename"><input type="text" name="new_name" value="<%=ef.getName()%>">
<input type="Submit" name="Submit" value="Save"></td>
</form>
<form action="<%=browser_name%>" method="Post">
<td align="left">
<input type="Submit" name="Submit" value="Cancel">
<input type="hidden" name="nfile" value="<%= request.getParameter("editfile")%>">
<input type="hidden" name="sort" value="<%=request.getParameter("sort")%>">
</td>
</form>
</tr>
</table>
</center>
<br />
<hr>
<center>
<small>jsp File Browser version <%= VERSION_NR%> by <a href="http://www.vonloesch.de">www.vonloesch.de</a></small>
</center>
</body>
</html>
<%
}
}
// Save or cancel the edited file
else if (request.getParameter("nfile") != null) {
File f = new File(request.getParameter("nfile"));
if (request.getParameter("Submit").equals("Save")) {
File new_f = new File(getDir(f.getParent(), request.getParameter("new_name")));
if (!isAllowed(new_f, true)){
request.setAttribute("error", "You are not allowed to access " + new_f.getAbsolutePath());
}
if (new_f.exists() && new_f.canWrite() && request.getParameter("Backup") != null) {
File bak = new File(new_f.getAbsolutePath() + ".bak");
bak.delete();
new_f.renameTo(bak);
}
if (new_f.exists() && !new_f.canWrite()) request.setAttribute("error",
"Cannot write to " + new_f.getName() + ", file is write protected.");
else {
BufferedWriter outs = new BufferedWriter(new FileWriter(new_f));
StringReader text = new StringReader(request.getParameter("text"));
int i;
boolean cr = false;
String lineend = "\n";
if (request.getParameter("lineformat").equals("dos")) lineend = "\r\n";
while ((i = text.read()) >= 0) {
if (i == '\r') cr = true;
else if (i == '\n') {
outs.write(lineend);
cr = false;
}
else if (cr) {
outs.write(lineend);
cr = false;
}
else {
outs.write(i);
cr = false;
}
}
outs.flush();
outs.close();
}
}
request.setAttribute("dir", f.getParent());
}
//Unpack file to the current directory without overwriting
else if (request.getParameter("unpackfile") != null) {
File f = new File(request.getParameter("unpackfile"));
String root = f.getParent();
request.setAttribute("dir", root);
if (!isAllowed(new File(root), true)){
request.setAttribute("error", "You are not allowed to access " + root);
}
//Check if file exists
else if (!f.exists()) {
request.setAttribute("error", "Cannot unpack " + f.getName()
+ ", file does not exist");
}
//Check if directory is readonly
else if (!f.getParentFile().canWrite()) {
request.setAttribute("error", "Cannot unpack " + f.getName()
+ ", directory is write protected.");
}
//GZip
else if (f.getName().toLowerCase().endsWith(".gz")) {
//New name is old Name without .gz
String newName = f.getAbsolutePath().substring(0, f.getAbsolutePath().length() - 3);
try {
byte buffer[] = new byte[0xffff];
copyStreams(new GZIPInputStream(new FileInputStream(f)), new FileOutputStream(
newName), buffer);
}
catch (IOException ex) {
request.setAttribute("error", "Unpacking of " + f.getName()
+ " aborted. Error: " + ex);
}
}
//Else try Zip
else {
try {
ZipFile zf = new ZipFile(f);
Enumeration entries = zf.entries();
//First check whether a file already exist
boolean error = false;
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
if (!entry.isDirectory()
&& new File(root + File.separator + entry.getName()).exists()) {
request.setAttribute("error", "Cannot unpack " + f.getName()
+ ", File " + entry.getName() + " already exists.");
error = true;
break;
}
}
if (!error) {
//Unpack File
entries = zf.entries();
byte buffer[] = new byte[0xffff];
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
File n = new File(root + File.separator + entry.getName());
if (entry.isDirectory()) n.mkdirs();
else {
n.getParentFile().mkdirs();
n.createNewFile();
copyStreams(zf.getInputStream(entry), new FileOutputStream(n),
buffer);
}
}
zf.close();
request.setAttribute("message", "Unpack of " + f.getName()
+ " was successful.");
}
}
catch (ZipException ex) {
request.setAttribute("error", "Cannot unpack " + f.getName()
+ ", no valid zip file");
}
catch (IOException ex) {
request.setAttribute("error", "Unpacking of " + f.getName()
+ " aborted. Error: " + ex);
}
}
}
// Delete Files
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(DELETE_FILES))) {
Vector v = expandFileList(request.getParameterValues("selfile"), true);
boolean error = false;
//delete backwards
for (int i = v.size() - 1; i >= 0; i--) {
File f = (File) v.get(i);
if (!isAllowed(f, true)){
request.setAttribute("error", "You are not allowed to access " + f.getAbsolutePath());
error = true;
break;
}
if (!f.canWrite() || !f.delete()) {
request.setAttribute("error", "Cannot delete " + f.getAbsolutePath()
+ ". Deletion aborted");
error = true;
break;
}
}
if ((!error) && (v.size() > 1)) request.setAttribute("message", "All files deleted");
else if ((!error) && (v.size() > 0)) request.setAttribute("message", "File deleted");
else if (!error) request.setAttribute("error", "No files selected");
}
// Create Directory
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(CREATE_DIR))) {
String dir = "" + request.getAttribute("dir");
String dir_name = request.getParameter("cr_dir");
String new_dir = getDir(dir, dir_name);
if (!isAllowed(new File(new_dir), true)){
request.setAttribute("error", "You are not allowed to access " + new_dir);
}
else if (new File(new_dir).mkdirs()) {
request.setAttribute("message", "Directory created");
}
else request.setAttribute("error", "Creation of directory " + new_dir + " failed");
}
// Create a new empty file
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(CREATE_FILE))) {
String dir = "" + request.getAttribute("dir");
String file_name = request.getParameter("cr_dir");
String new_file = getDir(dir, file_name);
if (!isAllowed(new File(new_file), true)){
request.setAttribute("error", "You are not allowed to access " + new_file);
}
// Test, if file_name is empty
else if (!"".equals(file_name.trim()) && !file_name.endsWith(File.separator)) {
if (new File(new_file).createNewFile()) request.setAttribute("message",
"File created");
else request.setAttribute("error", "Creation of file " + new_file + " failed");
}
else request.setAttribute("error", "Error: " + file_name + " is not a valid filename");
}
// Rename a file
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(RENAME_FILE))) {
Vector v = expandFileList(request.getParameterValues("selfile"), true);
String dir = "" + request.getAttribute("dir");
String new_file_name = request.getParameter("cr_dir");
String new_file = getDir(dir, new_file_name);
if (!isAllowed(new File(new_file), true)){
request.setAttribute("error", "You are not allowed to access " + new_file);
}
// The error conditions:
// 1) Zero Files selected
else if (v.size() <= 0) request.setAttribute("error",
"Select exactly one file or folder. Rename failed");
// 2a) Multiple files selected and the first isn't a dir
// Here we assume that expandFileList builds v from top-bottom, starting with the dirs
else if ((v.size() > 1) && !(((File) v.get(0)).isDirectory())) request.setAttribute(
"error", "Select exactly one file or folder. Rename failed");
// 2b) If there are multiple files from the same directory, rename fails
else if ((v.size() > 1) && ((File) v.get(0)).isDirectory()
&& !(((File) v.get(0)).getPath().equals(((File) v.get(1)).getParent()))) {
request.setAttribute("error", "Select exactly one file or folder. Rename failed");
}
else {
File f = (File) v.get(0);
if (!isAllowed(f, true)){
request.setAttribute("error", "You are not allowed to access " + f.getAbsolutePath());
}
// Test, if file_name is empty
else if ((new_file.trim() != "") && !new_file.endsWith(File.separator)) {
if (!f.canWrite() || !f.renameTo(new File(new_file.trim()))) {
request.setAttribute("error", "Creation of file " + new_file + " failed");
}
else request.setAttribute("message", "Renamed file "
+ ((File) v.get(0)).getName() + " to " + new_file);
}
else request.setAttribute("error", "Error: \"" + new_file_name
+ "\" is not a valid filename");
}
}
// Move selected file(s)
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(MOVE_FILES))) {
Vector v = expandFileList(request.getParameterValues("selfile"), true);
String dir = "" + request.getAttribute("dir");
String dir_name = request.getParameter("cr_dir");
String new_dir = getDir(dir, dir_name);
if (!isAllowed(new File(new_dir), false)){
request.setAttribute("error", "You are not allowed to access " + new_dir);
}
else{
boolean error = false;
// This ensures that new_dir is a directory
if (!new_dir.endsWith(File.separator)) new_dir += File.separator;
for (int i = v.size() - 1; i >= 0; i--) {
File f = (File) v.get(i);
if (!isAllowed(f, true)){
request.setAttribute("error", "You are not allowed to access " + f.getAbsolutePath());
error = true;
break;
}
else if (!f.canWrite() || !f.renameTo(new File(new_dir
+ f.getAbsolutePath().substring(dir.length())))) {
request.setAttribute("error", "Cannot move " + f.getAbsolutePath()
+ ". Move aborted");
error = true;
break;
}
}
if ((!error) && (v.size() > 1)) request.setAttribute("message", "All files moved");
else if ((!error) && (v.size() > 0)) request.setAttribute("message", "File moved");
else if (!error) request.setAttribute("error", "No files selected");
}
}
// Copy Files
else if ((request.getParameter("Submit") != null)
&& (request.getParameter("Submit").equals(COPY_FILES))) {
Vector v = expandFileList(request.getParameterValues("selfile"), true);
String dir = (String) request.getAttribute("dir");
if (!dir.endsWith(File.separator)) dir += File.separator;
String dir_name = request.getParameter("cr_dir");
String new_dir = getDir(dir, dir_name);
if (!isAllowed(new File(new_dir), true)){
request.setAttribute("error", "You are not allowed to access " + new_dir);
}
else{
boolean error = false;
if (!new_dir.endsWith(File.separator)) new_dir += File.separator;
try {
byte buffer[] = new byte[0xffff];
for (int i = 0; i < v.size(); i++) {
File f_old = (File) v.get(i);
File f_new = new File(new_dir + f_old.getAbsolutePath().substring(dir.length()));
if (!isAllowed(f_old, false)|| !isAllowed(f_new, true)){
request.setAttribute("error", "You are not allowed to access " + f_new.getAbsolutePath());
error = true;
}
else if (f_old.isDirectory()) f_new.mkdirs();
// Overwriting is forbidden
else if (!f_new.exists()) {
copyStreams(new FileInputStream(f_old), new FileOutputStream(f_new), buffer);
}
else {
// File exists
request.setAttribute("error", "Cannot copy " + f_old.getAbsolutePath()
+ ", file already exists. Copying aborted");
error = true;
break;
}
}
}
catch (IOException e) {
request.setAttribute("error", "Error " + e + ". Copying aborted");
error = true;
}
if ((!error) && (v.size() > 1)) request.setAttribute("message", "All files copied");
else if ((!error) && (v.size() > 0)) request.setAttribute("message", "File copied");
else if (!error) request.setAttribute("error", "No files selected");
}
}
// Directory viewer
if (dir_view && request.getAttribute("dir") != null) {
File f = new File("" + request.getAttribute("dir"));
//Check, whether the dir exists
if (!f.exists() || !isAllowed(f, false)) {
if (!f.exists()){
request.setAttribute("error", "Directory " + f.getAbsolutePath() + " does not exist.");
}
else{
request.setAttribute("error", "You are not allowed to access " + f.getAbsolutePath());
}
//if attribute olddir exists, it will change to olddir
if (request.getAttribute("olddir") != null && isAllowed(new File((String) request.getAttribute("olddir")), false)) {
f = new File("" + request.getAttribute("olddir"));
}
//try to go to the parent dir
else {
if (f.getParent() != null && isAllowed(f, false)) f = new File(f.getParent());
}
//If this dir also do also not exist, go back to browser.jsp root path
if (!f.exists()) {
String path = null;
if (application.getRealPath(request.getRequestURI()) != null) path = new File(
application.getRealPath(request.getRequestURI())).getParent();
if (path == null) // handle the case were we are not in a directory (ex: war file)
path = new File(".").getAbsolutePath();
f = new File(path);
}
if (isAllowed(f, false)) request.setAttribute("dir", f.getAbsolutePath());
else request.setAttribute("dir", null);
}
%>
<script type="text/javascript" src="<%=browser_name %>?Javascript">
</script>
<title><%=request.getAttribute("dir")%></title>
</head>
<body>
<%
//Output message
if (request.getAttribute("message") != null) {
out.println("<table border=\"0\" width=\"100%\"><tr><td class=\"message\">");
out.println(request.getAttribute("message"));
out.println("</td></tr></table>");
}
//Output error
if (request.getAttribute("error") != null) {
out.println("<table border=\"0\" width=\"100%\"><tr><td class=\"error\">");
out.println(request.getAttribute("error"));
out.println("</td></tr></table>");
}
if (request.getAttribute("dir") != null){
%>
<form class="formular" action="<%= browser_name %>" method="Post" name="FileList">
Filename filter: <input name="filt" onKeypress="event.cancelBubble=true;" onkeyup="filter(this)" type="text">
<br /><br />
<table id="filetable" class="filelist" cellspacing="1px" cellpadding="0px">
<%
// Output the table, starting with the headers.
String dir = URLEncoder.encode("" + request.getAttribute("dir"));
String cmd = browser_name + "?dir=" + dir;
int sortMode = 1;
if (request.getParameter("sort") != null) sortMode = Integer.parseInt(request
.getParameter("sort"));
int[] sort = new int[] {1, 2, 3, 4};
for (int i = 0; i < sort.length; i++)
if (sort[i] == sortMode) sort[i] = -sort[i];
out.print("<tr><th> </th><th title=\"Sort files by name\" align=left><a href=\""
+ cmd + "&sort=" + sort[0] + "\">Name</a></th>"
+ "<th title=\"Sort files by size\" align=\"right\"><a href=\"" + cmd
+ "&sort=" + sort[1] + "\">Size</a></th>"
+ "<th title=\"Sort files by type\" align=\"center\"><a href=\"" + cmd
+ "&sort=" + sort[3] + "\">Type</a></th>"
+ "<th title=\"Sort files by date\" align=\"left\"><a href=\"" + cmd
+ "&sort=" + sort[2] + "\">Date</a></th>"
+ "<th> </th>");
if (!READ_ONLY) out.print ("<th> </th>");
out.println("</tr>");
char trenner = File.separatorChar;
// Output the Root-Dirs, without FORBIDDEN_DRIVES
File[] entry = File.listRoots();
for (int i = 0; i < entry.length; i++) {
boolean forbidden = false;
for (int i2 = 0; i2 < FORBIDDEN_DRIVES.length; i2++) {
if (entry[i].getAbsolutePath().toLowerCase().equals(FORBIDDEN_DRIVES[i2])) forbidden = true;
}
if (!forbidden) {
out.println("<tr class=\"mouseout\" onmouseover=\"this.className='mousein'\""
+ "onmouseout=\"this.className='mouseout'\">");
out.println("<td> </td><td align=left >");
String name = URLEncoder.encode(entry[i].getAbsolutePath());
String buf = entry[i].getAbsolutePath();
out.println(" <a href=\"" + browser_name + "?sort=" + sortMode
+ "&dir=" + name + "\">[" + buf + "]</a>");
out.print("</td><td> </td><td> </td><td> </td><td> </td><td></td></tr>");
}
}
// Output the parent directory link ".."
if (f.getParent() != null) {
out.println("<tr class=\"mouseout\" onmouseover=\"this.className='mousein'\""
+ "onmouseout=\"this.className='mouseout'\">");
out.println("<td></td><td align=left>");
out.println(" <a href=\"" + browser_name + "?sort=" + sortMode + "&dir="
+ URLEncoder.encode(f.getParent()) + "\">" + FOL_IMG + "[..]</a>");
out.print("</td><td> </td><td> </td><td> </td><td> </td><td></td></tr>");
}
// Output all files and dirs and calculate the number of files and total size
entry = f.listFiles();
if (entry == null) entry = new File[] {};
long totalSize = 0; // The total size of the files in the current directory
long fileCount = 0; // The count of files in the current working directory
if (entry != null && entry.length > 0) {
Arrays.sort(entry, new FileComp(sortMode));
for (int i = 0; i < entry.length; i++) {
String name = URLEncoder.encode(entry[i].getAbsolutePath());
String type = "File"; // This String will tell the extension of the file
if (entry[i].isDirectory()) type = "DIR"; // It's a DIR
else {
String tempName = entry[i].getName().replace(' ', '_');
if (tempName.lastIndexOf('.') != -1) type = tempName.substring(
tempName.lastIndexOf('.')).toLowerCase();
}
String ahref = "<a onmousedown=\"dis()\" href=\"" + browser_name + "?sort="
+ sortMode + "&";
String dlink = " "; // The "Download" link
String elink = " "; // The "Edit" link
String buf = conv2Html(entry[i].getName());
if (!entry[i].canWrite()) buf = "<i>" + buf + "</i>";
String link = buf; // The standard view link, uses Mime-type
if (entry[i].isDirectory()) {
if (entry[i].canRead() && USE_DIR_PREVIEW) {
//Show the first DIR_PREVIEW_NUMBER directory entries in a tooltip
File[] fs = entry[i].listFiles();
if (fs == null) fs = new File[] {};
Arrays.sort(fs, new FileComp());
StringBuffer filenames = new StringBuffer();
for (int i2 = 0; (i2 < fs.length) && (i2 < 10); i2++) {
String fname = conv2Html(fs[i2].getName());
if (fs[i2].isDirectory()) filenames.append("[" + fname + "];");
else filenames.append(fname + ";");
}
if (fs.length > DIR_PREVIEW_NUMBER) filenames.append("...");
else if (filenames.length() > 0) filenames
.setLength(filenames.length() - 1);
link = ahref + "dir=" + name + "\" title=\"" + filenames + "\">"
+ FOL_IMG + "[" + buf + "]</a>";
}
else if (entry[i].canRead()) {
link = ahref + "dir=" + name + "\">" + FOL_IMG + "[" + buf + "]</a>";
}
else link = FOL_IMG + "[" + buf + "]";
}
else if (entry[i].isFile()) { //Entry is file
totalSize = totalSize + entry[i].length();
fileCount = fileCount + 1;
if (entry[i].canRead()) {
dlink = ahref + "downfile=" + name + "\">Download</a>";
//If you click at the filename
if (USE_POPUP) link = ahref + "file=" + name + "\" target=\"_blank\">"
+ buf + "</a>";
else link = ahref + "file=" + name + "\">" + buf + "</a>";
if (entry[i].canWrite()) { // The file can be edited
//If it is a zip or jar File you can unpack it
if (isPacked(name, true)) elink = ahref + "unpackfile=" + name
+ "\">Unpack</a>";
else elink = ahref + "editfile=" + name + "\">Edit</a>";
}
else { // If the file cannot be edited
//If it is a zip or jar File you can unpack it
if (isPacked(name, true)) elink = ahref + "unpackfile=" + name
+ "\">Unpack</a>";
else elink = ahref + "editfile=" + name + "\">View</a>";
}
}
else {
link = buf;
}
}
String date = dateFormat.format(new Date(entry[i].lastModified()));
out.println("<tr class=\"mouseout\" onmouseup=\"selrow(this, 2)\" "
+ "onmouseover=\"selrow(this, 0);\" onmouseout=\"selrow(this, 1)\">");
if (entry[i].canRead()) {
out.println("<td align=center><input type=\"checkbox\" name=\"selfile\" value=\""
+ name + "\" onmousedown=\"dis()\"></td>");
}
else {
out.println("<td align=center><input type=\"checkbox\" name=\"selfile\" disabled></td>");
}
out.print("<td align=left> " + link + "</td>");
if (entry[i].isDirectory()) out.print("<td> </td>");
else {
out.print("<td align=right title=\"" + entry[i].length() + " bytes\">"
+ convertFileSize(entry[i].length()) + "</td>");
}
out.println("<td align=\"center\">" + type + "</td><td align=left> " + // The file type (extension)
date + "</td><td>" + // The date the file was created
dlink + "</td>"); // The download link
if (!READ_ONLY)
out.print ("<td>" + elink + "</td>"); // The edit link (or view, depending)
out.println("</tr>");
}
}%>
</table>
<input type="checkbox" name="selall" onClick="AllFiles(this.form)">Select all
<p align=center>
<b title="<%=totalSize%> bytes">
<%=convertFileSize(totalSize)%></b><b> in <%=fileCount%> files in <%= dir2linkdir((String) request.getAttribute("dir"), browser_name, sortMode)%>
</b>
</p>
<input type="hidden" name="dir" value="<%=request.getAttribute("dir")%>">
<input type="hidden" name="sort" value="<%=sortMode%>">
<input title="Download selected files and directories as one zip file" class="button" id="but_Zip" type="Submit" name="Submit" value="<%=SAVE_AS_ZIP%>">
<% if (!READ_ONLY) {%>
<input title="Delete all selected files and directories incl. subdirs" class="button" id="but_Del" type="Submit" name="Submit" value="<%=DELETE_FILES%>"
onclick="return confirm('Do you really want to delete the entries?')">
<% } %>
<% if (!READ_ONLY) {%>
<br />
<input title="Enter new dir or filename or the relative or absolute path" class="textfield" type="text" onKeypress="event.cancelBubble=true;" id="text_Dir" name="cr_dir">
<input title="Create a new directory with the given name" class="button" id="but_NDi" type="Submit" name="Submit" value="<%=CREATE_DIR%>">
<input title="Create a new empty file with the given name" class="button" id="but_NFi" type="Submit" name="Submit" value="<%=CREATE_FILE%>">
<input title="Move selected files and directories to the entered path" id="but_Mov" class="button" type="Submit" name="Submit" value="<%=MOVE_FILES%>">
<input title="Copy selected files and directories to the entered path" id="but_Cop" class="button" type="Submit" name="Submit" value="<%=COPY_FILES%>">
<input title="Rename selected file or directory to the entered name" id="but_Ren" class="button" type="Submit" name="Submit" value="<%=RENAME_FILE%>">
<% } %>
</form>
<br />
<div class="formular">
<% if (ALLOW_UPLOAD) { %>
<form class="formular2" action="<%= browser_name%>" enctype="multipart/form-data" method="POST">
<input type="hidden" name="dir" value="<%=request.getAttribute("dir")%>">
<input type="hidden" name="sort" value="<%=sortMode%>">
<input type="file" class="textfield" onKeypress="event.cancelBubble=true;" name="myFile">
<input title="Upload selected file to the current working directory" type="Submit" class="button" name="Submit" value="<%=UPLOAD_FILES%>"
onClick="javascript:popUp('<%= browser_name%>')">
</form>
<%} %>
<% if (NATIVE_COMMANDS) {%>
<form class="formular2" action="<%= browser_name%>" method="POST">
<input type="hidden" name="dir" value="<%=request.getAttribute("dir")%>">
<input type="hidden" name="sort" value="<%=sortMode%>">
<input type="hidden" name="command" value="">
<input title="Launch command in current directory" type="Submit" class="button" id="but_Lau" name="Submit" value="<%=LAUNCH_COMMAND%>">
</form><%
}%>
</div>
<%}%>
<hr>
<center>
<small>jsp File Browser version <%= VERSION_NR%> by <a href="http://www.vonloesch.de">www.vonloesch.de</a></small>
</center>
</body>
</html><%
}
%> | zzprojects | trunk/zzprojects/zzClub/WebRoot/letsmanager.jsp | Java Server Pages | asf20 | 75,416 |
<html>
<head>
<meta http-equiv="content-type" content="text/xml; charset=utf-8" />
<title>My97DatePicker</title>
<script type="text/javascript" src="config.js"></script>
<script>
if(parent==window)
location.href = 'http://www.my97.net';
var $d, $dp, $pdp = parent.$dp, $dt, $tdt, $sdt, $IE=$pdp.ie, $FF = $pdp.ff,$OPERA=$pdp.opera, $ny, $cMark = false;
if ($pdp.eCont) {
$dp = {};
for (var p in $pdp) {
$dp[p] = $pdp[p];
}
}
else
$dp = $pdp;
$dp.getLangIndex = function(name){
var arr = langList;
for (var i = 0; i < arr.length; i++) {
if (arr[i].name == name) {
return i;
}
}
return -1;
}
$dp.getLang = function(name){
var index = $dp.getLangIndex(name);
if (index == -1) {
index = 0;
}
return langList[index];
}
$dp.realLang = $dp.getLang($dp.lang);
document.write("<script src='lang/" + $dp.realLang.name + ".js' charset='" + $dp.realLang.charset + "'><\/script>");
for (var i = 0; i < skinList.length; i++) {
document.write('<link rel="stylesheet" type="text/css" href="skin/' + skinList[i].name + '/datepicker.css" title="' + skinList[i].name + '" charset="' + skinList[i].charset + '" disabled="true"/>');
}
</script>
<script type="text/javascript" src="calendar.js"></script>
</head>
<body leftmargin="0" topmargin="0" onload="$c.autoSize()" tabindex=0>
</body>
</html>
<script>new My97DP();</script> | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/My97DatePicker.htm | HTML | asf20 | 1,389 |
/*
* My97 DatePicker 4.7 Skin:whyGreen
*/
.WdateDiv{
width:180px;
background-color:#fff;
border:#C5E1E4 1px solid;
padding:2px;
}
.WdateDiv2{
width:360px;
}
.WdateDiv *{font-size:9pt;}
.WdateDiv .NavImg a{
cursor:pointer;
display:block;
width:16px;
height:16px;
margin-top:1px;
}
.WdateDiv .NavImgll a{
float:left;
background:url(img.gif) no-repeat;
}
.WdateDiv .NavImgl a{
float:left;
background:url(img.gif) no-repeat -16px 0px;
}
.WdateDiv .NavImgr a{
float:right;
background:url(img.gif) no-repeat -32px 0px;
}
.WdateDiv .NavImgrr a{
float:right;
background:url(img.gif) no-repeat -48px 0px;
}
.WdateDiv #dpTitle{
height:24px;
padding:1px;
border:#c5d9e8 1px solid;
background:url(bg.jpg);
margin-bottom:2px;
}
.WdateDiv .yminput{
margin-top:2px;
text-align:center;
border:0px;
height:20px;
width:50px;
color:#034c50;
background-color:transparent;
cursor:pointer;
}
.WdateDiv .yminputfocus{
margin-top:2px;
text-align:center;
border:#939393 1px solid;
font-weight:bold;
color:#034c50;
height:20px;
width:50px;
}
.WdateDiv .menuSel{
z-index:1;
position:absolute;
background-color:#FFFFFF;
border:#A3C6C8 1px solid;
display:none;
}
.WdateDiv .menu{
cursor:pointer;
background-color:#fff;
color:#11777C;
}
.WdateDiv .menuOn{
cursor:pointer;
background-color:#BEEBEE;
}
.WdateDiv .invalidMenu{
color:#aaa;
}
.WdateDiv .YMenu{
margin-top:20px;
}
.WdateDiv .MMenu{
margin-top:20px;
*width:62px;
}
.WdateDiv .hhMenu{
margin-top:-90px;
margin-left:26px;
}
.WdateDiv .mmMenu{
margin-top:-46px;
margin-left:26px;
}
.WdateDiv .ssMenu{
margin-top:-24px;
margin-left:26px;
}
.WdateDiv .Wweek {
text-align:center;
background:#DAF3F5;
border-right:#BDEBEE 1px solid;
}
.WdateDiv .MTitle{
color:#13777e;
background-color:#bdebee;
}
.WdateDiv .WdayTable2{
border-collapse:collapse;
border:#BEE9F0 1px solid;
}
.WdateDiv .WdayTable2 table{
border:0;
}
.WdateDiv .WdayTable{
line-height:20px;
color:#13777e;
background-color:#edfbfb;
border:#BEE9F0 1px solid;
}
.WdateDiv .WdayTable td{
text-align:center;
}
.WdateDiv .Wday{
cursor:pointer;
}
.WdateDiv .WdayOn{
cursor:pointer;
background-color:#74d2d9 ;
}
.WdateDiv .Wwday{
cursor:pointer;
color:#ab1e1e;
}
.WdateDiv .WwdayOn{
cursor:pointer;
background-color:#74d2d9;
}
.WdateDiv .Wtoday{
cursor:pointer;
color:blue;
}
.WdateDiv .Wselday{
background-color:#A7E2E7;
}
.WdateDiv .WspecialDay{
background-color:#66F4DF;
}
.WdateDiv .WotherDay{
cursor:pointer;
color:#0099CC;
}
.WdateDiv .WotherDayOn{
cursor:pointer;
background-color:#C0EBEF;
}
.WdateDiv .WinvalidDay{
color:#aaa;
}
.WdateDiv #dpTime{
float:left;
margin-top:3px;
margin-right:30px;
}
.WdateDiv #dpTime #dpTimeStr{
margin-left:1px;
color:#497F7F;
}
.WdateDiv #dpTime input{
height:20px;
width:18px;
text-align:center;
color:#333;
border:#61CAD0 1px solid;
}
.WdateDiv #dpTime .tB{
border-right:0px;
}
.WdateDiv #dpTime .tE{
border-left:0;
border-right:0;
}
.WdateDiv #dpTime .tm{
width:7px;
border-left:0;
border-right:0;
}
.WdateDiv #dpTime #dpTimeUp{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -32px -16px;
}
.WdateDiv #dpTime #dpTimeDown{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -48px -16px;
}
.WdateDiv #dpQS {
float:left;
margin-right:3px;
margin-top:3px;
background:url(img.gif) no-repeat 0px -16px;
width:20px;
height:20px;
cursor:pointer;
}
.WdateDiv #dpControl {
text-align:right;
margin-top:3px;
}
.WdateDiv .dpButton{
height:20px;
width:45px;
margin-top:2px;
border:#38B1B9 1px solid;
background-color:#CFEBEE;
color:#08575B;
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/skin/whyGreen/datepicker.css | CSS | asf20 | 3,933 |
.Wdate{
border:#999 1px solid;
height:20px;
background:#fff url(datePicker.gif) no-repeat right;
}
.WdateFmtErr{
font-weight:bold;
color:red;
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/skin/WdatePicker.css | CSS | asf20 | 158 |
var langList =
[
{name:'en', charset:'UTF-8'},
{name:'zh-cn', charset:'UTF-8'},
{name:'zh-tw', charset:'UTF-8'}
];
var skinList =
[
{name:'default', charset:'UTF-8'},
{name:'whyGreen', charset:'UTF-8'}
]; | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/config.js | JavaScript | asf20 | 223 |
var $lang={
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?",
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
clearStr: "\u6E05\u7A7A",
todayStr: "\u4ECA\u5929",
okStr: "\u78BA\u5B9A",
updateStr: "\u78BA\u5B9A",
timeStr: "\u6642\u9593",
quickStr: "\u5FEB\u901F\u9078\u64C7",
err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!'
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/lang/zh-tw.js | JavaScript | asf20 | 1,088 |
var $lang={
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?",
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
clearStr: "\u6E05\u7A7A",
todayStr: "\u4ECA\u5929",
okStr: "\u786E\u5B9A",
updateStr: "\u786E\u5B9A",
timeStr: "\u65F6\u95F4",
quickStr: "\u5FEB\u901F\u9009\u62E9",
err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!'
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/lang/zh-cn.js | JavaScript | asf20 | 1,089 |
var $lang={
errAlertMsg: "Invalid date or the date out of range,redo or not?",
aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],
aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"],
clearStr: "Clear",
todayStr: "Today",
okStr: "OK",
updateStr: "OK",
timeStr: "Time",
quickStr: "Quick Selection",
err_1: 'MinDate Cannot be bigger than MaxDate!'
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/My97DatePicker/lang/en.js | JavaScript | asf20 | 644 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String dirId = request.getParameter("dirId");
String createTime = request.getParameter("createTime");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增联系人</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>新增联系人</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">联系人:</td>
<td><input type="text" name="linkName" id="linkName" value=""/></td>
</tr>
<tr>
<td class="tc">手机号码:</td>
<td><input type="text" name="linkPhone" id="linkPhone" value=""/></td>
</tr>
<tr><td class="tc"><input type="button" value="确定" onclick="addContact('../AddressServlet?method=addContactSubmit');"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
<input type="hidden" name="dirId" id="dirId" value="<%=dirId %>"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/addContact.jsp | Java Server Pages | asf20 | 2,553 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*,util.*,com.AddressListModule.dao.*"%>
<%
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
String phone = session.getAttribute("phone").toString();
List<KehujifenBean> mmsList = (ArrayList) session.getAttribute("kehujifenList");
int colSpanNum = 8;
%>
<jsp:include page="../head.jsp"></jsp:include>
<%
String result = session.getAttribute("resultAdd").toString();
if(!result.equals("")){
out.println("<script>alert('"+result+"');</script>");
session.removeAttribute("resultAdd");
}
%>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="4" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="14" /></jsp:include>
<section id="container">
<div id="crumbs">
客户管理 » 客户积分列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
客户积分列表
</li>
<li>
导入客户积分
</li>
<li>
新增客户积分
</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="9" class="tl">
手机号码:
<input type="text" name="phone" id="phone" value="<%=phone %>">
<input type="button" value="查询" onclick="searchContact('../KehujifenServlet?method=searchContact')">
<input type="button" value="批删" onclick="deleteAllContact('../KehujifenServlet?method=deleteAllContact&phone=<%=phone %>')">
</th>
</tr>
<tr>
<td width="30" class="tc">
<input type="checkbox" title="全选"
onClick="check_allT('deleteAll')"/>
</td>
<td>
手机号码
</td>
<td>
积分
</td>
<td>
最后时间
</td>
<td>
操作
</td>
</tr>
</thead>
<%
if (mmsList != null && mmsList.size() > 0) {
MyPagination mPage=new MyPagination();
mmsList=mPage.getInitPage(mmsList,currentPage,10);
AddressModuleDao addressModuleDao = new AddressModuleDao();
for (KehujifenBean mmsSendBean : mmsList) {
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=mmsSendBean.getCustomerId() %>"/>
</td>
<td><%=mmsSendBean.getCustomerPhone()%></td>
<td><%=Constant.nullToString(mmsSendBean.getCustomerIntegral())%></td>
<td><%=Constant.nullToString(mmsSendBean.getLastTime())%></td>
<td class="tc">
<a class="duanyu_edit" onclick="$mb=$.msgbox({height:320,width:550,content:{type:'ajax',content:'KehujifenServlet?method=modifyContact&mmsId=<%=mmsSendBean.getCustomerId() %>'},title: '客户积分',onAjaxed: function(data){}});">修改</a>
<a title="删除" class="duanyu_del"style="cursor:hand" onClick="deleteOneContact('../KehujifenServlet?method=deleteContact&mmsId=<%=mmsSendBean.getCustomerId() %>&phone=<%=phone %>')">删除</a>
</td>
</tr>
<%
}
%>
<tr>
<td colspan="<%=colSpanNum %>" class="tc" >
<%=mPage.printCtrl("KehujifenServlet",currentPage,"&method=lookContact&phone="+phone) %>
</td>
</tr>
<%
}
%>
</table>
</div>
<div class="tabs-panel">
<form id="formimport" name="formimport" enctype="multipart/form-data" method="post" action="">
<table width="100%" class="form">
<tr>
<th scope="row">导入模版:</th>
<td>
<a href="./module/kehujifen.xls" >点击这里下载导入模板</a>
</td>
</tr>
<tr>
<th scope="row">导入客户积分:</th>
<td>
<input type="file" id="daoru" name="daoru" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="insertImport()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function insertImport(){
var fileName = document.getElementById("daoru").value;
var lastFileName = encodeURI(fileName);
lastFileName = encodeURI(lastFileName);
var file_Name = fileName.split(".")[fileName.split(".").length-1];
if(file_Name=="xls"||file_Name=="XLS")
{
}else
{
alert("上传文件格式不对,请重新导入!");
return ;
}
formimport.action="./KehujifenServlet?method=importjifenSubmit&realImagePath="+lastFileName;
formimport.submit();
}
</script>
</tr>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formadd" name="formadd" method="post" action="">
<table width="100%" class="form">
<tr>
<th scope="row">新增手机号码:</th>
<td>
<input type="text" id="addphone" size="16" maxlength="11" name="addphone" value="" />
</td>
</tr>
<tr>
<th scope="row">初始化积分:</th>
<td>
<input type="text" id="jifen" size="16" name="jifen" value="0" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="addkehujifen()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function addkehujifen(){
var addphone = document.getElementById("addphone").value;
var jifen=document.getElementById("jifen").value;
if(addphone.length==0)
{
alert("手机号码不能为空,请重新添加!");
return;
}
if(jifen.length==0){
alert("积分默认初始值为0,不能为空!");
return;
}
formadd.action="./KehujifenServlet?method=addkehuSubmit";
formadd.submit();
}
</script>
</tr>
</table>
</form>
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/kehujifenList.jsp | Java Server Pages | asf20 | 7,876 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.BlackPhoneModule.bean.*,com.BlackPhoneModule.dao.*,com.UserModule.dao.TbUserDAO"%>
<%@ page import="util.*" %>
<%
List<BlackPhoneBean> BlackPhoneList =new ArrayList();
if(request.getParameter("s")!=null)
BlackPhoneList=(ArrayList) session.getAttribute("BlackPhoneList");
String phone=session.getAttribute("phone").toString();
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
BlackPhoneList=(ArrayList) session.getAttribute("BlackPhoneList");
currentPage=Integer.parseInt(request.getParameter("Page"));
}
//System.out.println("size==" + SmsTemplateList.size());
%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="4" /></jsp:include>
<jsp:include page="Left.jsp">
<jsp:param name="um" value="13" /></jsp:include>
<section id="container">
<div id="crumbs">
黑名单管理 » 黑名单列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
黑名单列表
</li>
<li>
导入黑名单
</li>
<li>
新增黑名单
</li>
</ul>
<div class="tabs-panel">
<%
try{
String resultSM=session.getAttribute("resultSM").toString();
if(!resultSM.equals("")){
out.println("<script>alertmess('"+resultSM+"');</script>");
session.removeAttribute("resultSM");
}
}catch(Exception ex){
}
%>
<form action="" method="post" id="form1" name="form2">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="7" class="tl">
手机号码
<input type="text" id="phone" name="phone" maxlength="11" value="<%=phone %>" />
<input type="button" value="查询" onclick="searcherByphone('../BlackPhoneModuleServlet?method=looksearch')" />
<input type="button" value="批删" onclick="deleteSmsAllSM('deleteAll','../BlackPhoneModuleServlet?method=deleteAll&looksms=2&phone=<%=phone %>')" />
<input type="button" value="导出" onclick="window.location='../upload/export3.xls'" />
</th>
</tr>
<tr>
<td class="tc">
<input type="checkbox" title="全选" onClick="check_allSM('deleteAll')"/>
</td>
<td>
序号
</td>
<td>
手机号码
</td>
<td>
创建人
</td>
<td>
创建时间
</td>
<td>
操作
</td>
</tr>
</thead>
<%
if(BlackPhoneList!=null){
String[][] exportArray=new String[BlackPhoneList.size()+1][4];
exportArray[0][0]="手机号码";
exportArray[0][1]="创建人";
exportArray[0][2]="创建时间";
for(int rowIndex=1;rowIndex<BlackPhoneList.size()+1;rowIndex++)
{
BlackPhoneBean bpb=BlackPhoneList.get(rowIndex-1);
exportArray[rowIndex][0]=""+bpb.getPhone();
exportArray[rowIndex][1]=""+((new TbUserDAO().getTbUsersByUserId(bpb.getUserid())).getUserName());
exportArray[rowIndex][2]=""+bpb.getCreateTime().substring(0,19);
}
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);
int i=0;
//--------------分页
MyPagination mPage=new MyPagination();
BlackPhoneList=mPage.getInitPage(BlackPhoneList,currentPage,10);
if (BlackPhoneList != null && BlackPhoneList.size() > 0) {
for (BlackPhoneBean tbBlackPhoneBean : BlackPhoneList) {
i++;
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=tbBlackPhoneBean.getId()%>"/>
</td>
<td><%=((10*(currentPage-1))+i) %></td>
<td><%=tbBlackPhoneBean.getPhone() %></td>
<td><%=(new TbUserDAO().getTbUsersByUserId(tbBlackPhoneBean.getUserid())).getUserName()%></td>
<td><%=tbBlackPhoneBean.getCreateTime().substring(0,19)%></td>
<td class="tc">
<a title="删除该记录" class="duanyu_del" style="cursor:hand" onClick="deleteOneSM('../BlackPhoneModuleServlet?method=deleteOne&BlackPhoneId=<%=tbBlackPhoneBean.getId() %>')">删除</a>
</td>
</tr>
<%
}
}
%>
<%=mPage.printCtrl("AddressListModule/BlackPhoneList.jsp",currentPage,"&phone="+phone) %>
<%}
else{
String[][] exportArray=new String[1][4];
exportArray[0][0]="手机号码";
exportArray[0][1]="创建人";
exportArray[0][2]="创建时间";
FileOperate.setExcelSavePath(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.deleteFile(request.getRealPath("/")+"upload".replace("\\","/")+"/"+"export3.xls");
FileOperate.writeExcel(exportArray);
}
%>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formimport" name="formimport" enctype="multipart/form-data" method="post" action="">
<table width="100%" class="datalist">
<tr>
<td class="tc">导入模版:</td>
<td>
<a href="./module/blackphoneimport.xls" >点击这里下载导入模板</a>
</td>
</tr>
<tr>
<td class="tc">导入黑名单:</td>
<td>
<input type="file" id="daoru" name="daoru" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="insertImport()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function insertImport(){
var fileName = document.getElementById("daoru").value;
var lastFileName = encodeURI(fileName);
lastFileName = encodeURI(lastFileName);
var file_Name = fileName.split(".")[fileName.split(".").length-1];
if(file_Name=="xls"||file_Name=="XLS")
{
}else
{
alert("上传文件格式不对,请重新导入!");
return ;
}
formimport.action="./BlackPhoneModuleServlet?method=importBlackPhoneSubmit&realImagePath="+lastFileName;
formimport.submit();
}
</script>
</tr>
</table>
</form>
</div>
<div class="tabs-panel">
<form id="formadd" name="formadd" method="post" action="">
<table width="100%" class="datalist">
<tr>
<td class="tc">新增黑名单:</td>
<td>
<input type="text" id="blackphone" maxlength="11" name="blackphone" value="" />
</td>
</tr>
<tr>
<th scope="row"></th>
<td><input type="button" onclick="addblackphone()" value=" 提 交 " /></td>
<script type="text/javascript">
//验证上传格式
function addblackphone(){
var blackphone = document.getElementById("blackphone").value;
if(blackphone.length!=11 || blackphone.length==0)
{
alert("手机号码格式不正确,请重新添加!");
return;
}
formadd.action="./BlackPhoneModuleServlet?method=addBlackPhoneSubmit";
formadd.submit();
}
</script>
</tr>
</table>
</form>
</div>
</div>
</div>
</section>
</div>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/BlackPhoneList.jsp | Java Server Pages | asf20 | 9,223 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String dirId = request.getParameter("dirId");
String dirLevel = request.getParameter("dirLevel");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增通讯录</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>新增通讯录</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="dirName" id="dirName" value=""/></td>
</tr>
<tr><td class="tc"><input type="button" value="确定" onclick="addDir('../AddressServlet?method=addDirSubmit');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
<input type="hidden" name="fatherDirId" id="fatherDirId" value="<%=dirId %>"/>
<input type="hidden" name="dirLevel" id="dirLevel" value="<%=dirLevel %>"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/addDirectory.jsp | Java Server Pages | asf20 | 2,251 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*,util.*"%>
<%@page import="com.AddressListModule.bean.*"%>
<%@page import="com.AddressListModule.dao.*"%>
<%@page import="util.*"%>
<%
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
List<ContactBean> contactList = (ArrayList)session.getAttribute("contactList");
String dirId = request.getParameter("dirId");
int colSpanNum = 8;
%>
<jsp:include page="../head.jsp"></jsp:include>
<body style="align:center">
<ul class="tabs-nav clearfix">
<li>
联系人
</li>
</ul>
<div class="tabs-panel">
<table width="90%" class="datalist">
<thead>
<tr>
<td>
联系人
</td>
<td>
手机号码
</td>
<td>
时间
</td>
</tr>
</thead>
<%
if (contactList!=null&&contactList.size()>0) {
MyPagination mPage=new MyPagination();
contactList=mPage.getInitPage(contactList,currentPage,10);
for (ContactBean contactBean : contactList) {
%>
<tr>
<td><%=contactBean.getCustomerName()%></td>
<td><%=contactBean.getCustomerPhone()%></td>
<td><%=Constant.nullToString(contactBean.getLastTime())%></td>
</tr>
<%
}
%>
<tr>
<td colspan="<%=colSpanNum %>" class="tc" >
<%=mPage.printCtrl("./AddressServlet",currentPage,"&method=getLinkMan&dirId="+dirId) %>
</td>
</tr>
<%
}
%>
</table>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/ShowContact.jsp | Java Server Pages | asf20 | 1,837 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*" %>
<%@page import="util.*"%>
<%
System.out.println("到页面!!!!");
KehujifenBean kehujifenBean = (KehujifenBean)request.getSession().getAttribute("kehujifenBean");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改客户积分</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<div id="pager">
<ul class="tabs-nav clearfix">
<li>
修改客户积分
</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<td>
手机号码
</td>
<td>
<input type="text" name="linkPhone" id="linkPhone" disabled="disabled" readonly="readonly" value="<%=kehujifenBean.getCustomerPhone() %>"/>
</td>
</tr>
<tr>
<td>
积分
</td>
<td>
<input type="text" name="customerIntegral" id="customerIntegral" value="<%=kehujifenBean.getCustomerIntegral() %>"/>
</td>
</tr>
</thead>
</table>
</div>
<input type="button" name="doSubmit" id="doSubmit" value="修改" onclick="modifyContactSubmit('../KehujifenServlet?method=modifyContactSubmit&mmsId=<%=kehujifenBean.getCustomerId() %>');$mb.close();"/>
<input type="button" name="colse" id="close" value="关闭" onclick="$mb.close();"/>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/modifyKehujifen.jsp | Java Server Pages | asf20 | 2,406 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
String dirId = request.getParameter("dirId");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>联系人上传</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="home" href="" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="../scripts/jquery.poshytip.js"></script>
<script language="javascript" type="text/javascript" src="../scripts/treeview.js"></script>
<script language="javascript" type="text/javascript" src="../scripts/mainAddress.js"></script>
<script type="text/javascript">
var updater = null;
function startStatusCheck()
{
//设置上传按钮为不可用状态,避免多次提交
$('submitButton').disabled = true;
//创建周期性发送请求的Ajax对象
updater = new Ajax.PeriodicalUpdater(
'status',
'MmsSendServlet',
{asynchronous:true, frequency:1, method: 'get', parameters: 'c=status', onFailure: reportError});
return true;
}
//出错时处理方法
function reportError(request)
{
$('submitButton').disabled = false;
$('status').innerHTML = '<div class="error"><b>Error communicating with server. Please try again.</b></div>';
}
//上传完毕后,取消周期性获取进度状态,将最终的状态显示在客户端
function killUpdate(message)
{
$('submitButton').disabled = false;
//停止刷新获取进度
updater.stop();
if(message != '')//如果有错误信息,则显示出来
{
$('status').innerHTML = '<div class="error"><b>Error processing results: ' + message + '</b></div>';
}
else//如果没有错误信息
{
//获取上传文件的完成状态,显示到客户端
new Ajax.Updater('status',
'UpLoadServlet',
{asynchronous:true, method: 'get', parameters: 'c=status', onFailure: reportError});
}
}
</script>
<script type="text/javascript">
function importContact(){
//var fileName = document.getElementById("importFile").value;
var fileName = document.getElementById("file").value;
//return false;
var lastFileName = encodeURI(fileName);
lastFileName = encodeURI(lastFileName);
var file_Name = fileName.split(".")[fileName.split(".").length-1];
if(file_Name=="xls"||file_Name=="XLS")
{
}else
{
alert("上传文件格式不对,请重新导入!");
return ;
}
fileform.action="./AddressServlet?method=importContactSubmit&dirId=<%=dirId%>&realImagePath="+lastFileName;
fileform.submit();
eval("top.fileform.mb.close()");
}
</script>
</head>
<body>
<!-- 这个是隐藏的<ifame>作为表单提交后处理的后台目标-->
<section id="container">
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>上传联系人</li>
</ul>
<div id="div2" class="tabs-panel">
<!-- 当表单提交后,调用startStatusCheck()方法-->
<form enctype="multipart/form-data" name="fileform" method="post" id="fileform"
action="./AddressServlet?method=importContactSubmit"
onsubmit="return startStatusCheck();">
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td class="tc">模版格式:</td>
<td align="left">
<a href="./module/date.xls" >点击这里下载导入模板</a>
</td></tr>
<tr>
<td class="tc" width="18%" align="right" valign="middle">
文件:
</td>
<td align="left">
<input type="file" id="file" name="file" >
</td>
</tr>
<tr><td class="tc" colspan="2"><input type="button" value="确定" onclick="importContact();"/>
<input type="button" value="关闭" onclick="$mb.close();"/>
<input type="hidden" name="dirId" id="dirId" value="<%=dirId %>"/>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</section>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/importContact.jsp | Java Server Pages | asf20 | 4,966 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*,util.*,com.AddressListModule.dao.*"%>
<%
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
String linkName = session.getAttribute("linkName").toString();
String phone = session.getAttribute("phone").toString();
List<ContactBean> mmsList = (ArrayList) session
.getAttribute("contactList");
int colSpanNum = 8;
%>
<jsp:include page="../head.jsp"></jsp:include>
<%
String result = session.getAttribute("resultAdd").toString();
if(!result.equals("")){
out.println("<script>alert('"+result+"');</script>");
session.removeAttribute("resultAdd");
}
%>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="4" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="12" /></jsp:include>
<section id="container">
<div id="crumbs">
客户管理 » 内部联系人
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
内部联系人
</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<th colspan="9" class="tl">
联系人
<input type="text" name="linkName" id="linkName" value="<%=linkName %>">
手机号码:
<input type="text" name="phone" id="phone" value="<%=phone %>">
<input type="button" value="查询" onclick="searchContact('../AddressServlet?method=searchContact')">
<input type="button" value="批删" onclick="deleteAllContact('../AddressServlet?method=deleteAllContact&linkName=<%=linkName %>&phone=<%=phone %>')">
</th>
</tr>
<tr>
<td width="30" class="tc">
<input type="checkbox" title="全选"
onClick="check_allT('deleteAll')"/>
</td>
<td>
联系人
</td>
<td>
手机号码
</td>
<td>
所属群组
</td>
<td>
最后时间
</td>
<td>
操作
</td>
</tr>
</thead>
<%
if (mmsList != null && mmsList.size() > 0) {
MyPagination mPage=new MyPagination();
mmsList=mPage.getInitPage(mmsList,currentPage,10);
AddressModuleDao addressModuleDao = new AddressModuleDao();
for (ContactBean mmsSendBean : mmsList) {
%>
<tr>
<td class="tc">
<input name="deleteAll" id = "deleteAll" type="checkbox" value="<%=mmsSendBean.getCustomerId() %>"/>
</td>
<td><%=mmsSendBean.getCustomerName()%></td>
<td><%=mmsSendBean.getCustomerPhone()%></td>
<td><%=addressModuleDao.getDirect(mmsSendBean.getDirId()).getDirName()%></td>
<td><%=Constant.nullToString(mmsSendBean.getLastTime())%></td>
<td class="tc">
<a class="duanyu_edit" onclick="$mb=$.msgbox({height:320,width:550,content:{type:'ajax',content:'AddressServlet?method=modifyContact&mmsId=<%=mmsSendBean.getCustomerId() %>'},title: '联系人',onAjaxed: function(data){}});">修改</a>
<a title="删除" class="duanyu_del"style="cursor:hand" onClick="deleteOneContact('../AddressServlet?method=deleteContact&mmsId=<%=mmsSendBean.getCustomerId() %>&linkName=<%=linkName %>&phone=<%=phone %>')">删除</a>
</td>
</tr>
<%
}
%>
<tr>
<td colspan="<%=colSpanNum %>" class="tc" >
<%=mPage.printCtrl("AddressServlet",currentPage,"&method=lookContact&linkName="+linkName+"&phone="+phone) %>
</td>
</tr>
<%
}
%>
</table>
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/contactList.jsp | Java Server Pages | asf20 | 4,085 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*" %>
<%
DirectoryBean directoryBean = (DirectoryBean)session.getAttribute("directoryBean");
String dirLevel = request.getParameter("dirLevel");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改通讯录</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>修改通讯录</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="dirName" id="dirName" value="<%=directoryBean.getDirName() %>"/></td>
</tr>
<tr><td class="tc"><input type="button" value="确定" onclick="modifyDir('../AddressServlet?method=modifyDirSubmit');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
<input type="hidden" name="dirId" id="dirId" value="<%=directoryBean.getDirId() %>"/>
<input type="hidden" name="dirLevel" id="dirLevel" value="<%=dirLevel %>"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/modifyDirectory.jsp | Java Server Pages | asf20 | 2,289 |
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(request.getParameter("um")!=null){
%>
<aside id="aside">
<ul>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>AddressServlet?method=lookDir&startTime=&endTime=&dirName=&dingwei=';" href="javascript:void(0);" class="nm11 <% if ("11".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">通讯录管理</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>AddressServlet?method=lookContact&linkName=&phone=&Page=1';" href="javascript:void(0);" class="nm12 <% if ("12".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">内部联系人</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>KehujifenServlet?method=lookContact&linkName=&phone=&Page=1';" href="javascript:void(0);" class="nm14 <% if ("14".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">客户积分</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>BlackPhoneModuleServlet?method=lookBlackPhone&linkName=&phone=&Page=1';" href="javascript:void(0);" class="nm13 <% if ("13".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">黑名单管理</a></li>
</ul>
</aside>
<%
}
%> | zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/Left.jsp | Java Server Pages | asf20 | 1,846 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*" %>
<%
DirectoryBean directoryBean = (DirectoryBean)session.getAttribute("directoryBean");
String dirLevel = request.getParameter("dirLevel");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>删除通讯录</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>删除通讯录</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="dirName" id="dirName" value="<%=directoryBean.getDirName() %>"/></td>
</tr>
<tr><td class="tc"><input type="button" value="删除" onclick="deleteDir('../AddressServlet?method=deleteDirSubmit&dirId=<%=directoryBean.getDirId() %>&fatherId=<%=directoryBean.getParentDirId() %>');$mb.close();"/></td>
<td class="tc"><input type="button" value="取消" onclick="$mb.close();"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/deleteDirectory.jsp | Java Server Pages | asf20 | 2,148 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page
import="com.AddressListModule.bean.*,com.AddressListModule.dao.*"%>
<%
StringBuffer sb = (StringBuffer)session.getAttribute("sb");
String dingwei = request.getParameter("dingwei");
%>
<jsp:include page="../head.jsp"></jsp:include>
<style>
.treeview LI.on {
background:#E6F5FD;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$('.treeview').treeview();
//$('.treeview li a').after('<span title="添加子节点" class="addnode"><a href="javascript:alert(1);">添加子节点</a></span><span title="编辑该节点" class="editnode"><a href="javascript:alert(2);">编辑该节点</a></span><span title="删除该节点" class="delnode"><a href="javascript:alert(3);">删除该节点</a></span>');
$('.treeview li span').hide();
$('.treeview li').hover(function(){
$(this).children('span').show();
},function(){
$(this).children('span').hide();
});
});
</script>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="4" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="11" /></jsp:include>
<section id="container">
<div id="crumbs">
客户管理 » 通讯录管理
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>
通讯录管理
</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<td>
通讯录
</td>
</tr>
</thead>
<tr>
<td>
<ul class="treeview" id="headerIndex">
<%=sb %>
</ul>
<script>
var headerIndex=document.getElementById("headerIndex");
var artlis = headerIndex.getElementsByTagName("li");
try{
for(var i =0;i<artlis.length;i++){
if(artlis[i].className!="0"&&artlis[i].className!=""&&artlis[i].className=="<%=dingwei%>"){
artlis[i].className = artlis[i].className+" on";
}
}
}catch(e){}
</script>
</td>
</tr>
</table>
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/showDirectry.jsp | Java Server Pages | asf20 | 2,402 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.AddressListModule.bean.*" %>
<%@page import="util.*"%>
<%
System.out.println("到页面!!!!");
ContactBean contact_Bean = (ContactBean)request.getSession().getAttribute("contact_Bean");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改联系人</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<div id="pager">
<ul class="tabs-nav clearfix">
<li>
修改联系人
</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<td>
联系人
</td>
<td>
<input type="text" name="linkMan" id="linkMan" value="<%=contact_Bean.getCustomerName() %>"/>
</td>
</tr>
<tr>
<td>
手机号码
</td>
<td>
<input type="text" name="linkPhone" id="linkPhone" value="<%=contact_Bean.getCustomerPhone() %>"/>
</td>
</tr>
<input type="hidden" name="customerIntegral" id="customerIntegral" value="<%=Constant.nullToString(contact_Bean.getCustomerIntegral()) %>"/>
<tr>
<td>
时间
</td>
<td>
<input type="text" name="danwei" id="danwei" value="<%=Constant.nullToString(contact_Bean.getLastTime()) %>"/>
</td>
</tr>
</thead>
</table>
</div>
<input type="button" name="doSubmit" id="doSubmit" value="修改" onclick="modifyContactSubmit('../AddressServlet?method=modifyContactSubmit&mmsId=<%=contact_Bean.getCustomerId() %>');$mb.close();"/>
<input type="button" name="colse" id="close" value="关闭" onclick="$mb.close();"/>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/AddressListModule/modifyContact.jsp | Java Server Pages | asf20 | 2,715 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
if((session.getAttribute("e")!=null) && (session.getAttribute("u")!=null) && (session.getAttribute("p")!=null))
{
%>
<script type="text/javascript" src="scripts/md5.js"></script>
<form name="LoginForm2" method="post" action="http://www.sdwzt.com.cn/t11login.do?method=login">
<input type="hidden" name="loginType" value="1">
<input type="hidden" name="e" value="<%=session.getAttribute("e").toString()%>" />
<input type="hidden" name="u" value="<%=session.getAttribute("u").toString()%>" />
<input type="hidden" name="p" value="<%=session.getAttribute("p").toString()%>" />
</form>
<script type="text/javascript">
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
//将Unicode编码的字符串,转换成Ansi编码的字符串
function strUnicode2Ansi(asContents)
{
var len1=asContents.length;
var temp="";
for(var i=0;i<len1;i++)
{
var varasc=asContents.charCodeAt(i);
if(varasc<0)
varasc+=65536;
if(varasc>127)
varasc=UnicodeToAnsi(varasc);
if(varasc>255)
{
var varlow=varasc & 65280;
varlow=varlow>>8;
var varhigh=varasc & 255;
temp+=String.fromCharCode(varlow)+String.fromCharCode(varhigh);
}
else
{
temp+=String.fromCharCode(varasc);
}
}
return temp;
}
//将Ansi编码的字符串进行Base64编码
function encode64(input) {
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;
do {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output +
keyStr.charAt(enc1) +
keyStr.charAt(enc2) +
keyStr.charAt(enc3) +
keyStr.charAt(enc4);
chr1 = chr2 = chr3 = "";
enc1 = enc2 = enc3 = enc4 = "";
} while (i < input.length);
return output;
}
function submitFmLocation(){
document.LoginForm2.e.value=encodeURI(encode64(strUnicode2Ansi(document.LoginForm2.e.value)));
document.LoginForm2.u.value=encodeURI(encode64(strUnicode2Ansi(document.LoginForm2.u.value)));
document.LoginForm2.p.value=encodeURI(encode64(hex_md5(strUnicode2Ansi(document.LoginForm2.p.value))));
document.LoginForm2.submit();
return true;
}
submitFmLocation();
</script>
<%
}
%>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/Location.jsp | Java Server Pages | asf20 | 3,279 |
function addOptionSM(oSelect,inValue)
{
/* var opt=document.createElement("OPTION");
opt.value=inValue;
opt.text=inValue;
oSelect.add(opt);*/
var str = $("<option>"+inValue+"</option>");
str.appendTo("#"+oSelect);
}
function alertmess(alertmessage){
$.msgbox({
width:300,
height:120,
content:{type:'alert', content:alertmessage},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
return false;
}
function confirmmess(alertmessage,inpath){
$.msgbox({
width:300,
height:120,
content:{type:'confirm', content:alertmessage,url:inpath},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
return false;
}
function addNumberSM(receiverType, formname,selectN) {
var mobile=formname.mobile.value;
var item = document.createElement("OPTION");
var leng = $("#"+selectN +" option").length;
//alert(mobile.length);
if(mobile.length==0){
alertmess('不能添加空联系人,请选择联系人!');
}else if(mobile.length<11){
alertmess("您输入的手机号码无效!");
}else{
if (receiverType == 7)
{
/*for (i=0;i<leng;i++)
{
if ($("#"+selectN).options(i).value == formname.mobile.value)
{
alertmess("您选择的用户重复!");
return;
}
}*/
}
addOptionSM(selectN,mobile);
formname.mobile.value="";
}
}
function delReceiverSM(formname,selectN)
{
$("#"+selectN+" option").each(function(){
//alert("ddd"+$('#'+va+' option:selected').val());
$('#'+selectN+' option:selected').remove();//delete the phone which selected
});
/* var destItem;
var item, itemValue;
var i;
srcItem = formname.selectN;
alert("srcItem=="+formname.selectN.length);
for (i=srcItem.length-1;i>=0;i--)
{
item = srcItem.item(i);
if (item.selected)
{
itemValue = item.value.split("\4");
item.value = itemValue[1];
srcItem.remove(i);
}
}*/
}
/**
*去除字符串内空格1
*/
function trims(inStr)
{
return inStr.replace(/ /g,"");
}//end function trims
function insertallSM(formname){
var isdingshi=formname.time;
var thisradio;
for(var i = 0; i< isdingshi.length; i++){
if(isdingshi[i].checked){
thisradio=isdingshi[i].value;
}
}
if(thisradio=="time"){
var sendTime=formname.sendTime.value;
var dt1=(sendTime);
var d=new Date();
var dt2=(d.getYear()+"-"+(d.getMonth()+1)+"-"+d.getDate()+" "+d.getHours()+":"+(d.getMinutes()-1)+":"+d.getSeconds());
var arrayD1=dt1.split(" ");
var arrayD2=dt2.split(" ");
dt1=new Date(arrayD1[0].split("-")[0],arrayD1[0].split("-")[1],arrayD1[0].split("-")[2],arrayD1[1].split(":")[0],arrayD1[1].split(":")[1],arrayD1[1].split(":")[2]);
dt2=new Date(arrayD2[0].split("-")[0],arrayD2[0].split("-")[1],arrayD2[0].split("-")[2],arrayD2[1].split(":")[0],arrayD2[1].split(":")[1],arrayD2[1].split(":")[2]);
var flag=(dt1>dt2);
if(flag==false){
alertmess('您选择的时间不能小于当前时间,请重新发送!');
return false;
}
}
var rec=formname.select1;
//alert(rec);
var len=rec.length;
//alert(len);
if(rec.length>0){
for(var i=0;i<len;i++){
if(rec.options[i].length<12)
{
alertmess("手机号码位数不对,请查证后重新输入!");
return ;
}
if(i==len-1){
formname.txtArea.value +=rec.options[i].text;
}else{
formname.txtArea.value +=rec.options[i].text+";";
}
}
// alert(formname.txtArea.value);
for(var i=0; i<rec.length; i++)
{
rec.options[i].selected="true";
}
formname.action="TbSmsServlet?method=save";
formname.submit();
}else{
formname.action="TbSmsServlet?method=save";
formname.submit();
}
}
function giveNowTimeSM(formname)
{
var dt=new Date();
var tempMonth=parseInt(dt.getMonth()+1);
tempMonth=tempMonth<10?"0"+tempMonth:tempMonth;
var tempDay=parseInt(dt.getDate());
tempDay=tempDay<10?"0"+tempDay:tempDay;
var tempHours=parseInt(dt.getHours());
tempHours=tempHours<10?"0"+tempHours:tempHours;
var tempMinutes=parseInt(dt.getMinutes());
tempMinutes=tempMinutes<10?"0"+tempMinutes:tempMinutes;
var tempSeconds=parseInt(dt.getSeconds());
tempSeconds=tempSeconds<10?"0"+tempSeconds:tempSeconds;
var timeStr=dt.getYear()+'-'+tempMonth+'-'+tempDay+' '+tempHours+':'+tempMinutes+':'+tempSeconds;
formname.sendTime.value=timeStr;
}
function giveNowTimeMettingSM(formname)
{
var dt=new Date();
var tempMonth=parseInt(dt.getMonth()+1);
tempMonth=tempMonth<10?"0"+tempMonth:tempMonth;
var tempDay=parseInt(dt.getDate());
tempDay=tempDay<10?"0"+tempDay:tempDay;
var tempHours=parseInt(dt.getHours());
tempHours=tempHours<10?"0"+tempHours:tempHours;
var tempMinutes=parseInt(dt.getMinutes());
tempMinutes=tempMinutes<10?"0"+tempMinutes:tempMinutes;
var timeStr=dt.getYear()+'-'+tempMonth+'-'+tempDay+' '+tempHours+':'+tempMinutes;
formname.MettingTime.value=timeStr;
}
function isReceveSM(formname,bl,inTrName)
{
if(bl)
{
giveNowTimeSM(formname);
document.getElementById(inTrName).style.display='none';
}else{
document.getElementById(inTrName).style.display='block';
}
}
//统计安监通知字数
function checkoverflowSM(formname,leng){
var str = new String();
str = formname.message.value;
formname.counterMsg.value = leng - str.length;
if (str.length>leng){
formname.message.value = str.substr(0,leng);
formname.counterMsg.value = 0;
alertmess('您输入的信息的长度应不超过'+leng+'!');
return false;
}
return true;
}
/*
* 删除一个记录
*/
function deleteOneSM(url){
var startTime = $("#startTime").val();
var endTime = $("#endTime").val();
// alert('starttime:'+startTime+'endtime:'+endTime);
var content=$("#content").val();
var phone=$("#phone").val();
var inputurl = url+"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone;
//alert("url=="+url);
var lastUrl = encodeURI(inputurl);
lastUrl = encodeURI(lastUrl);
confirmmess("你确定要删除此记录吗?",lastUrl);
}
function shenheSM(url){
var startTime = $("#startTime").val();
var endTime = $("#endTime").val();
var content=$("#content").val();
var phone=$("#phone").val();
// alert(url);
var inputurl = url+"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone;
//alert("url=="+url);
var lastUrl = encodeURI(inputurl);
lastUrl = encodeURI(lastUrl);
confirmmess("你确定要审核此记录吗?",lastUrl);
}
//多选删除
function deleteSmsAllSM(va,url)
{
//alert("url="+url)
var obj = document.getElementsByName(va);
var idList = "";
var num = 0;
for(var i = 0;i<obj.length;i++)
{
if(obj[i].checked)
{
num++;
idList+=obj[i].value+",";
}
}
if(num<1)
{
alertmess("没有选择记录无法删除!");
return ;
}
var lastUrl = encodeURI(url+"&idList="+idList);
lastUrl = encodeURI(lastUrl);
confirmmess('你确定删除吗?',lastUrl);
}
//全选功能
function check_allSM(va)
{
var obj = document.getElementsByName(va);
for(var o = 0;o<obj.length;o++)
{
if(obj[o].checked == true)
{
obj[o].checked = false;
}else if(obj[o].checked == false)
{
obj[o].checked = true;
}
}
}
//根据条件进行查询
function searcherSM(inPath){
//alert(inPath);
var startTime = $("#startTime").val();
var endTime = $("#endTime").val();
var content=$("#content").val();
var phone=$("#phone").val();
var lastUrl = inPath+"&startTime="+startTime+"&endTime="+endTime+"&content="+content+"&phone="+phone;
var last_url = encodeURI(lastUrl);
last_url = encodeURI(last_url);
window.location=last_url;
}
//提交常用短语
function insertTemplateSM(formname,inPath){
var phraseContent=formname.message.value;
var lastUrl=inPath+"&phraseContent="+phraseContent;
var last_url = encodeURI(lastUrl);
last_url = encodeURI(last_url);
if(phraseContent.length>0){
confirmmess('您确定提交此常用短语吗?',last_url);
//window.location=last_url;
}else{
alertmess('常用短语内容不能为空!');
}
}
//常用短语选择
function checkformSM(inFormName,inTabIndex){
var tempArray = document.getElementsByName("radioCommonPhrase");
var commonPhraseStr = '';
for(i=0;i<tempArray.length;i++)
{
if(tempArray[i].checked){
commonPhraseStr = tempArray[i].value;
}
}
eval("top."+inFormName+".mb.rtVl=commonPhraseStr;");
eval("top."+inFormName+".mb.close();");
}
//根据条件进行查询
function searcherByphone(inPath){
var phone=$("#phone").val();
var lastUrl = inPath+"&phone="+phone;
var last_url = encodeURI(lastUrl);
last_url = encodeURI(last_url);
window.location=last_url;
}
//根据条件进行查询
function searcherByDianbo(inPath){
var content=$("#content").val();
var dianbotype=$("#dianbotype").val();
var lastUrl = inPath+"&content="+content+"&dianbotype="+dianbotype;
var last_url = encodeURI(lastUrl);
last_url = encodeURI(last_url);
window.location=last_url;
}
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/smssend.js | JavaScript | asf20 | 9,813 |
$(function(){
$('.tabs>.tabs-panel').hide();
$('.tabs>.tabs-nav>li:first').addClass('tabs-selected');
$('.tabs>.tabs-panel:first').show();
$('.tabs>.tabs-nav>li').mousedown(function(e) {
if (e.target == this) {
var tabs = $(this).parent().children('li');
var panels = $(this).parent().parent().children('.tabs-panel');
var index = $.inArray(this, tabs);
if (panels.eq(index)[0]) {
tabs.removeClass('tabs-selected').eq(index).addClass('tabs-selected');
panels.hide().eq(index).show();
}
}
});
});
function selectTabs(inNum){
alert("innum=="+inNum);
var tabArray=$('.tabs>.tabs-panel');
var liArray=$('.tabs>.tabs-nav>li');
for(var i=0;i<tabArray.length;i++){
if(inNum==i){
liArray[i].className='tabs-selected';
tabArray[i].style.display='block';
}else{
liArray[i].className='';
tabArray[i].style.display='none';
}
}
}
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/tabs.js | JavaScript | asf20 | 919 |
//选择通讯录
function selectDirPhone(va,formName,selectPhone){
//$.msgbox({height:450,width:450,content:{type:'iframe',content:''},title:'选择通讯录'});
}
//删除手机号码
function deletePhone(va){
//alert("delete a phone"+va);
$("#"+va+" option").each(function(){
//alert("ddd"+$('#'+va+' option:selected').val());
$('#'+va+' option:selected').remove();//delete the phone which selected
});
}
//添加手机号码
function addPhone(formName,va){
var phone = formName.phone.value;
$("#"+va+" option").each(function(){
});
var bo = checkNum(phone)
if(bo){
var str = $("<option>"+phone+"</option>");
str.appendTo("#"+va);
formName.phone.value="";
}
//$("#"+va+".phone").attr("value","");
//selectObj.innerText =
}
//统计发送字数
function checkoverflowSM(formname,leng){
var str = new String();
str = formname.message.value;
formname.counterMsg.value = leng - str.length;
if (str.length>leng){
formname.message.value = str.substr(0,leng);
formname.counterMsg.value = 0;
//alertmess('您输入的信息的长度应不超过'+leng+'!');
return false;
}
return true;
}
function alertmess(alertmessage){
$.msgbox({
width:300,
height:120,
content:{type:'alert', content:alertmessage},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
return false;
}
//定时或及时发送
function isReceveSM(formname,bl,inTrName)
{
if(bl)
{
giveNowTimeSM(formname);
document.getElementById(inTrName).style.display='none';
}else{
document.getElementById(inTrName).style.display='block';
}
}
/*function userModule_checkForm(inForm){
alert("标识"+inForm.biaoshi.value);
var flag=false;
var tempObj="";
if((trims(inForm.userName.value))==""){
flag=true;
tempObj=inForm.userName;
}
if((trims(inForm.userPass.value))==""){
flag=true;
tempObj=inForm.userPass;
}
if((trims(inForm.reUserPass.value))==""){
flag=true;
tempObj=inForm.reUserPass;
}
if((trims(inForm.userPhone.value))==""){
flag=true;
tempObj=inForm.userPhone;
}
if((trims(inForm.biaoshi.value))==""){
flag=true;
tempObj=inForm.biaoshi;
}
if(inForm.userPass.value!=inForm.reUserPass.value){
$.msgbox({
height:150,
width:250,
content:{type:'alert', content:'两次输入密码不一致!'},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
inForm.userPass.value="";
inForm.reUserPass.value="";
inForm.userPass.focus();
return false;
}
if(flag){
$.msgbox({
height:150,
width:250,
content:{type:'alert', content:tempObj.tip},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
return false;
}
return true;
}*/
/**
*去空格
*/
function trims(inStr)
{
return inStr.replace(/ /g,"");
}//end function trims
//全选功能
function selectAll(inName)
{
var ckArray = document.getElementsByName(inName);
for(var i=0;i<ckArray.length;i++)
{
ckArray[i].checked=ckArray[0].checked;
}
}
//删除开始
function delRow(inPagePath,inCkName)
{
var allIds="";
var vslist = document.getElementsByName(inCkName);
if(vslist.length<=0)
{
return false;
}
for(i=vslist.length-1;i>=0;i--)
{
if(vslist[i].checked)
{
if(allIds=="")
{
allIds=vslist[i].id;
}else{
allIds+=","+vslist[i].id;
}
}//end if
}//end for i
if(trims(allIds).length==0)
{
$.msgbox({
height:150,
width:250,
content:{type:'alert', content:'请选中后再删除'},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
return false;
}
$.msgbox({
height:150,
width:250,
content:{type:'confirm', content: '确定要删除吗?'},
onClose:function(v){
if(v) {window.location=inPagePath+"?allId="+allIds;}
else return false;
}
});
}//end function delRow
function delRow(inPagePath,inCkName,inPram)
{
var allIds="";
var vslist = document.getElementsByName(inCkName);
if(vslist.length<=0)
{
return false;
}
for(i=vslist.length-1;i>=0;i--)
{
if(vslist[i].checked)
{
if(allIds=="")
{
allIds=vslist[i].id;
}else{
allIds+="_"+vslist[i].id;
}
}//end if
}//end for i
if(trims(allIds).length==0)
{
$.msgbox({
height:150,
width:250,
content:{type:'alert', content:'请选中后再删除'},
animation:0,//禁止拖拽
drag:false,//禁止动画
autoClose: 5 //自动关闭
});
return false;
}
$.msgbox({
height:150,
width:250,
content:{type:'confirm', content: '确定要删除吗?'},
onClose:function(v){
if(v) {window.location=inPagePath+"?delAll="+allIds+"&"+inPram;}
else return false;
}
});
}//删除结束
function userModule_checkForm(inForm){
var flag=false;
if((trims(inForm.userName.value))==""){
flag=true;
tempObj=inForm.userName;
}
if((trims(inForm.userPass.value))==""){
flag=true;
tempObj=inForm.userPass;
}
if((trims(inForm.reUserPass.value))==""){
flag=true;
tempObj=inForm.reUserPass;
}
if((trims(inForm.biaoshi.value))==""){
flag=true;
tempObj=inForm.biaoshi;
}
if((trims(inForm.reUserPass.value))!=(trims(inForm.userPass.value))){
flag=true;
tempObj=inForm.userPass;
}
if(flag){
alert("用户名或密码、标识码不合法,请检查后再提交");
tempObj.focus();
return false;
}
return true;
}
function setIsView(inBl){
document.getElementById('userType').value=inBl;
}//end function
//select the sex of user when create a loginUser 0: man 1:wonman
function selectSex(va){
document.getElementById("user_sex").value=va;
}
function doSubmit(typeId){
var fenshu= $("#num").val();
var strP=/^\d+(\.\d+)?$/;
if(!strP.test(fenshu))
{
alert("请输入整数!");
return false;
}
window.parent.location="../DianboServlet?method=setSubmit&num="+fenshu+"&typeId="+typeId;
top.msg.close();
}
function doSubmitDown(typeId){
var fenshu= $("#num").val();
var strP=/^\d+(\.\d+)?$/;
if(!strP.test(fenshu))
{
alert("请输入整数!");
return false;
}
window.parent.location="../DianboServlet?method=setDownSubmit&num="+fenshu+"&typeId="+typeId;
top.msg.close();
}
function doSubmitDownDati(typeId){
var fenshu= $("#num").val();
var strP=/^\d+(\.\d+)?$/;
if(!strP.test(fenshu))
{
alert("请输入整数!");
return false;
}
window.parent.location="../DatiServlet?method=setDownSubmit&num="+fenshu+"&typeId="+typeId;
top.msg.close();
}
function doSubmitXilie(xilieId){
var fenshu= $("#num").val();
var strP=/^\d+(\.\d+)?$/;
if(!strP.test(fenshu))
{
alert("请输入整数!");
return false;
}
window.parent.location="../DatiServlet?method=setSubmit&num="+fenshu+"&xilieId="+xilieId;
top.msg.close();
}
function addDatiType(url){
var datiTypeName = $("#datiTypeName").val();
var lastUrl = url+"&datiTypeName="+datiTypeName;
var last_Url = encodeURI(lastUrl);
last_Url=encodeURI(last_Url);
window.location=last_Url;
}
function modifyDatiType(url){
var datiTypeName = $("#datiTypeName").val();
if(datiTypeName==""){
alert("答题类型不能为空!");
return ;
}
var lastUrl = url+"&datiTypeName="+datiTypeName;
var last_Url = encodeURI(lastUrl);
last_Url=encodeURI(last_Url);
window.location=last_Url;
}
function deleteDatiType(url){
//window.location=url;
$.msgbox({
height:150,
width:250,
content:{type:'confirm', content: '此操作会删除此类型下的所有系列及所有题目,确定要删除吗?'},
onClose:function(v){
if(v) {window.location=url;}
else return false;
}
});
}
function addXilie(url){
var xilieName = $("#xilieName").val();
if(xilieName==""){
alert("系列不能为空!");
return ;
}
var lastUrl = encodeURI(url+"&xilieName="+xilieName);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
function modifyDatiXilie(url){
var xilieName = $("#datiXilieName").val();
if(xilieName==""){
alert("系列名列不能为空!");
return ;
}
var lastUrl = encodeURI(url+"&xilieName="+xilieName);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
function deleteXilie(url){
//window.location = url;
$.msgbox({
height:150,
width:250,
content:{type:'confirm', content: '此操作会删除此系列下的所有题目,确定要删除吗?'},
onClose:function(v){
if(v) {window.location=url;}
else return false;
}
});
}
function addDianboType(url){
var dianboTypeName = $("#dianboTypeName").val();
if(dianboTypeName==""){
alert("名称不能为空!");
return ;
}
var lastUrl = encodeURI(url+"&dianboTypeName="+dianboTypeName);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
function modifyDianboType(url){
var dianboTypeName = $("#dianboTypeName").val();
if(dianboTypeName==""){
alert("名称不能为空!");
return ;
}
var lastUrl = encodeURI(url+"&dianboTypeName="+dianboTypeName);
lastUrl = encodeURI(lastUrl);
window.location= lastUrl;
}
function delDianboType(url){
window.location= url;
}
//短信发送中的点点通
function upLoad(){
var fileName = document.getElementById("fileName").value;
//return false;
var lastFileName = encodeURI(fileName);
lastFileName = encodeURI(lastFileName);
var file_Name = fileName.split(".")[fileName.split(".").length-1];
if(file_Name=="xls"||file_Name=="XLS"||file_Name=="txt"||file_Name=="TXT")
{
}else
{
alert("上传文件格式不对,请重新导入!");
return ;
}
var url = "./TbSmsServlet?method=upLoad&filePath="+lastFileName;
fileForm.action=url;
fileForm.submit();
}
function selectDirPhone(va,formName,selectPhone){
/*var dir_Name=va.dir_Name.value;
var dirName = encodeURI(dir_Name);
dirName=encodeURI(dirName);*/
/* var quxian = encodeURI(qu_xian);
quxian = encodeURI(quxian);
var hangye = encodeURI(hang_ye);
hangye = encodeURI(hangye);
var qiye = encodeURI(qi_ye);
qiye = encodeURI(qiye);
var bumen = encodeURI(bu_men);
bumen = encodeURI(bumen);*/
// alert("come !!!!!!!");
var foName=formName;
frmMessage.mb=$.msgbox({height:450,width:800,content:{type:'iframe',content:'AddressServlet?method=selectDir&formName='+va.name+'&selectPhone='+selectPhone.name},title:'选择通讯录'});
}
function do_Submit(formName,selectPhone){
var select_dir = document.getElementsByName("select_Dir");
var dirId="";
var select_dirLen = select_dir.length;
for(var v = 0;v<select_dirLen;v++){
if(select_dir[v].checked){
dirId+=select_dir[v].id+",";
select_dir[v].checked=false;
}
}
getLinkMan(formName,selectPhone,dirId);
}
//get linkMan by dirId (1,2,3,.......)
function getLinkMan(formName,selectPhone,dirId){
var url = 'method=getLinkMans&dirId='+dirId+'&selectPhone='+selectPhone+'&formName='+formName+'&sessionId='+parseInt(Math.random()*(10000000));
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
// $.get(lastUrl,backFunction);
$.post('./AddressServlet',lastUrl,backFunction);
}
function backFunction(data){
var lastData =data.replace(/^\s+|\s+$/g,"");
var allData = lastData.split(",");
var formName = allData[0];
var first = allData[1];
var second = allData[2];
// second.appendTo("#"+top.first);
if(second!=""){
top.back(first,second);
}
eval("top.frmMessage.mb.close();");
}
//往发送页面传手机号码
function back(selectPhone,dat){
var second = $(dat);
second.appendTo("#"+selectPhone);
}
function addOrder(url){
var orderType = $("#orderType").val();
var typeId = $("#typeId").val();
var orderName = $("#orderName").val();
var lastUrl = url+"&orderName="+orderName+"&orderType="+orderType+"&typeId="+typeId;
window.location = lastUrl;
}
function selectOrder(va){
document.getElementById("typeId").value=va;
}
function modifyOrder(url){
var orderName = $("#orderName").val();
var lastUrl = encodeURI(url+"&orderName="+orderName);
lastUrl =encodeURI(lastUrl);
window.location=lastUrl;
}
function delOrder(url){
window.location = url;
}
function setWuxiao(){
var wuxiao = $("#wuxiao").val();
var isreply=$("#thischeck").val();
var url = "../TbOrderServlet?method=setWuxiao&wuxiao="+wuxiao+"&isreply="+isreply;
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
function selec(va){
if(va==0){//点播
document.getElementById("dianbo").style.display="block";
document.getElementById("dati").style.display="none";
}else if(va==1){//答题
document.getElementById("dianbo").style.display="none";
document.getElementById("dati").style.display="block";
}
}
//分拣短信时对此点播类型设置的分数查询
function selectDianbo(va){
document.getElementById("dianbo_Type").value=va;
$.post("./DianboTypeServlet","method=getValueByTypeId&typeId="+va,getDianboValue);
}
function getDianboValue(date){
document.getElementById("dianboValue").value=date;
}
/**
* 分拣短信时对答题类型设置的分数查询
* @param va
* @return
*/
function selectDati(va){
document.getElementById("dati_Type").value=va;
$.post("./DatiTypeServlet","method=getXilieByTypeId&typeId="+va,getXilieValue);
}
function getXilieValue(date){
var lastDatte = decodeURIComponent(date);
document.getElementById("xilie").style.display="block";
document.getElementById("xilieList").innerHTML=lastDatte;
}
function selectXilie(va){
document.getElementById("xilie_Type").value=va;
$.post("./DatiTypeServlet","method=getXilieValue&xilieId="+va,getDatiValue)
}
function getDatiValue(date){
document.getElementById("datiValue").value=date;
}
//分拣提交操作
function fenjiansubmit(url){
var dianboOrDati = $("#dianboOrDati").val();//是点播还是答题 ??
var fenshu ;
var phone ;
if(dianboOrDati=="0"){//点播
var dianbo_Type = $("#dianbo_Type").val();
if(dianbo_Type=="0"){
alert("请选择点播类型!");
return null;
}
var newFenshu = $("#newDianboValue").val();
var oldFenshu = $("#dianboValue").val();
if(newFenshu==""){
fenshu=oldFenshu;
}else{
fenshu=newFenshu;
}
phone = $("#dianboPhone").val();
var lastUrl = encodeURI(url+"&dianboOrDati=0&dianboType="+dianbo_Type+"&xilie_Type="+xilie_Type+"&phone="+phone+"&fenshu="+fenshu)
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}else if(dianboOrDati=="1")//答题
{
var dati_Type = $("#dati_Type").val();
var xilie_Type = $("#xilie_Type").val();
if(xilie_Type=="0"){
alert("请选择答题类型及系列!");
return null;
}
var newFenshu = $("#newDatiValue").val();
var oldFenshu = $("#datiValue").val();
if(newFenshu==""){
fenshu=oldFenshu;
}else{
fenshu=newFenshu;
}
phone = $("#datiPhone").val();
var lastUrl = encodeURI(url+"&dianboOrDati=1&dati_Type="+dati_Type+"&xilie_Type="+xilie_Type+"&phone="+phone+"&fenshu="+fenshu)
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
}
function fenjian(url){
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
form1.msg=$.msgbox({
height:400,
width:500,
content:{type:'ajax', content:lastUrl},
title: '短信分拣'
});
}
function selectJifenType(va){
if(va=="0"){
document.getElementById("1").style.display="none";
document.getElementById("0").style.display="block";
}else if(va=="1"){
document.getElementById("0").style.display="none";
document.getElementById("1").style.display="block";
}
}
//根据条件查询答题记录
function searcherByDati(url){
var datitype = $("#datitype").val();
var content = $("#content").val();
var lastUrl = encodeURI(url+"&datitype="+datitype+"&content="+content);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
//新增答题
function addDati(){
var dati_Type = formadd.dati_Type.value;
var xilie_Type = formadd.xilie_Type.value;//系列的ID
var daticontent = formadd.daticontent.value;
var datianswer = formadd.datianswer.value;
if(dati_Type=="0"){
alert("请选择答题类型!");
return null;
}
if(xilie_Type=="0"){
alert("请选择系列!");
return null;
}
if(datianswer==""){
alert("请输入答案!");
return null;
}
if(daticontent==""){
alert("请输入答题!");
return null;
}
var url = "../DatiServlet?method=addDati&datiType="+dati_Type+"&xilieType="+xilie_Type+"&datianswer="+datianswer+"&daticontent="+daticontent;
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
function deleteOneDati(url){
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/sms_zhang.js | JavaScript | asf20 | 17,563 |
// JavaScript Document
/// <reference path="jquery.js"/>
/*
* dragndrop
* version: 1.0.0 (05/13/2009)
* @ jQuery v1.2.*
*
* Licensed under the GPL:
* http://gplv3.fsf.org
*
* Copyright 2008, 2009 Jericho [ thisnamemeansnothing[at]gmail.com ]
* usage:
*
*/
(function($) {
$.extend($.fn, {
getCss: function(key) {
var v = parseInt(this.css(key));
if (isNaN(v))
return false;
return v;
}
});
$.fn.Drags = function(opts) {
var ps = $.extend({
zIndex: 20,
opacity: .7,
handler: null,
onMove: function() { },
onDrop: function() { },
range: ''
}, opts);
var dragndrop = {
drag: function(e) {
var dragData = e.data.dragData;
var dx = dragData.left + e.pageX - dragData.offLeft;
var dy = dragData.top + e.pageY - dragData.offTop;
var r = dragData.newRange;
if( typeof r == 'object' )
dragData.target.css({
left: dx < r[3] ? r[3] : ( dx > r[1] ? r[1] : dx ),
top: dy < r[0] ? r[0] : ( dy > r[2] ? r[2] : dy )
//left: dx,
//top: dy
});
else if( r == '' )
dragData.target.css({
left: dx,
top: dy
});
dragData.target.css({
'opacity': ps.opacity,
'cursor' : 'move'
});
dragData.onMove(e);
},
drop: function(e) {
var dragData = e.data.dragData;
dragData.target.css(dragData.oldCss); //.css({ 'opacity': '' });
dragData.handler.css('cursor', dragData.oldCss.cursor);
dragData.onDrop(e);
$(document).unbind('mousemove', dragndrop.drag)
.unbind('mouseup', dragndrop.drop);
}
}
return this.each(function() {
var me = this;
var handler = null;
if (typeof ps.handler == 'undefined' || ps.handler == null)
handler = $(me);
else
handler = (typeof ps.handler == 'string' ? $(ps.handler, this) : ps.handler);
handler.bind('mousedown', { e: me }, function(s) {
var target = $(s.data.e);
var oldCss = {};
if (target.css('position') != 'absolute') {
try {
target.position(oldCss);
} catch (ex) { }
target.css('position', 'absolute');
}
oldCss.cursor = target.css('cursor') || 'default';
oldCss.opacity = target.getCss('opacity') || 1;
var newRange = [];
if( ps.range == 'window' ){
newRange = [ // top, right, bottom, left
$(window).scrollTop(),
$(window).scrollLeft()+$(window).width() - target.outerWidth(),
$(window).scrollTop()+$(window).height() - target.outerHeight(),
$(window).scrollLeft()
];
}
else if( ps.range == 'document' ){
newRange = [
0,
$(document).width() - target.outerWidth(),
$(document).height() - target.outerHeight(),
0
];
} else if( typeof ps.range == 'object' ) {
newRange = [
ps.range[0],
ps.range[1] - target.outerWidth(),
ps.range[2] - target.outerWidth(),
ps.range[3]
];
} else newRange = ps.range;
var dragData = {
left: oldCss.left || target.getCss('left') || 0,
top: oldCss.top || target.getCss('top') || 0,
width: target.width() || target.getCss('width'),
height: target.height() || target.getCss('height'),
offLeft: s.pageX,
offTop: s.pageY,
oldCss: oldCss,
onMove: ps.onMove,
onDrop: ps.onDrop,
handler: handler,
target: target,
newRange: newRange
}
target.css({
//'opacity': ps.opacity,
'cursor' : 'move'
});
$(document).bind('mousemove', { dragData: dragData }, dragndrop.drag)
.bind('mouseup', { dragData: dragData }, dragndrop.drop);
});
});
}
})(jQuery); | zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/dragndrop.js | JavaScript | asf20 | 4,537 |
function deleteOneT(url){
if(window.confirm("你确定要删除此记录吗?")){
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
}
function deleteAllT(url){
var obj = document.getElementsByName("deleteAll");
var idList = "";
var num = 0;
for(var i = 0;i<obj.length;i++)
{
if(obj[i].checked)
{
num++;
idList+=obj[i].value+",";
}
}
if(num<1)
{
alert("没有选择记录无法删除!");
return ;
}
if(window.confirm("你确定要删除此记录吗?")){
var lastUrl = encodeURI(url+"&idList="+idList);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
}
//全选功能
function check_allT(va)
{
var obj = document.getElementsByName(va);
for(var o = 0;o<obj.length;o++)
{
if(obj[o].checked == true)
{
obj[o].checked = false;
}else if(obj[o].checked == false)
{
obj[o].checked = true;
}
}
}
//通讯录全选功能
/*function checkAdd_all(va)
{
var checkedO = document.getElementById("checkAll");
var oo = document.all(va).children;//.length;//document.all(va).children.size();<ul><li>.......</ul></li>
alert("oo==="+document.getElementById(va).innerHTML)
var len = oo.length;
alert("oo.tagName="+len);
for(var i = 0;i<3;i++){
var obj = oo[i];//循环每个<li>
alert("tagName=="+obj.children.item(0).checked);
if(checkedO.checked==true){
alert("选择");
obj.children.item(0).checked=true;
}else if(checkedO.checked==false){
obj.children.item(0).checked=false;
}
var chi = obj.children;
var chiLen = chi.length;
for(var o = 0;o<chiLen;o++){
var vv = chi[o];
if(vv.tagName=="UL"){
if(obj.children.item(0).checked==true){
vv.children.item(0).checked=true;
}else{
vv.children.item(0).checked=false;
}
ss(vv);
}
}
}
for(var o = 0;o<obj.length;o++)
{
if(obj[o].checked == true)
{
obj[o].checked = false;
}else if(obj[o].checked == false)
{
obj[o].checked = true;
}
}
}
function ss(vvs){
alert("aaaaaaaa");
var oo = vvs.children;//.length;//document.all(va).children.size();<ul><li>.......</ul></li>
var len = oo.length;
alert("ovvvvvo.tagName="+len);
for(var i = 0;i<3;i++){
var obj = oo[i];//循环每个<li>
var chi = obj.children;
var chiLength = chi.length;
if(vvs.children.item(0).checked==true){
obj.children.item(0).checked=true;
}else{
obj.children.item(0).checked=false;
}
for(var o = 0;o<chiLength;o++){
var vv = chi[0];
if(vv.tagName=="UL"){
if(obj.children.children.item(0)==true){
vv.children.children.item(0)=true;
}else {
vv.children.children.item(0)=false;
}
alert("vv.tagNItemame="+vv.children.item(1));
ss(vv);
}
}
}
} */
//address List
function ts(obj){
var tempArray=$(obj).parent("li").find(":checkbox");
for(var i=0;i<tempArray.length;i++)
{
//alert(tempArray[i].checked+"");
tempArray[i].checked=obj.checked;
}
}
function addDir(url){
var dirName = $("#dirName").val();
if(dirName==""){
alert("名称不能为空!");
return ;
}
var fatherDirId = $("#fatherDirId").val();
var dirLevel = $("#dirLevel").val();
var lastUrl =url+"&dirName="+dirName+"&fatherDirId="+fatherDirId+"&dirLevel="+dirLevel;
var last_Url = encodeURI(lastUrl);
last_Url = encodeURI(last_Url);
window.location= last_Url;
}
function modifyDir(url){
var dirName = $("#dirName").val();
if(dirName==""){
alert("名称不能为空!");
return ;
}
var dirId = $("#dirId").val();
var dirLevel = $("#dirLevel").val();
var lastUrl =url+"&dirName="+dirName+"&dirId="+dirId+"&dirLevel="+dirLevel;
var last_Url = encodeURI(lastUrl);
last_Url = encodeURI(last_Url);
window.location= last_Url;
}
//delete a Directory and the directory Chilren by dirId
function deleteDir(url){
window.location=url;
}
//add a linkMan
function addContact(url){
var linkName = $("#linkName").val();
var linkPhone = $("#linkPhone").val();
if(linkName==""){
alert("名称不能为空!");
return ;
}
var bo = checkNum(linkPhone);
if(!bo){
return ;
}
var dirId = $("#dirId").val();
var lastUrl = url+"&linkName="+linkName+"&linkPhone="+linkPhone+"&dirId="+dirId+"&jifen=0";
var last_Url = encodeURI(lastUrl);
last_Url = encodeURI(last_Url);
window.location = last_Url;
$mb.close();
}
//check the phone
function checkNum(num){
var strP=/^\d+(\.\d+)?$/;
if(!strP.test(num))
{
alert("请输入整数!");
return false;
}else{
if(num.length<11){
alert("手机号码位数不对!");
return false;
}else{
return true;
}
}
}
//modify a linkMan
function modifyContact(url){
var linkName = $("#linkName").val();
var linkPhone = $("#linkPhone").val();
var lastUrl = url+"&linkName="+linkName+"&linkPhone="+linkPhone;
var last_Url = encodeURI(lastUrl);
last_Url = encodeURI(last_Url);
window.location= last_Url;
}
//modify a linkMan submit
function modifyContactSubmit(url){
var linkName =$("#linkMan").val();//; $("#linkName").val();
var linkPhone = $("#linkPhone").val();
var birth = $("#birth").val();
var quxian = $("#customerIntegral").val();
var danwei = $("#danwei").val();
var zhiwu = $("#zhiwu").val();
var lastUrl = url+"&linkName="+linkName+"&linkPhone="+linkPhone+"&birth="+birth+"&customerIntegral="+quxian+"&danwei="+danwei+"&zhiwu="+zhiwu;
var last_Url = encodeURI(lastUrl);
last_Url = encodeURI(last_Url);
window.location= last_Url;
}
//search the contact
function searchContact(url){
var linkName = $("#linkName").val();
var phone = $("#phone").val();
var lastUrl = url+"&linkName="+linkName+"&phone="+phone
var last_Url = encodeURI(lastUrl);
last_Url = encodeURI(last_Url);
window.location=last_Url;
}
function deleteAllContact(url){
var obj = document.getElementsByName("deleteAll");
var idList = "";
var num = 0;
for(var i = 0;i<obj.length;i++)
{
if(obj[i].checked)
{
num++;
idList+=obj[i].value+",";
}
}
if(num<1)
{
alert("没有选择记录无法删除!");
return ;
}
var last_Url = url+"&idList="+idList;
var lastUrl = encodeURI(last_Url);
lastUrl = encodeURI(lastUrl);
window.location=lastUrl;
}
//delete a contact
function deleteOneContact(url){
var lastUrl = encodeURI(url);
lastUrl = encodeURI(lastUrl);
$.msgbox({
height:150,
width:200,
content:{type:'confirm', content: '确定要删除吗?'},
onClose:function(v){
if(v) window.location=lastUrl;
}
});
//window.location=lastUrl;
}
var Select = {
del : function(obj,e){
if((e.keyCode||e.which||e.charCode) == 8){
var opt = obj.options[0];
opt.text = opt.value = opt.value.substring(0, opt.value.length>0?opt.value.length-1:0);
}
},
write : function(obj,e){
if((e.keyCode||e.which||e.charCode) == 8)return ;
var opt = obj.options[0];
opt.selected = "selected";
opt.text = opt.value += String.fromCharCode(e.charCode||e.which||e.keyCode);
}
}
function test(va,nextVa){
var dirId=document.getElementById(va).value;
$.ajax({type:"GET",url:"AddressServlet?method=getDirByParId&parDir="+dirId+"&nextDir="+nextVa,contentType:"application/x-www-form-urlencoded;charset=UTF-8",success:getNextSelect});
}
function getNextSelect(date){
var das=date.split(",");
var str = $(das[1]);
str.appendTo("#"+das[0]);
}
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/mainAddress.js | JavaScript | asf20 | 7,859 |
/*
* Poshy Tip jQuery plugin v1.0
* http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
* Copyright 2010, Vasil Dinkov, http://vadikom.com/
*/
(function($) {
var tips = [],
reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
rePNG = /\.png$/i,
ie6 = $.browser.msie && $.browser.version == 6;
// make sure the tips' position is updated on resize
function handleWindowResize() {
$.each(tips, function() {
this.refresh(true);
});
}
$(window).resize(handleWindowResize);
$.Poshytip = function(elm, options) {
this.$elm = $(elm);
this.opts = $.extend({}, $.fn.poshytip.defaults, options);
this.$tip = $(['<div class="',this.opts.className,'">',
'<div class="tip-inner tip-bg-image"></div>',
'<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',
'</div>'].join(''));
this.$arrow = this.$tip.find('div.tip-arrow');
this.$inner = this.$tip.find('div.tip-inner');
this.disabled = false;
this.init();
};
$.Poshytip.prototype = {
init: function() {
tips.push(this);
// save the original title and a reference to the Poshytip object
this.$elm.data('title.poshytip', this.$elm.attr('title'))
.data('poshytip', this);
// hook element events
switch (this.opts.showOn) {
case 'hover':
this.$elm.bind({
'mouseenter.poshytip': $.proxy(this.mouseenter, this),
'mouseleave.poshytip': $.proxy(this.mouseleave, this)
});
if (this.opts.alignTo == 'cursor')
this.$elm.bind('mousemove.poshytip', $.proxy(this.mousemove, this));
if (this.opts.allowTipHover)
this.$tip.hover($.proxy(this.clearTimeouts, this), $.proxy(this.hide, this));
break;
case 'focus':
this.$elm.bind({
'focus.poshytip': $.proxy(this.show, this),
'blur.poshytip': $.proxy(this.hide, this)
});
break;
}
},
mouseenter: function(e) {
if (this.disabled)
return true;
this.clearTimeouts();
this.$elm.attr('title', '');
this.showTimeout = setTimeout($.proxy(this.show, this), this.opts.showTimeout);
},
mouseleave: function() {
if (this.disabled)
return true;
this.clearTimeouts();
this.$elm.attr('title', this.$elm.data('title.poshytip'));
this.hideTimeout = setTimeout($.proxy(this.hide, this), this.opts.hideTimeout);
},
mousemove: function(e) {
if (this.disabled)
return true;
this.eventX = e.pageX;
this.eventY = e.pageY;
if (this.opts.followCursor && this.$tip.data('active')) {
this.calcPos();
this.$tip.css({left: this.pos.l, top: this.pos.t});
if (this.pos.arrow)
this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
}
},
show: function() {
if (this.disabled || this.$tip.data('active'))
return;
this.reset();
this.update();
this.display();
},
hide: function() {
if (this.disabled || !this.$tip.data('active'))
return;
this.display(true);
},
reset: function() {
this.$tip.queue([]).detach().css('visibility', 'hidden').data('active', false);
this.$inner.find('*').poshytip('hide');
if (this.opts.fade)
this.$tip.css('opacity', this.opacity);
this.$arrow[0].className = 'tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left';
},
update: function(content) {
if (this.disabled)
return;
var async = content !== undefined;
if (async) {
if (!this.$tip.data('active'))
return;
} else {
content = this.opts.content;
}
this.$inner.contents().detach();
var self = this;
this.$inner.append(
typeof content == 'function' ?
content.call(this.$elm[0], function(newContent) {
self.update(newContent);
}) :
content == '[title]' ? this.$elm.data('title.poshytip') : content
);
this.refresh(async);
},
refresh: function(async) {
if (this.disabled)
return;
if (async) {
if (!this.$tip.data('active'))
return;
// save current position as we will need to animate
var currPos = {left: this.$tip.css('left'), top: this.$tip.css('top')};
}
// reset position to avoid text wrapping, etc.
this.$tip.css({left: 0, top: 0}).appendTo(document.body);
// save default opacity
if (this.opacity === undefined)
this.opacity = this.$tip.css('opacity');
// check for images - this code is here (i.e. executed each time we show the tip and not on init) due to some browser inconsistencies
var bgImage = this.$tip.css('background-image').match(reBgImage),
arrow = this.$arrow.css('background-image').match(reBgImage);
if (bgImage) {
var bgImagePNG = rePNG.test(bgImage[1]);
// fallback to background-color/padding/border in IE6 if a PNG is used
if (ie6 && bgImagePNG) {
this.$tip.css('background-image', 'none');
this.$inner.css({margin: 0, border: 0, padding: 0});
bgImage = bgImagePNG = false;
} else {
this.$tip.prepend('<table border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>')
.css({border: 0, padding: 0, 'background-image': 'none', 'background-color': 'transparent'})
.find('.tip-bg-image').css('background-image', 'url("' + bgImage[1] +'")').end()
.find('td').eq(3).append(this.$inner);
}
// disable fade effect in IE due to Alpha filter + translucent PNG issue
if (bgImagePNG && !$.support.opacity)
this.opts.fade = false;
}
// IE arrow fixes
if (arrow && !$.support.opacity) {
// disable arrow in IE6 if using a PNG
if (ie6 && rePNG.test(arrow[1])) {
arrow = false;
this.$arrow.css('background-image', 'none');
}
// disable fade effect in IE due to Alpha filter + translucent PNG issue
this.opts.fade = false;
}
var $table = this.$tip.find('table');
if (ie6) {
// fix min/max-width in IE6
this.$tip[0].style.width = '';
$table.width('auto').find('td').eq(3).width('auto');
var tipW = this.$tip.width(),
minW = parseInt(this.$tip.css('min-width')),
maxW = parseInt(this.$tip.css('max-width'));
if (!isNaN(minW) && tipW < minW)
tipW = minW;
else if (!isNaN(maxW) && tipW > maxW)
tipW = maxW;
this.$tip.add($table).width(tipW).eq(0).find('td').eq(3).width('100%');
} else if ($table[0]) {
// fix the table width if we are using a background image
$table.width('auto').find('td').eq(3).width('auto').end().end().width(this.$tip.width()).find('td').eq(3).width('100%');
}
this.tipOuterW = this.$tip.outerWidth();
this.tipOuterH = this.$tip.outerHeight();
this.calcPos();
// position and show the arrow image
if (arrow && this.pos.arrow) {
this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
this.$arrow.css('visibility', 'inherit');
}
if (async)
this.$tip.css(currPos).animate({left: this.pos.l, top: this.pos.t}, 200);
else
this.$tip.css({left: this.pos.l, top: this.pos.t});
},
display: function(hide) {
var active = this.$tip.data('active');
if (active && !hide || !active && hide)
return;
this.$tip.stop();
if ((this.opts.slide && this.pos.arrow || this.opts.fade) && (hide && this.opts.hideAniDuration || !hide && this.opts.showAniDuration)) {
var from = {}, to = {};
// this.pos.arrow is only undefined when alignX == alignY == 'center' and we don't need to slide in that rare case
if (this.opts.slide && this.pos.arrow) {
var prop, arr;
if (this.pos.arrow == 'bottom' || this.pos.arrow == 'top') {
prop = 'top';
arr = 'bottom';
} else {
prop = 'left';
arr = 'right';
}
var val = parseInt(this.$tip.css(prop));
from[prop] = val + (hide ? 0 : this.opts.slideOffset * (this.pos.arrow == arr ? -1 : 1));
to[prop] = val + (hide ? this.opts.slideOffset * (this.pos.arrow == arr ? 1 : -1) : 0);
}
if (this.opts.fade) {
from.opacity = hide ? this.$tip.css('opacity') : 0;
to.opacity = hide ? 0 : this.opacity;
}
this.$tip.css(from).animate(to, this.opts[hide ? 'hideAniDuration' : 'showAniDuration']);
}
hide ? this.$tip.queue($.proxy(this.reset, this)) : this.$tip.css('visibility', 'inherit');
this.$tip.data('active', !active);
},
disable: function() {
this.reset();
this.disabled = true;
},
enable: function() {
this.disabled = false;
},
destroy: function() {
this.reset();
this.$tip.remove();
this.$elm.unbind('poshytip').removeData('title.poshytip').removeData('poshytip');
tips.splice($.inArray(this, tips), 1);
},
clearTimeouts: function() {
if (this.showTimeout) {
clearTimeout(this.showTimeout);
this.showTimeout = 0;
}
if (this.hideTimeout) {
clearTimeout(this.hideTimeout);
this.hideTimeout = 0;
}
},
calcPos: function() {
var pos = {l: 0, t: 0, arrow: ''},
$win = $(window),
win = {
l: $win.scrollLeft(),
t: $win.scrollTop(),
w: $win.width(),
h: $win.height()
}, xL, xC, xR, yT, yC, yB;
if (this.opts.alignTo == 'cursor') {
xL = xC = xR = this.eventX;
yT = yC = yB = this.eventY;
} else { // this.opts.alignTo == 'target'
var elmOffset = this.$elm.offset(),
elm = {
l: elmOffset.left,
t: elmOffset.top,
w: this.$elm.outerWidth(),
h: this.$elm.outerHeight()
};
xL = elm.l + (this.opts.alignX != 'inner-right' ? 0 : elm.w); // left edge
xC = xL + Math.floor(elm.w / 2); // h center
xR = xL + (this.opts.alignX != 'inner-left' ? elm.w : 0); // right edge
yT = elm.t + (this.opts.alignY != 'inner-bottom' ? 0 : elm.h); // top edge
yC = yT + Math.floor(elm.h / 2); // v center
yB = yT + (this.opts.alignY != 'inner-top' ? elm.h : 0); // bottom edge
}
// keep in viewport and calc arrow position
switch (this.opts.alignX) {
case 'right':
case 'inner-left':
pos.l = xR + this.opts.offsetX;
if (pos.l + this.tipOuterW > win.l + win.w)
pos.l = win.l + win.w - this.tipOuterW;
if (this.opts.alignX == 'right' || this.opts.alignY == 'center')
pos.arrow = 'left';
break;
case 'center':
pos.l = xC - Math.floor(this.tipOuterW / 2);
if (pos.l + this.tipOuterW > win.l + win.w)
pos.l = win.l + win.w - this.tipOuterW;
else if (pos.l < win.l)
pos.l = win.l;
break;
default: // 'left' || 'inner-right'
pos.l = xL - this.tipOuterW - this.opts.offsetX;
if (pos.l < win.l)
pos.l = win.l;
if (this.opts.alignX == 'left' || this.opts.alignY == 'center')
pos.arrow = 'right';
}
switch (this.opts.alignY) {
case 'bottom':
case 'inner-top':
pos.t = yB + this.opts.offsetY;
// 'left' and 'right' need priority for 'target'
if (!pos.arrow || this.opts.alignTo == 'cursor')
pos.arrow = 'top';
if (pos.t + this.tipOuterH > win.t + win.h) {
pos.t = yT - this.tipOuterH - this.opts.offsetY;
if (pos.arrow == 'top')
pos.arrow = 'bottom';
}
break;
case 'center':
pos.t = yC - Math.floor(this.tipOuterH / 2);
if (pos.t + this.tipOuterH > win.t + win.h)
pos.t = win.t + win.h - this.tipOuterH;
else if (pos.t < win.t)
pos.t = win.t;
break;
default: // 'top' || 'inner-bottom'
pos.t = yT - this.tipOuterH - this.opts.offsetY;
// 'left' and 'right' need priority for 'target'
if (!pos.arrow || this.opts.alignTo == 'cursor')
pos.arrow = 'bottom';
if (pos.t < win.t) {
pos.t = yB + this.opts.offsetY;
if (pos.arrow == 'bottom')
pos.arrow = 'top';
}
}
this.pos = pos;
}
};
$.fn.poshytip = function(options){
if (typeof options == 'string') {
return this.each(function() {
var poshytip = $(this).data('poshytip');
if (poshytip && poshytip[options])
poshytip[options]();
});
}
var opts = $.extend({}, $.fn.poshytip.defaults, options);
// generate CSS for this tip class if not already generated
if (!$('#poshytip-css-' + opts.className)[0])
$(['<style id="poshytip-css-',opts.className,'" type="text/css">',
'div.',opts.className,'{visibility:hidden;position:absolute;top:0;left:0;}',
'div.',opts.className,' table, div.',opts.className,' td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}',
'div.',opts.className,' td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:',opts.bgImageFrameSize,'px;width:',opts.bgImageFrameSize,'px;overflow:hidden;}',
'div.',opts.className,' td.tip-right{background-position:100% 0;}',
'div.',opts.className,' td.tip-bottom{background-position:100% 100%;}',
'div.',opts.className,' td.tip-left{background-position:0 100%;}',
'div.',opts.className,' div.tip-inner{background-position:-',opts.bgImageFrameSize,'px -',opts.bgImageFrameSize,'px;}',
'div.',opts.className,' div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}',
'</style>'].join('')).appendTo('head');
return this.each(function() {
new $.Poshytip(this, opts);
});
}
// default settings
$.fn.poshytip.defaults = {
content: '[title]', // content to display ('[title]', 'string', element, function(updateCallback){...}, jQuery)
className: 'tip-yellow', // class for the tips
bgImageFrameSize: 10, // size in pixels for the background-image (if set in CSS) frame around the inner content of the tip
showTimeout: 500, // timeout before showing the tip (in milliseconds 1000 == 1 second)
hideTimeout: 100, // timeout before hiding the tip
showOn: 'hover', // handler for showing the tip ('hover', 'focus', 'none') - use 'none' to trigger it manually
alignTo: 'cursor', // align/position the tip relative to ('cursor', 'target')
alignX: 'right', // horizontal alignment for the tip relative to the mouse cursor or the target element
// ('right', 'center', 'left', 'inner-left', 'inner-right') - 'inner-*' matter if alignTo:'target'
alignY: 'top', // vertical alignment for the tip relative to the mouse cursor or the target element
// ('bottom', 'center', 'top', 'inner-bottom', 'inner-top') - 'inner-*' matter if alignTo:'target'
offsetX: -22, // offset X pixels from the default position - doesn't matter if alignX:'center'
offsetY: 18, // offset Y pixels from the default position - doesn't matter if alignY:'center'
allowTipHover: true, // allow hovering the tip without hiding it onmouseout of the target - matters only if showOn:'hover'
followCursor: false, // if the tip should follow the cursor - matters only if showOn:'hover' and alignTo:'cursor'
fade: true, // use fade animation
slide: true, // use slide animation
slideOffset: 8, // slide animation offset
showAniDuration: 300, // show animation duration - set to 0 if you don't want show animation
hideAniDuration: 300 // hide animation duration - set to 0 if you don't want hide animation
};
})(jQuery); | zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/jquery.poshytip.js | JavaScript | asf20 | 15,622 |
/*
Copyright (C) 2009 - 2012
WebSite: Http://wangking717.javaeye.com/
Author: wangking
*/
$(function(){
var xOffset = -20; // x distance from mouse
var yOffset = 20; // y distance from mouse
//input action
$("[reg],[url]:not([reg]),[tip]").hover(
function(e) {
if($(this).attr('tip') != undefined){
var top = (e.pageY + yOffset);
var left = (e.pageX + xOffset);
$('body').append( '<p id="vtip"><img id="vtipArrow" src="images/vtip_arrow.png"/>' + $(this).attr('tip') + '</p>' );
$('p#vtip').css("top", top+"px").css("left", left+"px");
$('p#vtip').bgiframe();
}
},
function() {
if($(this).attr('tip') != undefined){
$("p#vtip").remove();
}
}
).mousemove(
function(e) {
if($(this).attr('tip') != undefined){
var top = (e.pageY + yOffset);
var left = (e.pageX + xOffset);
$("p#vtip").css("top", top+"px").css("left", left+"px");
}
}
).blur(function(){
if($(this).attr("url") != undefined){
ajax_validate($(this));
}else if($(this).attr("reg") != undefined){
validate($(this));
}
});
$("form").submit(function(){
var isSubmit = true;
$(this).find("[reg],[url]:not([reg])").each(function(){
if($(this).attr("reg") == undefined){
if(!ajax_validate($(this))){
isSubmit = false;
}
}else{
if(!validate($(this))){
isSubmit = false;
}
}
});
if(typeof(isExtendsValidate) != "undefined"){
if(isSubmit && isExtendsValidate){
return extendsValidate();
}
}
return isSubmit;
});
});
function validate(obj){
var reg = new RegExp(obj.attr("reg"));
var objValue = obj.attr("value");
if(!reg.test(objValue)){
change_error_style(obj,"add");
change_tip(obj,null,"remove");
return false;
}else{
if(obj.attr("url") == undefined){
change_error_style(obj,"remove");
change_tip(obj,null,"remove");
return true;
}else{
return ajax_validate(obj);
}
}
}
function ajax_validate(obj){
var url_str = obj.attr("url");
if(url_str.indexOf("?") != -1){
url_str = url_str+"&"+obj.attr("name")+"="+obj.attr("value");
}else{
url_str = url_str+"?"+obj.attr("name")+"="+obj.attr("value");
}
var feed_back = $.ajax({url: url_str,cache: false,async: false}).responseText;
feed_back = feed_back.replace(/(^\s*)|(\s*$)/g, "");
if(feed_back == 'success'){
change_error_style(obj,"remove");
change_tip(obj,null,"remove");
return true;
}else{
change_error_style(obj,"add");
change_tip(obj,feed_back,"add");
return false;
}
}
function change_tip(obj,msg,action_type){
if(obj.attr("tip") == undefined){//初始化判断TIP是否为空
obj.attr("is_tip_null","yes");
}
if(action_type == "add"){
if(obj.attr("is_tip_null") == "yes"){
obj.attr("tip",msg);
}else{
if(msg != null){
if(obj.attr("tip_bak") == undefined){
obj.attr("tip_bak",obj.attr("tip"));
}
obj.attr("tip",msg);
}
}
}else{
if(obj.attr("is_tip_null") == "yes"){
obj.removeAttr("tip");
obj.removeAttr("tip_bak");
}else{
obj.attr("tip",obj.attr("tip_bak"));
obj.removeAttr("tip_bak");
}
}
}
function change_error_style(obj,action_type){
if(action_type == "add"){
obj.addClass("input_validation-failed");
}else{
obj.removeClass("input_validation-failed");
}
}
$.fn.validate_callback = function(msg,action_type,options){
this.each(function(){
if(action_type == "failed"){
change_error_style($(this),"add");
change_tip($(this),msg,"add");
}else{
change_error_style($(this),"remove");
change_tip($(this),null,"remove");
}
});
};
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/easy_validator.pack.js | JavaScript | asf20 | 3,704 |
/**
* jquery.msgbox 6.0 - 2010-05-12
*
* Author: pwwang
* Website: http://pwwang.com
* Note: All the stuff written by pwwang
* Feel free to do whatever you want with this file
* Please keep the distribution
*
**/
(function($) {
var $msgbox = function(o) {
if(typeof(o) == 'string'){ o = { content:{type:'text', content:o} } } // 如果参数给出字符串, 则直接进行提示(text)
opts = o || {}; // 用于接收参数
opts.width = o.width || 360; // 提示框的宽度
opts.height = o.height || 200, // 提示框的高度
opts.autoClose = o.autoClose || 0; // 自动关闭的时间, 0则不会自动关闭
opts.title = o.title || '提示', // 提示框标题
opts.wrapperClass = o.wrapperClass || 'msgbox_wrapper'; // 提示框外框class
opts.titleClass = o.titleClass || 'msgbox_title'; // 提示框标题class
opts.closeClass = o.closeClass || 'msgbox_close'; // 提示框关闭按钮class
opts.titleWrapperClass = o.titleWrapperClass || 'msgbox_title_wrapper'; // 提示框标题行class
opts.mainClass = o.mainClass || 'msgbox_main'; // 内容框class
opts.bgClass = o.bgClass || 'msgbox_bg'; // 背景层class
opts.buttonClass = o.buttonClass || 'msgbox_button'; // 内容框中button的class
opts.inputboxClass = o.inputboxClass || 'msgbox_inputbox'; // 内容框中input box的class
opts.content = typeof o.content == 'string' ? {type:'text', content:o.content} : (o.content || {type:'text',content:''});
opts.content.type = o.content.type || 'text';
opts.content.content = o.content.content || '';
// support: text, url(=get,ajax), iframe, confirm, alert; confirm, alert is added in version 4.0, input added in V5.0
opts.onClose = o.onClose || function(){}; // 关闭时执行的事件
opts.closeIcon = typeof o.closeIcon == 'string' ? {type:'string', content:o.closeIcon} : (o.closeIcon || {type:'string',content:'×'});
opts.closeIcon.type = o.closeIcon.type || 'string';
opts.closeIcon.content = o.closeIcon.content || '×';
opts.closeIcon.content = opts.closeIcon.type == 'icon' ? '<img src="' + opts.closeIcon.content + '" border="0" />' : opts.closeIcon.content;
opts.bgOpacity = o.bgOpacity || 0.6; // from 0 to 1 背景透明度
opts.onAjaxed = o.onAjaxed || function(){}; // ajax执行完之后的事件
opts.onInputed = o.onInputed || function(){}; // 输入框关闭后的事件
opts.drag = typeof o.drag != 'boolean' ? true : o.drag; // 默认允许拖拽
opts.animation = typeof o.animation != 'number' ? 1 : o.animation ;
opts.rtVl = '';
var returnValue = false; // 返回值, 用于confirm和input
var relTop = 0; // 提示框离窗口上边的距离
var relLeft = 0; // 提示框离窗口左边的距离, 用于页面滚动时保持窗口不动
var $background = $("<div>")
.css({
'position' : 'absolute',
'top' : '0',
'left' : '0',
'z-index' : '9999',
'opacity' : '0'
})
.addClass(opts.bgClass)
.dblclick(closeMe) // 双击关闭提示框
.click(function(){ // 单击闪烁提示框
flashTitle(0.5, 4, 80);
});
var $wrapper = $("<div>")
.css({
'width' : opts.width + 'px',
'height' : opts.height + 'px',
'position' : 'absolute',
'z-index' : '10000',
'display' : 'none'
})
.addClass(opts.wrapperClass)
var $titleWrapper = $('<ul><li>提示</li><li>关闭</li></ul>')
.addClass(opts.titleWrapperClass)
.appendTo($wrapper);
var $titleLi = $("li:first", $titleWrapper)
.html(opts.title)
.addClass(opts.titleClass);
var $closeLi = $titleLi.next()
.addClass(opts.closeClass)
.html(opts.closeIcon.content)
.mousedown(closeMe);
var $main = $(document.createElement("div"))
.addClass(opts.mainClass)
.appendTo($wrapper);
$main.height( opts.height - $titleWrapper.outerHeight(true) - $main.outerHeight(true) + $main.height() ); // 计算内容框高度
function animation(act, t){
switch(t){
case 1:
if(act=='open'){
$background.animate({'opacity':opts.bgOpacity});
$wrapper.slideDown('slow');
} else {
$background.fadeOut('slow', $background.remove);
$wrapper.slideUp('slow', $wrapper.remove);
}
break;
case 2:
if(act=='open'){
$background.animate({'opacity':opts.bgOpacity});
$wrapper.animate({'width':'toggle'}, 'slow', 'swing');
} else {
$background.fadeOut('slow', $background.remove);
$wrapper.animate({'width':'toggle'}, 'slow', 'swing', $wrapper.remove);
}
break;
case 3:
if(act=='open'){
$background.animate({'opacity':opts.bgOpacity});
$wrapper.animate({'width':'toggle', 'height':'toggle'}, 'slow', 'swing');
} else {
$background.fadeOut('slow', $background.remove);
$wrapper.animate({'width':'toggle', 'height':'toggle'}, 'slow', 'swing', $wrapper.remove);
}
break;
default:
if(act=='open'){
$background.css('opacity',opts.bgOpacity);
$wrapper.css('display', '');
} else {
$background.remove();
$wrapper.remove();
}
}
}
function closeMe(){
animation('close', opts.animation);
opts.onClose(returnValue);
$background.remove();
$wrapper.remove();
}
function isVisible(){
return $background.is(":visible") &&
$wrapper.is(":visible");
}
function autoCloseMe(autoClose){
if( autoClose > 0 && isVisible() ){ // 防止人为关闭后,计时器还在运行
autoCloseStr = "<font>本窗口将在 " + autoClose + "s ...后自动关闭</font>";
$titleLi.html(opts.title + " " + autoCloseStr);
autoClose --;
if( autoClose == 0 )
closeMe();
setTimeout(function(){ autoCloseMe(autoClose) }, 1000);
}
}
function resetPosition() {
$background.css({
'width' : document.documentElement.scrollWidth + 'px',
'height' : document.documentElement.scrollHeight + 'px'
});
relLeft = ($(window).width() - opts.width)/2;
relTop = ($(window).height() - opts.height)/2;
fixBox(); // 定位初始位置
}
function flashTitle(opacity, times, interval, flag){ // 闪烁标题(模拟windows)
if( times > 0 ) {
flag = !flag;
op = flag ? opacity : 1;
$titleWrapper.css('opacity',op);
setTimeout(function(){ flashTitle(opacity, times-1, interval, flag) }, interval);
}
}
function fixBox(){ // 定位box
$wrapper.css({
'top' : $(window).scrollTop() + relTop + 'px',
'left' : $(window).scrollLeft() + relLeft + 'px'
});
}
function msgbox(ctt){ // 按类型填充内容
switch(ctt.type){
case 'input':
$main.html("<p>" + ctt.content + "</p>");
var $inputbox = $("<input type='text' />")
.appendTo($main)
.addClass(opts.inputboxClass);
var $buttonWrapper = $("<div>")
.css({
'text-align':'center',
'padding':'15px 0'
})
.appendTo($main);
var $yesButton = $("<input type=button value=' 是 '>")
.appendTo($buttonWrapper)
.addClass(opts.buttonClass)
.after(" ")
.click(function(){
opts.onInputed($inputbox.val()); // 返回输入的值
closeMe();
});
var $noButton = $("<input type=button value=' 关闭 '>")
.appendTo($buttonWrapper)
.addClass(opts.buttonClass)
.click(closeMe);
break;
case 'alert':
$main.html("<p>" + ctt.content + "</p>");
var $buttonWrapper = $("<div>")
.css({
'text-align':'center',
'padding':'15px 0'
})
.appendTo($main);
var $OKButton = $("<input type=button value=' 确定 '>")
.appendTo($buttonWrapper)
.addClass(opts.buttonClass)
.click(closeMe);
break;
case 'confirm':
$main.html("<p>" + ctt.content + "</p>");
var $buttonWrapper = $("<div>")
.css({
'text-align':'center',
'padding':'15px 0'
})
.appendTo($main);
var $yesButton = $("<input type=button value=' 确定 ' onclick=\"window.location='"+ctt.url+"'\">")
.appendTo($buttonWrapper)
.addClass(opts.buttonClass)
.after(" ")
.click(function(){
returnValue = true;
closeMe();
});
var $noButton = $("<input type=button value=' 取消 '>")
.appendTo($buttonWrapper)
.addClass(opts.buttonClass)
.click(function(){
returnValue = false;
closeMe();
});
break;
case 'get':
case 'ajax':
case 'url':
$main.html("Loading ...").load(
ctt.content,
function(data){
(opts.onAjaxed)(data);
}
);
break;
case 'iframe':
$("<iframe frameborder=0 marginheight=0 marginwidth=0></iframe>")
.appendTo($main)
.attr({
'width' : '98%',
'height' : '98%',
'scrolling' : 'auto',
'src' : ctt.content
});
break;
default:
$main.html("<p>" + ctt.content + "</p>");
}
}
function allowDrag(flag){
if(flag)
$wrapper.Drags({ // 允许拖拽
handler : $titleWrapper,
onMove: function(){ $(window).unbind('scroll') },
onDrop: function(){
relTop = $wrapper.getCss('top') - $(window).scrollTop();
relLeft = $wrapper.getCss('left') - $(window).scrollLeft();
$(window).scroll(fixBox);
}
});
}
function showMe(){ // show the box
$('body').append($background).append($wrapper);
animation('open', opts.animation);
resetPosition();
$(window)
.load(resetPosition) // just in case user is changing size of page while loading
.resize(resetPosition)
.scroll(fixBox);
msgbox(opts.content); //填充内容
if( opts.autoClose > 0 ) // 自动关闭
autoCloseMe(opts.autoClose);
allowDrag(opts.drag);
}
showMe();
// public properties and functions:
this.value = returnValue;
this.close = closeMe;
this.setAutoClose = function(v){ opts.autoClose = v; autoCloseMe(v); return this; }
this.setHeight = function(v){ opts.height = v; $wrapper.css( 'height', v + 'px' ); return this; }
this.setWidth = function(v){ opts.width = v; $wrapper.css( 'width', v + 'px' ); return this; }
this.setTitle = function(v){ opts.title = v; $titleLi.html(v); return this; }
this.setWrapperClass = function(v){ opts.wrapperClass = v; $wrapper.removeClass().addClass(v); return this; }
this.setTitleClass = function(v){ opts.titleClass = v; $titleLi.removeClass().addClass(v); return this; }
this.setCloseClass = function(v){ opts.closeClass = v; $closeLi.removeClass().addClass(v); return this; }
this.setTitleWrapperClass = function(v){ opts.titleWrapperClass = v; $titleWrapper.removeClass().addClass(v); return this; }
this.setMainClass = function(v){ opts.mainClass = v; $main.removeClass().addClass(v); return this; }
this.setBgClass = function(v){ opts.bgClass = v; $background.removeClass().addClass(v); return this; }
this.setButtonClass = function(v){ opts.buttonClass = v; $(":input(input[type=button], input[type=submit], input[type=reset])", $main).removeClass().addClass(v); return this; }
this.setInputboxClass= function(v){ opts.inputboxClass = v; $("input[type=text]", $main).removeClass().addClass(v); return this; }
this.setContent = function(v){
v = typeof v == 'string' ? {type:'text', content:v} : v;
v.type = v.type || 'text';
v.content = v.content || opts.content.content || '';
opts.content = v;
msgbox(v);
return this;
}
this.setBgOpacity = function(v){ opts.bgOpacity = v; $background.css('opacity', v); return this; }
this.setOnClose = function(v){ opts.onClose = v; return this; }
this.setOnAjaxed = function(v){ opts.onAjaxed = v; return this; }
this.setOnInputed = function(v){ opts.onInputed = v; return this; }
this.setAnimation = function(v){ opts.animation = v; return this; }
this.setCloseIcon = function(v){
v = typeof v == 'string' ? {type:'string', content:v} : v;
v.type = v.type || 'string';
v.content = v.content || '×';
v.content = v.type == 'icon' ? '<img src="' + v.content + '" border="0" />' : v.content;
opts.closeIcon = v;
$closeLi.html(v.content);
return this;
}
}
$.msgbox = function(o){ return new $msgbox(o); }
return $.msgbox;
})(jQuery);
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/msgbox.js | JavaScript | asf20 | 17,307 |
/*
* Treeview 1.4.1 - jQuery plugin to hide and show branches of a tree
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.treeview.js 5759 2008-07-01 07:50:28Z joern.zaefferer $
*
*/
(function($) {
// TODO rewrite as a widget, removing all the extra plugins
$.extend($.fn, {
swapClass: function(c1, c2) {
var c1Elements = this.filter('.' + c1);
this.filter('.' + c2).removeClass(c2).addClass(c1);
c1Elements.removeClass(c1).addClass(c2);
return this;
},
replaceClass: function(c1, c2) {
return this.filter('.' + c1).removeClass(c1).addClass(c2).end();
},
hoverClass: function(className) {
className = className || "hover";
return this.hover(function() {
$(this).addClass(className);
}, function() {
$(this).removeClass(className);
});
},
heightToggle: function(animated, callback) {
animated ?
this.animate({ height: "toggle" }, animated, callback) :
this.each(function(){
jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
if(callback)
callback.apply(this, arguments);
});
},
heightHide: function(animated, callback) {
if (animated) {
this.animate({ height: "hide" }, animated, callback);
} else {
this.hide();
if (callback)
this.each(callback);
}
},
prepareBranches: function(settings) {
if (!settings.prerendered) {
// mark last tree items
this.filter(":last-child:not(ul)").addClass(CLASSES.last);
// collapse whole tree, or only those marked as closed, anyway except those marked as open
this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide();
}
// return all items with sublists
return this.filter(":has(>ul)");
},
applyClasses: function(settings, toggler) {
// TODO use event delegation
this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview", function(event) {
// don't handle click events on children, eg. checkboxes
if ( this == event.target )
toggler.apply($(this).next());
}).add( $("a", this) ).hoverClass();
if (!settings.prerendered) {
// handle closed ones first
this.filter(":has(>ul:hidden)")
.addClass(CLASSES.expandable)
.replaceClass(CLASSES.last, CLASSES.lastExpandable);
// handle open ones
this.not(":has(>ul:hidden)")
.addClass(CLASSES.collapsable)
.replaceClass(CLASSES.last, CLASSES.lastCollapsable);
// create hitarea if not present
var hitarea = this.find("div." + CLASSES.hitarea);
if (!hitarea.length)
hitarea = this.prepend("<div class=\"" + CLASSES.hitarea + "\"/>").find("div." + CLASSES.hitarea);
hitarea.removeClass().addClass(CLASSES.hitarea).each(function() {
var classes = "";
$.each($(this).parent().attr("class").split(" "), function() {
classes += this + "-hitarea ";
});
$(this).addClass( classes );
})
}
// apply event to hitarea
this.find("div." + CLASSES.hitarea).click( toggler );
},
treeview: function(settings) {
settings = $.extend({
cookieId: "treeview"
}, settings);
if ( settings.toggle ) {
var callback = settings.toggle;
settings.toggle = function() {
return callback.apply($(this).parent()[0], arguments);
};
}
// factory for treecontroller
function treeController(tree, control) {
// factory for click handlers
function handler(filter) {
return function() {
// reuse toggle event handler, applying the elements to toggle
// start searching for all hitareas
toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() {
// for plain toggle, no filter is provided, otherwise we need to check the parent element
return filter ? $(this).parent("." + filter).length : true;
}) );
return false;
};
}
// click on first element to collapse tree
$("a:eq(0)", control).click( handler(CLASSES.collapsable) );
// click on second to expand tree
$("a:eq(1)", control).click( handler(CLASSES.expandable) );
// click on third to toggle tree
$("a:eq(2)", control).click( handler() );
}
// handle toggle event
function toggler() {
$(this)
.parent()
// swap classes for hitarea
.find(">.hitarea")
.swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )
.end()
// swap classes for parent li
.swapClass( CLASSES.collapsable, CLASSES.expandable )
.swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
// find child lists
.find( ">ul" )
// toggle them
.heightToggle( settings.animated, settings.toggle );
if ( settings.unique ) {
$(this).parent()
.siblings()
// swap classes for hitarea
.find(">.hitarea")
.replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )
.end()
.replaceClass( CLASSES.collapsable, CLASSES.expandable )
.replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
.find( ">ul" )
.heightHide( settings.animated, settings.toggle );
}
}
this.data("toggler", toggler);
function serialize() {
function binary(arg) {
return arg ? 1 : 0;
}
var data = [];
branches.each(function(i, e) {
data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0;
});
$.cookie(settings.cookieId, data.join(""), settings.cookieOptions );
}
function deserialize() {
var stored = $.cookie(settings.cookieId);
if ( stored ) {
var data = stored.split("");
branches.each(function(i, e) {
$(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ]();
});
}
}
// add treeview class to activate styles
this.addClass("treeview");
// prepare branches and find all tree items with child lists
var branches = this.find("li").prepareBranches(settings);
switch(settings.persist) {
case "cookie":
var toggleCallback = settings.toggle;
settings.toggle = function() {
serialize();
if (toggleCallback) {
toggleCallback.apply(this, arguments);
}
};
deserialize();
break;
case "location":
var current = this.find("a").filter(function() {
return this.href.toLowerCase() == location.href.toLowerCase();
});
if ( current.length ) {
// TODO update the open/closed classes
var items = current.addClass("selected").parents("ul, li").add( current.next() ).show();
if (settings.prerendered) {
// if prerendered is on, replicate the basic class swapping
items.filter("li")
.swapClass( CLASSES.collapsable, CLASSES.expandable )
.swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
.find(">.hitarea")
.swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea );
}
}
break;
}
branches.applyClasses(settings, toggler);
// if control option is set, create the treecontroller and show it
if ( settings.control ) {
treeController(this, settings.control);
$(settings.control).show();
}
return this;
}
});
// classes used by the plugin
// need to be styled via external stylesheet, see first example
$.treeview = {};
var CLASSES = ($.treeview.classes = {
open: "open",
closed: "closed",
expandable: "expandable",
expandableHitarea: "expandable-hitarea",
lastExpandableHitarea: "lastExpandable-hitarea",
collapsable: "collapsable",
collapsableHitarea: "collapsable-hitarea",
lastCollapsableHitarea: "lastCollapsable-hitarea",
lastCollapsable: "lastCollapsable",
lastExpandable: "lastExpandable",
last: "last",
hitarea: "hitarea"
});
})(jQuery);
| zzprojects | trunk/zzprojects/zzClub/WebRoot/scripts/treeview.js | JavaScript | asf20 | 8,512 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增点播类型</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>新增点播类型</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="dianboTypeName" id="dianboTypeName" value=""/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="addDianboType('../DianboTypeServlet?method=addTypeSubmit');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/addDianboType.jsp | Java Server Pages | asf20 | 1,963 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增答题类型</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>新增答题类型</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="datiTypeName" id="datiTypeName" value=""/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="addDatiType('../DatiTypeServlet?method=addTypeSubmit');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/addDatiType.jsp | Java Server Pages | asf20 | 1,955 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<script type="text/javascript">
$(document).ready(function(){
$('.treeview').treeview();
//$('.treeview li a').after('<span title="添加子节点" class="addnode"><a href="javascript:alert(1);">添加子节点</a></span><span title="编辑该节点" class="editnode"><a href="javascript:alert(2);">编辑该节点</a></span><span title="删除该节点" class="delnode"><a href="javascript:alert(3);">删除该节点</a></span>');
$('.treeview li span').hide();
$('.treeview li').hover(function(){
$(this).children('span').show();
},function(){
$(this).children('span').hide();
});
});
</script>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="8" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="11" /></jsp:include>
<form action="" id="frmMessage" name="frmMessage"></form>
<section id="container">
<%
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
String result = session.getAttribute("result").toString();
%>
<div id="crumbs">
积分管理 » 积分列表
</div>
<!-- <div id="deleteContent"></div> -->
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>答题上行积分</li>
<li>点播上行积分</li>
</ul>
<div class="tabs-panel">
<%
StringBuffer sb = (StringBuffer)session.getAttribute("sb");
%>
<table width="100%" class="datalist">
<tr>
<td>
<ul class="treeview" id="headerIndex">
<%=sb %>
</ul>
</td>
</tr></table>
</div>
<div class="tabs-panel">
<%
if(!result.equals("")){
out.println("<script>alert('"+result+"');</script>");
session.removeAttribute("result");
}
int colSpanNum=11;
%>
<table width="100%" class="datalist">
<thead>
<tr><td><input type="button" name="addType" id = "addType" value="新建类型" onclick="$mb=$.msgbox({
height:400,
width:500,
content:{type:'ajax', content:'jifen/addDianboType.jsp'},
title: '新增点播类型'
});"/>
</td><td colspan="5"></td></tr>
<tr>
<td class="tc">
<input type="checkbox" name="ckUsers" id="ckUsers" onClick="selectAll('ckUsers');" />
</td>
<td class="tc">类型</td>
<td class="tc">分数</td>
<td class="tc">创建时间</td>
<td class="tc">设置</td>
<td class="tc">操作</td>
</tr>
</thead>
<%
List<DianboType> dianboTypeList = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
if(dianboTypeList!=null&&dianboTypeList.size()>0){
for(DianboType dianboType:dianboTypeList){
%>
<tr>
<td class="tc"><input type="checkbox" name="ckUsers" id="<%=dianboType.getTypeId() %>" value="<%=dianboType.getTypeId()%>"/></td>
<td class="tc">
<%=dianboType.getTypeName() %>
</td>
<td class="tc">
<%
String condition = " typeId='"+dianboType.getTypeId()+"' and integralType=0";
JiFen jiFen = new JifenDao().getJiFen("tb_integral","setTime",condition);
if(jiFen!=null){
%>
<%=jiFen.getIntegralValue() %>
<%
}
%>
</td>
<td class="tc">
<%=dianboType.getCreateTime() %>
</td>
<td class="tc"style="cursor:hand"><a style="cursor:hand" onclick="msg=$.msgbox({
height:400,
width:500,
content:{type:'iframe', content:'./DianboServlet?method=set&dianboId=<%=dianboType.getTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
title: '点播积分设置'
});">设置</a></td>
<td class="tc"><a style="cursor:hand" onclick="msg=$.msgbox({
height:400,
width:500,
content:{type:'ajax', content:'./DianboTypeServlet?method=modifyType&dianboId=<%=dianboType.getTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
title: '修改类型'
});" title="修改该类型" class="msg_open">修改</a> <a style="cursor:hand" onclick="delDianboType('../DianboTypeServlet?method=del&dianboTypeId=<%=dianboType.getTypeId() %>')" title="删除该消息" class="msg_del">删除</a></td>
</tr>
<%
}
}
%>
</table>
</div>
<div class="tabs-panel">
aaaaaaaaaaaa
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/jiFenupLoadList.jsp | Java Server Pages | asf20 | 6,440 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*" %>
<%
DatiType datiType = (DatiType) session.getAttribute("datiType");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改答题类型</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/sms_zhang.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>修改答题类型</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="datiTypeName" id="datiTypeName" value="<%=datiType.getTypeName() %>"/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="modifyDatiType('../DatiTypeServlet?method=modifyTypeSubmit&datiType=<%=datiType.getAnswerTypeId() %>');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
<input type = "hidden" name="datiTypeId" id="datiTypeId" value="<%=datiType.getAnswerTypeId() %>"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/modifyDatiType.jsp | Java Server Pages | asf20 | 2,363 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.JiFen"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>点播上行设置</li>
</ul>
<div class="tabs-panel">
<form action="DianboServlet?method=setSubmit">
<table width="100%" class="datalist">
<tr>
<td width="19%" class="tc">类型名称:</td>
<%
List<DianboType> dianboType = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
String condition="typeId='"+dianboType.get(0).getTypeId()+"' and integralType=0";
JiFen jf = new JifenDao().getJiFen("tb_integral","",condition);
String fenshu= "";
if(jf==null){
fenshu="";
}else {
fenshu=Constant.decodeString(jf.getIntegralValue());
}
%>
<td width="81%"> <input type="text" name="typeName" id="typeName" readonly="readonly" value="<%=dianboType.get(0).getTypeName() %>"/></td>
</tr>
<tr>
<td width="19%" class="tc">分 数:</td>
<td> <input type="text" name="num" id="num" value="<%=fenshu%>"> <font color="red">*</font>
</td>
</tr>
<tr>
<td colspan="2" class="tc">
<input type="button" name="doSub" id="doSub" value="确定" onclick="doSubmit('<%=dianboType.get(0).getTypeId() %>')">
<input type="button" name="Submit2" value="取消" onClick="top.msg.close();">
</tr>
</table>
</form>
</div>
</div>
</div>
</section >
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/jiFenupLoadSet.jsp | Java Server Pages | asf20 | 2,758 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.JiFen"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>点播下行设置</li>
</ul>
<div class="tabs-panel">
<form action="DianboServlet?method=setSubmit">
<table width="100%" class="datalist">
<tr>
<td width="19%" class="tc">类型名称:</td>
<%
List<DianboType> dianboType = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
String condition="typeId='"+dianboType.get(0).getTypeId()+"' and integralType=1";
JiFen jf = new JifenDao().getJiFen("tb_integral","",condition);
String fenshu= "";
if(jf==null){
fenshu="";
}else {
fenshu=Constant.decodeString(jf.getIntegralValue());
}
%>
<td width="81%"> <input type="text" name="typeName" id="typeName" readonly="readonly" value="<%=dianboType.get(0).getTypeName() %>"/></td>
</tr>
<tr>
<td width="19%" class="tc">分 数:</td>
<td> <input type="text" name="num" id="num" value="<%=fenshu%>"> <font color="red">*</font>
</td>
</tr>
<tr>
<td colspan="2" class="tc">
<input type="button" name="doSub" id="doSub" value="确定" onclick="doSubmitDown('<%=dianboType.get(0).getTypeId() %>')">
<input type="button" name="Submit2" value="取消" onClick="top.msg.close();">
</tr>
</table>
</form>
</div>
</div>
</div>
</section >
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/jiFendownSet.jsp | Java Server Pages | asf20 | 2,762 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*,com.dianbo.bean.*" %>
<%
DianboType dianboType = (DianboType) session.getAttribute("dianboType");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改点播类型</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/sms_zhang.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>修改点播类型</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="dianboTypeName" id="dianboTypeName" value="<%=dianboType.getTypeName() %>"/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="modifyDianboType('../DianboTypeServlet?method=modifyTypeSubmit&dianboTypeId=<%=dianboType.getTypeId() %>');top.msg.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="top.msg.close();"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/modifyDianboType.jsp | Java Server Pages | asf20 | 2,274 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.*,com.dati.bean.*,com.dati.dao.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="8" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="12" /></jsp:include>
<form action="" id="frmMessage" name="frmMessage"></form>
<section id="container">
<%
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
String result = session.getAttribute("result").toString();
%>
<div id="crumbs">
积分管理 » 下行积分列表
</div>
<!-- <div id="deleteContent"></div> -->
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>答题下行积分</li>
<li>点播下行积分</li>
</ul>
<div class="tabs-panel">
<%
if(!result.equals("")){
out.println("<script>alert('"+result+"');</script>");
session.removeAttribute("result");
}
int colSpanNum=11;
%>
<table width="100%" class="datalist">
<thead>
<tr>
<td class="tc">类型</td>
<td class="tc">分数</td>
<td class="tc">创建时间</td>
<td class="tc">设置</td>
</tr>
</thead>
<%
List<DatiType> datiTypeList = (ArrayList<DatiType>)session.getAttribute("datiTypeList");
if(datiTypeList!=null&&datiTypeList.size()>0){
for(DatiType datiType:datiTypeList){
%>
<tr>
<td class="tc">
<%=datiType.getTypeName() %>
</td>
<td class="tc">
<%
String condition = " typeId='"+datiType.getAnswerTypeId()+"' and integralType=1";
JiFen jiFen = new JifenDao().getJiFen("tb_integral","setTime",condition);
if(jiFen!=null){
%>
<%=jiFen.getIntegralValue() %>
<%
}
%>
</td>
<td class="tc">
<%=datiType.getCreateTime() %>
</td>
<td class="tc"style="cursor:hand"><a onclick="msg=$.msgbox({
height:400,
width:500,
content:{type:'iframe', content:'./DatiServlet?method=setDown&dianboId=<%=datiType.getAnswerTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
title: '答题下行积分设置'
});">设置</a></td>
</tr>
<%
}
}
%>
</table>
</div>
<div class="tabs-panel">
<table width="100%" class="datalist">
<thead>
<tr>
<td class="tc">类型</td>
<td class="tc">分数</td>
<td class="tc">创建时间</td>
<td class="tc">设置</td>
</tr>
</thead>
<%
List<DianboType> dianboTypeList = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
if(dianboTypeList!=null&&dianboTypeList.size()>0){
for(DianboType dianboType:dianboTypeList){
%>
<tr>
<td class="tc">
<%=dianboType.getTypeName() %>
</td>
<td class="tc">
<%
String condition = " typeId='"+dianboType.getTypeId()+"' and integralType=1";
JiFen jiFen = new JifenDao().getJiFen("tb_integral","setTime",condition);
if(jiFen!=null){
%>
<%=jiFen.getIntegralValue() %>
<%
}
%>
</td>
<td class="tc">
<%=dianboType.getCreateTime() %>
</td>
<td class="tc"style="cursor:hand"><a onclick="msg=$.msgbox({
height:400,
width:500,
content:{type:'iframe', content:'./DianboServlet?method=setDown&dianboId=<%=dianboType.getTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
title: '点播积分设置'
});">设置</a></td>
</tr>
<%
}
}
%>
</table>
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/jiFendownList.jsp | Java Server Pages | asf20 | 6,111 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*" %>
<%
Xulie xilie = (Xulie) session.getAttribute("xilie");
System.out.println("系列名称"+xilie.getSeriseName());
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改答题系列</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/sms_zhang.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>修改答题系列</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="datiXilieName" id="datiXilieName" value="<%=xilie.getSeriseName()%>"/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="modifyDatiXilie('../DatiTypeServlet?method=modifyXilieSubmit&xilieId=<%=xilie.getSeriseId() %>');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
<input type = "hidden" name="datiTypeId" id="datiTypeId" value="<%=xilie.getSeriseId() %>"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/modifyDatiXilie.jsp | Java Server Pages | asf20 | 2,398 |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String typeId= session.getAttribute("typeId").toString();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增答题系列</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<ul class="tabs-nav clearfix">
<li>新增答题系列</li>
</ul>
<div class="tabs-panel">
<table width="100%" class="datalist">
<tr>
<td class="tc">名称:</td>
<td><input type="text" name="xilieName" id="xilieName" value=""/></td>
</tr>
<tr><td class="tl"><input type="button" value="确定" onclick="addXilie('../DatiTypeServlet?method=addXilieSubmit&typeId=<%=typeId %>');$mb.close();"/></td>
<td class="tc"><input type="button" value="关闭" onclick="$mb.close();"/>
</td>
</tr>
</table>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/addXiLie.jsp | Java Server Pages | asf20 | 2,027 |
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(request.getParameter("um")!=null){
%>
<aside id="aside">
<ul>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>DianboTypeServlet?method=look';" href="javascript:void(0);" class="nm11 <% if ("11".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">上行积分列表</a></li>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>DianboTypeServlet?method=lookDown';" href="javascript:void(0);" class="nm12 <% if ("12".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">下行积分列表</a></li>
</ul>
</aside>
<%
}
%> | zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/Left.jsp | Java Server Pages | asf20 | 1,010 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.JiFen,com.dati.bean.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>答题上行设置</li>
</ul>
<div class="tabs-panel">
<form action="DianboServlet?method=setSubmit">
<table width="100%" class="datalist">
<tr>
<td width="19%" class="tc">类型名称:</td>
<%
Xulie xl = (Xulie)session.getAttribute("xilie");
String condition="seriseId='"+xl.getSeriseId()+"'";
JiFen jf = new JifenDao().getJiFen("tb_integral","",condition);
String fenshu= "";
if(jf==null){
fenshu="";
}else {
fenshu=Constant.decodeString(jf.getIntegralValue());
}
%>
<td width="81%"> <input type="text" name="typeName" id="typeName" readonly="readonly" value="<%=xl.getSeriseName() %>"/></td>
</tr>
<tr>
<td width="19%" class="tc">分 数:</td>
<td> <input type="text" name="num" id="num" value="<%=fenshu%>"> <font color="red">*</font>
</td>
</tr>
<tr>
<td colspan="2" class="tc">
<input type="button" name="doSub" id="doSub" value="确定" onclick="doSubmitXilie('<%=xl.getSeriseId() %>')">
<input type="button" name="Submit2" value="取消" onClick="top.mb.close();">
</tr>
</table>
</form>
</div>
</div>
</div>
</section >
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/jiFenupLoadSetDati.jsp | Java Server Pages | asf20 | 2,678 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.JiFen,com.dati.bean.*,com.dati.dao.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>答题下行积分设置</li>
</ul>
<div class="tabs-panel">
<form action="DianboServlet?method=setSubmit">
<table width="100%" class="datalist">
<tr>
<td width="19%" class="tc">类型名称:</td>
<%
List<DatiType> datiType = (ArrayList<DatiType>)session.getAttribute("datiTypeList");
String condition="typeId='"+datiType.get(0).getAnswerTypeId()+"' and integralType=1";
JiFen jf = new JifenDao().getJiFen("tb_integral","",condition);
String fenshu= "";
if(jf==null){
fenshu="";
}else {
fenshu=Constant.decodeString(jf.getIntegralValue());
}
%>
<td width="81%"> <input type="text" name="typeName" id="typeName" readonly="readonly" value="<%=datiType.get(0).getTypeName() %>"/></td>
</tr>
<tr>
<td width="19%" class="tc">分 数:</td>
<td> <input type="text" name="num" id="num" value="<%=fenshu%>"> <font color="red">*</font>
</td>
</tr>
<tr>
<td colspan="2" class="tc">
<input type="button" name="doSub" id="doSub" value="确定" onclick="doSubmitDownDati('<%=datiType.get(0).getAnswerTypeId() %>')">
<input type="button" name="Submit2" value="取消" onClick="top.msg.close();">
</tr>
</table>
</form>
</div>
</div>
</div>
</section >
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/jifen/jiFendownDatiSet.jsp | Java Server Pages | asf20 | 2,801 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<jsp:include page="head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="top.jsp"></jsp:include>
<section id="container">
<div id="crumbs">
» 您的操作可能有错误
</div>
<div id="main">
<div class="tabs">
<div class="error">
您的操作有误或是您填写的数据可能不合法<br>
<img src="<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"%>/images/error.gif" />
</div>
<div align="center">
<a href="javascript:void(0);" onclick="history.go(-1);">点击这里返回</a>
</div>
</div>
</div>
</section>
<jsp:include page="foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/ErrorPage.jsp | Java Server Pages | asf20 | 951 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="security.*"%>
<header id="header">
<div class="logo"> </div>
<div id="status" class="fr m20">
<strong>
<%
String basePath=request.getScheme() + "://" + request.getServerName() + ":"+ request.getServerPort() + request.getContextPath()+ "/" ;
if (session.getAttribute("User") == null) {
response.sendRedirect(basePath+"UserModule/Login.jsp");
} else {
TbUserBean tu = (TbUserBean) session.getAttribute("User");
%> 欢迎您 <%
switch (tu.getUserState()) {
case 0:
out.print("超级管理员");
break;
case 1:
out.print("管理员");
break;
case 2:
out.print("审核人员");
break;
case 3:
out.print("普通用户");
break;
}
%> :<%=tu.getUserName()%>,当前您正在线。
</strong>
<%} %>
<a href="<%=basePath%>UserModule/Exit.jsp" id="logout">退出登录</a>
</div>
</header>
<nav id="nav">
<ul>
<li><a href="TbSmsServlet?method=look" class="nav1 <%if ("1".equals(request.getParameter("topCurrent"))) {%>current <%}%> ">短信管理</a></li>
<li><a href="TbOrderServlet?method=look" class="nav2 <%if ("2".equals(request.getParameter("topCurrent"))) {%>current <%}%> " >互动管理</a></li>
<li><a href="UserModule/UsersList.jsp" class="nav3 <%if ("3".equals(request.getParameter("topCurrent"))) {%>current <%}%> ">账户管理</a></li>
<li><a href="AddressServlet?method=lookDir&startTime=&endTime=&dirName=&dingwei=" class="nav4 <%if ("4".equals(request.getParameter("topCurrent"))) {%>current <%}%> ">客户管理</a></li>
<li><a href="TbSmsTemplateServlet?method=search" class="nav6 <%if ("6".equals(request.getParameter("topCurrent"))) {%>current <%}%> ">常用短语</a></li>
<li><a href="DianboTypeServlet?method=look" class="nav8 <%if ("8".equals(request.getParameter("topCurrent"))) {%>current <%}%> ">积分管理</a></li>
</ul>
</nav>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/top.jsp | Java Server Pages | asf20 | 2,263 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
request.setCharacterEncoding("UTF-8");
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>枣庄俱乐部信息化平台</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="styles/style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="styles/tip-yellow/tip-yellow.css">
<script src="scripts/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/tabs.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/dragndrop.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/msgbox.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/sms_zhang.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/mainAddress.js" type="text/javascript" charset="utf-8"></script>
<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="scripts/treeview.js"></script>
<script type="text/javascript" src="scripts/easy_validator.pack.js"></script>
<script type="text/javascript" src="scripts/jquery.poshytip.js"></script>
<script type="text/javascript" src="scripts/smssend.js"></script>
<link href="styles/validate.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script type="text/javascript">/*@cc_on'abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})@*/</script>
<![endif]-->
</head>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/head.jsp | Java Server Pages | asf20 | 2,248 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="security.AES"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增用户</title>
<meta name="Robots" content="all" />
<meta name="Author" content="Gushu">
<meta name="Description" content="" />
<meta name="Keywords" content="" />
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="home" href="./" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<script src="../scripts/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/tabs.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/dragndrop.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/msgbox.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/mainAddress.js" type="text/javascript"
charset="utf-8"></script>
<script src="../scripts/sms_zhang.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body>
<%
int colSpanNum=2;
String trBgColor="";
if(request.getParameter("id")==null){
%>
<ul class="tabs-nav clearfix">
<li>新增用户</li>
</ul>
<div class="tabs-panel">
<form method="post" action="UserServlet" onSubmit="return userModule_checkForm(this);">
<table width="100%" class="datalist">
<tr>
<td class="tc">用 户 名:<input type="text" name="userName" id="userName" value="" reg="^.+$" tip="用户名不能为空" /></td>
</tr>
<tr>
<td class="tc">密 码:<input type="password" name="userPass" id="userPass" value="" reg="^.+$" tip="密码不能为空" /></td>
</tr>
<tr>
<td class="tc">确认密码:<input type="password" name="reUserPass" id="reUserPass" value=""/></td>
</tr>
<tr>
<td class="tc"> 标识码:
<input type="text" name="biaoshi" id="biaoshi" value="" reg="^.+$" tip="标识码不能为空且为0到9的数字" /><font color="red">[0-9]</font></td>
</tr>
<tr>
<td><input type="submit" value="添 加"/>
<input type="button" name="clo" id="clo" onClick="$mb.close();" value="关 闭"/>
<input type="hidden" name="method" value="add"/>
</td>
</tr>
</table>
</form>
</div>
<%
}else{
TbUserBean tbUser=new TbUserDAO().getTbUsersByUserId(Integer.parseInt(request.getParameter("id")));
%>
<ul class="tabs-nav clearfix">
<li>修改用户</li>
</ul>
<div class="tabs-panel">
<form method="post" action="UserServlet" onSubmit="return userModule_checkForm(this);">
<table width="100%" class="datalist">
<tr>
<td class="tc">用 户 名:<input type="text" name="userName" id="userName" value="<%=tbUser.getUserName() %>"/></td>
</tr>
<tr>
<td class="tc">密 码:<input type="password" name="userPass" id="userPass" value="<%=tbUser.getUserPass() %>"/></td>
</tr>
<tr>
<td class="tc">确认密码:<input type="password" name="reUserPass" id="reUserPass" value="<%=tbUser.getUserPass() %>"/></td>
</tr>
<tr>
<td><input type="submit" value="添 加"/>
<input type="button" name="clo" id="clo" onClick="$mb.close();" value="关 闭"/>
<input type="hidden" name="method" value="edit"/>
<input type="hidden" name="userId" value="<%=tbUser.getUserId() %>"/>
</td>
</tr>
</table>
</form>
</div>
<%
}
%>
</body>
</html> | zzprojects | trunk/zzprojects/zzClub/WebRoot/UserModule/UserOperate.jsp | Java Server Pages | asf20 | 4,591 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.SmsModule.dao.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="3" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="12" /></jsp:include>
<form action="" id="frmMessage" name="frmMessage"></form>
<section id="container">
<%
//---------分页
int currentPage=1;
if(request.getParameter("Page")!=null)
{
currentPage=Integer.parseInt(request.getParameter("Page"));
}
if(session.getAttribute("userModuleResult")!=null){
out.println("<script>alert('"+session.getAttribute("userModuleResult").toString()+"');</script>");
session.removeAttribute("userModuleResult");
}
if(request.getParameter("del")!=null)
{
if(new TbUserDAO().del(Integer.parseInt(request.getParameter("del")))){
out.println("<script>alert('删除用户成功');</script>");
}else{
out.println("<script>alert('删除用户失败');</script>");
}
}
%>
<div id="crumbs">
账户管理 » 用户列表
</div>
<div id="main">
<div class="tabs">
<ul class="tabs-nav clearfix">
<li>用户列表</li>
</ul>
<div class="tabs-panel">
<%
int colSpanNum=11;
%>
<table width="100%" class="datalist">
<thead>
<tr><td class="tc"><input type="button" value="添加用户" onclick="$mb=$.msgbox({
height:350,
width:450,
content:{type:'url',content:'UserModule/UserOperate.jsp'},
title: '添加用户'
});"/></td><td colspan="4"></td></tr>
<tr>
<!-- <td class="tc">
<input type="checkbox" name="ckUsers" id="ckUsers" onClick="selectAll('ckUsers');" />
</td> -->
<td class="tc">用户名</td>
<td class="tc">标识码</td>
<!-- <td class="tc">用户类型</td>
<td class="tc">手机号码</td>
<td class="tc">出生日期</td> -->
<td class="tc">创建时间</td>
<td class="tc">编辑</td>
<td class="tc">删除</td>
</tr>
</thead>
<%
List<TbUserBean> userList=new TbUserDAO().getAllTbUsers();
if(userList!=null){
for(TbUserBean userBean:userList){
%>
<tr>
<td class="tc">
<%=userBean.getUserName() %>
</td>
<td class="tc">
<%=userBean.getOrgNum() %>
</td>
<td class="tc">
<%=userBean.getCreateTime()%>
</td>
<td class="tc">
<a href="javascript:void(0);" class="duanyu_edit" onclick="$mb=$.msgbox({
height:350,
width:450,
content:{type:'ajax',content:'UserModule/UserOperate.jsp?id=<%=userBean.getUserId() %>'},
title: '修改用户'
});">修改</a>
</td>
<td class="tc">
<a href="javascript:void(0);" onclick="if(confirm('确定要删除吗?'))window.location='UsersList.jsp?del=<%=userBean.getUserId() %>';" class="duanyu_del">删除</a>
</td>
</tr>
<%
}
}
%>
</table>
</div>
</div>
</div>
</section>
<jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/UserModule/UsersList.jsp | Java Server Pages | asf20 | 4,702 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="loginer">
<div id="loginbox">
<form name="form1" id="form1" method="post" action="UserServlet" >
<input type="hidden" name="method" value="login">
<table class="form">
<tr>
<th scope="row">用户名:</th>
<td><input type="text" name="userName" id="userName" value="" size="30" /></td>
<td rowspan="2" valign="middle"><button type="submit">登录</button></td>
</tr>
<tr>
<th scope="row">密码:</th>
<td><input type="password" name="userPass" size="30" /></td>
</tr>
</table>
<script type="text/javascript">
form1.userName.focus();
</script>
</form>
<%
if(request.getParameter("err")!=null)
{
%>
<div class="notice" align="center">
用户名或密码错误,登录失败。
</div>
<%
}
%>
</div>
</div>
</body>
</html>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/UserModule/Login.jsp | Java Server Pages | asf20 | 1,170 |
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
session.removeAttribute("User");
response.sendRedirect("Login.jsp");
%>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/UserModule/Exit.jsp | Java Server Pages | asf20 | 177 |
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(request.getParameter("um")!=null){
%>
<aside id="aside">
<ul>
<li><a onclick="window.location='<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>UserModule/UsersList.jsp';" href="javascript:void(0);" class="nm12 <% if ("12".equals(request.getParameter("um"))){out.print(" current");} else out.print(""); %>">用户管理</a></li>
</ul>
</aside>
<%
}
%> | zzprojects | trunk/zzprojects/zzClub/WebRoot/UserModule/Left.jsp | Java Server Pages | asf20 | 641 |
.tip-yellow {
z-index:1000;
text-align:left;
border:1px solid #939393;
padding:7px;
min-width:50px;
max-width:530px;
color:#8c3901;
background-color:#fef9d9;
background-image:url(tip-yellow.png); /* bgImageFrameSize >= 10 should work fine */
/**
* - If you set a background-image, border/padding/background-color will be ingnored.
* You can set any padding to .tip-inner instead if you need.
* - If you want a tiled background-image and border/padding for the tip,
* set the background-image to .tip-inner instead.
*/
}
.tip-yellow .tip-inner {
font:bold 13px/18px 'trebuchet ms',arial,helvetica,sans-serif;
margin-top:-2px;
padding:0 3px 1px 3px;
}
/* Configure an arrow image - the script will automatically position it on the correct side of the tip */
.tip-yellow .tip-arrow-top {
margin-top:-7px;
margin-left:15px;
top:0;
left:0;
width:16px;
height:10px;
background:url(tip-yellow_arrows.png) no-repeat;
}
.tip-yellow .tip-arrow-right {
margin-top:-9px; /* approx. half the height to center it */
margin-left:-4px;
top:50%;
left:100%;
width:10px;
height:20px;
background:url(tip-yellow_arrows.png) no-repeat -16px 0;
}
.tip-yellow .tip-arrow-bottom {
margin-top:-6px;
margin-left:15px;
top:100%;
left:0;
width:16px;
height:13px;
background:url(tip-yellow_arrows.png) no-repeat -32px 0;
}
.tip-yellow .tip-arrow-left {
margin-top:-9px; /* approx. half the height to center it */
margin-left:-6px;
top:50%;
left:0;
width:10px;
height:20px;
background:url(tip-yellow_arrows.png) no-repeat -48px 0;
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/styles/tip-yellow/tip-yellow.css | CSS | asf20 | 1,616 |
p#vtip {position: absolute; padding: 10px; left: 5px; font-size: 0.8em; background-color: white; border: 1px solid #a6c9e2; -moz-border-radius: 5px; -webkit-border-radius: 5px; z-index: 99999;}
p#vtip #vtipArrow { position: absolute; top: -10px; left: 5px }
.input_validation-failed { border: 2px solid #FF0000; color:red;} | zzprojects | trunk/zzprojects/zzClub/WebRoot/styles/validate.css | CSS | asf20 | 328 |
@charset "utf-8";
@import url("reset.css");
@import url("common.css");
html,body,#pager,#loginer{height:100%; max-height:100%; width:100%; margin:0; padding:0; border:0;}
#loginer{
background:#fff url(../images/loginer.gif) repeat-x top;
}
#loginer #loginbox{ width:560px; margin:0 auto; padding-top:350px; background:url(../images/login-bg.png) no-repeat center 35px;}
#loginer #loginbox table{ margin:0 auto;}
#loginer #loginbox table th{ color:#369; font-size:14px;text-shadow:1px 1px 1px rgba(255,255,255,.6);}
#loginer #loginbox table td a{ color:#fff; text-decoration:underline;}
#loginer #loginbox table td input{ border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; border:1px solid #257ea8; background:#daecf6;}
#loginer #loginbox table td button{ height:60px; width:80px; font-size:16px; color:#fff; border:1px solid #257ea8; text-shadow:0 1px 1px rgba(0,0,0,.3); border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;
background:#3aa8db;
background:-webkit-gradient(linear,left top,left bottom,from(#3aa8db),to(#3284aa));
background:-moz-linear-gradient(top, #3aa8db, #3284aa);
background:linear-gradient(top, #3aa8db, #3284aa);
}
#header{
position:absolute;
overflow:hidden;
top:0;
left:0;
width:100%;
height:65px;
background:#f0f7fc url(../images/head-bg.gif) right top no-repeat;
color:#999;
}
.logo{ position:absolute; z-index:1; width:400px; height:80px; text-indent:-9999em; background:url(../images/logo.png) no-repeat left top;_background:url(../images/logo.gif) no-repeat left top;}
#status strong{ color:#e60; margin:0 5px;}
#status #setting{ margin:0 0 0 20px; background:url(../images/setting.png) no-repeat left center; padding-left:18px;}
#status #logout{ margin:0 0 0 20px; background:url(../images/logout.png) no-repeat left center; padding-left:18px;}
#nav{
position:absolute;
overflow:hidden;
top:65px;
left:0;
width:100%;
background:#3aa8db;
background:-webkit-gradient(linear,left top,left bottom,from(#3aa8db),to(#3284aa));
background:-moz-linear-gradient(top, #3aa8db, #3284aa);
background:linear-gradient(top, #3aa8db, #3284aa);
height:60px;
border-bottom:1px solid #257ea8;
/*
-moz-box-shadow:0px 1px 3px #41a4d3;
-webkit-box-shadow:0px 1px 3px #bbb;
box-shadow:0px 1px 3px #41a4d3;
*/
}
#nav ul{ margin-left:200px;}
#nav ul li{list-style:none; float:left;}
#nav ul li a{color:#ddeef6; text-decoration:none; display:block; width:80px; text-align:center; padding-top:35px; margin:5px 10px; height:15px; line-height:120%; font-size:13px;text-shadow:0 1px 1px rgba(0,0,0,.3); border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; }
#nav ul li a:hover,#nav ul li a.current{ color:#FFF; border:1px solid #5cb2dc; margin:4px 9px;}
.nav0,.nav1,.nav2,.nav3,.nav4,.nav5,.nav6,.nav7,.nav8,.nav9{background-image:url(../images/navK1.png); _background-image:url(../images/navK1.gif); background-repeat:no-repeat; background-position:center -100%;}
.nav0{ background-position:center 0;}
.nav1{ background-position:center -50px;}
.nav2{ background-position:center -100px;}
.nav3{ background-position:center -150px;}
.nav4{ background-position:center -200px;}
.nav5{ background-position:center -250px;}
.nav6{ background-position:center -300px;}
.nav7{ background-position:center -350px;}
.nav8{ background-position:center -400px;}
.nav9{ background-position:center -450px;}
#aside{
position:absolute;
top:126px;
bottom:30px;
left:0;
width:200px;
background:#ddeef6;
border-right:1px solid #86caef;
}
#aside ul{ margin:10px;}
#aside ul li{ padding:0; margin:2px 0; list-style:none;}
#aside ul li a{ display:block; height:20px; line-height:20px; padding:5px 10px 5px 30px; margin:0;border:1px solid #ddeef6; border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;text-shadow:0 1px 1px rgba(255,255,255,.8);}
#aside ul li a:hover,#aside ul li a.current{
text-decoration:none;
box-shadow:inset 0 0 2px #fff;
-moz-box-shadow:inset 0 0 2px #fff;
-webkit-box-shadow:inset 0 0 2px #fff;
border:1px solid #95cdeb;
background-color:#e6f5fd;
/*
background:-webkit-gradient(linear,left top,left bottom,from(#ddeef7),color-stop(0.5,#e6f5fd),color-stop(0.5,#dcedf6),to(#c4deeb));
background:-moz-linear-gradient(#e6f5fd 0%, #e6f5fd 50%,#dcedf6 51%,#c4deeb 100%);
background:linear-gradient(#e6f5fd 0%, #e6f5fd 50%,#dcedf6 51%,#c4deeb 100%);
*/
}
#aside ul li a em{ color:#f60; font-size:10px; font-style:normal; margin-left:5px;}
.nm11,.nm12,.nm13,.nm14,.nm15{background-image:url(../images/nav1.png); _background-image:url(../images/nav1.gif); background-repeat:no-repeat; background-position:5px -100%;}
.nm11{ background-position:8px 0;}
.nm12{ background-position:8px -50px;}
.nm13{ background-position:8px -100px;}
.nm14{ background-position:8px -150px;}
.nm15{ background-position:8px -200px;}
.nm21,.nm22,.nm23,.nm24,.nm25{background-image:url(../images/nav2.png); _background-image:url(../images/nav2.gif); background-repeat:no-repeat; background-position:5px -100%;}
.nm21{ background-position:8px 0;}
.nm22{ background-position:8px -50px;}
.nm23{ background-position:8px -100px;}
.nm24{ background-position:8px -150px;}
.nm25{ background-position:8px -200px;}
#container{
position:fixed;
top:126px;
bottom:30px;
left:200px;
right:0;
overflow:auto;
}
#crumbs{ color:#888; padding:5px 10px;}
#main{ margin:5px 10px;}
#footer{
position:absolute;
bottom:0px;
left:0;
width:100%;
height:30px;
color:#ddeef6;
background:#3aa8db;
background:-webkit-gradient(linear,left top,left bottom,from(#3aa8db),to(#3284aa));
background:-moz-linear-gradient(top, #3aa8db, #3284aa);
background:linear-gradient(top, #3aa8db, #3284aa);
}
#footer a{ padding:5px; color:#ddeef6; text-decoration:underline;}
#footer .fl{ background:url(../images/help.gif) no-repeat left bottom;}
/*IE6 hack Start*/
* html body #pager{overflow:auto; padding:126px 0 0 200px;}
* html #aside{height:100%;}
* html #container{height:100%;width:100%;}
* html #header, * html #nav, * html #footer{width:100%;}
* html #footer{display:none;}
/*IE6 hack End*/
.tabs{}
.tabs-nav{
margin:0; list-style:none;
}
.tabs-nav li{
color:#666;
cursor:pointer;
padding:3px 12px;
margin-right:3px;
float: left;
border:1px solid;
border-color:#ccc #ccc #86caef #ccc;
-moz-border-radius-topright:3px;
-moz-border-radius-topleft:3px;
-webkit-border-top-right-radius:3px;
-webkit-border-top-left-radius:3px;
border-top-right-radius:3px;
border-top-left-radius:3px;
background:#f4f4f4;
background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#ebebeb));
background:-moz-linear-gradient(top, #fefefe, #ebebeb);
background:linear-gradient(top, #fefefe, #ebebeb);
}
.tabs-nav li.tabs-selected{
color:#369;
border-color:#86caef #86caef #fff #86caef;
background:#fff;
background:-webkit-gradient(linear,left top,left bottom,from(#fc0),color-stop(0.06,#fc3),color-stop(0.08,#e6f5fd),to(#fff));
background:-moz-linear-gradient(#fc0 0%, #fc3 6%,#e6f5fd 8%,#fff 100%);
background:linear-gradient(#fc0 0%, #fc3 6%,#e6f5fd 8%,#fff 100%);
}
.tabs-panel{
border:1px solid #86caef;
-moz-border-radius-bottomright:3px;
-moz-border-radius-bottomleft:3px;
-moz-border-radius-topright:3px;
-webkit-border-bottom-right-radius:3px;
-webkit-border-bottom-left-radius:3px;
-webkit-border-top-right-radius:3px;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px;
border-top-right-radius:3px;
padding:10px;
margin-top:-1px;
}
.form{ border:none;}
.form th{text-align:right; font-weight:normal; color:#444;}
.form td,.form th{ padding:6px; vertical-align:top; }
.datalist{}
.datalist thead th{
padding:3px 5px;
border:1px solid #8eb7e3;
background:#ddeef6;
}
.datalist thead th span{ color:#369; font-weight:normal;}
.datalist thead th span a{ text-decoration:underline; color:#369}
.datalist thead td{
text-align:center;
color:#7ac;
padding:3px 5px;
border:1px solid;
border-color:#bed3ea #bed3ea #bed3ea #bed3ea;
background:#eff5f8;
background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#eff5f8));
background:-moz-linear-gradient(top, #fefefe, #eff5f8);
background:linear-gradient(top, #fefefe, #eff5f8);
}
.datalist tr:hover{
background:#ffe;
}
.datalist tr.unread{ font-weight:bolder; color:#000;}
.datalist tr.readed{ font-weight:normal; color:#333;}
.datalist td{
color:#333;
padding:5px;
border-bottom:1px solid #e3e6eb;
}
.datalist td a.msg_open{ background:url(../images/email_open.png) no-repeat left center; padding-left:18px; margin:0 5px;}
.datalist td a.msg_del{ background:url(../images/email_delete.png) no-repeat left center; padding-left:18px; margin:0 5px;}
.datalist td a.user_edit{ background:url(../images/user_edit.png) no-repeat left center; padding-left:18px; margin:0 5px;}
.datalist td a.user_del{ background:url(../images/user_delete.png) no-repeat left center; padding-left:18px; margin:0 5px;}
.datalist td a.duanyu_edit{ background:url(../images/duanyu_edit.png) no-repeat left center; padding-left:18px; margin:0 5px;}
.datalist td a.duanyu_del{ background:url(../images/duanyu_delete.png) no-repeat left center; padding-left:18px; margin:0 5px;}
.msgbox_wrapper{border:#257ea8 1px solid; background-color:#fff; overflow: hidden; vertical-align:top; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;}
.msgbox_title_wrapper { list-style-type:none;margin:0; height:24px;vertical-align: middle; padding:4px; vertical-align:middle;
background:#3aa8db;
background:-webkit-gradient(linear,left top,left bottom,from(#3aa8db),to(#3284aa));
background:-moz-linear-gradient(top, #3aa8db, #3284aa);
background:linear-gradient(top, #3aa8db, #3284aa);
}
.msgbox_title_wrapper img {
position:static;
+position:relative;
vertical-align:middle
}
.msgbox_title { float:left;line-height:22px; height:22px; padding-left:10px; color:#fff; font-weight:bold}
.msgbox_title font{ color:yellow; }
.msgbox_close { float:right;line-height:22px; display:table-cell; height:22px; color: #fff; font-weight:bold; cursor:pointer;padding-right: 8px;}
.msgbox_main {text-align:center; padding:12px; color:#f00; overflow:hide;}
.msgbox_bg {background:#ddd;}
.msgbox_button {border:1px solid #010;}
.msgbox_inputbox {border:1px solid #010;}
.treeview, .treeview ul {padding:0; margin:0; list-style:none;}
.treeview ul {margin-top:3px;}
.treeview .hitarea {
background: url(../images/treeview-default.gif) -64px -25px no-repeat;
height: 16px;
width: 16px;
margin-left: -16px;
float: left;
cursor: pointer;
}
/* fix for IE6 */
* html .hitarea{display:inline; float:none;}
.treeview li {margin:0; padding:3px 0pt 3px 16px;}
.treeview .hover { color: red; cursor: pointer; }
.treeview li { background: url(../images/treeview-default-line.gif) 0 0 no-repeat; }
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
.treeview .expandable-hitarea { background-position: -80px -3px; }
.treeview li.last { background-position: 0 -1766px }
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(../images/treeview-default.gif); }
.treeview li.lastCollapsable { background-position: 0 -111px }
.treeview li.lastExpandable { background-position: -32px -67px }
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
.treeview .placeholder {background:url(../images/ajax-loader.gif) 0 0 no-repeat; height:16px; width:16px; display:block;}
.treeview .addnode a{margin:0 5px; padding:0 0 0 16px; background:url(../images/node_add.png) no-repeat left center; display:inline-block; text-indent:-999em;}
.treeview .editnode a{margin:0 5px; padding:0 0 0 16px; background:url(../images/node_edit.png) no-repeat left center; display:inline-block; text-indent:-999em;}
.treeview .delnode a{margin:0 5px; padding:0 0 0 16px; background:url(../images/node_delete.png) no-repeat left center; display:inline-block; text-indent:-999em;}
.treeview .addLinkMan a{margin:0 5px; padding:0 0 0 16px; background:url(../images/user_edit.png) no-repeat left center; display:inline-block; text-indent:-999em;}
.treeview .importLinkMan a{margin:0 5px; padding:0 0 0 16px; background:url(../images/manadd.png) no-repeat left center; display:inline-block; text-indent:-999em;}
| zzprojects | trunk/zzprojects/zzClub/WebRoot/styles/style.css | CSS | asf20 | 12,533 |
@charset "utf-8";
/*** 古树CSS框架v0.1 ***/
/** 更新时间2011-01-18 **/
/* Reset CSS */
html{margin:0;padding:0;border:0;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,iframe,button,textarea,p,blockquote,th,td,article,aside,dialog,figure,footer,header,hgroup,menu,nav,section,time,mark,audio,video{margin:0;padding:0;}
body,button,input,select,textarea{font:12px/1.5 tahoma,\5FAE\8F6F\96C5\9ED1,arial,\5b8b\4f53,sans-serif;}
code,kbd,pre,samp{font-family:courier new,courier,monospace;*font-size:108%;}
a img{border:0;}
a{text-decoration:none;color:#28c;}
a:link,a:visited,a:active{text-decoration:none;}
a:hover{text-decoration:underline;}
input,button,textarea,select{*font-size:100%;}
p,h1,h2,h3,h4,h5,h6{margin:9px 0;}
strong,b{font-weight:bold;}
em,i{font-style:italic;}
sup{vertical-align:text-top;}
sub{vertical-align:text-bottom;}
table{border-collapse:collapse;border-spacing:0;}
thead{display:table-header-group;}
tbody{display:table-row-group;}
tfoot{display:table-footer-group;}
tr{display:table-row;}
th,td{display:table-cell;}
caption{display:table-caption;}
col{display:table-column;}
colgroup{display:table-column-group;}
q:before,q:after,blockquote:before,blockquote:after{content:"";}
| zzprojects | trunk/zzprojects/zzClub/WebRoot/styles/reset.css | CSS | asf20 | 1,274 |
@charset "utf-8";
/*** 古树CSS框架v0.1 ***/
/** 更新时间2011-01-18 **/
/* Layout CSS */
.pager,#pager{margin:0 auto; position:relative;}
.fl{float:left;}
.fr{float:right;}
.fc{ margin-left:auto; margin-right:auto;}
.tl{text-align:left;}
.tr{text-align:right;}
.tc{text-align:center;}
.m5{margin:5px;}.m10{margin:10px;}.m20{margin:20px;}.m30{margin:30px;}
.mt5{margin-top:5px;}.mt10{margin-top:10px;}.mt20{margin-top:20px;}
.mr5{margin-right:5px;}.mr10{margin-right:10px;}.mr20{margin-right:20px;}
.mb5{margin-bottom:5px;}.mb10{margin-bottom:10px;}.mb20{margin-bottom:20px;}
.ml5{margin-left:5px;}.ml10{margin-left:10px;}.ml20{margin-left:20px;}
.p5{padding:5px;}.p10{padding:10px;}.p20{padding:20px;}.p30{padding:30px;}
.pt5{padding-top:5px;}.pt10{padding-top:10px;}.pt20{padding-top:20px;}
.pr5{padding-right:5px;}.pr10{padding-right:10px;}.pr20{padding-right:20px;}
.pb5{padding-bottom:5px;}.pb10{padding-bottom:10px;}.pb20{padding-bottom:20px;}
.pl5{padding-left:5px;}.pl10{padding-left:10px;}.pl20{padding-left:20px;}
.hide{display:none;overflow:hidden;visibility:hidden;}
.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0;}
.clearfix {display:inline-block;}
.clearfix:after{clear:both;content:"\0020";display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0;}
* html .clearfix{height:1%;}
.clearfix {display: block;}
.error,.alert,.notice,.success,.info{padding:5px;margin-bottom:5px;border:1px solid #ddd;}
.error,.alert {background:#fbe3e4;color:#8a1f11;border-color:#fbc2c4;}
.notice{background:#fff6bf;color:#514721;border-color:#ffd324;}
.success{background:#e6efc2;color:#264409;border-color:#c6d880;}
.info{background:#d5edf8;color:#205791;border-color:#92cae4;}
.error a,.alert a{color:#8a1f11;}
.notice a{color:#514721;}
.success a{color:#264409;}
/*分页*/
.pagination{padding:5px;text-align:center;}
.pagination a,.pagination b{color:#444;border:1px solid #ddd;background:#fefefe;padding:2px 8px;text-decoration:none;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;}
/*.pagination a:hover{background:#ffe;border:1px solid #f80;color:#f60;}*/
.pagination a:hover{background:#d5edf8;border:1px solid #92cae4;color:#28c;box-shadow:0px 0px 3px #92cae4;-webkit-box-shadow:0px 0px 3px #92cae4;-moz-box-shadow:0px 0px 3px #92cae4;}
.pagination b{background:#333;border:1px solid #444;color:#fff;}
.w10,.w30,.w70,.w110,.w150,.w190,.w230,.w270,.w310,.w350,.w390,.w430,.w470,.w510,.w550,.w590,.w630,.w670,.w710,.w750,.w790,.w830,.w870,.w910,.w950{display:inline;float:left;position:relative;}
.w10{width:10px;}.w30{width:30px;}.w70{width:70px;}.w110{width:110px;}.w150{width:150px;}.w190{width:190px;}.w230{width:230px;}.w270{width:270px;}.w310{width:310px;}.w350{width:350px;}.w390{width:390px;}.w430{width:430px;}.w470{width:470px;}.w510{width:510px;}.w550{width:550px;}.w590{width:590px;}.w630{width:630px;}.w670{width:670px;}.w710{width:710px;}.w750{width:750px;}.w790{width:790px;}.w830{width:830px;}.w870{width:870px;}.w910{width:910px;}.w950{width:950px;}
.h10{height:10px;}.h30{height:30px;}.h70{height:70px;}.h110{height:110px;}.h150{height:150px;}.h190{height:190px;}.h230{height:230px;}.h270{height:270px;}.h310{height:310px;}.h350{height:350px;}.h390{height:390px;}.h430{height:430px;}.h470{height:470px;}.h510{height:510px;}.h550{height:550px;}.h590{height:590px;}.h630{height:630px;}.h670{height:670px;}.h710{height:710px;}.h750{height:750px;}.h790{height:790px;}.h830{height:830px;}.h870{height:870px;}.h910{height:910px;}.h950{height:950px;}
input[type=text],input[type=password],textarea{ border:1px solid #ccc; padding:2px;}
input[type=button]:disabled,input[type=submit]:disabled,button:disabled{color:#999;cursor:auto;}
input[type=button],input[type=submit],button{
color:#369;
background:#ddeef7;
background:-webkit-gradient(linear,left top,left bottom,from(#ddeef7),color-stop(0.5,#e6f5fd),color-stop(0.5,#dcedf6),to(#c4deeb));
background:-moz-linear-gradient(#e6f5fd 0%, #e6f5fd 50%,#dcedf6 51%,#c4deeb 100%);
background:linear-gradient(#e6f5fd 0%, #e6f5fd 50%,#dcedf6 51%,#c4deeb 100%);
box-shadow:inset 0 0 2px #fff;
-moz-box-shadow:inset 0 0 2px #fff;
-webkit-box-shadow:inset 0 0 2px #fff;
border-top:1px solid #86caef;
border-left:1px solid #86caef;
border-right:1px solid #389bca;
border-bottom:1px solid #389bca;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
cursor: pointer;
display: inline-block;
padding: 2px 8px;
text-shadow: #fff 1px 1px 0px;
}
input[type=button]:enabled:hover,
input[type=button]:enabled:focus,
input[type=submit]:enabled:hover,
input[type=submit]:enabled:focus,
button:enabled:hover,
button:enabled:focus{
border: 1px solid #8c0;
color:#360;
background:#f4fee3;
background:-webkit-gradient(linear,left top,left bottom,from(#fafef5),to(#f4fee3));
background:-moz-linear-gradient(#fafef5 0%, #f4fee3 100%);
background:linear-gradient(#fafef5 0%,#f4fee3 100%);
box-shadow:inset 0 0 2px #fff;
-moz-box-shadow:inset 0 0 2px #fff;
-webkit-box-shadow:inset 0 0 2px #fff;
} | zzprojects | trunk/zzprojects/zzClub/WebRoot/styles/common.css | CSS | asf20 | 5,144 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%
if(session.getAttribute("User")==null)
{
response.sendRedirect("UserModule/Login.jsp");
}
if(request.getParameter("smsSendStyle")!=null)
{
%>
<aside id="aside">
<ul>
<li><a href="SmsModule/SmsSend.jsp" class="nm11 current">短信发送</a></li>
<li><a href="TbSmsServlet?method=smsSend&startTime=&endTime=&phone=&content=" class="nm13">短信发件箱</a></li>
<li><a href="TbSmsServlet?method=smsSendRece&startTime=&endTime=&phone=&content=" class="nm14">短信收件箱</a></li>
<li><a href="TbSmsServlet?method=smsUpload&startTime=&endTime=&phone=&content=" class="nm15">分拣信息</a></li>
</ul>
</aside>
<%
}
%>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/Left.jsp | Java Server Pages | asf20 | 885 |
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<footer id="footer">
<p class="fl ml10 pl20"><a href="#">使用帮助</a></p>
<p class="fr mr10">
Copyright © 2011 济南华恒讯科技有限公司 版权所有
</p>
</footer>
| zzprojects | trunk/zzprojects/zzClub/WebRoot/foot.jsp | Java Server Pages | asf20 | 299 |
# coding:utf-8
# Description: Page download class
# Author: redice
# License: LGPL
import urllib
import urllib2
import httplib
from urlparse import urlparse
from urllib2 import URLError, HTTPError
from StringIO import StringIO
import common
import cache
import gzip
import socket
import threading
import re
import time
DEBUG = True
#counter for pages downloaded
counter = 0
#create a thread lock to access counter
lock = threading.Lock()
def synchronous(f):
def call(*args, **kwargs):
lock.acquire()
try:
return f(*args, **kwargs)
finally:
lock.release()
return call
@synchronous
def add_counter():
"""Increase counter"""
global counter
counter = counter +1
def get_counter():
"""Get counter"""
global counter
return counter
class DownLoad:
"""Download page and return html"""
def __init__(self,proxy=None):
self.proxy = proxy
#Create Cache Object
self.cache = cache.Cache()
socket.setdefaulttimeout(100)
def getHtml(self,url,post_data=None,cookie=None,cached=True,sleep=None):
"""Fetch the target html.
Params:
url - URL to fetch.
post_data - POST Entity,Both Dict and String(urlencoded) will be accept.
cookie - Cookie Header.
Return:
return a Dict like {'html':'','cookie':''}.
"""
if DEBUG:
print "getHtml: ",url
up = urlparse(url)
#if need a https connections
#i find urllib dosen't support https very well
if up.scheme and up.scheme=='https':
return self.getHttps(url, post_data, cookie, cached, sleep)
#Increase counter
add_counter()
result ={'html':'','cookie':''}
try:
if cached:
result['html'] = self.cache.get(url)
if result['html']:
# find the cache data
return result
#as the firewall,sometimes need to delay request
if sleep:
time.sleep(sleep)
#create a request
request = urllib2.Request(url)
#change User-Agent
request.add_header('User-Agent','Mozilla/5.0')
#change Referrer
request.add_header('Referrer',url)
#support gzip
request.add_header('Accept-encoding','gzip')
#if has cookie,add cookie header
if cookie:
request.add_header('Cookie',cookie)
#create a opener
opener = urllib2.build_opener()
if self.proxy:
if isinstance(self.proxy,list):
#Take turns to use
proxy = self.proxy.pop()
self.proxy.insert(0,proxy)
else:
proxy = self.proxy
opener.add_handler(urllib2.ProxyHandler({'http' : proxy}))
#if has post entity
if post_data:
#encode post data
if isinstance(post_data,dict):
post_data = urllib.urlencode(post_data)
response = opener.open(request,post_data)
else:
response = opener.open(request)
result['html'] = response.read()
if response.headers.get('content-encoding') == 'gzip':
result['html'] = gzip.GzipFile(fileobj=StringIO(result['html'])).read()
if response.headers.get('Set-Cookie'):
if isinstance(response.headers.get('Set-Cookie'),basestring):
result['cookie'] = response.headers.get('Set-Cookie')
else:
for c in response.headers.get('Set-Cookie'):
result['cookie'] = result['cookie'] + c + ";"
#fix the cookie
if result['cookie']:
result['cookie'] = re.compile(r"path=/[;]?", re.IGNORECASE).sub('',result['cookie'])
result['cookie'] = result['cookie'].replace(',',';')
response.close()
#no content,don't save
if not result['html']:
return result
if cached:
#save into chaches
self.cache.set(url,result['html'])
return result
except HTTPError, e:
if DEBUG:
print 'Error retrieving data:',e
print 'Server error document follows:\n'
#print e.read()
common.logerror('error.log', "getHTML::Error retrieving data. %s, error reason: %s " % (url,e))
return result
except URLError, e:
if hasattr(e, 'reason'):
if DEBUG:
print 'Failed to reach a server.'
print 'Reason: ', e.reason
common.logerror('error.log', "getHTML::Failed to reach a server. %s, error reason: %s " % (url,e.reason))
return result
elif hasattr(e, 'code'):
if DEBUG:
print 'The server couldn\'t fulfill the request.'
print 'Error code: ', e.code
common.logerror('error.log', "getHTML::The server couldn\'t fulfill the request. %s, error code: %s " % (url,e.code))
return result
except Exception, e:
if DEBUG:
print e
common.logerror('error.log', "getHTML::Unknow Exception. %s, error info: %s " % (url,e))
return result
def getHttps(self,url,post_data=None,cookie=None,cached=True,sleep=None):
"""Fetch the target html from https.
Params:
url - URL to fetch.
post_data - POST Entity,Both Dict and String(urlencoded) will be accept.
cookie - Cookie Header.
Return:
return a Dict like {'html':'','cookie':''}.
"""
if DEBUG:
print "getHttps: ",url
#Increase counter
add_counter()
result ={'html':'','cookie':''}
try:
if cached:
result['html'] = self.cache.get(url)
if result['html']:
# find the cache data
return result
#as the firewall,sometimes need to delay request
if sleep:
time.sleep(sleep)
up = urlparse(url)
host_with_port = up.netloc
host = up.netloc.partition(':')[0]
conn = httplib.HTTPSConnection(host_with_port)
conn.connect()
headers = {"Host":host,"User-Agent":"Mozilla/5.0","Content-Type":"application/x-www-form-urlencoded"}
headers['Accept-encoding']='gzip'
if cookie:
headers['Cookie'] = cookie
if post_data:
#encode post data
if isinstance(post_data,dict):
post_data = urllib.urlencode(post_data)
conn.request("POST",up.path + "?" + up.query,post_data,headers)
else:
conn.request("GET",up.path + "?" + up.query,None,headers)
response = conn.getresponse()
result['html'] = response.read()
if response.getheader('content-encoding') == 'gzip':
result['html'] = gzip.GzipFile(fileobj=StringIO(result['html'])).read()
result['cookie'] = response.getheader("Set-Cookie")
#fix the cookie
if result['cookie']:
result['cookie'] = re.compile(r"path=/[;]?", re.IGNORECASE).sub('',result['cookie'])
result['cookie'] = result['cookie'].replace(',',';')
conn.close()
#no content,don't save
if not result['html']:
return result
if cached:
#save into chaches
self.cache.set(url,result['html'])
return result
except Exception, e:
if DEBUG:
print e
common.logerror('error.log', "getHttps::Unknow Exception. %s, error info: %s " % (url,e))
return result
def getLocation(self,url,post_data=None,cookie=None,cached=True,sleep=None):
"""Fetch the redirect location.
Params:
url - URL to fetch.
post_data - POST Entity,Both Dict and String(urlencoded) will be accept.
cookie - Cookie Header.
Return:
return the redirect Location.
Notice:
if no redirection, just return the previous url.
"""
if DEBUG:
print "getLocation: ",url
#Increase counter
add_counter()
result = ''
try:
if cached:
# look up the caches file firstly
result = self.cache.get(url)
if result:
# find the cache data
return result
#as the firewall,sometimes need to delay request
if sleep:
time.sleep(sleep)
up = urlparse(url)
host_with_port = up.netloc
host = up.netloc.partition(':')[0]
conn = httplib.HTTPConnection(host_with_port)
conn.connect()
headers = {"Host":host,"User-Agent":"Mozilla/5.0","Content-Type":"application/x-www-form-urlencoded"}
if cookie:
headers['Cookie'] = cookie
if post_data:
#encode post data
if isinstance(post_data,dict):
post_data = urllib.urlencode(post_data)
conn.request("POST",up.path + "?" + up.query,post_data,headers)
else:
conn.request("GET",up.path + "?" + up.query,None,headers)
response = conn.getresponse()
#if has Location header
if response.getheader('Location'):
result = response.getheader('Location')
#fix the Location
if result and not urlparse(result).scheme:
if result[0]=='/':
result = up.scheme + "://" + up.netloc + result
else:
previous_path = up.scheme + "://" + up.netloc + up.path
if previous_path[-1]=='/':
result = previous_path + result
else:
path,slash,fname = previous_path.rpartition('/')
result = path + "/" + result
else:
return url
if cached:
#save into caches
self.cache.set(url,result)
return result
except Exception, e:
if DEBUG:
print e
common.logerror('error.log', "getHTML::Unknow Exception. %s, error info: %s " % (url,e))
return url
if __name__ == '__main__':
# test performance of DownLoad class
download = DownLoad()
print download.getHtml('http://www.redicecn.com')
#print download.getHtml('https://www.alipay.com/')
#print download.getLocation('http://www.redicecn.com/tools/redirect.php') | zztemp001-crawl | download.py | Python | lgpl | 12,428 |
# coding:utf-8
# Description: Page cache class
# Author: redice
# License: LGPL
import sqlite3
import threading
import zlib
try:
import cPickle as pickle
except ImportError:
import pickle
DEBUG = True
#create a thread lock to access SQLite
lock = threading.Lock()
def synchronous(f):
def call(*args, **kwargs):
lock.acquire()
try:
return f(*args, **kwargs)
finally:
lock.release()
return call
class Cache:
"""Cache pages"""
@synchronous
def __init__(self,db_name='html_cache.db'):
self.create(db_name)
self.compress_level = 6
def create(self,db_name='html_cache.db'):
"""Create and connect SQLite Database
"""
self.conn = sqlite3.connect(db_name,timeout=100,isolation_level=None, detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
self.conn.text_factory = lambda x: unicode(x, 'utf-8', 'replace')
self.curs = self.conn.cursor()
#create if htmls tables dosen't exist
self.curs.execute('''CREATE TABLE if not exists htmls(url VARCHAR(255) UNIQUE,content BLOB,size INTEGER);''')
self.conn.commit()
@synchronous
def set(self,url,data,trytimes=1):
"""Save page data into caches
"""
self.set_(url, self.serialize(data), trytimes)
def set_(self,url,data,trytimes=1):
if DEBUG:
print "Save %s into caches " % (url)
try:
self.curs.execute("insert into htmls values(?,?,?);", (url,data,len(data)))
self.conn.commit()
return
except sqlite3.IntegrityError:
if DEBUG:
print "%s already exist" % (url)
return
except Exception, e: # for example "database is locked"
if DEBUG:
print 'error from set_'
print e
self.conn.close()
self.create()
if trytimes>0:
self.set_(url, data, trytimes-1)
else:
return
@synchronous
def get(self,url,trytimes=1):
"""Get page from caches
"""
return self.deserialize(self.get_(url, trytimes))
def get_(self,url,trytimes=1):
if DEBUG:
print "Try to get %s from caches " % (url)
try:
self.curs.execute("select * from htmls where url=?;" ,(url,))
row = self.curs.fetchone()
if row:
# find the cache data
return row[1]
return ''
except Exception, e:
if DEBUG:
print 'error from get_'
print e
self.conn.close()
self.create()
if trytimes>0:
return self.get_(url, trytimes-1)
else:
return ''
def serialize(self, value):
"""convert object to a compressed pickled string to save in the db
"""
return sqlite3.Binary(zlib.compress(pickle.dumps(value, protocol=pickle.HIGHEST_PROTOCOL), self.compress_level))
def deserialize(self, value):
"""convert compressed pickled string from database back into an object
"""
return pickle.loads(zlib.decompress(value)) if value else value
if __name__ == '__main__':
# test performance of Cache class
cache = Cache()
cache.set('http://www.redicecn.com', 'This is redice\'s blog!')
print cache.get('http://www.redicecn2.com') | zztemp001-crawl | cache.py | Python | lgpl | 3,721 |
# coding:utf-8
# httpcookie.py
# httpcookie Class
# by redice
import re
class httpcookie:
def __init__(self):
self.cookie_cache = {}
def cookie2dict(self,cookie):
"""
Convert Cookie to Dict
"""
cookie_dic = {}
param_array = cookie.split(';')
for param in param_array:
if not param: continue
if '=' not in param: continue
param = param.strip()
#type1: ASPSESSIONIDCCSQQCDB=NKPFHJIAKJMBELINHGFJNDMC;
if '&' not in param:
name,equal,value = param.partition('=')
if not name: continue
cookie_dic[name] = value
else:
#type2: blog=pass=123456&user=redice
farther,equal,pairs = param.partition('=')
pairs = pairs.split('&')
children = {}
for pair in pairs:
name,eaual,value = pair.partition('=')
if not name: continue
children[name] = value
cookie_dic[farther] = children
return cookie_dic
def dict2cookie(self,dic):
"""
Convert Dict to Cookie
"""
cookie = ''
for key in dic:
value = dic[key]
if isinstance(value,basestring):
cookie = cookie + key + '=' + value + ';'
if isinstance(value,dict):
subdic = value
cookie = cookie + key + '='
for key in subdic:
value = subdic[key]
cookie = cookie + key + '=' + value + '&'
if cookie[-1]=='&':
cookie = cookie[0:-1]
cookie = cookie + ';'
return cookie
def tidy_cookie(self,cookie):
"""
Tidy cookie
"""
param_array = cookie.split(';')
cookie = ''
for param in param_array:
if not param: continue
if '=' not in param: continue
param = param.strip()
name,equal,value = param.partition('=')
if name.lower() == 'expires' or name.lower() == 'path': continue
cookie = cookie + param + ';'
return cookie
def merge_cookie(self,cookie_old,cookie_new):
"""
Merge two cookie
"""
dic_old = self.cookie2dict(cookie_old)
dic_new = self.cookie2dict(cookie_new)
dic_old.update(dic_new)
return self.dict2cookie(dic_old)
def resolve_cookie(self,raw_cookie,default_domain = None):
"""
Resolve cookie for httplib
Store cookie by domain
"""
cookies = {}
raw_cookie = re.compile(r"expires=(.*?);?", re.DOTALL|re.IGNORECASE).sub('',raw_cookie)
cookie_groups = raw_cookie.split(',')
for _group in cookie_groups:
pairs = _group.split(';')
_domain = ''
tmp = ''
for pair in pairs:
if '=' not in pair: continue
pair = pair.strip()
name,equal,value = pair.partition('=')
if name.lower() == 'domain':
_domain = value
else:
if name.lower() == 'path': continue
tmp = tmp + pair + ';'
if not _domain:
_domain = default_domain if default_domain else 'unknow'
if cookies.has_key(_domain):
cookies[_domain] = self.merge_cookie(cookies[_domain],tmp)
else:
cookies[_domain] = tmp
self.cookie_cache.update(cookies)
def get_cookie(self,domain):
"""
Get cookie by domain
"""
cookie = ''
if self.cookie_cache.has_key(domain):
cookie = self.cookie_cache[domain]
if self.cookie_cache.has_key('.'+domain):
cookie = cookie + ';' + self.cookie_cache['.'+domain]
hostname,dot,domain = domain.partition('.')
if self.cookie_cache.has_key('.'+domain):
cookie = cookie + ';' + self.cookie_cache['.'+domain]
return cookie
if __name__ == '__main__':
#Test httpcookie
cookie = httpcookie()
cookie.resolve_cookie('MSPRequ=lt=1293416888&co=1&id=N; path=/;version=1, MSPOK=$uuid-24e2dac0-944a-45bc-86a4-9b2a4b6b779f; domain=login.live.com;path=/;version=1','login.live.com')
print cookie.get_cookie('login.live.com')
| zztemp001-crawl | httpcookie.py | Python | lgpl | 4,808 |
# coding:utf-8
import sys
import os
sys.path.append(os.path.abspath(os.path.dirname(__file__))) | zztemp001-crawl | __init__.py | Python | lgpl | 98 |
# coding:utf-8
# Description: Common web scraping related functions
# Author: Richard Penman (richard@sitescraper.net) & redice
# License: LGPL
#
import os
import re
import time
import math
import csv
import string
import urllib
import urlparse
import string
import htmlentitydefs
import cookielib
from datetime import datetime, timedelta
# known media file extensions
MEDIA_EXTENSIONS = ['ai', 'aif', 'aifc', 'aiff', 'asc', 'au', 'avi', 'bcpio', 'bin', 'c', 'cc', 'ccad', 'cdf', 'class', 'cpio', 'cpt', 'csh', 'css', 'csv', 'dcr', 'dir', 'dms', 'doc', 'drw', 'dvi', 'dwg', 'dxf', 'dxr', 'eps', 'etx', 'exe', 'ez', 'f', 'f90', 'fli', 'flv', 'gif', 'gtar', 'gz', 'h', 'hdf', 'hh', 'hqx', 'ice', 'ico', 'ief', 'iges', 'igs', 'ips', 'ipx', 'jpe', 'jpeg', 'jpg', 'js', 'kar', 'latex', 'lha', 'lsp', 'lzh', 'm', 'man', 'me', 'mesh', 'mid', 'midi', 'mif', 'mime', 'mov', 'movie', 'mp2', 'mp3', 'mpe', 'mpeg', 'mpg', 'mpga', 'ms', 'msh', 'nc', 'oda', 'pbm', 'pdb', 'pdf', 'pgm', 'pgn', 'png', 'pnm', 'pot', 'ppm', 'pps', 'ppt', 'ppz', 'pre', 'prt', 'ps', 'qt', 'ra', 'ram', 'ras', 'rgb', 'rm', 'roff', 'rpm', 'rtf', 'rtx', 'scm', 'set', 'sgm', 'sgml', 'sh', 'shar', 'silo', 'sit', 'skd', 'skm', 'skp', 'skt', 'smi', 'smil', 'snd', 'sol', 'spl', 'src', 'step', 'stl', 'stp', 'sv4cpio', 'sv4crc', 'swf', 't', 'tar', 'tcl', 'tex', 'texi', 'tif', 'tiff', 'tr', 'tsi', 'tsp', 'tsv', 'txt', 'unv', 'ustar', 'vcd', 'vda', 'viv', 'vivo', 'vrml', 'w2p', 'wav', 'wrl', 'xbm', 'xlc', 'xll', 'xlm', 'xls', 'xlw', 'xml', 'xpm', 'xsl', 'xwd', 'xyz', 'zip']
# US_STATES
US_STATES = ['AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','PR','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY']
def to_ascii(html):
"""Return ascii part of html
"""
return ''.join(c for c in html if ord(c) < 128)
def to_int(s):
"""Return integer from this string
>>> to_int('90')
90
>>> to_int('a90a')
90
>>> to_int('a')
0
"""
return int(to_float(s))
def to_float(s):
"""Return float from this string
"""
valid = string.digits + '.'
return float('0' + ''.join(c for c in s if c in valid))
def is_html(html):
"""Returns whether content is HTML
"""
try:
result = re.search('html|head|body', html) is not None
except TypeError:
result = False
return result
def unique(l):
"""Remove duplicates from list, while maintaining order
>>> unique([3,6,4,4,6])
[3, 6, 4]
>>> unique([])
[]
>>> unique([3,6,4])
[3, 6, 4]
"""
checked = []
for e in l:
if e not in checked:
checked.append(e)
return checked
def flatten(ls):
"""Flatten sub lists into single list
>>> [[1,2,3], [4,5,6], [7,8,9]]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
"""
return [e for l in ls for e in l]
def nth(l, i, default):
return l[i] if len(l) > i else default
def first(l, default=''):
"""Return first element from list or default value if empty
>>> first([1,2,3])
1
>>> first([], None)
None
"""
return nth(l, 0, default)
def last(l, default=''):
"""Return last element from list or default value if empty
"""
return l[-1] if l else default
def any_in(es, l):
"""Returns True if any element of es are in l
>>> any_in([1, 2, 3], [3, 4, 5])
True
>>> any_in([1, 2, 3], [4, 5])
False
"""
for e in es:
if e in l:
return True
else:
return False
def all_in(es, l):
"""Returns True if all elements of es are in l
>>> all_in([1, 2, 3], [2, 3, 1, 1])
True
>>> all_in([1, 2, 3], [1, 2])
False
"""
for e in es:
if e not in l:
return False
return True
def remove_tags(html, keep_children=True):
"""Remove HTML tags leaving just text
If keep children is True then keep text within child tags
>>> remove_tags('hello <b>world</b>!')
'hello world!'
>>> remove_tags('hello <b>world</b>!', False)
'hello !'
"""
if not keep_children:
# XXX does not work for multiple nested tags
html = re.compile('<.*?>(.*?)</.*?>', re.DOTALL).sub('', html)
return re.compile('<[^<]*?>').sub('', html)
def unescape(text, encoding='utf-8'):
"""Interpret escape characters
>>> unescape('<hello & world>')
'<hello & world>'
"""
def fixup(m):
text = m.group(0)
if text[:2] == '&#':
# character reference
try:
if text[:3] == '&#x':
return unichr(int(text[3:-1], 16))
else:
return unichr(int(text[2:-1]))
except ValueError:
pass
else:
# named entity
try:
text = unichr(htmlentitydefs.name2codepoint[text[1:-1]])
except KeyError:
pass
return text # leave as is
try:
text = text.decode(encoding, 'ignore')
except UnicodeError:
pass
text = urllib.unquote(text).replace(' ', ' ').replace('&', '&').replace('<', '<').replace('>', '>')
text = re.sub('&#?\w+;', fixup, urllib.unquote(text))
try:
text = text.encode(encoding, 'ignore')
except UnicodeError:
pass
#replace "\xc2\xa0", fixed by redice 2010.12.17
return text.replace("\xc2\xa0"," ")
def clean(s):
return unescape(remove_tags(s)).strip()
def safe(s):
"""Return safe version of string for URLs
"""
safe_chars = string.letters + string.digits + ' '
return ''.join(c for c in s if c in safe_chars).replace(' ', '-')
def pretty(s):
"""Return pretty version of string for display
"""
return re.sub('[-_]', ' ', s.title())
def get_extension(url):
"""Return extension from given URL
>>> get_extension('hello_world.JPG')
'jpg'
>>> get_extension('http://www.google-analytics.com/__utm.gif?utmwv=1.3&utmn=420639071')
'gif'
"""
return os.path.splitext(urlparse.urlsplit(url).path)[-1].lower().replace('.', '')
def get_domain(url):
"""Extract the domain from the given URL
>>> get_domain('http://www.google.com.au/tos.html')
'google.com.au'
"""
suffixes = 'ac', 'ad', 'ae', 'aero', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'arpa', 'as', 'asia', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'biz', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cat', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'com', 'coop', 'cr', 'cu', 'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'edu', 'ee', 'eg', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gov', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'info', 'int', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jobs', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mil', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'name', 'nc', 'ne', 'net', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'org', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'pro', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'st', 'su', 'sv', 'sy', 'sz', 'tc', 'td', 'tel', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'xn', 'ye', 'yt', 'za', 'zm', 'zw'
url = re.sub('^.*://', '', url).partition('/')[0].lower()
domain = []
for section in url.split('.'):
if section in suffixes:
domain.append(section)
else:
domain = [section]
return '.'.join(domain)
def same_domain(url1, url2):
"""Return whether URLs belong to same domain
"""
server1 = get_domain(url1)
server2 = get_domain(url2)
return server1 and server2 and (server1 in server2 or server2 in server1)
def pretty_duration(dt):
"""Return english description of this time difference
"""
if isinstance(dt, datetime):
# convert datetime to timedelta
dt = datetime.now() - dt
if not isinstance(dt, timedelta):
return ''
if dt.days >= 2*365:
return '%d years' % int(dt.days / 365)
elif dt.days >= 365:
return '1 year'
elif dt.days >= 60:
return '%d months' % int(dt.days / 30)
elif dt.days > 21:
return '1 month'
elif dt.days >= 14:
return '%d weeks' % int(dt.days / 7)
elif dt.days >= 7:
return '1 week'
elif dt.days > 1:
return '%d days' % dt.days
elif dt.days == 1:
return '1 day'
elif dt.seconds >= 2*60*60:
return '%d hours' % int(dt.seconds / 3600)
elif dt.seconds >= 60*60:
return '1 hour'
elif dt.seconds >= 2*60:
return '%d minutes' % int(dt.seconds / 60)
elif dt.seconds >= 60:
return '1 minute'
elif dt.seconds > 1:
return '%d seconds' % dt.seconds
elif dt.seconds == 1:
return '1 second'
else:
return ''
def distance(p1, p2):
"""Calculate distance between 2 (latitude, longitude) points
Multiply result by radius of earth (6373 km, 3960 miles)
"""
lat1, long1 = p1
lat2, long2 = p2
# Convert latitude and longitude to
# spherical coordinates in radians.
degrees_to_radians = math.pi/180.0
# phi = 90 - latitude
phi1 = (90.0 - lat1)*degrees_to_radians
phi2 = (90.0 - lat2)*degrees_to_radians
# theta = longitude
theta1 = long1*degrees_to_radians
theta2 = long2*degrees_to_radians
# Compute spherical distance from spherical coordinates.
# For two locations in spherical coordinates
# (1, theta, phi) and (1, theta, phi)
# cosine( arc length ) =
# sin phi sin phi' cos(theta-theta') + cos phi cos phi'
# distance = rho * arc length
cos = (math.sin(phi1)*math.sin(phi2)*math.cos(theta1 - theta2) + math.cos(phi1)*math.cos(phi2))
arc = math.acos( cos )
# Remember to multiply arc by the radius of the earth
# in your favorite set of units to get length.
return arc
def get_zip_codes(city_file, min_distance):
"""Find zip codes that are the given distance apart
"""
zip_codes = []
zip_code_positions = {}
header = None
for row in csv.reader(open(city_file)):
if header:
zip_code, state, city, long1, lat1 = row
p1 = float(lat1), float(long1)
success = True
for z in reversed(zip_codes):
if distance(p1, zip_code_positions[z]) * 3960 < min_distance:
success = False
break
if success:
zip_codes.append(zip_code)
zip_code_positions[zip_code] = p1
else:
header = row
return zip_codes
def logerror(logname,logstr):
"""
write error log
logname - logfile name
logstr - log content
"""
log(logname,logstr)
def log(logname,logstr):
"""
write log
logname - logfile name
logstr - log content
"""
logf = open(logname,'a+')
logf.write(str(time.strftime('%Y-%m-%d-%H-%M-%s',time.localtime(time.time())))+' '+logstr+'\n')
logf.close() | zztemp001-crawl | common.py | Python | lgpl | 12,210 |
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<link href="common/css/style.css" rel="stylesheet" type="text/css">
<script src="common/js/jquery.js" language="JavaScript" type="text/javascript"></script>
<script src="common/js/scripts.js" language="JavaScript" type="text/javascript"></script>
<script src="common/js/jquery.buttons.js" language="JavaScript" type="text/javascript"></script>
<!--[if IE 7]><link href="common/css/ie7.css" rel="stylesheet" type="text/css"><![endif]-->
</head>
<body>
<div class="main">
<div class="ztop">
zfooter
</div>
<div class="content">
test
До окончания игры <span class="timer timer_d">1</span> день <span class="timer timer_h">18</span> : <span class="timer timer_m">23</span>
<div>
<input class="default butt" type="submit" value="сохранить">
</div>
</div>
<div class="zfooter">
zfooter
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".butt").btn();
})
</script>
</body>
</html> | zzzagad | trunk/index.html | HTML | mit | 1,156 |
(function($) {
getChk = function(obj, _options) {
var options = $.extend({}, $.fn.chk.defaults, _options);
var checkedImage = options.checked;
var uncheckedImage = options.unchecked;
var disabledImage = options.disabled;
var disabledCheckImage = options.disabledChecked;
var selectAllBtn = options.selectAll;
var width = options.width;
var height = options.height;
$(obj).css('width', width);
var checkbox = obj;
$(checkbox).wrap('<div class="styledCheckbox" ></div').css({position:'absolute', left : -7777, 'z-index': 0}).parent().css({background:uncheckedImage, width: width, height:height});
$(checkbox).filter(':checked').parent().addClass('checked').css({"background":checkedImage});
if (disabledImage !== false || disabledCheckImage !== false ){
$(checkbox).filter(':disabled').each(function(){
if ($(this).is(':checked')){
$(this).parent().addClass('disabled').css({"background":disabledCheckImage});
}
else {
$(this).parent().addClass('disabled').css({"background":disabledImage});
}
});
$(checkbox).focus(function() {
$(checkbox).parent().addClass("wrapper_focused");
})
$(checkbox).blur(function() {
$(checkbox).parent().removeClass("wrapper_focused");
})
}
$(checkbox).each(function(){
var checkboxClass = $(this).attr('class');
var checkboxClick = $(this).attr('onclick');
$(this).parent().addClass(checkboxClass);
$(this).parent().attr('onclick',checkboxClick );
});
$(checkbox).parent().click(function(){
if(!($(this).hasClass('disabled'))){
if(!($(this).hasClass('checked'))){
$(this).addClass('checked')
.css({"background":checkedImage})
.find('input:checkbox')
.attr('checked','checked');
}
else{
$(this).removeClass('checked')
.css({"background":uncheckedImage})
.find('input:checkbox')
.removeAttr('checked','checked');
$(selectAllBtn).removeAttr('checked','checked')
.parent('.styledCheckbox')
.removeClass('checked')
.css({"background":uncheckedImage});
}
if (selectAllBtn != null){
if ($(this).find('input:checkbox').is(selectAllBtn)){
if($(this).hasClass('checked')){
$(checkbox).each(function(){
$(this).attr('checked','checked')
.parent('.styledCheckbox')
.addClass('checked')
.css({"background":checkedImage});
});
}
else {
$(checkbox).each(function(){
$(this).removeAttr('checked','checked')
.parent('.styledCheckbox')
.removeClass('checked')
.css({"background":uncheckedImage});
});
}
}
}
}
});
$('label').click(function(){
var labelFor = $(this).attr('for');
var radioForMatch = $('input:checkbox').filter('#' + labelFor);
if (!(radioForMatch.parent().hasClass("checked"))){
if ( $.browser.msie ) {
if( $.browser.version == 7.0 || $.browser.version == 8.0 ){
radioForMatch.attr('checked','checked')
.parent('.styledCheckbox')
.addClass('checked')
.css({"background":checkedImage});
if (radioForMatch.is(selectAllBtn)){
$(checkbox).each(function(){
$(this).attr('checked','checked')
.parent('.styledCheckbox')
.addClass('checked')
.css({"background":checkedImage});
});
}
}
}
}
else if (radioForMatch.parent().hasClass("checked")){
if ( $.browser.msie ) {
if( $.browser.version == 7.0 || $.browser.version == 8.0 ){
radioForMatch.removeAttr('checked','checked')
.parent('.styledCheckbox')
.removeClass('checked')
.css({"background":uncheckedImage});
$(selectAllBtn).removeAttr('checked','checked')
.parent('.styledCheckbox')
.removeClass('checked')
.css({"background":uncheckedImage});
}
}
}
});
// ------------------------------------------------
};
getBtn = function(obj, _options) {
var options = $.extend({}, $.fn.btn.defaults, _options);
//
// var checkedImage = options.checked;
// var uncheckedImage = options.unchecked;
// var disabledImage = options.disabled;
// var disabledCheckImage = options.disabledChecked;
// var selectAllBtn = options.selectAll;
// var width = options.width;
// var height = options.height;
// $(obj).css('width', width);
var button = obj;
$(button).css({position:'absolute', left : -7777, top: 45, 'z-index': 0})
.wrap('<div>' + $(button).attr('value') + '</div>')
.bind({
"focus" : function() {
console.log('focus');
$(this).parent().addClass('btn_focused');
},
"blur" : function() {
console.log('blur');
$(this).parent().removeClass('btn_focused');
}
})
.unbind("click")
.parent()
.css({display:"inline", position: 'relative'}).addClass("btn " + $(button).attr('class'))/*.append("<ul><li class='err'>1</li><li class='err2'>2</li><li class='err3'>3</li></ul>")*/
.bind({
"mouseenter" : function() {
console.log('mouseenter');
$(this).addClass("btn_hoverd");
},
"click" : function(e) {
console.log('click');
$(this).removeClass("btn_clickd btn_mousedownd");
var target = $(e.target);
target.find('input').click();
},
"mouseup" : function(e) {
console.log('mouseup');
$(this).addClass("btn_clickd");
},
"mousedown" : function() {
console.log('mousedown');
$(this).addClass("btn_mousedownd");
},
"mouseleave" : function() {
console.log('mousedown');
$(this).removeClass("btn_hoverd btn_mousedownd btn_clickd");
}
});
};
$.fn.chk = function(options) {
this.each(function() {
getChk($(this), options);
});
};
$.fn.btn = function(options) {
this.each(function() {
getBtn($(this), options);
});
};
$.fn.btn.defaults = {
};
})(jQuery);
| zzzagad | trunk/common/js/jquery.buttons.js | JavaScript | mit | 7,096 |
@import url("default.css");
@import url("0.css");
@import url("blocks.css");
@import url("forms.css");
@import url("jquery.buttons.css");
| zzzagad | trunk/common/css/style.css | CSS | mit | 143 |
html {
}
body {
font-family: Georgia,serif;
line-height: 1;
font-size: 14px;
color: #eeeeee;
text-shadow:1px 1px 0px #333333;
padding:0;
margin:0;
background: #000 url("../img/bg_body.png") repeat-y 50% 100%;
}
.main {
width: 1000px;
margin: 0 auto;
background: url("../img/bg_btm.jpg") no-repeat 50% 100%;
}
input::-moz-selection{
background: #62482f; color:#ff9239;
}
input::-webkit-selection{
background: #62482f; color:#ff9239;
}
input::selection{
background: #62482f; color:#ff9239;
}
a {
color:#0087A9;
text-decoration: none;
}
p {
font-size: 12px;
color: #666;
margin-bottom: 12px;
line-height: 16px
}
.timer {
font-size: 2.1em;
line-height: 1em;
padding:0 0.3em 0.1em 0.3em ;
text-shadow:none;
}
.timer_d {
background: #417630;
}
.timer_h {
background: #dd6000;
}
.timer_m {
background: #fd4239;
} | zzzagad | trunk/common/css/default.css | CSS | mit | 980 |
.btn {
background: #DDDDDD;
border-color: #BBBBBB #BBBBBB #999999;
border-radius: 4px 4px 4px 4px;
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 #F8F8F8;
color: #333333 !important;
cursor: pointer;
display: inline-block;
font: 12px/15px Helvetica Neue,Arial,"Lucida Grande",Sans-serif;
margin: 0;
overflow: hidden;
padding: 5px 9px;
text-shadow: 0 1px #F0F0F0;
}
.btn_focused {
border: 1px solid #e69a00;
}
.btn_hoverd {
background: #e69a00;
}
.btn_mousedownd {
-moz-box-shadow: -1px -1px 5px #333;
-webkit-box-shadow: -1px -1px 5px #333;
box-shadow: -1px -1px 5px #333;
text-shadow: -1px -1px 0 #aaa;
}
.btn_clickd {
}
| zzzagad | trunk/common/css/jquery.buttons.css | CSS | mit | 780 |
.zfooter {
height: 556px;
background: url("../img/bg_zz_btm.png") no-repeat 50% 100%;
}
.ztop {
height: 322px;
background: url("../img/bg_zz_top.png") no-repeat 50% 100%;
}
.content {
background: url("../img/bg_zz_content.png") repeat-y 50% 0;
} | zzzagad | trunk/common/css/blocks.css | CSS | mit | 282 |
/**
* Created by 相杰 on 13-10-21.
*/
$(function(){
var $btnCount = $('.btnCount')
var $countVla = $('#countVla')
var countVla = $countVla.val()
$btnCount.on("click",function(){
$this = $(this)
countVla = $countVla.val()
if($this.attr('id')!='btnMinus'){
countVla++
}else{
if(countVla!=1){
countVla--
}
}
$countVla.val(countVla)
return false
})
}) | zzzxj-project-jackphonewebsote | trunk/js/count.js | JavaScript | asf20 | 501 |