Compare commits
2 Commits
f85762f626
...
2abe2298c6
| Author | SHA1 | Date |
|---|---|---|
|
|
2abe2298c6 | |
|
|
c67565c543 |
|
|
@ -0,0 +1,95 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// FacebookHelper 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class FacebookHelper
|
||||||
|
{
|
||||||
|
private string _appId;
|
||||||
|
private string _appSecret;
|
||||||
|
private string _accessToken;
|
||||||
|
|
||||||
|
public string AccessToken
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_accessToken == null)
|
||||||
|
GetAccessToken();
|
||||||
|
|
||||||
|
return _accessToken;
|
||||||
|
}
|
||||||
|
set { _accessToken = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public FacebookHelper(string appId, string appSecret)
|
||||||
|
{
|
||||||
|
this._appId = appId;
|
||||||
|
this._appSecret = appSecret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetAccessToken()
|
||||||
|
{
|
||||||
|
var facebookCookie = HttpContext.Current.Request.Cookies["fbsr_" + _appId];
|
||||||
|
if (facebookCookie != null && facebookCookie.Value != null)
|
||||||
|
{
|
||||||
|
string jsoncode = System.Text.ASCIIEncoding.ASCII.GetString(FromBase64ForUrlString(facebookCookie.Value.Split(new char[] { '.' })[1]));
|
||||||
|
var tokenParams = HttpUtility.ParseQueryString(GetAccessToken((string)JObject.Parse(jsoncode)["code"]));
|
||||||
|
_accessToken = tokenParams["access_token"];
|
||||||
|
return _accessToken;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// return DBLoginCall(username, passwordHash, cookieToken, cookieTokenExpires, args.LoginType == LoginType.Logout, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetAccessToken(string code)
|
||||||
|
{
|
||||||
|
//Notice the empty redirect_uri! And the replace on the code we get from the cookie.
|
||||||
|
string url = string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}", _appId, "", _appSecret, code.Replace("\"", ""));
|
||||||
|
|
||||||
|
System.Net.HttpWebRequest request = System.Net.WebRequest.Create(url) as System.Net.HttpWebRequest;
|
||||||
|
System.Net.HttpWebResponse response = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (response = request.GetResponse() as System.Net.HttpWebResponse)
|
||||||
|
{
|
||||||
|
System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream());
|
||||||
|
|
||||||
|
string retVal = reader.ReadToEnd();
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] FromBase64ForUrlString(string base64ForUrlInput)
|
||||||
|
{
|
||||||
|
int padChars = (base64ForUrlInput.Length % 4) == 0 ? 0 : (4 - (base64ForUrlInput.Length % 4));
|
||||||
|
StringBuilder result = new StringBuilder(base64ForUrlInput, base64ForUrlInput.Length + padChars);
|
||||||
|
result.Append(String.Empty.PadRight(padChars, '='));
|
||||||
|
result.Replace('-', '+');
|
||||||
|
result.Replace('_', '/');
|
||||||
|
return Convert.FromBase64String(result.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// authPermission 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class authPermission
|
||||||
|
{
|
||||||
|
|
||||||
|
public string user_uid = "";
|
||||||
|
public string user_id = "";
|
||||||
|
public string user_name = "";
|
||||||
|
public string user_email = "";
|
||||||
|
public string user_type = "";
|
||||||
|
public string user_perm = "";
|
||||||
|
public string user_pic = "";
|
||||||
|
|
||||||
|
public Boolean _isLogin = false;
|
||||||
|
|
||||||
|
public authPermission()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
string delExpiredDataStr = "delete token where token_expireddate <= '" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "'";
|
||||||
|
autoExecSQL delExpiredData = new autoExecSQL(delExpiredDataStr);
|
||||||
|
|
||||||
|
HttpCookie tokenCookie = (HttpContext.Current.Request.Cookies["token"] == null) ? null : HttpContext.Current.Request.Cookies["token"];
|
||||||
|
HttpCookie idCookie = (HttpContext.Current.Request.Cookies["id"] == null) ? null : HttpContext.Current.Request.Cookies["id"];
|
||||||
|
|
||||||
|
if (tokenCookie==null)
|
||||||
|
{
|
||||||
|
_isLogin = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string token = tokenCookie["token"];
|
||||||
|
string id = tokenCookie["uid"];
|
||||||
|
|
||||||
|
string tokenStr = string.Format("select * from token where token_key = '{0}' and user_uid = '{1}'", token, id);
|
||||||
|
autoBindDataTable tokenObj = new autoBindDataTable(tokenStr);
|
||||||
|
|
||||||
|
if (tokenObj.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
tokenCookie.Expires = DateTime.Now.AddDays(-10);
|
||||||
|
HttpContext.Current.Response.Cookies.Add(tokenCookie);
|
||||||
|
_isLogin = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (tokenObj.dataRows[0]["token_isremember"].ToString() == "Y")
|
||||||
|
{
|
||||||
|
idCookie.Expires = DateTime.Now.AddDays(31);
|
||||||
|
tokenCookie.Expires = DateTime.Now.AddDays(10);
|
||||||
|
tokenObj.dataRows[0]["token_expireddate"] = DateTime.Now.AddDays(10);
|
||||||
|
|
||||||
|
HttpContext.Current.Response.Cookies.Add(tokenCookie);
|
||||||
|
HttpContext.Current.Response.Cookies.Add(idCookie);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tokenObj.dataRows[0]["token_expireddate"] = DateTime.Now.AddMinutes(60);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string userStr = string.Format("select * from users where user_uid = '{0}' and user_onjob = 'Y'", id);
|
||||||
|
autoBindDataTable userObj = new autoBindDataTable(userStr);
|
||||||
|
|
||||||
|
if (userObj.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
_isLogin = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userObj.dataRows[0]["user_type"].ToString() == "N") {
|
||||||
|
string elabStr = string.Format("select * from new_userdata where userid = '{0}' and onjob = 0", userObj.dataRows[0]["user_id"].ToString());
|
||||||
|
autoBindElab elabObj = new autoBindElab(elabStr);
|
||||||
|
|
||||||
|
if (elabObj.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
userObj.dataRows[0]["user_onjob"] = "N";
|
||||||
|
userObj.updateDataTable();
|
||||||
|
_isLogin = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
user_uid = id;
|
||||||
|
user_id = userObj.dataRows[0]["user_id"].ToString();
|
||||||
|
user_name = userObj.dataRows[0]["user_name"].ToString();
|
||||||
|
user_email = userObj.dataRows[0]["user_email"].ToString();
|
||||||
|
user_type = userObj.dataRows[0]["user_type"].ToString();
|
||||||
|
user_perm = userObj.dataRows[0]["user_perm"].ToString();
|
||||||
|
user_pic = userObj.dataRows[0]["user_pic"].ToString();
|
||||||
|
|
||||||
|
userObj.dataRows[0]["user_lastlogindate"] = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userObj.updateDataTable();
|
||||||
|
tokenObj.updateDataTable();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
_isLogin = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isLogin()
|
||||||
|
{
|
||||||
|
return _isLogin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// autoBindDataTable 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class autoBindDataTable
|
||||||
|
{
|
||||||
|
private string _strSQL = "";
|
||||||
|
private SqlConnection _objConn = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString);
|
||||||
|
private SqlCommand _objCmd;
|
||||||
|
private SqlDataAdapter _objDataAdapter;
|
||||||
|
private SqlCommandBuilder _objDataCommandBuilder;
|
||||||
|
private DataTable _objDataTable = new DataTable();
|
||||||
|
|
||||||
|
public autoBindDataTable(string strSQL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
_strSQL = strSQL;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_objConn.Open();
|
||||||
|
_objCmd = new SqlCommand(_strSQL, _objConn);
|
||||||
|
_objDataAdapter = new SqlDataAdapter(_objCmd);
|
||||||
|
_objDataCommandBuilder = new SqlCommandBuilder(_objDataAdapter);
|
||||||
|
_objDataAdapter.Fill(_objDataTable);
|
||||||
|
_objConn.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_objConn.Close();
|
||||||
|
throw new Exception("Bind DataTable 發生錯誤! " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataRow newRow
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
DataRow objRow = this._objDataTable.NewRow();
|
||||||
|
return objRow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateDataTable()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_objConn.Open();
|
||||||
|
_objDataAdapter.Update(_objDataTable);
|
||||||
|
_objConn.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_objConn.Close();
|
||||||
|
throw new Exception("DataTable 資料庫更新發生錯誤[" + _objDataTable.TableName + "], " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disConnection()
|
||||||
|
{
|
||||||
|
_objConn.Close();
|
||||||
|
_objConn.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataRowCollection dataRows
|
||||||
|
{
|
||||||
|
get { return this._objDataTable.Rows; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataRow[] selectedRows(string value)
|
||||||
|
{
|
||||||
|
return this._objDataTable.Select(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int columnNumber
|
||||||
|
{
|
||||||
|
get { return this._objDataTable.Columns.Count; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string columnName(int columnIndex) {
|
||||||
|
string colName = "";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
colName = this._objDataTable.Columns[columnIndex].ColumnName;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return colName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// autoBindElab 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class autoBindElab
|
||||||
|
{
|
||||||
|
private string _strSQL = "";
|
||||||
|
private SqlConnection _objConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ElabConnectionString"].ConnectionString);
|
||||||
|
private SqlCommand _objCmd;
|
||||||
|
private SqlDataAdapter _objDataAdapter;
|
||||||
|
private SqlCommandBuilder _objDataCommandBuilder;
|
||||||
|
private DataTable _objDataTable = new DataTable();
|
||||||
|
|
||||||
|
public autoBindElab(string strSQL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
_strSQL = strSQL;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_objConn.Open();
|
||||||
|
_objCmd = new SqlCommand(_strSQL, _objConn);
|
||||||
|
_objDataAdapter = new SqlDataAdapter(_objCmd);
|
||||||
|
_objDataCommandBuilder = new SqlCommandBuilder(_objDataAdapter);
|
||||||
|
_objDataAdapter.Fill(_objDataTable);
|
||||||
|
_objConn.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
throw new Exception("BindElab 發生錯誤! " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateDataTable() {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_objConn.Open();
|
||||||
|
_objDataAdapter.Update(_objDataTable);
|
||||||
|
_objConn.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_objConn.Close();
|
||||||
|
throw new Exception("ELab資料庫更新發生錯誤[" + _objDataTable.TableName + "], " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataRowCollection dataRows {
|
||||||
|
get { return this._objDataTable.Rows; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// autoExecSQL 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class autoExecSQL
|
||||||
|
{
|
||||||
|
private string _strSQL = "";
|
||||||
|
private int _intEffectNum = 0;
|
||||||
|
private SqlConnection _objConn = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString);
|
||||||
|
private SqlCommand _objCmd;
|
||||||
|
public autoExecSQL(string strSQL)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
_strSQL = strSQL;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_objConn.Open();
|
||||||
|
_objCmd = new SqlCommand(_strSQL, _objConn);
|
||||||
|
_intEffectNum = _objCmd.ExecuteNonQuery();
|
||||||
|
_objConn.Close();
|
||||||
|
_objConn.Dispose();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_objConn.Close();
|
||||||
|
_objConn.Dispose();
|
||||||
|
throw new Exception("Exec SQL 發生錯誤! " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string strSQL
|
||||||
|
{
|
||||||
|
get { return this._strSQL; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int effectDataCount
|
||||||
|
{
|
||||||
|
get { return _intEffectNum; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
/// <summary>
|
||||||
|
/// baseMasterPage 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class baseMasterPage : System.Web.UI.MasterPage
|
||||||
|
{
|
||||||
|
public authPermission objAuth;
|
||||||
|
public userdata objLoginUser;
|
||||||
|
public baseMasterPage()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
this.Load += new EventHandler(this.Page_Load);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
objAuth = new authPermission();
|
||||||
|
//Response.Write(objAuth.isLogin().ToString());
|
||||||
|
if (objAuth.isLogin() == false)
|
||||||
|
{
|
||||||
|
//Response.Redirect("Login.html");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
objLoginUser = new userdata(objAuth.user_uid);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,343 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// globalClass 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public static class globalClass
|
||||||
|
{
|
||||||
|
public static bool isURL(string url)
|
||||||
|
{
|
||||||
|
|
||||||
|
return Uri.IsWellFormedUriString(url, UriKind.Absolute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetIPAddress()
|
||||||
|
{
|
||||||
|
System.Web.HttpContext context = System.Web.HttpContext.Current;
|
||||||
|
string sIPAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
|
||||||
|
if (string.IsNullOrEmpty(sIPAddress))
|
||||||
|
{
|
||||||
|
return context.Request.ServerVariables["REMOTE_ADDR"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] ipArray = sIPAddress.Split(new Char[] { ',' });
|
||||||
|
return ipArray[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean Base64ToFile(string base64String, string filePath) {
|
||||||
|
Boolean ret = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] imageBytes = Convert.FromBase64String(base64String.Replace("data:image/png;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "").Replace("data:application/pdf;base64,", "").Replace("data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,", ""));
|
||||||
|
File.WriteAllBytes(filePath, imageBytes);
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
ret = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static System.Drawing.Image Base64ToImage(string base64String)
|
||||||
|
{
|
||||||
|
// Convert Base64 String to byte[]
|
||||||
|
byte[] imageBytes = Convert.FromBase64String(base64String.Replace("data:image/png;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", ""));
|
||||||
|
MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);
|
||||||
|
|
||||||
|
// Convert byte[] to Image
|
||||||
|
ms.Write(imageBytes, 0, imageBytes.Length);
|
||||||
|
System.Drawing.Image image__1 = System.Drawing.Image.FromStream(ms, true);
|
||||||
|
return image__1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Stream Base64ToStream(string base64String)
|
||||||
|
{
|
||||||
|
Stream newReturn;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] imageBytes = Convert.FromBase64String(base64String.Replace("data:image/png;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "").Replace("data:application/pdf;base64,", "").Replace("data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,", ""));
|
||||||
|
//File.WriteAllBytes(filePath, imageBytes);
|
||||||
|
newReturn = new MemoryStream(imageBytes);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
newReturn = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return newReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取得網址圖片
|
||||||
|
public static System.Drawing.Image DownloadImageFromUrl(string imageUrl)
|
||||||
|
{
|
||||||
|
System.Drawing.Image image = null/* TODO Change to default(_) if this is not a reference type */;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(imageUrl);
|
||||||
|
webRequest.AllowWriteStreamBuffering = true;
|
||||||
|
webRequest.Timeout = 30000;
|
||||||
|
|
||||||
|
System.Net.WebResponse webResponse = webRequest.GetResponse();
|
||||||
|
|
||||||
|
System.IO.Stream stream = webResponse.GetResponseStream();
|
||||||
|
|
||||||
|
image = System.Drawing.Image.FromStream(stream);
|
||||||
|
|
||||||
|
webResponse.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return null/* TODO Change to default(_) if this is not a reference type */;
|
||||||
|
}
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static System.Drawing.Image fileToImage(System.IO.Stream fileContent)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.Drawing.Image imgObj;
|
||||||
|
|
||||||
|
long fileLength = fileContent.Length;
|
||||||
|
byte[] imageBuffer = new byte[fileLength - 1 + 1];
|
||||||
|
fileContent.Read(imageBuffer, 0, System.Convert.ToInt32(fileLength));
|
||||||
|
|
||||||
|
// 將圖片塞進MemoryStream
|
||||||
|
MemoryStream inputMS = new MemoryStream(imageBuffer);
|
||||||
|
imgObj = System.Drawing.Image.FromStream(inputMS);
|
||||||
|
|
||||||
|
return imgObj;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null/* TODO Change to default(_) if this is not a reference type */;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static System.Drawing.Image markImage(System.Drawing.Image backImg, System.Drawing.Image waterImg)
|
||||||
|
{
|
||||||
|
// 設定背景圖片
|
||||||
|
Graphics gr = System.Drawing.Graphics.FromImage(backImg);
|
||||||
|
|
||||||
|
float newP = float.Parse(backImg.Width.ToString()) / 720f;
|
||||||
|
|
||||||
|
float newWH = 72f * newP;
|
||||||
|
int newWidthHeight = Convert.ToInt32(newWH);
|
||||||
|
|
||||||
|
Bitmap waterLogo = new Bitmap(waterImg);
|
||||||
|
|
||||||
|
//新建logo浮水印圖片
|
||||||
|
Bitmap Logo = ScaleImage(waterLogo, newWidthHeight, newWidthHeight);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gr.DrawImage(Logo, (backImg.Width - Logo.Width) / 2, (backImg.Height - Logo.Height) / 2);
|
||||||
|
gr.Dispose();
|
||||||
|
|
||||||
|
return backImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static System.Drawing.Image resizeImage(System.Drawing.Image img, int newWidth, int newHeight)
|
||||||
|
{
|
||||||
|
Bitmap imageOutput = new Bitmap(img, newWidth, newHeight);
|
||||||
|
Image oimg = (Image)imageOutput;
|
||||||
|
return oimg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static Bitmap ScaleImage(Bitmap pBmp, int pWidth, int pHeight)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Bitmap tmpBmp = new Bitmap(pWidth, pHeight);
|
||||||
|
Graphics tmpG = Graphics.FromImage(tmpBmp);
|
||||||
|
|
||||||
|
//tmpG.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||||
|
|
||||||
|
tmpG.DrawImage(pBmp,
|
||||||
|
new Rectangle(0, 0, pWidth, pHeight),
|
||||||
|
new Rectangle(0, 0, pBmp.Width, pBmp.Height),
|
||||||
|
GraphicsUnit.Pixel);
|
||||||
|
tmpG.Dispose();
|
||||||
|
return tmpBmp;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Stream ToStream(this Image image, ImageFormat format)
|
||||||
|
{
|
||||||
|
var stream = new System.IO.MemoryStream();
|
||||||
|
image.Save(stream, format);
|
||||||
|
stream.Position = 0;
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string CreateRandomCode(int Number)
|
||||||
|
{
|
||||||
|
string allChar = "1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z";
|
||||||
|
string[] allCharArray = allChar.Split(',');
|
||||||
|
string randomCode = "";
|
||||||
|
|
||||||
|
Random rand = new Random(Guid.NewGuid().GetHashCode());
|
||||||
|
for (int i = 0; i <= Number - 1; i++)
|
||||||
|
{
|
||||||
|
int t = rand.Next(allCharArray.Length);
|
||||||
|
randomCode += allCharArray[t];
|
||||||
|
}
|
||||||
|
return randomCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string CreateCaseRandomCode(int Number)
|
||||||
|
{
|
||||||
|
string allChar = "1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,v,w,x,y,z";
|
||||||
|
string[] allCharArray = allChar.Split(',');
|
||||||
|
string randomCode = "";
|
||||||
|
|
||||||
|
Random rand = new Random(Guid.NewGuid().GetHashCode());
|
||||||
|
for (int i = 0; i <= Number - 1; i++)
|
||||||
|
{
|
||||||
|
int t = rand.Next(allCharArray.Length);
|
||||||
|
randomCode += allCharArray[t];
|
||||||
|
}
|
||||||
|
return randomCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsDate(string strDate)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DateTime.Parse(strDate);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string getPageData(string url)
|
||||||
|
{
|
||||||
|
if (url == null || url.Trim() == "")
|
||||||
|
return "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
WebClient wc = new WebClient();
|
||||||
|
wc.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;");
|
||||||
|
|
||||||
|
wc.Credentials = CredentialCache.DefaultCredentials;
|
||||||
|
Byte[] pageData = wc.DownloadData(url);
|
||||||
|
return Encoding.UTF8.GetString(pageData);//.ASCII.GetString
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Image getUrlPic(string url) {
|
||||||
|
if (url == null || url.Trim() == "")
|
||||||
|
return null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WebClient wc = new WebClient();
|
||||||
|
wc.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;");
|
||||||
|
wc.Credentials = CredentialCache.DefaultCredentials;
|
||||||
|
|
||||||
|
System.IO.MemoryStream Ms = new System.IO.MemoryStream(wc.DownloadData(url));
|
||||||
|
Image img = Image.FromStream(Ms);
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsNumeric(string anyString)
|
||||||
|
{
|
||||||
|
if (anyString == null)
|
||||||
|
{
|
||||||
|
anyString = "";
|
||||||
|
}
|
||||||
|
if (anyString.Length > 0)
|
||||||
|
{
|
||||||
|
double dummyOut = new double();
|
||||||
|
System.Globalization.CultureInfo cultureInfo =
|
||||||
|
new System.Globalization.CultureInfo("en-US", true);
|
||||||
|
|
||||||
|
return Double.TryParse(anyString, System.Globalization.NumberStyles.Any,
|
||||||
|
cultureInfo.NumberFormat, out dummyOut);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string getLocalBaseDomain()
|
||||||
|
{
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string getLocalDomain()
|
||||||
|
{
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath.TrimEnd('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddScriptToHead(this System.Web.UI.HtmlControls.HtmlHead h, string script, bool AddScriptTags)
|
||||||
|
{
|
||||||
|
System.Web.UI.WebControls.Literal l = new System.Web.UI.WebControls.Literal();
|
||||||
|
|
||||||
|
if (AddScriptTags)
|
||||||
|
{
|
||||||
|
l.Text = @"<script type=""text/javascript"">
|
||||||
|
//<![CDATA["
|
||||||
|
+ script +
|
||||||
|
@"//]]>
|
||||||
|
</script>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
l.Text = script;
|
||||||
|
}
|
||||||
|
h.Controls.Add(l);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,209 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// project 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class project : projectBase
|
||||||
|
{
|
||||||
|
public List<userdata> project_users;
|
||||||
|
public List<projectApiDomainBase> projectApi_domains;
|
||||||
|
public List<projectApiDomainBase> projectApi_ips;
|
||||||
|
public userdata project_createUser;
|
||||||
|
|
||||||
|
[IgnoreDataMember] public string update_result = "";
|
||||||
|
|
||||||
|
autoBindDataTable projectSQL;
|
||||||
|
autoExecSQL recExec;
|
||||||
|
string recString = "";
|
||||||
|
Boolean isNew = false;
|
||||||
|
DataRow projectRow;
|
||||||
|
|
||||||
|
public project() : base()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
project_users = new List<userdata>();
|
||||||
|
projectApi_domains = new List<projectApiDomainBase>();
|
||||||
|
projectApi_ips = new List<projectApiDomainBase>();
|
||||||
|
|
||||||
|
string projectString = "select * from projects where project_sn = -1";
|
||||||
|
projectSQL = new autoBindDataTable(projectString);
|
||||||
|
projectRow = projectSQL.newRow;
|
||||||
|
projectSQL.dataRows.Add(projectRow);
|
||||||
|
isNew = true;
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
project_createUid = objAuth.user_uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public project(string project_uid) : base(project_uid)
|
||||||
|
{
|
||||||
|
projectSQL = projectBaseSQL;
|
||||||
|
projectRow = projectBaseRow;
|
||||||
|
|
||||||
|
project_users = new List<userdata>();
|
||||||
|
projectApi_domains = new List<projectApiDomainBase>();
|
||||||
|
projectApi_ips = new List<projectApiDomainBase>();
|
||||||
|
|
||||||
|
project_createUser = new userdata(project_createUid);
|
||||||
|
|
||||||
|
string apiDomainString = string.Format("select * from projectApiDomain where project_uid = '{0}'", project_uid);
|
||||||
|
autoBindDataTable sqlApiDomain = new autoBindDataTable(apiDomainString);
|
||||||
|
|
||||||
|
foreach (DataRow tmpRow in sqlApiDomain.dataRows)
|
||||||
|
{
|
||||||
|
projectApiDomainBase tmpApi = new projectApiDomainBase();
|
||||||
|
tmpApi.project_uid = project_uid;
|
||||||
|
tmpApi.projectApiDomain_type = tmpRow["projectApiDomain_type"].ToString();
|
||||||
|
tmpApi.projectApiDomain_address = tmpRow["projectApiDomain_address"].ToString();
|
||||||
|
|
||||||
|
if (tmpApi.projectApiDomain_type == "domain")
|
||||||
|
{
|
||||||
|
projectApi_domains.Add(tmpApi);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tmpApi.projectApiDomain_type == "ip")
|
||||||
|
{
|
||||||
|
projectApi_ips.Add(tmpApi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string userString = string.Format("select * from projectUser where project_uid = '{0}' and user_uid <> ''", project_uid);
|
||||||
|
autoBindDataTable sqlUser = new autoBindDataTable(userString);
|
||||||
|
|
||||||
|
foreach (DataRow tmpRow in sqlUser.dataRows)
|
||||||
|
{
|
||||||
|
userdata tmpUser = new userdata(tmpRow["user_uid"].ToString());
|
||||||
|
project_users.Add(tmpUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean updateData()
|
||||||
|
{
|
||||||
|
Boolean result = false;
|
||||||
|
|
||||||
|
update_result = "更新失敗!";
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (objAuth.isLogin() == false)
|
||||||
|
{
|
||||||
|
update_result = "無權限!";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
projectRow["project_uid"] = project_uid;
|
||||||
|
projectRow["project_name"] = project_name;
|
||||||
|
projectRow["project_descript"] = project_descript;
|
||||||
|
projectRow["project_recTableName"] = project_recTableName;
|
||||||
|
projectRow["project_dateLimit"] = project_dateLimit;
|
||||||
|
projectRow["project_endDate"] = project_endDate;
|
||||||
|
projectRow["project_endToRedirect"] = project_endToRedirect;
|
||||||
|
projectRow["project_apiId"] = project_apiId;
|
||||||
|
projectRow["project_apiKey"] = project_apiKey;
|
||||||
|
projectRow["project_createUid"] = project_createUid;
|
||||||
|
|
||||||
|
if (isNew)
|
||||||
|
{
|
||||||
|
recString += string.Format(" CREATE TABLE [dbo].[rec_{0}](", project_uid);
|
||||||
|
recString += string.Format(" [rec_sn] [int] IDENTITY(1,1) NOT NULL,");
|
||||||
|
recString += string.Format(" [project_uid] [nvarchar](36) NOT NULL,");
|
||||||
|
recString += string.Format(" [url_uid] [nvarchar](36) NOT NULL,");
|
||||||
|
recString += string.Format(" [rec_sourceIP] [nvarchar](36) NOT NULL,");
|
||||||
|
recString += string.Format(" [rec_sourceDomain] [nvarchar](500) NOT NULL,");
|
||||||
|
recString += string.Format(" [rec_country] [nvarchar](50) NOT NULL,");
|
||||||
|
recString += string.Format(" [rec_city] [nvarchar](50) NOT NULL,");
|
||||||
|
recString += string.Format(" [rec_loc] [nvarchar](50) NOT NULL,");
|
||||||
|
recString += string.Format(" [rec_createdate] [datetime] NOT NULL,");
|
||||||
|
recString += string.Format(" CONSTRAINT [PK_rec_{0}] PRIMARY KEY CLUSTERED ", project_uid);
|
||||||
|
recString += string.Format("(");
|
||||||
|
recString += string.Format(" [rec_sn] ASC");
|
||||||
|
recString += string.Format(") WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]");
|
||||||
|
recString += string.Format(") ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" CREATE NONCLUSTERED INDEX [IX_rec_{0}] ON [dbo].[rec_{1}]", project_uid, project_uid);
|
||||||
|
recString += string.Format(" (");
|
||||||
|
recString += string.Format(" [project_uid] ASC");
|
||||||
|
recString += string.Format(")WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" CREATE NONCLUSTERED INDEX [IX_rec_{0}_1] ON [dbo].[rec_{1}]", project_uid, project_uid);
|
||||||
|
recString += string.Format(" (");
|
||||||
|
recString += string.Format(" [url_uid] ASC");
|
||||||
|
recString += string.Format(")WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" CREATE NONCLUSTERED INDEX [IX_rec_{0}_2] ON [dbo].[rec_{1}]", project_uid, project_uid);
|
||||||
|
recString += string.Format("(");
|
||||||
|
recString += string.Format(" [project_uid] ASC,");
|
||||||
|
recString += string.Format(" [url_uid] ASC");
|
||||||
|
recString += string.Format(") WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" CREATE NONCLUSTERED INDEX [IX_rec_{0}_3] ON [dbo].[rec_{1}]", project_uid, project_uid);
|
||||||
|
recString += string.Format(" (");
|
||||||
|
recString += string.Format(" [rec_createdate] ASC");
|
||||||
|
recString += string.Format(") WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" CREATE NONCLUSTERED INDEX [IX_rec_{0}_4] ON [dbo].[rec_{1}]", project_uid, project_uid);
|
||||||
|
recString += string.Format("(");
|
||||||
|
recString += string.Format(" [url_uid] ASC,");
|
||||||
|
recString += string.Format(" [rec_createdate] ASC");
|
||||||
|
recString += string.Format(")WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" CREATE NONCLUSTERED INDEX [IX_rec_{0}_5] ON [dbo].[rec_{1}]", project_uid, project_uid);
|
||||||
|
recString += string.Format("(");
|
||||||
|
recString += string.Format(" [project_uid] ASC,");
|
||||||
|
recString += string.Format(" [url_uid] ASC,");
|
||||||
|
recString += string.Format(" [rec_createdate] ASC");
|
||||||
|
recString += string.Format(") WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];");
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_project_uid] DEFAULT ('') FOR [project_uid];", project_uid, project_uid);
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_url_uid] DEFAULT ('') FOR [url_uid];", project_uid, project_uid);
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_rec_sourceIP] DEFAULT ('') FOR [rec_sourceIP];", project_uid, project_uid);
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_rec_sourceDomain] DEFAULT ('') FOR [rec_sourceDomain];", project_uid, project_uid);
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_rec_country] DEFAULT ('') FOR [rec_country];", project_uid, project_uid);
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_rec_city] DEFAULT ('') FOR [rec_city]", project_uid, project_uid);
|
||||||
|
|
||||||
|
recString += string.Format(" ALTER TABLE [dbo].[rec_{0}] ADD CONSTRAINT [DF_rec_{1}_rec_createdate] DEFAULT (getdate()) FOR [rec_createdate];", project_uid, project_uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
projectSQL.updateDataTable();
|
||||||
|
|
||||||
|
if (isNew) {
|
||||||
|
autoExecSQL objNewRec = new autoExecSQL(recString);
|
||||||
|
}
|
||||||
|
result = true;
|
||||||
|
update_result = "";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
result = false;
|
||||||
|
update_result = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// projectApiDomainBase 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class projectApiDomainBase
|
||||||
|
{
|
||||||
|
public string project_uid = "";
|
||||||
|
public string projectApiDomain_type = "domain";
|
||||||
|
public string projectApiDomain_address = "";
|
||||||
|
|
||||||
|
public projectApiDomainBase()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// projectBase 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class projectBase
|
||||||
|
{
|
||||||
|
public string project_uid = "";
|
||||||
|
public string project_name = "";
|
||||||
|
public string project_recTableName = "";
|
||||||
|
public string project_descript = "";
|
||||||
|
public string project_dateLimit = "";
|
||||||
|
public DateTime project_startDate = DateTime.Now;
|
||||||
|
public DateTime project_endDate = DateTime.Now;
|
||||||
|
public string project_endToRedirect = "";
|
||||||
|
public string project_apiId = "";
|
||||||
|
public string project_apiKey = "";
|
||||||
|
public DateTime project_createdate = DateTime.Now;
|
||||||
|
|
||||||
|
public string project_createUid = "";
|
||||||
|
|
||||||
|
protected autoBindDataTable projectBaseSQL;
|
||||||
|
protected DataRow projectBaseRow;
|
||||||
|
|
||||||
|
public projectBase()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public projectBase(string _project_uid)
|
||||||
|
{
|
||||||
|
string projectString = string.Format("select * from projects where project_uid = '{0}' and project_isRevoke = 'N'", _project_uid);
|
||||||
|
projectBaseSQL = new autoBindDataTable(projectString);
|
||||||
|
|
||||||
|
if (projectBaseSQL.dataRows.Count > 0)
|
||||||
|
{
|
||||||
|
projectBaseRow = projectBaseSQL.dataRows[0];
|
||||||
|
|
||||||
|
project_uid = projectBaseRow["project_uid"].ToString();
|
||||||
|
project_name = projectBaseRow["project_name"].ToString();
|
||||||
|
project_recTableName = projectBaseRow["project_recTableName"].ToString();
|
||||||
|
project_descript = projectBaseRow["project_descript"].ToString();
|
||||||
|
project_dateLimit = projectBaseRow["project_dateLimit"].ToString();
|
||||||
|
|
||||||
|
if (project_dateLimit == "Y")
|
||||||
|
{
|
||||||
|
project_startDate = DateTime.Parse(projectBaseRow["project_startDate"].ToString());
|
||||||
|
project_endDate = DateTime.Parse(projectBaseRow["project_endDate"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
project_endToRedirect = projectBaseRow["project_endToRedirect"].ToString();
|
||||||
|
project_apiId = projectBaseRow["project_apiId"].ToString();
|
||||||
|
project_apiKey = projectBaseRow["project_apiKey"].ToString();
|
||||||
|
project_createdate = DateTime.Parse(projectBaseRow["project_createdate"].ToString());
|
||||||
|
project_createUid = projectBaseRow["project_createUid"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string project_createdateString
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return DateTime.Parse(project_createdate.ToString()).ToString("yyyy/MM/dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,210 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// urlBase 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class urlBase
|
||||||
|
{
|
||||||
|
public string url_uid = "";
|
||||||
|
public string project_uid = "";
|
||||||
|
public string url_descript = "";
|
||||||
|
public string url_directToUrl = "";
|
||||||
|
public string url_Code = "";
|
||||||
|
public string url_datelimit = "";
|
||||||
|
public string url_gifTag = "N";
|
||||||
|
public string url_gifLink = "";
|
||||||
|
public string url_fbTag = "N";
|
||||||
|
public string url_fbTitle = "";
|
||||||
|
public string url_fbImage = "";
|
||||||
|
public string url_fbDescript = "";
|
||||||
|
public string url_fbPixel = "N";
|
||||||
|
public string url_fbPixelCode = "";
|
||||||
|
public string url_googleAds = "N";
|
||||||
|
public string url_googleAwConversionId = "";
|
||||||
|
public string url_uploadFile = "N";
|
||||||
|
public string url_uploadFileClientName = "";
|
||||||
|
public string url_uploadFileLinkName = "";
|
||||||
|
public string url_uploadFileType = "";
|
||||||
|
public string fileUrl = "";
|
||||||
|
public string url_playBtn = "N";
|
||||||
|
public DateTime url_endDate = DateTime.Now;
|
||||||
|
public string url_isRevoke = "N";
|
||||||
|
public DateTime url_createdate = DateTime.Now;
|
||||||
|
public string url_createUid = "";
|
||||||
|
public int url_version = 0;
|
||||||
|
public string url_photoId = "";
|
||||||
|
|
||||||
|
private string _baseurl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority +"/";
|
||||||
|
[IgnoreDataMember] protected Image _picImage;
|
||||||
|
[IgnoreDataMember] protected Boolean imageChange = false;
|
||||||
|
|
||||||
|
protected autoBindDataTable urlBaseSQL;
|
||||||
|
protected DataRow urlBaseRow;
|
||||||
|
private Image _myImage;
|
||||||
|
public urlBase()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public urlBase(string _url_uid)
|
||||||
|
{
|
||||||
|
urlBaseSQL = new autoBindDataTable(string.Format("select * from url where url_uid = '{0}'", _url_uid));
|
||||||
|
|
||||||
|
if (urlBaseSQL.dataRows.Count > 0) {
|
||||||
|
urlBaseRow = urlBaseSQL.dataRows[0];
|
||||||
|
|
||||||
|
url_uid = urlBaseRow["url_uid"].ToString();
|
||||||
|
project_uid = urlBaseRow["project_uid"].ToString();
|
||||||
|
url_descript = urlBaseRow["url_descript"].ToString();
|
||||||
|
url_directToUrl = urlBaseRow["url_directToUrl"].ToString();
|
||||||
|
url_Code = urlBaseRow["url_Code"].ToString();
|
||||||
|
url_gifTag = urlBaseRow["url_gifTag"].ToString();
|
||||||
|
url_gifLink = urlBaseRow["url_gifLink"].ToString();
|
||||||
|
url_fbTag = urlBaseRow["url_fbTag"].ToString();
|
||||||
|
url_fbTitle = urlBaseRow["url_fbTitle"].ToString();
|
||||||
|
url_fbImage = urlBaseRow["url_fbImage"].ToString();
|
||||||
|
url_fbDescript = urlBaseRow["url_fbDescript"].ToString();
|
||||||
|
url_fbPixel = urlBaseRow["url_fbPixel"].ToString();
|
||||||
|
url_fbPixelCode = urlBaseRow["url_fbPixelCode"].ToString();
|
||||||
|
url_googleAds = urlBaseRow["url_googleAds"].ToString();
|
||||||
|
url_googleAwConversionId = urlBaseRow["url_googleAwConversionId"].ToString();
|
||||||
|
url_playBtn = urlBaseRow["url_playBtn"].ToString();
|
||||||
|
url_datelimit = urlBaseRow["url_datelimit"].ToString();
|
||||||
|
url_endDate = DateTime.Parse(urlBaseRow["url_endDate"].ToString());
|
||||||
|
url_isRevoke = urlBaseRow["url_isRevoke"].ToString();
|
||||||
|
url_createdate = DateTime.Parse(urlBaseRow["url_createdate"].ToString());
|
||||||
|
url_createUid = urlBaseRow["url_createUid"].ToString();
|
||||||
|
url_version = int.Parse(urlBaseRow["url_version"].ToString());
|
||||||
|
url_photoId = urlBaseRow["url_photoId"].ToString();
|
||||||
|
url_uploadFile = urlBaseRow["url_uploadFile"].ToString();
|
||||||
|
url_uploadFileClientName = urlBaseRow["url_uploadFileClientName"].ToString();
|
||||||
|
url_uploadFileLinkName = urlBaseRow["url_uploadFileLinkName"].ToString();
|
||||||
|
url_uploadFileType = urlBaseRow["url_uploadFileType"].ToString();
|
||||||
|
|
||||||
|
fileUrl = _baseurl + "/upload_files/" + url_uploadFileLinkName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public urlBase(DataRow _urlBaseRow) {
|
||||||
|
urlBaseRow = _urlBaseRow;
|
||||||
|
|
||||||
|
url_uid = urlBaseRow["url_uid"].ToString();
|
||||||
|
project_uid = urlBaseRow["project_uid"].ToString();
|
||||||
|
url_descript = urlBaseRow["url_descript"].ToString();
|
||||||
|
url_directToUrl = urlBaseRow["url_directToUrl"].ToString();
|
||||||
|
url_Code = urlBaseRow["url_Code"].ToString();
|
||||||
|
url_fbTitle = urlBaseRow["url_fbTitle"].ToString();
|
||||||
|
url_gifTag = urlBaseRow["url_gifTag"].ToString();
|
||||||
|
url_gifLink = urlBaseRow["url_gifLink"].ToString();
|
||||||
|
url_fbTag = urlBaseRow["url_fbTag"].ToString();
|
||||||
|
url_fbImage = urlBaseRow["url_fbImage"].ToString();
|
||||||
|
url_fbDescript = urlBaseRow["url_fbDescript"].ToString();
|
||||||
|
url_fbPixel = urlBaseRow["url_fbPixel"].ToString();
|
||||||
|
url_fbPixelCode = urlBaseRow["url_fbPixelCode"].ToString();
|
||||||
|
url_googleAds = urlBaseRow["url_googleAds"].ToString();
|
||||||
|
url_googleAwConversionId = urlBaseRow["url_googleAwConversionId"].ToString();
|
||||||
|
url_playBtn = urlBaseRow["url_playBtn"].ToString();
|
||||||
|
url_datelimit = urlBaseRow["url_datelimit"].ToString();
|
||||||
|
url_endDate = DateTime.Parse(urlBaseRow["url_endDate"].ToString());
|
||||||
|
url_isRevoke = urlBaseRow["url_isRevoke"].ToString();
|
||||||
|
url_createdate = DateTime.Parse(urlBaseRow["url_createdate"].ToString());
|
||||||
|
url_createUid = urlBaseRow["url_createUid"].ToString();
|
||||||
|
url_version = int.Parse(urlBaseRow["url_version"].ToString());
|
||||||
|
url_photoId = urlBaseRow["url_photoId"].ToString();
|
||||||
|
url_uploadFile = urlBaseRow["url_uploadFile"].ToString();
|
||||||
|
url_uploadFileClientName = urlBaseRow["url_uploadFileClientName"].ToString();
|
||||||
|
url_uploadFileLinkName = urlBaseRow["url_uploadFileLinkName"].ToString();
|
||||||
|
url_uploadFileType = urlBaseRow["url_uploadFileType"].ToString();
|
||||||
|
|
||||||
|
fileUrl = _baseurl + "/upload_files/" + url_uploadFileClientName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string url_shortUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/" + url_Code;
|
||||||
|
}
|
||||||
|
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string url_fbImageUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + url_fbImage + "?v=" + url_version;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string baseUrl_shortUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Url_fbCacheUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (url_playBtn == "Y")
|
||||||
|
{
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/photos.ashx?id=" + url_photoId + "&play=Y&v=" + url_version.ToString();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/photos.ashx?id=" + url_photoId + "&v=" + url_version.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public Image pic_image
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
string fullPath = path + url_fbImage.Replace("/", "\\");
|
||||||
|
fullPath = fullPath.Replace("\\\\", "\\");
|
||||||
|
_myImage = Image.FromFile(fullPath);
|
||||||
|
|
||||||
|
return _myImage;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
imageChange = true;
|
||||||
|
url_version += 1;
|
||||||
|
_picImage = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// urlObj 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class urlObj : urlBase
|
||||||
|
{
|
||||||
|
autoBindDataTable urlSQL;
|
||||||
|
|
||||||
|
DataRow urlRow;
|
||||||
|
|
||||||
|
[IgnoreDataMember] Boolean isNew = false;
|
||||||
|
[IgnoreDataMember] public string update_result = "";
|
||||||
|
|
||||||
|
public userdata url_createUser;
|
||||||
|
|
||||||
|
public urlObj() : base()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
string urlString = "select * from url where url_sn = -1";
|
||||||
|
urlSQL = new autoBindDataTable(urlString);
|
||||||
|
urlRow = urlSQL.newRow;
|
||||||
|
urlSQL.dataRows.Add(urlRow);
|
||||||
|
|
||||||
|
isNew = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
url_createUid = objAuth.user_uid;
|
||||||
|
url_createUser = new userdata(url_createUid);
|
||||||
|
} catch (Exception ex) { }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public urlObj(string _url_uid) : base(_url_uid)
|
||||||
|
{
|
||||||
|
urlSQL = urlBaseSQL;
|
||||||
|
urlRow = urlBaseRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public urlObj(DataRow _urlRow) : base(_urlRow)
|
||||||
|
{
|
||||||
|
urlRow = _urlRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean updateData()
|
||||||
|
{
|
||||||
|
Boolean result = false;
|
||||||
|
|
||||||
|
update_result = "更新失敗!";
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (objAuth.isLogin() == false)
|
||||||
|
{
|
||||||
|
update_result = "無權限!";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageChange)
|
||||||
|
{
|
||||||
|
string filePath = string.Format("upload_pics/{0}.png", url_uid);
|
||||||
|
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
|
||||||
|
//using (System.IO.MemoryStream oMS = new System.IO.MemoryStream())
|
||||||
|
//{
|
||||||
|
// //將oTarImg儲存(指定)到記憶體串流中
|
||||||
|
// _picImage.Save(oMS, System.Drawing.Imaging.ImageFormat.Png);
|
||||||
|
// //將串流整個讀到陣列中,寫入某個路徑中的某個檔案裡
|
||||||
|
// using (System.IO.FileStream oFS = System.IO.File.Open(path + filePath.Replace("/", "\\"), System.IO.FileMode.OpenOrCreate))
|
||||||
|
// { oFS.Write(oMS.ToArray(), 0, oMS.ToArray().Length); }
|
||||||
|
//}
|
||||||
|
|
||||||
|
_picImage.Save(path + filePath.Replace("/", "\\"), ImageFormat.Png);
|
||||||
|
url_fbImage = "/" + filePath;
|
||||||
|
|
||||||
|
if (url_photoId == "") {
|
||||||
|
url_photoId = globalClass.CreateRandomCode(24);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
urlRow["url_uid"] = url_uid;
|
||||||
|
urlRow["project_uid"] = project_uid;
|
||||||
|
urlRow["url_descript"] = url_descript;
|
||||||
|
urlRow["url_directToUrl"] = url_directToUrl;
|
||||||
|
urlRow["url_Code"] = url_Code;
|
||||||
|
urlRow["url_gifTag"] = url_gifTag;
|
||||||
|
urlRow["url_gifLink"] = url_gifLink;
|
||||||
|
urlRow["url_fbTag"] = url_fbTag;
|
||||||
|
urlRow["url_fbTitle"] = url_fbTitle;
|
||||||
|
urlRow["url_fbDescript"] = url_fbDescript;
|
||||||
|
urlRow["url_fbImage"] = url_fbImage;
|
||||||
|
urlRow["url_fbPixel"] = url_fbPixel;
|
||||||
|
urlRow["url_fbPixelCode"] = url_fbPixelCode;
|
||||||
|
urlRow["url_googleAds"] = url_googleAds;
|
||||||
|
urlRow["url_googleAwConversionId"] = url_googleAwConversionId;
|
||||||
|
urlRow["url_uploadFile"] = url_uploadFile;
|
||||||
|
urlRow["url_uploadFileClientName"] = url_uploadFileClientName;
|
||||||
|
urlRow["url_uploadFileLinkName"] = url_uploadFileLinkName;
|
||||||
|
urlRow["url_uploadFileType"] = url_uploadFileType;
|
||||||
|
urlRow["url_playBtn"] = url_playBtn;
|
||||||
|
urlRow["url_datelimit"] = url_datelimit;
|
||||||
|
urlRow["url_endDate"] = url_endDate;
|
||||||
|
urlRow["url_isRevoke"] = url_isRevoke;
|
||||||
|
urlRow["url_createUid"] = url_createUid;
|
||||||
|
urlRow["url_version"] = url_version;
|
||||||
|
urlRow["url_photoId"] = url_photoId;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
urlSQL.updateDataTable();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
result = false;
|
||||||
|
update_result = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,221 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// userdata 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class userdata
|
||||||
|
{
|
||||||
|
autoBindDataTable userSQL;
|
||||||
|
|
||||||
|
DataRow userRow;
|
||||||
|
public string user_uid = "";
|
||||||
|
public string user_id = "";
|
||||||
|
public string user_name = "";
|
||||||
|
public string user_email = "";
|
||||||
|
public string user_onjob = "N";
|
||||||
|
public string user_type = "Y";
|
||||||
|
public string user_perm = "N";
|
||||||
|
public string user_pic = "";
|
||||||
|
//public string user_picurl = "";
|
||||||
|
private string _user_pwd = "";
|
||||||
|
private int user_pic_version = 1;
|
||||||
|
private string _baseurl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath.TrimEnd('/');
|
||||||
|
[IgnoreDataMember] private Image _picImage;
|
||||||
|
|
||||||
|
public string update_result = "";
|
||||||
|
public string user_lastlogin = "";
|
||||||
|
private Boolean imageChange = false;
|
||||||
|
private Boolean pwdChange = false;
|
||||||
|
|
||||||
|
public userdata()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
string userStr = string.Format("select * from users where user_sn = -1");
|
||||||
|
userSQL = new autoBindDataTable(userStr);
|
||||||
|
userRow = userSQL.newRow;
|
||||||
|
userSQL.dataRows.Add(userRow);
|
||||||
|
user_uid = globalClass.CreateRandomCode(16);
|
||||||
|
userRow["user_uid"] = user_uid;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public userdata(DataRow userRow)
|
||||||
|
{
|
||||||
|
|
||||||
|
user_uid = userRow["user_uid"].ToString();
|
||||||
|
user_id = userRow["user_id"].ToString();
|
||||||
|
user_name = userRow["user_name"].ToString();
|
||||||
|
user_email = userRow["user_email"].ToString();
|
||||||
|
user_type = userRow["user_type"].ToString();
|
||||||
|
user_perm = userRow["user_perm"].ToString();
|
||||||
|
_user_pwd = userRow["user_pwd"].ToString();
|
||||||
|
user_pic = userRow["user_pic"].ToString();
|
||||||
|
user_onjob = userRow["user_onjob"].ToString();
|
||||||
|
user_pic_version = int.Parse(userRow["user_pic_version"].ToString());
|
||||||
|
user_lastlogin = ((DateTime)userRow["user_lastlogindate"]).ToString("yyyy/MM/dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
public userdata(string uid)
|
||||||
|
{
|
||||||
|
string userStr = string.Format("select * from users where user_uid = '{0}'", uid);
|
||||||
|
userSQL = new autoBindDataTable(userStr);
|
||||||
|
|
||||||
|
if (userSQL.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
throw new Exception("無此 uid 使用者! uid = " + uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRow = userSQL.dataRows[0];
|
||||||
|
user_uid = userRow["user_uid"].ToString();
|
||||||
|
user_id = userRow["user_id"].ToString();
|
||||||
|
user_name = userRow["user_name"].ToString();
|
||||||
|
user_email = userRow["user_email"].ToString();
|
||||||
|
user_type = userRow["user_type"].ToString();
|
||||||
|
user_perm = userRow["user_perm"].ToString();
|
||||||
|
_user_pwd = userRow["user_pwd"].ToString();
|
||||||
|
user_pic = userRow["user_pic"].ToString();
|
||||||
|
user_onjob = userRow["user_onjob"].ToString();
|
||||||
|
user_pic_version = int.Parse(userRow["user_pic_version"].ToString());
|
||||||
|
user_lastlogin = ((DateTime)userRow["user_lastlogindate"]).ToString("yyyy/MM/dd HH:mm:ss");
|
||||||
|
|
||||||
|
//if (user_pic == "")
|
||||||
|
//{
|
||||||
|
// user_picurl = _baseurl + "/uploads/images/avatars/unknown-profile.jpg";
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
// user_picurl = _baseurl + user_pic + "?v=" + user_pic_version.ToString();
|
||||||
|
//}
|
||||||
|
|
||||||
|
_picImage = globalClass.DownloadImageFromUrl(user_picurl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string user_picurl
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (user_pic == "")
|
||||||
|
{
|
||||||
|
return _baseurl + "/BackEnd/assets/images/avatars/unknown-profile.jpg";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return _baseurl + user_pic + "?v=" + user_pic_version.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean updateData()
|
||||||
|
{
|
||||||
|
Boolean result = false;
|
||||||
|
|
||||||
|
update_result = "更新失敗!";
|
||||||
|
|
||||||
|
if (imageChange)
|
||||||
|
{
|
||||||
|
user_pic = string.Format("/BackEnd/uploads/images/avatars/{0}.png", user_uid);
|
||||||
|
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
_picImage.Save(path + user_pic.Replace("/", "\\"), ImageFormat.Png);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRow["user_name"] = user_name;
|
||||||
|
userRow["user_email"] = user_email;
|
||||||
|
userRow["user_id"] = user_id;
|
||||||
|
userRow["user_type"] = user_type;
|
||||||
|
userRow["user_perm"] = user_perm;
|
||||||
|
userRow["user_pic"] = user_pic;
|
||||||
|
userRow["user_pic_version"] = user_pic_version;
|
||||||
|
userRow["user_onjob"] = user_onjob;
|
||||||
|
|
||||||
|
if (pwdChange)
|
||||||
|
{
|
||||||
|
userRow["user_pwd"] = _user_pwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userSQL.updateDataTable();
|
||||||
|
update_result = "儲存成功";
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
update_result = "儲存失敗 - " + ex.Message;
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string perm_string
|
||||||
|
{
|
||||||
|
set { }
|
||||||
|
get {
|
||||||
|
string output = "一般用戶";
|
||||||
|
|
||||||
|
switch (user_perm)
|
||||||
|
{
|
||||||
|
case "A":
|
||||||
|
output = "系統管理員";
|
||||||
|
break;
|
||||||
|
case "P":
|
||||||
|
output = "專案管理員";
|
||||||
|
break;
|
||||||
|
case "N":
|
||||||
|
output = "一般用戶";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public string user_pwd
|
||||||
|
{
|
||||||
|
get { return _user_pwd; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
pwdChange = true;
|
||||||
|
_user_pwd = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public Image pic_image
|
||||||
|
{
|
||||||
|
get { return _picImage; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
imageChange = true;
|
||||||
|
user_pic_version += 1;
|
||||||
|
_picImage = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// webBase 的摘要描述
|
||||||
|
/// </summary>
|
||||||
|
public class webBase : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
public authPermission objAuth;
|
||||||
|
public webBase()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// TODO: 在這裡新增建構函式邏輯
|
||||||
|
//
|
||||||
|
this.Load += new EventHandler(this.Page_Load);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string myIP = globalClass.GetIPAddress();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
objAuth = new authPermission();
|
||||||
|
//Response.Write(objAuth.isLogin().ToString());
|
||||||
|
if (objAuth.isLogin() == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("Login.html");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,178 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><!-- End Required meta tags -->
|
||||||
|
<!-- Begin SEO tag -->
|
||||||
|
<title> Fullwidth Page Layout | Looper - Bootstrap 4 Admin Theme </title>
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="assets/apple-touch-icon.png">
|
||||||
|
<link rel="shortcut icon" href="assets/favicon.ico">
|
||||||
|
<meta name="theme-color" content="#3063A0"><!-- End FAVICONS -->
|
||||||
|
<!-- GOOGLE FONT -->
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600" rel="stylesheet">
|
||||||
|
<!-- End GOOGLE FONT -->
|
||||||
|
<!-- BEGIN PLUGINS STYLES -->
|
||||||
|
<link rel="stylesheet" href="assets/vendor/open-iconic/css/open-iconic-bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/vendor/fontawesome/css/all.css">
|
||||||
|
<link rel="stylesheet" href="assets/vendor/flatpickr/flatpickr.min.css">
|
||||||
|
<!-- END PLUGINS STYLES -->
|
||||||
|
<!-- BEGIN THEME STYLES -->
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/theme.min.css" data-skin="default">
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/theme-dark.min.css" data-skin="dark">
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/custom.css?v=1"><!-- Disable unused skin immediately -->
|
||||||
|
<script>
|
||||||
|
var skin = localStorage.getItem('skin') || 'default';
|
||||||
|
var unusedLink = document.querySelector('link[data-skin]:not([data-skin="' + skin + '"])');
|
||||||
|
unusedLink.setAttribute('rel', '');
|
||||||
|
unusedLink.setAttribute('disabled', true);
|
||||||
|
</script><!-- END THEME STYLES -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- .app -->
|
||||||
|
<div class="app has-fullwidth">
|
||||||
|
<!--[if lt IE 10]>
|
||||||
|
<div class="page-message" role="alert">You are using an <strong>outdated</strong> browser. Please <a class="alert-link" href="http://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</div>
|
||||||
|
<![endif]-->
|
||||||
|
<!-- .app-header -->
|
||||||
|
<header class="app-header app-header-dark">
|
||||||
|
<!-- .top-bar -->
|
||||||
|
<div class="top-bar">
|
||||||
|
<!-- .top-bar-brand -->
|
||||||
|
<div class="top-bar-brand bg-transparent">
|
||||||
|
<!-- toggle menu -->
|
||||||
|
<button class="hamburger hamburger-squeeze mr-2" type="button" data-toggle="aside" aria-label="toggle menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> <!-- /toggle menu -->
|
||||||
|
<a href="projects-management.aspx"><img src="assets/images/logo_white.png" alt="" style="height: 48px;width: auto;"></a>
|
||||||
|
</div><!-- /.top-bar-brand -->
|
||||||
|
<!-- .top-bar-list -->
|
||||||
|
<div class="top-bar-list">
|
||||||
|
<!-- .top-bar-item -->
|
||||||
|
<div class="top-bar-item px-2 d-md-none d-lg-none d-xl-none">
|
||||||
|
<!-- toggle menu -->
|
||||||
|
<button class="hamburger hamburger-squeeze" type="button" data-toggle="aside" aria-label="Menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> <!-- /toggle menu -->
|
||||||
|
</div><!-- /.top-bar-item -->
|
||||||
|
<!-- .top-bar-item 搜尋框-->
|
||||||
|
<!--<div class="top-bar-item top-bar-item-full">
|
||||||
|
<!-- .top-bar-search -->
|
||||||
|
<!--<form class="top-bar-search">
|
||||||
|
<div class="input-group input-group-search">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><span class="oi oi-magnifying-glass"></span></span>
|
||||||
|
</div><input type="text" class="form-control" aria-label="Search" placeholder="Search">
|
||||||
|
</div>
|
||||||
|
</form>-->
|
||||||
|
<!-- /.top-bar-search -->
|
||||||
|
<!--</div>-->
|
||||||
|
<!-- /.top-bar-item 搜尋框-->
|
||||||
|
<!-- .top-bar-item -->
|
||||||
|
<div class="top-bar-item top-bar-item-right px-0 d-none d-sm-flex">
|
||||||
|
<!-- .btn-account -->
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn-account d-none d-md-flex" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="user-avatar user-avatar-md"><img src="assets/images/avatars/profile.jpg" alt="" id="profilePic1" runat="server"></span> <span class="account-summary pr-lg-4 d-none d-lg-block"><span class="account-name" id="accountName1" runat="server">Beni Arisandi</span></span></button>
|
||||||
|
<div class="dropdown-arrow dropdown-arrow-left"></div><!-- .dropdown-menu -->
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<h6 class="dropdown-header d-none d-md-block d-lg-none" id="accountName2" runat="server"> Beni Arisandi </h6><a class="dropdown-item" href="user-profile.html"><span class="dropdown-icon oi oi-person"></span> Profile</a> <a class="dropdown-item" href="auth-signin-v1.html" onclick="return confirm('確定要登出?');"><span class="dropdown-icon oi oi-account-logout"></span> Logout</a>
|
||||||
|
|
||||||
|
</div><!-- /.dropdown-menu -->
|
||||||
|
</div><!-- /.btn-account -->
|
||||||
|
</div><!-- /.top-bar-item -->
|
||||||
|
</div><!-- /.top-bar-list -->
|
||||||
|
</div><!-- /.top-bar -->
|
||||||
|
</header><!-- /.app-header -->
|
||||||
|
<!-- .app-aside -->
|
||||||
|
<aside class="app-aside app-aside-light">
|
||||||
|
<!-- .aside-content -->
|
||||||
|
<div class="aside-content">
|
||||||
|
<!-- .aside-header -->
|
||||||
|
<header class="aside-header">
|
||||||
|
<!-- toggle menu -->
|
||||||
|
<button class="hamburger hamburger-squeeze" type="button" data-toggle="aside" aria-label="Menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> <!-- /toggle menu -->
|
||||||
|
<!-- .btn-account -->
|
||||||
|
<button class="btn-account d-flex d-md-none" type="button" data-toggle="collapse" data-target="#dropdown-aside"><span class="user-avatar user-avatar-lg"><img src="assets/images/avatars/profile.jpg" alt="" id="profilePic2" runat="server"></span> <span class="account-icon"><span class="fa fa-caret-down fa-lg"></span></span> <span class="account-summary"><span class="account-name" id="accountName3" runat="server">Beni Arisandi</span></span></button> <!-- /.btn-account -->
|
||||||
|
<!-- .dropdown-aside -->
|
||||||
|
<div id="dropdown-aside" class="dropdown-aside d-md-none collapse">
|
||||||
|
<!-- dropdown-items -->
|
||||||
|
<div class="pb-3">
|
||||||
|
<a class="dropdown-item" href="user-profile.html"><span class="dropdown-icon oi oi-person"></span> Profile</a> <a class="dropdown-item" href="auth-signin-v1.html" onclick="return confirm('確定要登出?');"><span class="dropdown-icon oi oi-account-logout"></span> Logout</a>
|
||||||
|
|
||||||
|
</div><!-- /dropdown-items -->
|
||||||
|
</div><!-- /.dropdown-aside -->
|
||||||
|
<!-- .top-bar-brand -->
|
||||||
|
<div class="top-bar-brand bg-primary">
|
||||||
|
<a href="projects-management.aspx"><img src="assets/images/logo_white.png" height="48" alt=""></a>
|
||||||
|
</div><!-- /.top-bar-brand -->
|
||||||
|
</header><!-- /.aside-header -->
|
||||||
|
<!-- .aside-menu -->
|
||||||
|
<div class="aside-menu">
|
||||||
|
<!-- .stacked-menu -->
|
||||||
|
<nav id="stacked-menu" class="stacked-menu">
|
||||||
|
<!-- .menu -->
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<!-- .menu-header -->
|
||||||
|
<li class="menu-header" id="permission" runat="server">帳號與權限 </li><!-- /.menu-header -->
|
||||||
|
<!-- .menu-item -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="users-management.aspx" class="menu-link">
|
||||||
|
<span class="menu-icon oi oi-person"></span>
|
||||||
|
<span class="menu-text">帳號管理</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- /.menu-item -->
|
||||||
|
</ul><!-- /.menu -->
|
||||||
|
</nav><!-- /.stacked-menu -->
|
||||||
|
</div><!-- /.aside-menu -->
|
||||||
|
<!-- Skin changer -->
|
||||||
|
<footer class="aside-footer border-top p-3">
|
||||||
|
<button class="btn btn-light btn-block text-primary" data-toggle="skin">Night mode <i class="fas fa-moon ml-1"></i></button>
|
||||||
|
</footer><!-- /Skin changer -->
|
||||||
|
</div><!-- /.aside-content -->
|
||||||
|
</aside><!-- /.app-aside -->
|
||||||
|
<!-- .app-main -->
|
||||||
|
<main class="app-main">
|
||||||
|
<!-- .wrapper -->
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- .page 主畫面-->
|
||||||
|
<div class="page">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- /.page 主畫面-->
|
||||||
|
</div><!-- /.wrapper -->
|
||||||
|
<!-- .app-footer 頁尾-->
|
||||||
|
<footer class="app-footer">
|
||||||
|
<!--<ul class="list-inline">
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Support</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Help Center</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Privacy</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Terms of Service</a>
|
||||||
|
</li>
|
||||||
|
</ul>-->
|
||||||
|
<div class="copyright"> Copyright © 2019. All right reserved. </div>
|
||||||
|
</footer>
|
||||||
|
<!-- /.app-footer 頁尾-->
|
||||||
|
</main><!-- /.app-main -->
|
||||||
|
</div><!-- /.app -->
|
||||||
|
<!-- BEGIN BASE JS -->
|
||||||
|
<script src="assets/vendor/jquery/jquery.min.js"></script>
|
||||||
|
<script src="assets/vendor/bootstrap/js/popper.min.js"></script>
|
||||||
|
<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script> <!-- END BASE JS -->
|
||||||
|
<!-- BEGIN PLUGINS JS -->
|
||||||
|
<script src="assets/vendor/pace/pace.min.js"></script>
|
||||||
|
<script src="assets/vendor/stacked-menu/stacked-menu.min.js"></script>
|
||||||
|
<script src="assets/vendor/perfect-scrollbar/perfect-scrollbar.min.js"></script>
|
||||||
|
<script src="assets/vendor/flatpickr/flatpickr.min.js"></script>
|
||||||
|
<script src="assets/vendor/easy-pie-chart/jquery.easypiechart.min.js"></script>
|
||||||
|
<script src="assets/vendor/chart.js/Chart.min.js"></script> <!-- END PLUGINS JS -->
|
||||||
|
<!-- BEGIN THEME JS -->
|
||||||
|
<script src="assets/javascript/theme.min.js"></script> <!-- END THEME JS -->
|
||||||
|
<!-- BEGIN PAGE LEVEL JS -->
|
||||||
|
<script src="assets/javascript/pages/dashboard-demo.js"></script> <!-- END PAGE LEVEL JS -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,193 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<!-- Required meta tags -->
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<!-- End Required meta tags -->
|
||||||
|
<title>不來梅短網址管理系統</title>
|
||||||
|
<!-- BEGIN BASE JS -->
|
||||||
|
<script src="assets/vendor/jquery/jquery.min.js"></script>
|
||||||
|
<script src="assets/vendor/jquery.cookie/jquery.cookie.js"></script>
|
||||||
|
<script src="assets/javascript/sha256.js"></script>
|
||||||
|
<script src="assets/vendor/bootstrap/js/popper.min.js"></script>
|
||||||
|
<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<!-- END BASE JS -->
|
||||||
|
<!-- Favicons -->
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="assets/apple-touch-icon.png">
|
||||||
|
<link rel="shortcut icon" href="assets/favicon.ico">
|
||||||
|
<meta name="theme-color" content="#3063A0"><!-- Google font -->
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600" rel="stylesheet"><!-- End Google font -->
|
||||||
|
<!-- BEGIN PLUGINS STYLES -->
|
||||||
|
<link rel="stylesheet" href="assets/vendor/fontawesome/css/all.css"><!-- END PLUGINS STYLES -->
|
||||||
|
<!-- BEGIN THEME STYLES -->
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/theme.min.css" data-skin="default">
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/theme-dark.min.css" data-skin="dark">
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/custom.css"><!-- Disable unused skin immediately -->
|
||||||
|
<script>
|
||||||
|
var skin = localStorage.getItem('skin') || 'default';
|
||||||
|
var unusedLink = document.querySelector('link[data-skin]:not([data-skin="' + skin + '"])');
|
||||||
|
unusedLink.setAttribute('rel', '');
|
||||||
|
unusedLink.setAttribute('disabled', true);
|
||||||
|
</script><!-- END THEME STYLES -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function ($, document) {
|
||||||
|
if ($.cookie) {
|
||||||
|
$.cookieKey = function (CookieName, KeyName, Value, Options) {
|
||||||
|
var reg = new RegExp("(?:([^=]+)=([^&]*)&?)", "ig"),
|
||||||
|
match = null,
|
||||||
|
matches = [];
|
||||||
|
var cookieVal = $.cookie(CookieName);
|
||||||
|
while (match = reg.exec(cookieVal)) {
|
||||||
|
if (KeyName.toLowerCase() == match[1].toLowerCase()) {
|
||||||
|
if (Value) { //we are updating, collect all values
|
||||||
|
matches.push([match[1], Value]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return match[2]; //we are getting, sub key found just return it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Value) { //we are updating, collect all values
|
||||||
|
matches.push([match[1], match[2]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Value) { //we are updating, update values
|
||||||
|
updatedValue = "",
|
||||||
|
sep = "";
|
||||||
|
for (i = 0; i < matches; i++) {
|
||||||
|
updatedValue += sep + matches[i][0] + "=" + matches[i][1];
|
||||||
|
sep = "&"
|
||||||
|
}
|
||||||
|
$.cookie(CookieName, updatedValue, Options);
|
||||||
|
}
|
||||||
|
else return null;//we are getting, value not found
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})(jQuery, document);
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
if ($.cookie("id") != null) {
|
||||||
|
$("#inputUser").val($.cookieKey("id", "id"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.cookie("token") != null) {
|
||||||
|
location.href = "projects-management.aspx";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function login() {
|
||||||
|
var rem = "N";
|
||||||
|
|
||||||
|
if ($("#remember-me").prop("checked")) {
|
||||||
|
rem = "Y";
|
||||||
|
}
|
||||||
|
|
||||||
|
var formData = {
|
||||||
|
id: $("#inputUser").val(),
|
||||||
|
pwd: sha256_digest($("#inputPassword").val()),
|
||||||
|
rem: rem
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "api/signin.ashx",
|
||||||
|
type: "POST",
|
||||||
|
data: formData,
|
||||||
|
success: function (data, textStatus, jqXHR) {
|
||||||
|
if (data.ret == "yes") {
|
||||||
|
location.href = "projects-management.aspx";
|
||||||
|
} else {
|
||||||
|
alert(data.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
alert('网絡或伺服器发生错误,请稍后重试!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- .auth -->
|
||||||
|
<main class="auth">
|
||||||
|
<header id="auth-header" class="auth-header" style="background-image: url(assets/images/illustration/img-1.png);">
|
||||||
|
<h1>
|
||||||
|
<img src="assets/images/bremen_white_2.png" alt="" height="100">
|
||||||
|
<span class="sr-only">Sign In</span>
|
||||||
|
</h1>
|
||||||
|
</header>
|
||||||
|
<!-- form -->
|
||||||
|
<form class="auth-form" onsubmit="return login();">
|
||||||
|
<!-- .form-group -->
|
||||||
|
<div class="text-center">
|
||||||
|
|
||||||
|
<div style="font-size:25px; font-weight:bold;">短網址管理系統</div>
|
||||||
|
<div style="font-size:14.6px;">Short URL Management</div>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
<!-- /.form-group -->
|
||||||
|
<!-- .form-group -->
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-label-group">
|
||||||
|
<input type="text" id="inputUser" class="form-control" placeholder="E白板帳號" required="" autofocus="">
|
||||||
|
<label for="inputUser">E白板帳號</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.form-group -->
|
||||||
|
<!-- .form-group -->
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-label-group">
|
||||||
|
<input type="password" id="inputPassword" class="form-control" placeholder="E白板密碼" required="">
|
||||||
|
<label for="inputPassword">E白板密碼</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.form-group -->
|
||||||
|
<!-- .form-group -->
|
||||||
|
<div class="form-group">
|
||||||
|
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign In</button>
|
||||||
|
</div>
|
||||||
|
<!-- /.form-group -->
|
||||||
|
<!-- .form-group -->
|
||||||
|
<div class="form-group text-center">
|
||||||
|
<div class="custom-control custom-control-inline custom-checkbox">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="remember-me">
|
||||||
|
<label class="custom-control-label" for="remember-me">保持登入狀態</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.form-group -->
|
||||||
|
<!-- recovery links -->
|
||||||
|
<div class="text-center pt-3">
|
||||||
|
<a href="https://prm.bremennetwork.tw/auth-recovery-password.html" class="link">忘記密碼?</a>
|
||||||
|
</div>
|
||||||
|
<!-- /recovery links -->
|
||||||
|
</form>
|
||||||
|
<!-- /.auth-form -->
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<!-- /.auth -->
|
||||||
|
|
||||||
|
<!-- BEGIN PLUGINS JS -->
|
||||||
|
<script src="assets/vendor/particles.js/particles.min.js"></script>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* Keep in mind that your scripts may not always be executed after the theme is completely ready,
|
||||||
|
* you might need to observe the `theme:load` event to make sure your scripts are executed after the theme is ready.
|
||||||
|
*/
|
||||||
|
$(document).on('theme:init', () => {
|
||||||
|
/* particlesJS.load(@dom-id, @path-json, @callback (optional)); */
|
||||||
|
particlesJS.load('auth-header', 'assets/javascript/pages/particles.json');
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script> <!-- END PLUGINS JS -->
|
||||||
|
<!-- BEGIN THEME JS -->
|
||||||
|
<script src="assets/javascript/theme.min.js"></script> <!-- END THEME JS -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,225 @@
|
||||||
|
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="BackEnd_MasterPage" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head runat="server">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><!-- End Required meta tags -->
|
||||||
|
<!-- Begin SEO tag -->
|
||||||
|
<title> MINI短網址管理系統 </title>
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="assets/apple-touch-icon.png">
|
||||||
|
<link rel="shortcut icon" href="assets/favicon.ico">
|
||||||
|
<meta name="theme-color" content="#3063A0"><!-- End FAVICONS -->
|
||||||
|
<!-- GOOGLE FONT -->
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600" rel="stylesheet">
|
||||||
|
<!-- End GOOGLE FONT -->
|
||||||
|
<!-- BEGIN PLUGINS STYLES -->
|
||||||
|
<link rel="stylesheet" href="assets/vendor/open-iconic/css/open-iconic-bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/vendor/fontawesome/css/all.css">
|
||||||
|
<link rel="stylesheet" href="assets/vendor/flatpickr/flatpickr.min.css">
|
||||||
|
<!-- END PLUGINS STYLES -->
|
||||||
|
<!-- BEGIN THEME STYLES -->
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/theme.css" data-skin="default">
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/theme-dark.min.css" data-skin="dark">
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/custom.css?v=1" data-skin="default"><!-- Disable unused skin immediately -->
|
||||||
|
<link rel="stylesheet" href="assets/stylesheets/custom-dark.css?v=1" data-skin="dark"><!-- Disable unused skin immediately -->
|
||||||
|
|
||||||
|
<!-- BEGIN BASE JS -->
|
||||||
|
<script src="assets/vendor/jquery/jquery.min.js"></script>
|
||||||
|
<script src="assets/vendor/jquery.cookie/jquery.cookie.js"></script>
|
||||||
|
<script src="assets/vendor/bootstrap/js/popper.min.js"></script>
|
||||||
|
<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/qr-code-styling@1.9.2/lib/qr-code-styling.js"></script>
|
||||||
|
<!-- END BASE JS -->
|
||||||
|
|
||||||
|
<!-- jQuery UI -->
|
||||||
|
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/blitzer/jquery-ui.css">
|
||||||
|
|
||||||
|
<!-- BEGIN PLUGINS JS -->
|
||||||
|
<script src="assets/vendor/pace/pace.min.js"></script>
|
||||||
|
<script src="assets/vendor/moment/moment-with-locales.js"></script>
|
||||||
|
<script src="assets/vendor/stacked-menu/stacked-menu.min.js"></script>
|
||||||
|
<script src="assets/vendor/perfect-scrollbar/perfect-scrollbar.min.js"></script>
|
||||||
|
<script src="assets/vendor/flatpickr/flatpickr.min.js"></script>
|
||||||
|
<script src="assets/vendor/datepicker/js/bootstrap-datepicker.min.js"></script>
|
||||||
|
<script src="assets/vendor/datepicker/locales/bootstrap-datepicker.zh-TW.min.js"></script>
|
||||||
|
<script src="assets/vendor/sortablejs/Sortable.min.js"></script>
|
||||||
|
<script src="assets/vendor/nestable2/jquery.nestable.min.js"></script>
|
||||||
|
<script src="assets/vendor/easy-pie-chart/jquery.easypiechart.min.js"></script>
|
||||||
|
<script src="assets/vendor/chart.js/Chart.min.js"></script>
|
||||||
|
<script src="assets/slim/slim.jquery.min.js"></script>
|
||||||
|
<script src="assets/vendor/select2/js/select2.js"></script>
|
||||||
|
<script src="assets/vendor/datatables/jquery.dataTables.min.js"></script>
|
||||||
|
<script src="assets/vendor/datatables/extensions/buttons/dataTables.buttons.min.js"></script>
|
||||||
|
<script src="assets/vendor/datatables/extensions/buttons/buttons.bootstrap4.min.js"></script>
|
||||||
|
<script src="assets/vendor/datatables/extensions/buttons/buttons.html5.min.js"></script>
|
||||||
|
<script src="assets/vendor/jszip/jszip.min.js"></script>
|
||||||
|
<script src="assets/vendor/datatables/extensions/buttons/buttons.print.min.js"></script>
|
||||||
|
<script src="assets/javascript/pages/dataTables.bootstrap.js"></script>
|
||||||
|
<script src="assets/javascript/pages/dataTables.fixedHeader.min.js"></script>
|
||||||
|
<script src="assets/javascript/jquery.textareamaxrows.js"></script>
|
||||||
|
<script src="assets/javascript/waitingfor.js"></script>
|
||||||
|
<script src="assets/vendor/clipboard/clipboard.min.js"></script>
|
||||||
|
<script src="assets/javascript/custom.js"></script>
|
||||||
|
<!-- END PLUGINS JS -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN SLIM STYLES -->
|
||||||
|
<link href="assets/slim/slim.min.css" rel="stylesheet" />
|
||||||
|
<link href="assets/vendor/datepicker/css/bootstrap-datepicker3.standalone.css" rel="stylesheet" />
|
||||||
|
<!-- END SLIM STYLES -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var skin = localStorage.getItem('skin') || 'default';
|
||||||
|
var unusedLink = document.querySelector('link[data-skin]:not([data-skin="' + skin + '"])');
|
||||||
|
unusedLink.setAttribute('rel', '');
|
||||||
|
unusedLink.setAttribute('disabled', true);
|
||||||
|
</script><!-- END THEME STYLES -->
|
||||||
|
<asp:ContentPlaceHolder id="head" runat="server">
|
||||||
|
</asp:ContentPlaceHolder>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" enctype="multipart/form-data" runat="server">
|
||||||
|
<!-- .app -->
|
||||||
|
<div class="app has-fullwidth">
|
||||||
|
<!--[if lt IE 10]>
|
||||||
|
<div class="page-message" role="alert">You are using an <strong>outdated</strong> browser. Please <a class="alert-link" href="http://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</div>
|
||||||
|
<![endif]-->
|
||||||
|
<!-- .app-header -->
|
||||||
|
<header class="app-header app-header-dark">
|
||||||
|
<!-- .top-bar -->
|
||||||
|
<div class="top-bar">
|
||||||
|
<!-- .top-bar-brand -->
|
||||||
|
<div class="top-bar-brand bg-transparent">
|
||||||
|
<!-- toggle menu -->
|
||||||
|
<button class="hamburger hamburger-squeeze mr-2" type="button" data-toggle="aside" aria-label="toggle menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> <!-- /toggle menu -->
|
||||||
|
<a href="projects-management.aspx"><img src="assets/images/MINI-CI-BOX--2012.png" alt="" style="height: 64px;width: auto;"></a>
|
||||||
|
</div><!-- /.top-bar-brand -->
|
||||||
|
<!-- .top-bar-list -->
|
||||||
|
<div class="top-bar-list">
|
||||||
|
<!-- .top-bar-item -->
|
||||||
|
<div class="top-bar-item px-2 d-md-none d-lg-none d-xl-none">
|
||||||
|
<!-- toggle menu -->
|
||||||
|
<button class="hamburger hamburger-squeeze" type="button" data-toggle="aside" aria-label="Menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> <!-- /toggle menu -->
|
||||||
|
</div><!-- /.top-bar-item -->
|
||||||
|
<!-- .top-bar-item 搜尋框-->
|
||||||
|
<!--<div class="top-bar-item top-bar-item-full">
|
||||||
|
<!-- .top-bar-search -->
|
||||||
|
<!--<form class="top-bar-search">
|
||||||
|
<div class="input-group input-group-search">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><span class="oi oi-magnifying-glass"></span></span>
|
||||||
|
</div><input type="text" class="form-control" aria-label="Search" placeholder="Search">
|
||||||
|
</div>
|
||||||
|
</form>-->
|
||||||
|
<!-- /.top-bar-search -->
|
||||||
|
<!--</div>-->
|
||||||
|
<!-- /.top-bar-item 搜尋框-->
|
||||||
|
<!-- .top-bar-item -->
|
||||||
|
<div class="top-bar-item top-bar-item-right px-0 d-none d-sm-flex">
|
||||||
|
<!-- .btn-account -->
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn-account d-none d-md-flex" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="user-avatar user-avatar-md"><img src="assets/images/avatars/profile.jpg" alt="" id="profilePic1" runat="server"></span> <span class="account-summary pr-lg-4 d-none d-lg-block"><span class="account-name" id="accountName1" runat="server">Beni Arisandi</span></span></button>
|
||||||
|
<div class="dropdown-arrow dropdown-arrow-left"></div><!-- .dropdown-menu -->
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<h6 class="dropdown-header d-none d-md-block d-lg-none" id="accountName2" runat="server"> Beni Arisandi </h6><a class="dropdown-item" href="user-profile-settings.aspx"><span class="dropdown-icon oi oi-person"></span> Profile</a> <a class="dropdown-item" href="logout.aspx" onclick="return confirm('確定要登出?');"><span class="dropdown-icon oi oi-account-logout"></span> Logout</a>
|
||||||
|
|
||||||
|
</div><!-- /.dropdown-menu -->
|
||||||
|
</div><!-- /.btn-account -->
|
||||||
|
</div><!-- /.top-bar-item -->
|
||||||
|
</div><!-- /.top-bar-list -->
|
||||||
|
</div><!-- /.top-bar -->
|
||||||
|
</header><!-- /.app-header -->
|
||||||
|
<!-- .app-aside -->
|
||||||
|
<aside class="app-aside app-aside-light">
|
||||||
|
<!-- .aside-content -->
|
||||||
|
<div class="aside-content">
|
||||||
|
<!-- .aside-header -->
|
||||||
|
<header class="aside-header">
|
||||||
|
<!-- toggle menu -->
|
||||||
|
<button class="hamburger hamburger-squeeze" type="button" data-toggle="aside" aria-label="Menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> <!-- /toggle menu -->
|
||||||
|
<!-- .btn-account -->
|
||||||
|
<button class="btn-account d-flex d-md-none" type="button" data-toggle="collapse" data-target="#dropdown-aside"><span class="user-avatar user-avatar-lg"><img src="assets/images/avatars/profile.jpg" alt="" id="profilePic2" runat="server"></span> <span class="account-icon"><span class="fa fa-caret-down fa-lg"></span></span> <span class="account-summary"><span class="account-name" id="accountName3" runat="server">Beni Arisandi</span></span></button> <!-- /.btn-account -->
|
||||||
|
<!-- .dropdown-aside -->
|
||||||
|
<div id="dropdown-aside" class="dropdown-aside d-md-none collapse">
|
||||||
|
<!-- dropdown-items -->
|
||||||
|
<div class="pb-3">
|
||||||
|
<a class="dropdown-item" href="user-profile-settings.aspx"><span class="dropdown-icon oi oi-person"></span> Profile</a> <a class="dropdown-item" href="logout.aspx" onclick="return confirm('確定要登出?');"><span class="dropdown-icon oi oi-account-logout"></span> Logout</a>
|
||||||
|
|
||||||
|
</div><!-- /dropdown-items -->
|
||||||
|
</div><!-- /.dropdown-aside -->
|
||||||
|
<!-- .top-bar-brand -->
|
||||||
|
<div class="top-bar-brand bg-primary">
|
||||||
|
<a href="projects-management.aspx"><img src="assets/images/MINI-CI-BOX--2012.png" height="64" alt=""></a>
|
||||||
|
</div><!-- /.top-bar-brand -->
|
||||||
|
</header><!-- /.aside-header -->
|
||||||
|
<!-- .aside-menu -->
|
||||||
|
<div class="aside-menu">
|
||||||
|
<!-- .stacked-menu -->
|
||||||
|
<nav id="stacked-menu" class="stacked-menu">
|
||||||
|
<!-- .menu -->
|
||||||
|
<ul class="menu">
|
||||||
|
<!-- .menu-item -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="projects-management.aspx" class="menu-link">
|
||||||
|
<span class="menu-icon fas fa-bars"></span>
|
||||||
|
<span class="menu-text">專案列表</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- /.menu-item -->
|
||||||
|
<!-- .menu-header -->
|
||||||
|
<li class="menu-header" id="permission" runat="server">帳號與權限 </li><!-- /.menu-header -->
|
||||||
|
<!-- .menu-item -->
|
||||||
|
<li class="menu-item" id="permission_child" runat="server">
|
||||||
|
<a href="users-management.aspx" class="menu-link">
|
||||||
|
<span class="menu-icon oi oi-person"></span>
|
||||||
|
<span class="menu-text">帳號管理</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- /.menu-item -->
|
||||||
|
</ul><!-- /.menu -->
|
||||||
|
</nav><!-- /.stacked-menu -->
|
||||||
|
</div><!-- /.aside-menu -->
|
||||||
|
<!-- Skin changer -->
|
||||||
|
<footer class="aside-footer border-top p-3">
|
||||||
|
<button class="btn btn-light btn-block text-primary" data-toggle="skin">Night mode <i class="fas fa-moon ml-1"></i></button>
|
||||||
|
</footer><!-- /Skin changer -->
|
||||||
|
</div><!-- /.aside-content -->
|
||||||
|
</aside><!-- /.app-aside -->
|
||||||
|
<!-- .app-main -->
|
||||||
|
<main class="app-main">
|
||||||
|
<!-- .wrapper -->
|
||||||
|
<div class="wrapper">
|
||||||
|
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
|
||||||
|
</asp:ContentPlaceHolder>
|
||||||
|
</div><!-- /.wrapper -->
|
||||||
|
<!-- .app-footer 頁尾-->
|
||||||
|
<footer class="app-footer">
|
||||||
|
<!--<ul class="list-inline">
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Support</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Help Center</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Privacy</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-inline-item">
|
||||||
|
<a class="text-muted" href="#">Terms of Service</a>
|
||||||
|
</li>
|
||||||
|
</ul>-->
|
||||||
|
<div class="copyright"> Copyright © 2019. All right reserved. </div>
|
||||||
|
</footer>
|
||||||
|
<!-- /.app-footer 頁尾-->
|
||||||
|
</main><!-- /.app-main -->
|
||||||
|
</div><!-- /.app -->
|
||||||
|
|
||||||
|
<!-- BEGIN THEME JS -->
|
||||||
|
<script src="assets/javascript/theme.min.js"></script>
|
||||||
|
<!-- END THEME JS -->
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using System.Web.UI.HtmlControls;
|
||||||
|
|
||||||
|
public partial class BackEnd_MasterPage : baseMasterPage
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
HtmlLink iconLink = new HtmlLink();
|
||||||
|
iconLink.Href = "assets/favicon_2.ico";
|
||||||
|
iconLink.Attributes.Add("rel", "shortcut icon");
|
||||||
|
|
||||||
|
|
||||||
|
Page.Header.Controls.Add(iconLink);
|
||||||
|
|
||||||
|
profilePic1.Attributes["src"] = objLoginUser.user_picurl;
|
||||||
|
profilePic2.Attributes["src"] = objLoginUser.user_picurl;
|
||||||
|
accountName1.InnerText = objLoginUser.user_name;
|
||||||
|
accountName2.InnerText = objLoginUser.user_name;
|
||||||
|
accountName3.InnerText = objLoginUser.user_name;
|
||||||
|
|
||||||
|
if (objAuth.user_perm == "N")
|
||||||
|
{
|
||||||
|
permission.Visible = false;
|
||||||
|
permission_child.Visible = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
permission.Visible = true;
|
||||||
|
permission_child.Visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,177 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="chromeGetShortCode" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class chromeGetShortCode : IHttpHandler {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
string id = (context.Request["id"] == null) ? "" : context.Request["id"].ToString();
|
||||||
|
string pwd = (context.Request["pwd"] == null) ? "" : context.Request["pwd"].ToString();
|
||||||
|
|
||||||
|
string user_sql = string.Format("select * from users where user_id = '{0}'", id);
|
||||||
|
autoBindDataTable objUser = new autoBindDataTable(user_sql);
|
||||||
|
|
||||||
|
if (objUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "此帳號尚未擁有權限,請專案管理者加入權限!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//系統內建帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "Y")
|
||||||
|
{
|
||||||
|
if (objUser.dataRows[0]["user_onjob"].ToString() == "N")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString()))
|
||||||
|
{
|
||||||
|
string test = SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString());
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//E白板帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "N")
|
||||||
|
{
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (objElabUser.dataRows[0]["onjob"].ToString() == "1")
|
||||||
|
{
|
||||||
|
objUser.dataRows[0]["user_onjob"] = "N";
|
||||||
|
objUser.updateDataTable();
|
||||||
|
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objElabUser.dataRows[0]["userpw"].ToString()))
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string shor_Code = globalClass.CreateCaseRandomCode(6);
|
||||||
|
Boolean isCheck = false;
|
||||||
|
|
||||||
|
while (isCheck == false)
|
||||||
|
{
|
||||||
|
string checkString = string.Format("select * from url where url_code Collate SQL_Latin1_General_CP1_CS_AS = '{0}'", shor_Code);
|
||||||
|
autoBindDataTable checkSQL = new autoBindDataTable(checkString);
|
||||||
|
|
||||||
|
if (checkSQL.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
isCheck = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shor_Code = globalClass.CreateCaseRandomCode(6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.shorCode = shor_Code;
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string SHA256_Encode(string value)
|
||||||
|
{
|
||||||
|
byte[] bytValue = System.Text.Encoding.UTF8.GetBytes(value);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SHA256 sha256 = new SHA256CryptoServiceProvider();
|
||||||
|
byte[] retVal = sha256.ComputeHash(bytValue);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < retVal.Length; i++)
|
||||||
|
{
|
||||||
|
sb.Append(retVal[i].ToString("x2"));
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception("GetSHA256HashFromString() fail,error:" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string shorCode = "";
|
||||||
|
public string urlHeader = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="chromeProjectsList" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class chromeProjectsList : IHttpHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
public void ProcessRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
|
||||||
|
string id = (context.Request["id"] == null) ? "" : context.Request["id"].ToString();
|
||||||
|
string pwd = (context.Request["pwd"] == null) ? "" : context.Request["pwd"].ToString();
|
||||||
|
|
||||||
|
string user_sql = string.Format("select * from users where user_id = '{0}'", id);
|
||||||
|
autoBindDataTable objUser = new autoBindDataTable(user_sql);
|
||||||
|
|
||||||
|
if (objUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "此帳號尚未擁有權限,請專案管理者加入權限!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//系統內建帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "Y")
|
||||||
|
{
|
||||||
|
if (objUser.dataRows[0]["user_onjob"].ToString() == "N")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString()))
|
||||||
|
{
|
||||||
|
string test = SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString());
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//E白板帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "N")
|
||||||
|
{
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (objElabUser.dataRows[0]["onjob"].ToString() == "1")
|
||||||
|
{
|
||||||
|
objUser.dataRows[0]["user_onjob"] = "N";
|
||||||
|
objUser.updateDataTable();
|
||||||
|
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objElabUser.dataRows[0]["userpw"].ToString()))
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string projectString = "select * from projects where project_isRevoke = 'N' order by project_sn desc";
|
||||||
|
|
||||||
|
if (objUser.dataRows[0]["user_perm"].ToString() != "A")
|
||||||
|
{
|
||||||
|
projectString = string.Format("select A.* from projects A, projectUser B where A.project_uid = B.project_uid and A.project_isRevoke = 'N' and B.user_uid = '{0}' order by A.project_sn desc", objUser.dataRows[0]["user_uid"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
autoBindDataTable sqlProjects = new autoBindDataTable(projectString);
|
||||||
|
|
||||||
|
foreach (DataRow tmpRow in sqlProjects.dataRows)
|
||||||
|
{
|
||||||
|
projectBase tmpProject = new projectBase(tmpRow["project_uid"].ToString());
|
||||||
|
objRet.projectlist.Add(tmpProject);
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string SHA256_Encode(string value)
|
||||||
|
{
|
||||||
|
byte[] bytValue = System.Text.Encoding.UTF8.GetBytes(value);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SHA256 sha256 = new SHA256CryptoServiceProvider();
|
||||||
|
byte[] retVal = sha256.ComputeHash(bytValue);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < retVal.Length; i++)
|
||||||
|
{
|
||||||
|
sb.Append(retVal[i].ToString("x2"));
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception("GetSHA256HashFromString() fail,error:" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string user_perm = "N";
|
||||||
|
public List<projectBase> projectlist = new List<projectBase>();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,303 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="chromeSaveUrlData" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Facebook;
|
||||||
|
using System.Net;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
|
public class chromeSaveUrlData : IHttpHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
public void ProcessRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
|
||||||
|
string id = (context.Request["id"] == null) ? "" : context.Request["id"].ToString();
|
||||||
|
string pwd = (context.Request["pwd"] == null) ? "" : context.Request["pwd"].ToString();
|
||||||
|
|
||||||
|
string method = (context.Request["method"] == null) ? "" : context.Request["method"].ToString();
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
string url_uid = (context.Request["url_uid"] == null) ? "" : context.Request["url_uid"].ToString();
|
||||||
|
string url_descript = (context.Request["url_descript"] == null) ? "" : context.Request["url_descript"].ToString();
|
||||||
|
string url_directToUrl = (context.Request["url_directToUrl"] == null) ? "" : context.Request["url_directToUrl"].ToString();
|
||||||
|
string url_Code = (context.Request["url_Code"] == null) ? "" : context.Request["url_Code"].ToString();
|
||||||
|
string url_gifTag = (context.Request["url_gifTag"] == null) ? "N" : context.Request["url_gifTag"].ToString();
|
||||||
|
string url_gifLink = (context.Request["url_gifLink"] == null) ? "" : context.Request["url_gifLink"].ToString();
|
||||||
|
string url_fbTag = (context.Request["url_fbTag"] == null) ? "N" : context.Request["url_fbTag"].ToString();
|
||||||
|
string url_fbTitle = (context.Request["url_fbTitle"] == null) ? "" : context.Request["url_fbTitle"].ToString();
|
||||||
|
string url_fbDescript = (context.Request["url_fbDescript"] == null) ? "" : context.Request["url_fbDescript"].ToString();
|
||||||
|
string url_fbPixel = (context.Request["url_fbPixel"] == null) ? "N" : context.Request["url_fbPixel"].ToString();
|
||||||
|
string url_fbPixelCode = (context.Request["url_fbPixelCode"] == null) ? "" : context.Request["url_fbPixelCode"].ToString();
|
||||||
|
string url_googleAds = (context.Request["url_googleAds"] == null) ? "N" : context.Request["url_googleAds"].ToString();
|
||||||
|
string url_googleAwConversionId = (context.Request["url_googleAwConversionId"] == null) ? "" : context.Request["url_googleAwConversionId"].ToString();
|
||||||
|
string url_playBtn = (context.Request["url_playBtn"] == null) ? "N" : context.Request["url_playBtn"].ToString();
|
||||||
|
string pic_data = (context.Request["pic_data"] == null) ? "" : context.Request["pic_data"].ToString();
|
||||||
|
string url_photoId = "";
|
||||||
|
|
||||||
|
string errmsg = "";
|
||||||
|
|
||||||
|
if (url_descript == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有短網址說明!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_descript == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有短網址說明!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_Code == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有短網址碼!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_directToUrl == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有目的地網址!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_uid == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有專案代碼!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "") {
|
||||||
|
errmsg += "Method!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string user_sql = string.Format("select * from users where user_id = '{0}'", id);
|
||||||
|
autoBindDataTable objUser = new autoBindDataTable(user_sql);
|
||||||
|
|
||||||
|
if (objUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "此帳號尚未擁有權限,請專案管理者加入權限!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//系統內建帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "Y")
|
||||||
|
{
|
||||||
|
if (objUser.dataRows[0]["user_onjob"].ToString() == "N")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString()))
|
||||||
|
{
|
||||||
|
string test = SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString());
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//E白板帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "N")
|
||||||
|
{
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (objElabUser.dataRows[0]["onjob"].ToString() == "1")
|
||||||
|
{
|
||||||
|
objUser.dataRows[0]["user_onjob"] = "N";
|
||||||
|
objUser.updateDataTable();
|
||||||
|
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objElabUser.dataRows[0]["userpw"].ToString()))
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "add")
|
||||||
|
{
|
||||||
|
string checkString = string.Format("select * from url where url_Code Collate SQL_Latin1_General_CP1_CS_AS = '{0}'", url_Code);
|
||||||
|
autoBindDataTable checkSQL = new autoBindDataTable(checkString);
|
||||||
|
|
||||||
|
if (checkSQL.dataRows.Count > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0006";
|
||||||
|
objRet.message = "此短網址已經被使用了,請換一組短網址碼再試一次!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
url_uid = globalClass.CreateRandomCode(32);
|
||||||
|
url_photoId = globalClass.CreateRandomCode(36);
|
||||||
|
|
||||||
|
urlObj objUrl = new urlObj();
|
||||||
|
objUrl.url_uid = url_uid;
|
||||||
|
objUrl.project_uid = project_uid;
|
||||||
|
objUrl.url_descript = url_descript;
|
||||||
|
objUrl.url_directToUrl = url_directToUrl;
|
||||||
|
objUrl.url_Code = url_Code;
|
||||||
|
objUrl.url_playBtn = url_playBtn;
|
||||||
|
objUrl.url_fbTag = url_fbTag;
|
||||||
|
objUrl.url_gifTag = url_gifTag;
|
||||||
|
objUrl.url_gifLink = url_gifLink;
|
||||||
|
objUrl.url_fbTitle = url_fbTitle;
|
||||||
|
objUrl.url_fbDescript = url_fbDescript;
|
||||||
|
objUrl.url_fbPixel = url_fbPixel;
|
||||||
|
objUrl.url_fbPixelCode = url_fbPixelCode;
|
||||||
|
objUrl.url_googleAds = url_googleAds;
|
||||||
|
objUrl.url_googleAwConversionId = url_googleAwConversionId;
|
||||||
|
objUrl.url_createUid = id;
|
||||||
|
objUrl.url_photoId = url_photoId;
|
||||||
|
|
||||||
|
|
||||||
|
string picChange = "N";
|
||||||
|
|
||||||
|
JToken jsonObj;
|
||||||
|
|
||||||
|
string base64Img = "";
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jsonObj = JValue.Parse(pic_data);
|
||||||
|
picChange = jsonObj[0]["meta"]["picChange"].ToString();
|
||||||
|
base64Img = jsonObj[0]["output"]["image"].ToString();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (picChange == "Y")
|
||||||
|
{
|
||||||
|
//base64Img = jsonObj[0]["output"]["image"].ToString();
|
||||||
|
objUrl.pic_image = globalClass.Base64ToImage(base64Img);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
objUrl.updateData();
|
||||||
|
objRet.data = objUrl;
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "9999";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string SHA256_Encode(string value)
|
||||||
|
{
|
||||||
|
byte[] bytValue = System.Text.Encoding.UTF8.GetBytes(value);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SHA256 sha256 = new SHA256CryptoServiceProvider();
|
||||||
|
byte[] retVal = sha256.ComputeHash(bytValue);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < retVal.Length; i++)
|
||||||
|
{
|
||||||
|
sb.Append(retVal[i].ToString("x2"));
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception("GetSHA256HashFromString() fail,error:" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public urlObj data = new urlObj();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="elab_userslist" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class elab_userslist : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objAuth.user_perm != "A" && objAuth.user_perm != "P")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "權限不足,無法使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
autoBindDataTable userSQL = new autoBindDataTable("select * from users where user_type = 'N' and user_onjob = 'Y' ");
|
||||||
|
|
||||||
|
string users_list = "''";
|
||||||
|
|
||||||
|
foreach (DataRow tmpRow in userSQL.dataRows) {
|
||||||
|
users_list += string.Format(", '{0}'", tmpRow["user_id"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
autoBindElab elabSQL = new autoBindElab(string.Format("select * from new_userdata where onjob = 0 and userid not in ({0})", users_list));
|
||||||
|
|
||||||
|
foreach (DataRow tmpRow in elabSQL.dataRows) {
|
||||||
|
elab_userdata tmpUser = new elab_userdata();
|
||||||
|
objRet.userslist.Add(tmpUser);
|
||||||
|
|
||||||
|
tmpUser.userid = tmpRow["userid"].ToString();
|
||||||
|
tmpUser.username = tmpRow["username"].ToString();
|
||||||
|
tmpUser.mail = tmpRow["mail"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public List<elab_userdata> userslist = new List<elab_userdata>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class elab_userdata {
|
||||||
|
public string userid = "";
|
||||||
|
public string username = "";
|
||||||
|
public string mail = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,294 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="exportCountReport" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using NPOI;
|
||||||
|
using NPOI.HPSF;
|
||||||
|
using NPOI.HSSF;
|
||||||
|
using NPOI.HSSF.UserModel;
|
||||||
|
using NPOI.POIFS;
|
||||||
|
using NPOI.Util;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Text;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
public class exportCountReport : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
context.Response.Write("尚未登入! 或時間過久已被登出!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
string startDate = (context.Request["startDate"] == null) ? "" : context.Request["startDate"].ToString();
|
||||||
|
string endDate = (context.Request["endDate"] == null) ? "" : context.Request["endDate"].ToString();
|
||||||
|
string url_uid = (context.Request["url_uid"] == null) ? "" : context.Request["url_uid"].ToString();
|
||||||
|
string type = (context.Request["type"] == null) ? "" : context.Request["type"].ToString();
|
||||||
|
|
||||||
|
string errmsg = "";
|
||||||
|
|
||||||
|
if (globalClass.IsDate(startDate) == false) {
|
||||||
|
errmsg = "請輸入開始日期!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (globalClass.IsDate(endDate) == false) {
|
||||||
|
errmsg = "請輸入結束日期!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type != "day" && type != "total" && type != "month" && type != "hour") {
|
||||||
|
errmsg += "無正確的統計方式!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0) {
|
||||||
|
context.Response.Write(errmsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string urlString = string.Format("select * from url where url_uid = '{0}' and url_isRevoke = 'N' ", url_uid);
|
||||||
|
autoBindDataTable urlSQL = new autoBindDataTable(urlString);
|
||||||
|
|
||||||
|
if (urlSQL.dataRows.Count == 0) {
|
||||||
|
context.Response.Write("找不到此 url_uid 的資料!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string url_descript = urlSQL.dataRows[0]["url_descript"].ToString();
|
||||||
|
|
||||||
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||||
|
MemoryStream ms = new MemoryStream();
|
||||||
|
HSSFSheet sheet = (HSSFSheet)workbook.CreateSheet();
|
||||||
|
HSSFRow headerRow = (HSSFRow)sheet.CreateRow(0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DateTime dateStart = DateTime.Parse(startDate);
|
||||||
|
DateTime dateEnd = DateTime.Parse(endDate + " 23:59:59");
|
||||||
|
|
||||||
|
if (type == "hour") {
|
||||||
|
headerRow.CreateCell(0).SetCellValue("日期時間");
|
||||||
|
headerRow.CreateCell(1).SetCellValue("次數");
|
||||||
|
|
||||||
|
string projString = string.Format("select * from projects where project_isRevoke = 'N' and project_uid = '{0}'", urlSQL.dataRows[0]["project_uid"].ToString());
|
||||||
|
autoBindDataTable projSQL = new autoBindDataTable(projString);
|
||||||
|
|
||||||
|
project_uid = urlSQL.dataRows[0]["project_uid"].ToString();
|
||||||
|
|
||||||
|
if (projSQL.dataRows.Count == 0) {
|
||||||
|
context.Response.Write("找不到此URL的專案資料!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string recTableName = projSQL.dataRows[0]["project_recTableName"].ToString();
|
||||||
|
|
||||||
|
string rangeString = string.Format("select * from {0} where project_uid = '{1}' and url_uid = '{2}' and rec_createdate >= '{3}' and rec_createdate <= '{4}'", recTableName, project_uid, url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
DateTime tmpDate = dateStart;
|
||||||
|
int rowNum = 1;
|
||||||
|
int intTotal = 0;
|
||||||
|
|
||||||
|
while (tmpDate <= dateEnd) {
|
||||||
|
DateTime dateS = DateTime.Parse(tmpDate.ToString("yyyy/MM/dd HH:00:00"));
|
||||||
|
DateTime dateE = DateTime.Parse(tmpDate.AddHours(1).ToString("yyyy/MM/dd HH:00:00")).AddSeconds(-1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DataRow[] objTmp = rangeSQL.selectedRows(string.Format("rec_createdate >= '{0}' and rec_createdate <= '{1}'", dateS.ToString("yyyy/MM/dd HH:mm:ss"), dateE.ToString("yyyy/MM/dd HH:mm:ss")));
|
||||||
|
|
||||||
|
//countData objCount = new countData();
|
||||||
|
//objRet.data.Add(objCount);
|
||||||
|
|
||||||
|
string col1 = tmpDate.ToString("yyyy/MM/dd") + " " + tmpDate.ToString("HH") + ":00:00 - " + tmpDate.ToString("HH") + ":59:59";
|
||||||
|
|
||||||
|
HSSFRow excelRow = (HSSFRow)sheet.CreateRow(rowNum);
|
||||||
|
excelRow.CreateCell(0).SetCellValue(col1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (objTmp.Length == 0)
|
||||||
|
{
|
||||||
|
excelRow.CreateCell(1).SetCellValue(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
excelRow.CreateCell(1).SetCellValue(objTmp.Length);
|
||||||
|
intTotal += objTmp.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpDate = tmpDate.AddHours(1);
|
||||||
|
rowNum += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
HSSFRow excelRow2 = (HSSFRow)sheet.CreateRow(rowNum);
|
||||||
|
excelRow2.CreateCell(0).SetCellValue("總計");
|
||||||
|
excelRow2.CreateCell(1).SetCellValue(intTotal);
|
||||||
|
|
||||||
|
workbook.Write(ms);
|
||||||
|
ms.Flush();
|
||||||
|
|
||||||
|
context.Response.ContentType = "application/vnd.ms-excel;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=" + HttpUtility.UrlEncode(url_descript.Trim() + "_" + DateTime.Now.ToString("yyyy-MM-dd"), Encoding.UTF8) + ".xls"));
|
||||||
|
context.Response.BinaryWrite(ms.ToArray());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "month") {
|
||||||
|
headerRow.CreateCell(0).SetCellValue("日期時間");
|
||||||
|
headerRow.CreateCell(1).SetCellValue("次數");
|
||||||
|
|
||||||
|
string rangeString = string.Format("select * from recSubTotal where url_uid = '{0}' and recSubTotal_date >= '{1}' and recSubTotal_date <= '{2}'", url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
DateTime tmpDate = dateStart;
|
||||||
|
int intTotal = 0;
|
||||||
|
int rowNum = 1;
|
||||||
|
|
||||||
|
while (tmpDate <= dateEnd) {
|
||||||
|
DateTime dateS = DateTime.Parse(tmpDate.ToString("yyyy/MM/01 00:00:00"));
|
||||||
|
DateTime dateE = DateTime.Parse(tmpDate.AddMonths(1).ToString("yyyy/MM/01 00:00:00")).AddSeconds(-1);
|
||||||
|
|
||||||
|
if (dateStart > dateS) {
|
||||||
|
dateS = dateStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dateE > dateEnd) {
|
||||||
|
dateE = dateEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataRow[] objTmp = rangeSQL.selectedRows(string.Format("recSubTotal_date > '{0}' and recSubTotal_date <= '{1}'", dateS.ToString("yyyy/MM/dd 00:00:00"), dateE.ToString("yyyy/MM/dd 23:59:59")));
|
||||||
|
|
||||||
|
string col1 = tmpDate.ToString("yyyy") + "年" + tmpDate.ToString("MM") + "月";
|
||||||
|
|
||||||
|
HSSFRow excelRow = (HSSFRow)sheet.CreateRow(rowNum);
|
||||||
|
excelRow.CreateCell(0).SetCellValue(col1);
|
||||||
|
|
||||||
|
if (objTmp.Length == 0)
|
||||||
|
{
|
||||||
|
excelRow.CreateCell(1).SetCellValue(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
excelRow.CreateCell(1).SetCellValue(objTmp.Sum(row => row.Field<int>("recSubTotal_count")));
|
||||||
|
intTotal += objTmp.Sum(row => row.Field<int>("recSubTotal_count"));
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpDate = tmpDate.AddMonths(1);
|
||||||
|
|
||||||
|
if (tmpDate > dateEnd && tmpDate.ToString("yyyy/MM") == dateEnd.ToString("yyyy/MM")) {
|
||||||
|
tmpDate = dateEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
rowNum += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
HSSFRow excelRow2 = (HSSFRow)sheet.CreateRow(rowNum);
|
||||||
|
excelRow2.CreateCell(0).SetCellValue("總計");
|
||||||
|
excelRow2.CreateCell(1).SetCellValue(intTotal);
|
||||||
|
|
||||||
|
workbook.Write(ms);
|
||||||
|
ms.Flush();
|
||||||
|
|
||||||
|
context.Response.ContentType = "application/vnd.ms-excel;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=" + HttpUtility.UrlEncode(url_descript.Trim() + "_" + DateTime.Now.ToString("yyyy-MM-dd"), Encoding.UTF8) + ".xls"));
|
||||||
|
context.Response.BinaryWrite(ms.ToArray());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "day") {
|
||||||
|
headerRow.CreateCell(0).SetCellValue("日期時間");
|
||||||
|
headerRow.CreateCell(1).SetCellValue("次數");
|
||||||
|
|
||||||
|
string rangeString = string.Format("select * from recSubTotal where url_uid = '{0}' and recSubTotal_date >= '{1}' and recSubTotal_date <= '{2}'", url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
DateTime tmpDate = dateStart;
|
||||||
|
int intTotal = 0;
|
||||||
|
int rowNum = 1;
|
||||||
|
|
||||||
|
while (tmpDate < dateEnd) {
|
||||||
|
DataRow[] objTmp = rangeSQL.selectedRows(string.Format("recSubTotal_date > '{0}' and recSubTotal_date <= '{1}'", tmpDate.ToString("yyyy/MM/dd"), tmpDate.ToString("yyyy/MM/dd 23:59:59")));
|
||||||
|
|
||||||
|
string col1 = tmpDate.ToString("yyyy/MM/dd");
|
||||||
|
|
||||||
|
HSSFRow excelRow = (HSSFRow)sheet.CreateRow(rowNum);
|
||||||
|
excelRow.CreateCell(0).SetCellValue(col1);
|
||||||
|
|
||||||
|
if (objTmp.Length == 0)
|
||||||
|
{
|
||||||
|
excelRow.CreateCell(1).SetCellValue(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
excelRow.CreateCell(1).SetCellValue(int.Parse(objTmp[0]["recSubTotal_count"].ToString()));
|
||||||
|
intTotal += int.Parse(objTmp[0]["recSubTotal_count"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpDate = tmpDate.AddDays(1);
|
||||||
|
rowNum += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
HSSFRow excelRow2 = (HSSFRow)sheet.CreateRow(rowNum);
|
||||||
|
excelRow2.CreateCell(0).SetCellValue("總計");
|
||||||
|
excelRow2.CreateCell(1).SetCellValue(intTotal);
|
||||||
|
|
||||||
|
workbook.Write(ms);
|
||||||
|
ms.Flush();
|
||||||
|
|
||||||
|
context.Response.ContentType = "application/vnd.ms-excel;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=" + HttpUtility.UrlEncode(url_descript.Trim() + "_" + DateTime.Now.ToString("yyyy-MM-dd"), Encoding.UTF8) + ".xls"));
|
||||||
|
context.Response.BinaryWrite(ms.ToArray());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "total") {
|
||||||
|
string rangeString = string.Format("select sum(recSubTotal_count) as num from recSubTotal where url_uid = '{0}' and recSubTotal_date >= '{1}' and recSubTotal_date <= '{2}'", url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
HSSFRow excelRow2 = (HSSFRow)sheet.CreateRow(1);
|
||||||
|
excelRow2.CreateCell(0).SetCellValue("總計");
|
||||||
|
|
||||||
|
|
||||||
|
if (rangeSQL.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
excelRow2.CreateCell(0).SetCellValue("0");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
excelRow2.CreateCell(1).SetCellValue(int.Parse(rangeSQL.dataRows[0]["num"].ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
workbook.Write(ms);
|
||||||
|
ms.Flush();
|
||||||
|
|
||||||
|
context.Response.ContentType = "application/vnd.ms-excel;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=" + HttpUtility.UrlEncode(url_descript.Trim() + "_" + DateTime.Now.ToString("yyyy-MM-dd"), Encoding.UTF8) + ".xls"));
|
||||||
|
context.Response.BinaryWrite(ms.ToArray());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,275 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="getCountData" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
public class getCountData : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string startDate = (context.Request["startDate"] == null) ? "" : context.Request["startDate"].ToString();
|
||||||
|
string endDate = (context.Request["endDate"] == null) ? "" : context.Request["endDate"].ToString();
|
||||||
|
string url_uid = (context.Request["url_uid"] == null) ? "" : context.Request["url_uid"].ToString();
|
||||||
|
string type = (context.Request["type"] == null) ? "" : context.Request["type"].ToString();
|
||||||
|
|
||||||
|
string errmsg = "";
|
||||||
|
|
||||||
|
if (globalClass.IsDate(startDate) == false) {
|
||||||
|
errmsg = "請輸入開始日期!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (globalClass.IsDate(endDate) == false) {
|
||||||
|
errmsg = "請輸入結束日期!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type != "day" && type != "total" && type != "month" && type != "hour") {
|
||||||
|
errmsg += "無正確的統計方式!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string urlString = string.Format("select * from url where url_uid = '{0}' and url_isRevoke = 'N' ", url_uid);
|
||||||
|
autoBindDataTable urlSQL = new autoBindDataTable(urlString);
|
||||||
|
|
||||||
|
if (urlSQL.dataRows.Count == 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "找不到此 url_uid 的資料!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime dateStart = DateTime.Parse(startDate);
|
||||||
|
DateTime dateEnd = DateTime.Parse(endDate + " 23:59:59");
|
||||||
|
|
||||||
|
if (type == "hour") {
|
||||||
|
string projString = string.Format("select * from projects where project_isRevoke = 'N' and project_uid = '{0}'", urlSQL.dataRows[0]["project_uid"].ToString());
|
||||||
|
autoBindDataTable projSQL = new autoBindDataTable(projString);
|
||||||
|
|
||||||
|
project_uid = urlSQL.dataRows[0]["project_uid"].ToString();
|
||||||
|
|
||||||
|
if (projSQL.dataRows.Count == 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "找不到此URL的專案資料!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string recTableName = projSQL.dataRows[0]["project_recTableName"].ToString();
|
||||||
|
|
||||||
|
string rangeString = string.Format("select * from {0} where project_uid = '{1}' and url_uid = '{2}' and rec_createdate >= '{3}' and rec_createdate <= '{4}'", recTableName, project_uid, url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
DateTime tmpDate = dateStart;
|
||||||
|
int intTotal = 0;
|
||||||
|
while (tmpDate <= dateEnd) {
|
||||||
|
DateTime dateS = DateTime.Parse(tmpDate.ToString("yyyy/MM/dd HH:00:00"));
|
||||||
|
DateTime dateE = DateTime.Parse(tmpDate.AddHours(1).ToString("yyyy/MM/dd HH:00:00")).AddSeconds(-1);
|
||||||
|
|
||||||
|
//if (dateStart > dateS) {
|
||||||
|
// dateS = dateStart;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (dateE > dateEnd) {
|
||||||
|
// dateE = dateEnd;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
DataRow[] objTmp = rangeSQL.selectedRows(string.Format("rec_createdate >= '{0}' and rec_createdate <= '{1}'", dateS.ToString("yyyy/MM/dd HH:mm:ss"), dateE.ToString("yyyy/MM/dd HH:mm:ss")));
|
||||||
|
|
||||||
|
countData objCount = new countData();
|
||||||
|
objRet.data.Add(objCount);
|
||||||
|
|
||||||
|
objCount.title = tmpDate.ToString("yyyy/MM/dd") + " " + tmpDate.ToString("HH") + ":00:00 - " + tmpDate.ToString("HH") + ":59:59";
|
||||||
|
if (objTmp.Length == 0)
|
||||||
|
{
|
||||||
|
objCount.num = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objCount.num = objTmp.Length;
|
||||||
|
intTotal += objCount.num;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpDate = tmpDate.AddHours(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
countData objTotal = new countData();
|
||||||
|
objTotal.title = "總計";
|
||||||
|
objTotal.num = intTotal;
|
||||||
|
objRet.data.Add(objTotal);
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "month") {
|
||||||
|
|
||||||
|
|
||||||
|
string rangeString = string.Format("select * from recSubTotal where url_uid = '{0}' and recSubTotal_date >= '{1}' and recSubTotal_date <= '{2}'", url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
DateTime tmpDate = dateStart;
|
||||||
|
int intTotal = 0;
|
||||||
|
while (tmpDate <= dateEnd) {
|
||||||
|
DateTime dateS = DateTime.Parse(tmpDate.ToString("yyyy/MM/01 00:00:00"));
|
||||||
|
DateTime dateE = DateTime.Parse(tmpDate.AddMonths(1).ToString("yyyy/MM/01 00:00:00")).AddSeconds(-1);
|
||||||
|
|
||||||
|
if (dateStart > dateS) {
|
||||||
|
dateS = dateStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dateE > dateEnd) {
|
||||||
|
dateE = dateEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataRow[] objTmp = rangeSQL.selectedRows(string.Format("recSubTotal_date > '{0}' and recSubTotal_date <= '{1}'", dateS.ToString("yyyy/MM/dd 00:00:00"), dateE.ToString("yyyy/MM/dd 23:59:59")));
|
||||||
|
|
||||||
|
countData objCount = new countData();
|
||||||
|
objRet.data.Add(objCount);
|
||||||
|
|
||||||
|
objCount.title = tmpDate.ToString("yyyy") + "年" + tmpDate.ToString("MM") + "月";
|
||||||
|
if (objTmp.Length == 0)
|
||||||
|
{
|
||||||
|
objCount.num = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objCount.num = int.Parse(objTmp[0]["recSubTotal_count"].ToString());
|
||||||
|
objCount.num = objTmp.Sum(row => row.Field<int>("recSubTotal_count"));
|
||||||
|
intTotal += objCount.num;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpDate = tmpDate.AddMonths(1);
|
||||||
|
|
||||||
|
if (tmpDate > dateEnd && tmpDate.ToString("yyyy/MM") == dateEnd.ToString("yyyy/MM")) {
|
||||||
|
tmpDate = dateEnd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
countData objTotal = new countData();
|
||||||
|
objTotal.title = "總計";
|
||||||
|
objTotal.num = intTotal;
|
||||||
|
objRet.data.Add(objTotal);
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "day") {
|
||||||
|
string rangeString = string.Format("select * from recSubTotal where url_uid = '{0}' and recSubTotal_date >= '{1}' and recSubTotal_date <= '{2}'", url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
DateTime tmpDate = dateStart;
|
||||||
|
int intTotal = 0;
|
||||||
|
while (tmpDate < dateEnd) {
|
||||||
|
DataRow[] objTmp = rangeSQL.selectedRows(string.Format("recSubTotal_date > '{0}' and recSubTotal_date <= '{1}'", tmpDate.ToString("yyyy/MM/dd"), tmpDate.ToString("yyyy/MM/dd 23:59:59")));
|
||||||
|
|
||||||
|
countData objCount = new countData();
|
||||||
|
objRet.data.Add(objCount);
|
||||||
|
|
||||||
|
objCount.title = tmpDate.ToString("yyyy/MM/dd");
|
||||||
|
if (objTmp.Length == 0)
|
||||||
|
{
|
||||||
|
objCount.num = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objCount.num = int.Parse(objTmp[0]["recSubTotal_count"].ToString());
|
||||||
|
intTotal += objCount.num;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpDate = tmpDate.AddDays(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
countData objTotal = new countData();
|
||||||
|
objTotal.title = "總計";
|
||||||
|
objTotal.num = intTotal;
|
||||||
|
objRet.data.Add(objTotal);
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "total") {
|
||||||
|
string rangeString = string.Format("select sum(recSubTotal_count) as num from recSubTotal where url_uid = '{0}' and recSubTotal_date >= '{1}' and recSubTotal_date <= '{2}'", url_uid, dateStart.ToString("yyyy/MM/dd HH:mm:ss"), dateEnd.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||||
|
autoBindDataTable rangeSQL = new autoBindDataTable(rangeString);
|
||||||
|
|
||||||
|
countData objTotal = new countData();
|
||||||
|
objTotal.title = "總計";
|
||||||
|
|
||||||
|
if (rangeSQL.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objTotal.num = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objTotal.num = int.Parse(rangeSQL.dataRows[0]["num"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.data.Add(objTotal);
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public List<countData> data = new List<countData>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class countData
|
||||||
|
{
|
||||||
|
public string title = "";
|
||||||
|
public int num = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="getMeta" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
public class getMeta : IHttpHandler, IReadOnlySessionState {
|
||||||
|
private string _baseurl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath.TrimEnd('/');
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
|
||||||
|
string acceptEncoding = context.Request.Headers["Accept-Encoding"].ToString().ToUpperInvariant();
|
||||||
|
if (!String.IsNullOrEmpty(acceptEncoding))
|
||||||
|
{
|
||||||
|
if (acceptEncoding.Contains("GZIP"))
|
||||||
|
{
|
||||||
|
//输出流头部GZIP压缩
|
||||||
|
context.Response.AppendHeader("Content-encoding", "gzip");
|
||||||
|
context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress);
|
||||||
|
}
|
||||||
|
else if (acceptEncoding.Contains("DEFLATE"))
|
||||||
|
{
|
||||||
|
//输出流头部DEFLATE压缩
|
||||||
|
context.Response.AppendHeader("Content-encoding", "deflate");
|
||||||
|
context.Response.Filter = new DeflateStream(context.Response.Filter, CompressionMode.Compress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string url = (context.Request["url"] == null) ? "" : context.Request["url"].ToString();
|
||||||
|
|
||||||
|
if (url == "") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無傳入網址!\n";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string htmlData = globalClass.getPageData(url);
|
||||||
|
//htmlData = htmlData.Replace("\n", "");
|
||||||
|
|
||||||
|
Match ogTitleMatch = Regex.Match(htmlData, "<meta.*?property=\"og:title\".*?content=\"([^<]*)\".*?([^<]*)>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||||
|
Match ogDescMatch = Regex.Match(htmlData, "<meta.*?property=\"og:description\" content=\"([^<]*)\".*?([^<]*)>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||||
|
Match ogImageMatch = Regex.Match(htmlData, "<meta.*?property=\"og:image\".*?content=\"([^<]*)\".*?([^<]*)>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||||
|
string ogTitle = ogTitleMatch.Groups[1].Value;
|
||||||
|
string ogDesc = ogDescMatch.Groups[1].Value;
|
||||||
|
string ogImage = ogImageMatch.Groups[1].Value;
|
||||||
|
|
||||||
|
if (ogTitle == "") {
|
||||||
|
ogTitleMatch = Regex.Match(htmlData, "<meta.*?name=\"og:title\".*?content=\"([^<]*)\".*?([^<]*)>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||||
|
ogDescMatch = Regex.Match(htmlData, "<meta.*?name=\"og:description\" content=\"([^<]*)\".*?([^<]*)>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||||
|
ogImageMatch = Regex.Match(htmlData, "<meta.*?name=\"og:image\".*?content=\"([^<]*)\".*?([^<]*)>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||||
|
ogTitle = ogTitleMatch.Groups[1].Value;
|
||||||
|
ogDesc = ogDescMatch.Groups[1].Value;
|
||||||
|
ogImage = ogImageMatch.Groups[1].Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.ogTitle = ogTitle;
|
||||||
|
objRet.ogDescript = ogDesc;
|
||||||
|
|
||||||
|
if (objRet.ogDescript.Length > 100) {
|
||||||
|
objRet.ogDescript = objRet.ogDescript.Substring(0, 95) + "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
string imageName = "";
|
||||||
|
|
||||||
|
if (ogImage != "") {
|
||||||
|
imageName = globalClass.CreateRandomCode(24);
|
||||||
|
string filePath = string.Format("/downloads/{0}.png", imageName);
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
globalClass.getUrlPic(ogImage).Save(path + filePath.Replace("/", "\\"), ImageFormat.Png);
|
||||||
|
objRet.ogImage = _baseurl + "/downloads/" + imageName + ".png";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ogImage = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string ogTitle = "";
|
||||||
|
public string ogDescript = "";
|
||||||
|
public string ogImage = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="getShortCode" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class getShortCode : IHttpHandler {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string shor_Code = globalClass.CreateCaseRandomCode(6);
|
||||||
|
Boolean isCheck = false;
|
||||||
|
|
||||||
|
while (isCheck == false) {
|
||||||
|
string checkString = string.Format("select * from url where url_code Collate SQL_Latin1_General_CP1_CS_AS = '{0}'", shor_Code);
|
||||||
|
autoBindDataTable checkSQL = new autoBindDataTable(checkString);
|
||||||
|
|
||||||
|
if (checkSQL.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
isCheck = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
shor_Code = globalClass.CreateCaseRandomCode(6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.shorCode = shor_Code;
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string shorCode = "";
|
||||||
|
public string urlHeader = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,168 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="importXlsx" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NPOI;
|
||||||
|
using NPOI.HPSF;
|
||||||
|
using NPOI.HSSF;
|
||||||
|
using NPOI.HSSF.UserModel;
|
||||||
|
using NPOI.XSSF;
|
||||||
|
using NPOI.XSSF.UserModel;
|
||||||
|
using NPOI.POIFS;
|
||||||
|
using NPOI.Util;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
public class importXlsx : IHttpHandler {
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
string xlsxFileCode = globalClass.CreateRandomCode(12);
|
||||||
|
string xlsxFileName = xlsxFileCode + ".xlsx";
|
||||||
|
string projPath = "uploads/xlsx/";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (objAuth.isLogin() == false) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "9999";
|
||||||
|
objRet.message = "尚未登入!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string base64_string = (context.Request["base64"] == null) ? "" : context.Request["base64"].ToString();
|
||||||
|
|
||||||
|
if (base64_string == "") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "無base64檔案!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string filePath = string.Format("BackEnd/uploads/xlsx/{0}.xlsx", xlsxFileCode);
|
||||||
|
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
|
||||||
|
globalClass.Base64ToFile(base64_string, path + filePath);
|
||||||
|
|
||||||
|
//globalClass.Base64ToAzure(base64_string, projPath + xlsxFileName);
|
||||||
|
|
||||||
|
XSSFWorkbook workbook = new XSSFWorkbook(globalClass.Base64ToStream(base64_string));
|
||||||
|
|
||||||
|
XSSFSheet sheet = (XSSFSheet)workbook.GetSheetAt(0);
|
||||||
|
DataTable dt = new DataTable(xlsxFileCode);
|
||||||
|
|
||||||
|
XSSFRow headerRow = (XSSFRow)sheet.GetRow(0);
|
||||||
|
|
||||||
|
int asciiA = 1;
|
||||||
|
foreach (XSSFCell headerCell in headerRow) {
|
||||||
|
dt.Columns.Add("A" + asciiA.ToString());
|
||||||
|
objRet.columns.Add(headerCell.ToString());
|
||||||
|
col newCol = new col();
|
||||||
|
newCol.data = "A" + asciiA.ToString();
|
||||||
|
newCol.visible = "true";
|
||||||
|
newCol.title = headerCell.ToString();
|
||||||
|
objRet.cols.Add(newCol);
|
||||||
|
asciiA++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rowIndex = 0;
|
||||||
|
int rowNum = 0;
|
||||||
|
int py = sheet.PhysicalNumberOfRows;
|
||||||
|
|
||||||
|
foreach (XSSFRow row in sheet) {
|
||||||
|
|
||||||
|
DataRow dataRow = dt.NewRow();
|
||||||
|
|
||||||
|
string hasData = "N";
|
||||||
|
|
||||||
|
foreach (XSSFCell cell in row.Cells) {
|
||||||
|
if (cell.ToString() != "")
|
||||||
|
{
|
||||||
|
hasData = "Y";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasData == "Y" && rowIndex != 0) {
|
||||||
|
dataRow.ItemArray = row.Cells.ToArray();
|
||||||
|
|
||||||
|
dt.Rows.Add(dataRow);
|
||||||
|
rowNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
rowIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int totalRowNum = rowNum;
|
||||||
|
|
||||||
|
DataTable dt2 = dt.Clone();
|
||||||
|
|
||||||
|
if (totalRowNum < 6)
|
||||||
|
{
|
||||||
|
foreach (DataRow row in dt.Rows)
|
||||||
|
{
|
||||||
|
dt2.ImportRow(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
dt2.ImportRow(dt.Rows[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = (totalRowNum - 3); i < totalRowNum; i++) {
|
||||||
|
dt2.ImportRow(dt.Rows[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string datatableJsonString = "";
|
||||||
|
datatableJsonString = JsonConvert.SerializeObject(dt2);
|
||||||
|
objRet.data = datatableJsonString;
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.totalRecNum = totalRowNum;
|
||||||
|
objRet.xlsxSerial = xlsxFileCode;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string xlsxSerial = "";
|
||||||
|
public int totalRecNum = 0;
|
||||||
|
public List<string> columns = new List<string>();
|
||||||
|
public List<col> cols = new List<col>();
|
||||||
|
public string data = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class col {
|
||||||
|
public string data = "";
|
||||||
|
public string visible = "";
|
||||||
|
public string title = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,253 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="importXlsx2" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NPOI;
|
||||||
|
using NPOI.HPSF;
|
||||||
|
using NPOI.HSSF;
|
||||||
|
using NPOI.HSSF.UserModel;
|
||||||
|
using NPOI.XSSF;
|
||||||
|
using NPOI.XSSF.UserModel;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using NPOI.POIFS;
|
||||||
|
using NPOI.Util;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
public class importXlsx2 : IHttpHandler {
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
string shortUrlHeader = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/";
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (objAuth.isLogin() == false) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "9999";
|
||||||
|
objRet.message = "尚未登入!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string xlsx_serial = (context.Request["xlsx_serial"] == null) ? "" : context.Request["xlsx_serial"].ToString();
|
||||||
|
string import_col = (context.Request["import_col"] == null) ? "" : context.Request["import_col"].ToString();
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
|
||||||
|
if (xlsx_serial == "") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無xlsx_serial!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (import_col == "") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無import_col!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
autoBindDataTable projectSQL = new autoBindDataTable(string.Format("select * from projects where project_uid = '{0}'", project_uid));
|
||||||
|
|
||||||
|
if (projectSQL.dataRows.Count == 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "無此Project!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string table_name = projectSQL.dataRows[0]["project_recTableName"].ToString();
|
||||||
|
|
||||||
|
projectSQL.disConnection();
|
||||||
|
|
||||||
|
string xlsxFileName = xlsx_serial + ".xlsx";
|
||||||
|
|
||||||
|
string filePath = string.Format("BackEnd/uploads/xlsx/{0}", xlsxFileName);
|
||||||
|
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
|
||||||
|
Stream xlsxStream = new FileStream(path + filePath, FileMode.Open);
|
||||||
|
|
||||||
|
XSSFWorkbook workbook = new XSSFWorkbook(xlsxStream);
|
||||||
|
workbook.MissingCellPolicy = NPOI.SS.UserModel.MissingCellPolicy.CREATE_NULL_AS_BLANK;
|
||||||
|
XSSFSheet sheet = (XSSFSheet)workbook.GetSheetAt(0);
|
||||||
|
|
||||||
|
int rowIndex = 0;
|
||||||
|
|
||||||
|
int importNum = 0;
|
||||||
|
int overNum = 0;
|
||||||
|
int rowNum = 0;
|
||||||
|
|
||||||
|
foreach (XSSFRow row in sheet) {
|
||||||
|
List<ICell> cells = row.Cells;
|
||||||
|
List<string> rowData = new List<string>();
|
||||||
|
|
||||||
|
for (int colNumber = 0; colNumber < row.LastCellNum; colNumber++) {
|
||||||
|
ICell cell = row.GetCell(colNumber, MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||||
|
rowData.Add(cell.ToString());
|
||||||
|
|
||||||
|
}
|
||||||
|
rowNum = row.LastCellNum;
|
||||||
|
string url = rowData[int.Parse(import_col)].ToString().Trim();
|
||||||
|
|
||||||
|
if (globalClass.isURL(url))
|
||||||
|
{
|
||||||
|
string findUrlString = string.Format("select * from url where project_uid = '{0}' and url_directToUrl = '{1}' ", project_uid, url);
|
||||||
|
autoBindDataTable findUrlSQL = new autoBindDataTable(findUrlString);
|
||||||
|
|
||||||
|
string url_code = "";
|
||||||
|
|
||||||
|
if (findUrlSQL.dataRows.Count > 0)
|
||||||
|
{
|
||||||
|
urlBase objUrl = new urlBase(findUrlSQL.dataRows[0]);
|
||||||
|
//objRet.urllist.Add(objUrl);
|
||||||
|
|
||||||
|
url_code = findUrlSQL.dataRows[0]["url_Code"].ToString();
|
||||||
|
overNum++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataRow newRow = findUrlSQL.newRow;
|
||||||
|
|
||||||
|
string shor_Code = globalClass.CreateCaseRandomCode(6);
|
||||||
|
Boolean isCheck = false;
|
||||||
|
|
||||||
|
url_code = shor_Code;
|
||||||
|
|
||||||
|
while (isCheck == false)
|
||||||
|
{
|
||||||
|
string checkString = string.Format("select * from url where url_code Collate SQL_Latin1_General_CP1_CS_AS = '{0}'", shor_Code);
|
||||||
|
autoBindDataTable checkSQL = new autoBindDataTable(checkString);
|
||||||
|
|
||||||
|
if (checkSQL.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
isCheck = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shor_Code = globalClass.CreateCaseRandomCode(6);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSQL.disConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
url_code = shor_Code;
|
||||||
|
|
||||||
|
urlObj objUrl = new urlObj();
|
||||||
|
objUrl.url_uid = globalClass.CreateRandomCode(32);
|
||||||
|
objUrl.project_uid = project_uid;
|
||||||
|
objUrl.url_descript = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + " 透過excel上傳匯入";
|
||||||
|
objUrl.url_directToUrl = url;
|
||||||
|
objUrl.url_Code = shor_Code;
|
||||||
|
objUrl.url_playBtn = "N";
|
||||||
|
objUrl.url_fbTag = "N";
|
||||||
|
objUrl.url_gifTag = "N";
|
||||||
|
objUrl.url_gifLink = "";
|
||||||
|
objUrl.url_fbTitle = "";
|
||||||
|
objUrl.url_fbDescript = "";
|
||||||
|
objUrl.url_fbPixel = "N";
|
||||||
|
objUrl.url_fbPixelCode = "";
|
||||||
|
objUrl.url_googleAds = "N";
|
||||||
|
objUrl.url_googleAwConversionId = "";
|
||||||
|
objUrl.url_createUid = objAuth.user_uid;
|
||||||
|
objUrl.url_photoId = "";
|
||||||
|
|
||||||
|
objUrl.updateData();
|
||||||
|
|
||||||
|
urlBase objb = new urlBase(objUrl.url_uid);
|
||||||
|
|
||||||
|
objRet.urllist.Add(objb);
|
||||||
|
importNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
row.CreateCell(row.LastCellNum).SetCellValue(shortUrlHeader + url_code);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
row.CreateCell(row.LastCellNum).SetCellValue("");
|
||||||
|
}
|
||||||
|
|
||||||
|
rowIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
sheet.AutoSizeColumn(rowNum);
|
||||||
|
|
||||||
|
MemoryStream ms = new MemoryStream();
|
||||||
|
//workbook.Write(ms);
|
||||||
|
|
||||||
|
|
||||||
|
string xlsxPath = path + string.Format("BackEnd/uploads/xlsx/output_{0}.xlsx", xlsx_serial);
|
||||||
|
|
||||||
|
using (var fs = new FileStream(xlsxPath, FileMode.Create, FileAccess.Write))
|
||||||
|
{
|
||||||
|
workbook.Write(fs);
|
||||||
|
fs.Close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var fs = new FileStream(xlsxPath, FileMode.Open, FileAccess.Read)) {
|
||||||
|
long fileSize = fs.Length;
|
||||||
|
byte[] fileBuffer = new byte[fileSize];
|
||||||
|
fs.Read(fileBuffer, 0, (int)fileSize);
|
||||||
|
|
||||||
|
//context.Response.AddHeader("Content-Length", fileSize.ToString());
|
||||||
|
//context.Response.AddHeader("Content-Disposition", string.Format("attachment;filename=\"{0}.xlsx\"", HttpUtility.UrlEncode(xlsx_serial, Encoding.UTF8)));
|
||||||
|
|
||||||
|
// context.Response.BinaryWrite(fileBuffer);
|
||||||
|
|
||||||
|
//context.ApplicationInstance.CompleteRequest();
|
||||||
|
//context.Response.Output.Flush();
|
||||||
|
|
||||||
|
fs.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//FileStream file = new FileStream(xlsxPath, FileMode.Create, FileAccess.Write);
|
||||||
|
//workbook.Write(file);
|
||||||
|
//ms.WriteTo(file);
|
||||||
|
//file.Flush();
|
||||||
|
//file.Close();
|
||||||
|
//ms.Flush();
|
||||||
|
|
||||||
|
objRet.outputFile = shortUrlHeader + string.Format("BackEnd/uploads/xlsx/output_{0}.xlsx", xlsx_serial);
|
||||||
|
objRet.ret = "yes";
|
||||||
|
|
||||||
|
objRet.overyNum = overNum;
|
||||||
|
objRet.totalImportNum = importNum;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string outputFile = "";
|
||||||
|
public int totalImportNum = 0;
|
||||||
|
public int overyNum = 0;
|
||||||
|
public List<urlBase> urllist = new List<urlBase>();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,394 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="projectData" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
public class projectData : IHttpHandler, IReadOnlySessionState
|
||||||
|
{
|
||||||
|
|
||||||
|
public void ProcessRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
|
||||||
|
string acceptEncoding = context.Request.Headers["Accept-Encoding"].ToString().ToUpperInvariant();
|
||||||
|
if (!String.IsNullOrEmpty(acceptEncoding))
|
||||||
|
{
|
||||||
|
if (acceptEncoding.Contains("GZIP"))
|
||||||
|
{
|
||||||
|
//输出流头部GZIP压缩
|
||||||
|
context.Response.AppendHeader("Content-encoding", "gzip");
|
||||||
|
context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress);
|
||||||
|
}
|
||||||
|
else if (acceptEncoding.Contains("DEFLATE"))
|
||||||
|
{
|
||||||
|
//输出流头部DEFLATE压缩
|
||||||
|
context.Response.AppendHeader("Content-encoding", "deflate");
|
||||||
|
context.Response.Filter = new DeflateStream(context.Response.Filter, CompressionMode.Compress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
string method = (context.Request["method"] == null) ? "" : context.Request["method"].ToString();
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
string project_name = (context.Request["project_name"] == null) ? "" : context.Request["project_name"].ToString();
|
||||||
|
string project_descript = (context.Request["project_descript"] == null) ? "" : context.Request["project_descript"].ToString();
|
||||||
|
string project_limited = (context.Request["project_dateLimit"] == null) ? "N" : context.Request["project_dateLimit"].ToString();
|
||||||
|
string project_enddate = (context.Request["project_enddate"] == null) ? "" : context.Request["project_enddate"].ToString();
|
||||||
|
string project_endToRedirect = (context.Request["project_endToRedirect"] == null) ? "" : context.Request["project_endToRedirect"].ToString();
|
||||||
|
string userJson = (context.Request["userList"] == null) ? "[]" : context.Request["userList"].ToString();
|
||||||
|
string project_apiId = (context.Request["project_apiId"] == null) ? "" : context.Request["project_apiId"].ToString();
|
||||||
|
string project_apiKey = (context.Request["project_apiKey"] == null) ? "" : context.Request["project_apiKey"].ToString();
|
||||||
|
string domainList = (context.Request["domainList"] == null) ? "[]" : context.Request["domainList"].ToString();
|
||||||
|
string ipList = (context.Request["ipList"] == null) ? "[]" : context.Request["ipList"].ToString();
|
||||||
|
string delUserJson = (context.Request["delUserJson"] == null) ? "[]" : context.Request["delUserJson"].ToString();
|
||||||
|
|
||||||
|
dynamic usersJson;
|
||||||
|
dynamic delUsersJson;
|
||||||
|
dynamic domainJson;
|
||||||
|
dynamic ipJson;
|
||||||
|
|
||||||
|
usersJson = JValue.Parse(userJson);
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0999";
|
||||||
|
objRet.message = "沒有Method,無法使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string errmsg = "";
|
||||||
|
|
||||||
|
if (method != "add")
|
||||||
|
{
|
||||||
|
if (project_uid == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有系統編號!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "get")
|
||||||
|
{
|
||||||
|
project objProj = new project(project_uid);
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.data = objProj;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "delete")
|
||||||
|
{
|
||||||
|
if (objAuth.user_perm != "A" && objAuth.user_perm != "P")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "無權限刪除專案基本資訊!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_uid == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有系統編號!\n";
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string delQuotationString = string.Format("update projects set project_isRevoke = 'Y' where project_uid = '{0}'", project_uid);
|
||||||
|
autoExecSQL objDel = new autoExecSQL(delQuotationString);
|
||||||
|
|
||||||
|
if (objDel.effectDataCount > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0033";
|
||||||
|
objRet.message = "無專案被刪除,請重新整理後重新刪除!";
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_name == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有專案名稱!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_limited == "Y" && globalClass.IsDate(project_enddate) == false)
|
||||||
|
{
|
||||||
|
errmsg += "沒有專案結束日期或專案結束日期格式錯誤!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_limited == "Y" && project_endToRedirect == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有專案結束後導向的網址!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (usersJson.Count == 0)
|
||||||
|
{
|
||||||
|
errmsg += "沒有專案成員\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_apiId == "" || project_apiKey == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有App ID或App Key!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "edit")
|
||||||
|
{
|
||||||
|
if (objAuth.user_perm != "A" && objAuth.user_perm != "P")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "無權限修改專案基本資訊!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
domainJson = JValue.Parse(domainList);
|
||||||
|
ipJson = JValue.Parse(ipList);
|
||||||
|
delUsersJson = JValue.Parse(delUserJson);
|
||||||
|
|
||||||
|
project objProj = new project(project_uid);
|
||||||
|
|
||||||
|
objProj.project_name = project_name;
|
||||||
|
objProj.project_descript = project_descript;
|
||||||
|
objProj.project_dateLimit = project_limited;
|
||||||
|
|
||||||
|
if (project_limited == "Y")
|
||||||
|
{
|
||||||
|
objProj.project_endDate = DateTime.Parse(project_enddate + " 23:59:59");
|
||||||
|
objProj.project_endToRedirect = project_endToRedirect;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objProj.project_endToRedirect = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
objProj.project_apiId = project_apiId;
|
||||||
|
objProj.project_apiKey = project_apiKey;
|
||||||
|
|
||||||
|
//autoExecSQL delProjectUser = new autoExecSQL(string.Format("delete projectUser where project_uid = '{0}'", project_uid));
|
||||||
|
string projUserString = "select * from projectUser where projectUser_sn = -1";
|
||||||
|
autoBindDataTable projUserSQL = new autoBindDataTable(projUserString);
|
||||||
|
|
||||||
|
foreach (JToken item in usersJson)
|
||||||
|
{
|
||||||
|
DataRow projUserRow = projUserSQL.newRow;
|
||||||
|
projUserSQL.dataRows.Add(projUserRow);
|
||||||
|
|
||||||
|
projUserRow["project_uid"] = project_uid;
|
||||||
|
projUserRow["user_uid"] = item["user_uid"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
//autoExecSQL delApiDomain = new autoExecSQL(string.Format("delete projectApiDomain where project_uid = '{0}'", project_uid));
|
||||||
|
string projApiDomainString = "select * from projectApiDomain where projectApiDomain_sn = -1";
|
||||||
|
autoBindDataTable projApiDomainSQL = new autoBindDataTable(projApiDomainString);
|
||||||
|
|
||||||
|
foreach (string item in domainJson)
|
||||||
|
{
|
||||||
|
if (item != "")
|
||||||
|
{
|
||||||
|
DataRow domainRow = projApiDomainSQL.newRow;
|
||||||
|
projApiDomainSQL.dataRows.Add(domainRow);
|
||||||
|
|
||||||
|
domainRow["project_uid"] = project_uid;
|
||||||
|
domainRow["projectApiDomain_type"] = "domain";
|
||||||
|
domainRow["projectApiDomain_address"] = item.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string item in ipJson)
|
||||||
|
{
|
||||||
|
if (item != "")
|
||||||
|
{
|
||||||
|
DataRow domainRow = projApiDomainSQL.newRow;
|
||||||
|
projApiDomainSQL.dataRows.Add(domainRow);
|
||||||
|
|
||||||
|
domainRow["project_uid"] = project_uid;
|
||||||
|
domainRow["projectApiDomain_type"] = "ip";
|
||||||
|
domainRow["projectApiDomain_address"] = item.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
objProj.updateData();
|
||||||
|
autoExecSQL delProjectUser = new autoExecSQL(string.Format("delete projectUser where project_uid = '{0}'", project_uid));
|
||||||
|
autoExecSQL delApiDomain = new autoExecSQL(string.Format("delete projectApiDomain where project_uid = '{0}'", project_uid));
|
||||||
|
projUserSQL.updateDataTable();
|
||||||
|
projApiDomainSQL.updateDataTable();
|
||||||
|
|
||||||
|
objRet.data = objProj;
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "9999";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "add")
|
||||||
|
{
|
||||||
|
domainJson = JValue.Parse(domainList);
|
||||||
|
ipJson = JValue.Parse(ipList);
|
||||||
|
|
||||||
|
project_uid = globalClass.CreateRandomCode(16);
|
||||||
|
|
||||||
|
project objProj = new project();
|
||||||
|
|
||||||
|
objProj.project_uid = project_uid;
|
||||||
|
objProj.project_recTableName = "rec_" + project_uid;
|
||||||
|
objProj.project_name = project_name;
|
||||||
|
objProj.project_descript = project_descript;
|
||||||
|
objProj.project_dateLimit = project_limited;
|
||||||
|
|
||||||
|
if (project_limited == "Y")
|
||||||
|
{
|
||||||
|
objProj.project_endDate = DateTime.Parse(project_enddate + " 23:59:59");
|
||||||
|
objProj.project_endToRedirect = project_endToRedirect;
|
||||||
|
}
|
||||||
|
|
||||||
|
objProj.project_apiId = project_apiId;
|
||||||
|
objProj.project_apiKey = project_apiKey;
|
||||||
|
objProj.project_createUid = objAuth.user_uid;
|
||||||
|
|
||||||
|
string projUserString = "select * from projectUser where projectUser_sn = -1";
|
||||||
|
autoBindDataTable projUserSQL = new autoBindDataTable(projUserString);
|
||||||
|
|
||||||
|
string projApiDomainString = "select * from projectApiDomain where projectApiDomain_sn = -1";
|
||||||
|
autoBindDataTable projApiDomainSQL = new autoBindDataTable(projApiDomainString);
|
||||||
|
|
||||||
|
foreach (JToken item in usersJson)
|
||||||
|
{
|
||||||
|
DataRow projUserRow = projUserSQL.newRow;
|
||||||
|
projUserSQL.dataRows.Add(projUserRow);
|
||||||
|
|
||||||
|
projUserRow["project_uid"] = project_uid;
|
||||||
|
projUserRow["user_uid"] = item["user_uid"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string item in domainJson)
|
||||||
|
{
|
||||||
|
if (item != "")
|
||||||
|
{
|
||||||
|
DataRow domainRow = projApiDomainSQL.newRow;
|
||||||
|
projApiDomainSQL.dataRows.Add(domainRow);
|
||||||
|
|
||||||
|
domainRow["project_uid"] = project_uid;
|
||||||
|
domainRow["projectApiDomain_type"] = "domain";
|
||||||
|
domainRow["projectApiDomain_address"] = item.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string item in ipJson)
|
||||||
|
{
|
||||||
|
if (item != "")
|
||||||
|
{
|
||||||
|
DataRow domainRow = projApiDomainSQL.newRow;
|
||||||
|
projApiDomainSQL.dataRows.Add(domainRow);
|
||||||
|
|
||||||
|
domainRow["project_uid"] = project_uid;
|
||||||
|
domainRow["projectApiDomain_type"] = "ip";
|
||||||
|
domainRow["projectApiDomain_address"] = item.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
projUserSQL.updateDataTable();
|
||||||
|
projApiDomainSQL.updateDataTable();
|
||||||
|
objProj.updateData();
|
||||||
|
objRet.data = objProj;
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "9999";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public project data = new project();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="projectsList" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class projectsList : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (objAuth.user_perm != "A" && objAuth.user_perm != "P")
|
||||||
|
//{
|
||||||
|
// objRet.ret = "no";
|
||||||
|
// objRet.err_code = "0002";
|
||||||
|
// objRet.message = "權限不足,無法使用";
|
||||||
|
// json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
objRet.user_perm = objAuth.user_perm;
|
||||||
|
|
||||||
|
string projectString = "select * from projects where project_isRevoke = 'N' order by project_sn desc";
|
||||||
|
|
||||||
|
if (objAuth.user_perm != "A")
|
||||||
|
{
|
||||||
|
projectString = string.Format("select A.* from projects A, projectUser B where A.project_uid = B.project_uid and A.project_isRevoke = 'N' and B.user_uid = '{0}' order by A.project_sn desc", objAuth.user_uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
autoBindDataTable sqlProjects = new autoBindDataTable(projectString);
|
||||||
|
|
||||||
|
foreach(DataRow tmpRow in sqlProjects.dataRows)
|
||||||
|
{
|
||||||
|
projectBase tmpProject = new projectBase(tmpRow["project_uid"].ToString());
|
||||||
|
objRet.projectlist.Add(tmpProject);
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string user_perm = "N";
|
||||||
|
public List<projectBase> projectlist = new List<projectBase>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,197 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="signin" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class signin : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
string id = (context.Request["id"] == null) ? "" : context.Request["id"].ToString();
|
||||||
|
string pwd = (context.Request["pwd"] == null) ? "" : context.Request["pwd"].ToString();
|
||||||
|
string remember = (context.Request["rem"] == null) ? "N" : context.Request["rem"].ToString();
|
||||||
|
|
||||||
|
string user_sql = string.Format("select * from users where user_id = '{0}'", id);
|
||||||
|
autoBindDataTable objUser = new autoBindDataTable(user_sql);
|
||||||
|
|
||||||
|
if (objUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "此帳號尚未擁有權限,請專案管理者加入權限!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
|
||||||
|
//系統內建帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "Y") {
|
||||||
|
if (objUser.dataRows[0]["user_onjob"].ToString() == "N") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString())) {
|
||||||
|
string test = SHA256_Encode(objUser.dataRows[0]["user_pwd"].ToString());
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//E白板帳號
|
||||||
|
if (objUser.dataRows[0]["user_type"].ToString() == "N") {
|
||||||
|
string elab_sql = string.Format("select * from new_userdata where userid = '{0}'", id);
|
||||||
|
autoBindElab objElabUser = new autoBindElab(elab_sql);
|
||||||
|
|
||||||
|
if (objElabUser.dataRows.Count == 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "無此帳號密碼!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (objElabUser.dataRows[0]["onjob"].ToString() == "1") {
|
||||||
|
objUser.dataRows[0]["user_onjob"] = "N";
|
||||||
|
objUser.updateDataTable();
|
||||||
|
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0003";
|
||||||
|
objRet.message = "此帳號已經離職!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pwd != SHA256_Encode(objElabUser.dataRows[0]["userpw"].ToString())) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = "密碼有誤!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string token_key = CreateRandomCode(36);
|
||||||
|
string user_uid = objUser.dataRows[0]["user_uid"].ToString();
|
||||||
|
|
||||||
|
autoBindDataTable dataToken = new autoBindDataTable("select * from token where token_sn = -1");
|
||||||
|
DataRow rowToken = dataToken.newRow;
|
||||||
|
dataToken.dataRows.Add(rowToken);
|
||||||
|
rowToken["token_key"] = token_key;
|
||||||
|
rowToken["user_uid"] = user_uid;
|
||||||
|
rowToken["token_isremember"] = remember;
|
||||||
|
rowToken["token_expireddate"] = DateTime.Now.AddMinutes(60);
|
||||||
|
|
||||||
|
|
||||||
|
HttpCookie tokenCookie = new HttpCookie("token");
|
||||||
|
HttpCookie idCookie = new HttpCookie("id");
|
||||||
|
tokenCookie["token"] = HttpUtility.UrlEncode(token_key);
|
||||||
|
tokenCookie["uid"] = HttpUtility.UrlEncode(user_uid);
|
||||||
|
tokenCookie["name"] = HttpUtility.UrlEncode(objUser.dataRows[0]["user_name"].ToString());
|
||||||
|
idCookie["id"] = HttpUtility.UrlEncode(id);
|
||||||
|
|
||||||
|
idCookie.Expires = DateTime.Now.AddDays(31);
|
||||||
|
|
||||||
|
if (remember == "Y") {
|
||||||
|
tokenCookie.Expires = DateTime.Now.AddDays(10);
|
||||||
|
rowToken["token_expireddate"] = DateTime.Now.AddDays(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
dataToken.updateDataTable();
|
||||||
|
context.Response.Cookies.Add(tokenCookie);
|
||||||
|
context.Response.Cookies.Add(idCookie);
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
string SHA256_Encode(string value) {
|
||||||
|
byte[] bytValue = System.Text.Encoding.UTF8.GetBytes(value);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SHA256 sha256 = new SHA256CryptoServiceProvider();
|
||||||
|
byte[] retVal = sha256.ComputeHash(bytValue);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < retVal.Length; i++)
|
||||||
|
{
|
||||||
|
sb.Append(retVal[i].ToString("x2"));
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception("GetSHA256HashFromString() fail,error:" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CreateRandomCode(int Number)
|
||||||
|
{
|
||||||
|
string allChar = "0,1,2,3,4,5,6,7,8,9,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";
|
||||||
|
string[] allCharArray = allChar.Split(',');
|
||||||
|
string randomCode = "";
|
||||||
|
|
||||||
|
Random rand = new Random(Guid.NewGuid().GetHashCode());
|
||||||
|
for (int i = 0; i <= Number - 1; i++)
|
||||||
|
{
|
||||||
|
int t = rand.Next(allCharArray.Length);
|
||||||
|
randomCode += allCharArray[t];
|
||||||
|
}
|
||||||
|
return randomCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="uploadPDFImage" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class uploadPDFImage : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
private string _baseurl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath.TrimEnd('/');
|
||||||
|
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string picFile = (context.Request["picFile"] == null) ? "" : context.Request["picFile"].ToString();
|
||||||
|
string filename = (context.Request["filename"] == null) ? "" : context.Request["filename"].ToString();
|
||||||
|
string filetype = (context.Request["filetype"] == null) ? "" : context.Request["filetype"].ToString();
|
||||||
|
|
||||||
|
string fileClientName = globalClass.CreateCaseRandomCode(16);
|
||||||
|
|
||||||
|
if (!(filetype == "image/jpeg" || filetype == "image/png" || filetype == "application/pdf" || filetype == "image/jpg")) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "不支援檔案格式為" + filetype;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filetype == "application/pdf") {
|
||||||
|
fileClientName = fileClientName + ".pdf";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filetype == "image/jpeg" || filetype == "image/jpg") {
|
||||||
|
fileClientName = fileClientName + ".jpg";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filetype == "application/png") {
|
||||||
|
fileClientName = fileClientName + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
string filePath = string.Format("upload_files/{0}", fileClientName).Replace("/", "\\");
|
||||||
|
|
||||||
|
string path = System.Web.HttpContext.Current.Server.MapPath("~/");
|
||||||
|
|
||||||
|
globalClass.Base64ToFile(picFile, path + filePath);
|
||||||
|
|
||||||
|
objRet.fileName = filename;
|
||||||
|
objRet.fileLinkName = fileClientName;
|
||||||
|
objRet.fileUrl = _baseurl + "/upload_files/" + fileClientName;
|
||||||
|
objRet.fileType = filetype;
|
||||||
|
objRet.ret = "yes";
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string fileName = "";
|
||||||
|
public string fileUrl = "";
|
||||||
|
public string fileType = "";
|
||||||
|
public string fileLinkName = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,441 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="urlData" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Facebook;
|
||||||
|
using System.Net;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
|
public class urlData : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
|
||||||
|
string acceptEncoding = context.Request.Headers["Accept-Encoding"].ToString().ToUpperInvariant();
|
||||||
|
if (!String.IsNullOrEmpty(acceptEncoding))
|
||||||
|
{
|
||||||
|
if (acceptEncoding.Contains("GZIP"))
|
||||||
|
{
|
||||||
|
//输出流头部GZIP压缩
|
||||||
|
context.Response.AppendHeader("Content-encoding", "gzip");
|
||||||
|
context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress);
|
||||||
|
}
|
||||||
|
else if (acceptEncoding.Contains("DEFLATE"))
|
||||||
|
{
|
||||||
|
//输出流头部DEFLATE压缩
|
||||||
|
context.Response.AppendHeader("Content-encoding", "deflate");
|
||||||
|
context.Response.Filter = new DeflateStream(context.Response.Filter, CompressionMode.Compress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string method = (context.Request["method"] == null) ? "" : context.Request["method"].ToString();
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
string url_uid = (context.Request["url_uid"] == null) ? "" : context.Request["url_uid"].ToString();
|
||||||
|
string url_descript = (context.Request["url_descript"] == null) ? "" : context.Request["url_descript"].ToString();
|
||||||
|
string url_directToUrl = (context.Request["url_directToUrl"] == null) ? "" : context.Request["url_directToUrl"].ToString();
|
||||||
|
string url_Code = (context.Request["url_Code"] == null) ? "" : context.Request["url_Code"].ToString();
|
||||||
|
string url_gifTag = (context.Request["url_gifTag"] == null) ? "N" : context.Request["url_gifTag"].ToString();
|
||||||
|
string url_gifLink = (context.Request["url_gifLink"] == null) ? "" : context.Request["url_gifLink"].ToString();
|
||||||
|
string url_fbTag = (context.Request["url_fbTag"] == null) ? "N" : context.Request["url_fbTag"].ToString();
|
||||||
|
string url_fbTitle = (context.Request["url_fbTitle"] == null) ? "" : context.Request["url_fbTitle"].ToString();
|
||||||
|
string url_fbDescript = (context.Request["url_fbDescript"] == null) ? "" : context.Request["url_fbDescript"].ToString();
|
||||||
|
string url_fbPixel = (context.Request["url_fbPixel"] == null) ? "N" : context.Request["url_fbPixel"].ToString();
|
||||||
|
string url_fbPixelCode = (context.Request["url_fbPixelCode"] == null) ? "" : context.Request["url_fbPixelCode"].ToString();
|
||||||
|
string url_googleAds = (context.Request["url_googleAds"] == null) ? "N" : context.Request["url_googleAds"].ToString();
|
||||||
|
string url_googleAwConversionId = (context.Request["url_googleAwConversionId"] == null) ? "" : context.Request["url_googleAwConversionId"].ToString();
|
||||||
|
string url_playBtn = (context.Request["url_playBtn"] == null) ? "N" : context.Request["url_playBtn"].ToString();
|
||||||
|
string pic_data = (context.Request["pic_data"] == null) ? "" : context.Request["pic_data"].ToString();
|
||||||
|
string url_uploadFile = (context.Request["url_uploadFile"] == null) ? "N" : context.Request["url_uploadFile"].ToString();
|
||||||
|
string url_uploadFileClientName = (context.Request["url_uploadFileClientName"] == null) ? "" : context.Request["url_uploadFileClientName"].ToString();
|
||||||
|
string url_uploadFileLinkName = (context.Request["url_uploadFileLinkName"] == null) ? "" : context.Request["url_uploadFileLinkName"].ToString();
|
||||||
|
string url_uploadFileType = (context.Request["url_uploadFileType"] == null) ? "" : context.Request["url_uploadFileType"].ToString();
|
||||||
|
string url_photoId = "";
|
||||||
|
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0999";
|
||||||
|
objRet.message = "沒有Method,無法使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string errmsg = "";
|
||||||
|
|
||||||
|
if (method != "add") {
|
||||||
|
if (url_uid == "") {
|
||||||
|
errmsg += "沒有系統編號!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "get")
|
||||||
|
{
|
||||||
|
urlObj objUrl = new urlObj(url_uid);
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.data = objUrl;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "delete")
|
||||||
|
{
|
||||||
|
if (url_uid == "") {
|
||||||
|
errmsg += "沒有系統編號!\n";
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string delQuotationString = string.Format("update url set url_isRevoke = 'Y' where project_uid = '{0}' and url_uid = '{1}'", project_uid, url_uid);
|
||||||
|
autoExecSQL objDel = new autoExecSQL(delQuotationString);
|
||||||
|
|
||||||
|
if (objDel.effectDataCount > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0033";
|
||||||
|
objRet.message = "無短網址被刪除,請重新整理後重新刪除!";
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_descript == "") {
|
||||||
|
errmsg += "沒有短網址說明!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_Code == "") {
|
||||||
|
errmsg += "沒有短網址碼!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_directToUrl == "") {
|
||||||
|
errmsg += "沒有目的地網址!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project_uid == "") {
|
||||||
|
errmsg += "沒有專案代碼!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_gifTag == "Y") {
|
||||||
|
if (url_gifLink == "") {
|
||||||
|
errmsg += "沒有gif的網路連結位置!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_fbTag == "Y") {
|
||||||
|
if (pic_data == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有FB預覽圖片\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_fbTitle == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有FB預覽標題!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url_descript == "")
|
||||||
|
{
|
||||||
|
errmsg += "沒有FB預覽內容!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg.Length > 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = errmsg;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "add") {
|
||||||
|
string checkString = string.Format("select * from url where url_Code Collate SQL_Latin1_General_CP1_CS_AS = '{0}'", url_Code);
|
||||||
|
autoBindDataTable checkSQL = new autoBindDataTable(checkString);
|
||||||
|
|
||||||
|
if (checkSQL.dataRows.Count > 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0006";
|
||||||
|
objRet.message = "此短網址已經被使用了,請換一組短網址碼再試一次!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
url_uid = globalClass.CreateRandomCode(32);
|
||||||
|
url_photoId = globalClass.CreateRandomCode(36);
|
||||||
|
|
||||||
|
urlObj objUrl = new urlObj();
|
||||||
|
objUrl.url_uid = url_uid;
|
||||||
|
objUrl.project_uid = project_uid;
|
||||||
|
objUrl.url_descript = url_descript;
|
||||||
|
objUrl.url_directToUrl = url_directToUrl;
|
||||||
|
objUrl.url_Code = url_Code;
|
||||||
|
objUrl.url_playBtn = url_playBtn;
|
||||||
|
objUrl.url_fbTag = url_fbTag;
|
||||||
|
objUrl.url_gifTag = url_gifTag;
|
||||||
|
objUrl.url_gifLink = url_gifLink;
|
||||||
|
objUrl.url_fbTitle = url_fbTitle;
|
||||||
|
objUrl.url_fbDescript = url_fbDescript;
|
||||||
|
objUrl.url_fbPixel = url_fbPixel;
|
||||||
|
objUrl.url_fbPixelCode = url_fbPixelCode;
|
||||||
|
objUrl.url_googleAds = url_googleAds;
|
||||||
|
objUrl.url_googleAwConversionId = url_googleAwConversionId;
|
||||||
|
objUrl.url_createUid = objAuth.user_uid;
|
||||||
|
objUrl.url_photoId = url_photoId;
|
||||||
|
objUrl.url_uploadFile = url_uploadFile;
|
||||||
|
objUrl.url_uploadFileClientName = url_uploadFileClientName;
|
||||||
|
objUrl.url_uploadFileLinkName = url_uploadFileLinkName;
|
||||||
|
objUrl.url_uploadFileType = url_uploadFileType;
|
||||||
|
|
||||||
|
string picChange = "N";
|
||||||
|
|
||||||
|
JToken jsonObj;
|
||||||
|
|
||||||
|
string base64Img = "";
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jsonObj = JValue.Parse(pic_data);
|
||||||
|
picChange = jsonObj[0]["meta"]["picChange"].ToString();
|
||||||
|
base64Img = jsonObj[0]["output"]["image"].ToString();
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (picChange == "Y")
|
||||||
|
{
|
||||||
|
//base64Img = jsonObj[0]["output"]["image"].ToString();
|
||||||
|
objUrl.pic_image = globalClass.Base64ToImage(base64Img);
|
||||||
|
|
||||||
|
//if (objUrl.pic_image.Width > 702) {
|
||||||
|
// float ratoF = 702f / float.Parse(objUrl.pic_image.Width.ToString());
|
||||||
|
// int newW = Convert.ToInt32(objUrl.pic_image.Width * ratoF);
|
||||||
|
// int newH = Convert.ToInt32(objUrl.pic_image.Height * ratoF);
|
||||||
|
// objUrl.pic_image = globalClass.resizeImage(objUrl.pic_image, newW, newH);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
objUrl.updateData();
|
||||||
|
objRet.data = objUrl;
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "9999";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "edit") {
|
||||||
|
Boolean isChange = false;
|
||||||
|
|
||||||
|
urlObj objUrl = new urlObj(url_uid);
|
||||||
|
|
||||||
|
if (objUrl.url_Code == "") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0009";
|
||||||
|
objRet.message = "無此url_uid資料!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objUrl.url_gifLink != url_gifLink) {
|
||||||
|
isChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objUrl.url_fbTag != url_fbTag) {
|
||||||
|
isChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objUrl.url_playBtn != url_playBtn) {
|
||||||
|
isChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objUrl.url_directToUrl != url_directToUrl) {
|
||||||
|
isChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objUrl.url_fbTitle != url_fbTitle) {
|
||||||
|
isChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objUrl.url_fbDescript != url_fbDescript) {
|
||||||
|
isChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
string base64Img = "";
|
||||||
|
string picChange = "N";
|
||||||
|
JToken jsonObj;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jsonObj = JValue.Parse(pic_data);
|
||||||
|
picChange = jsonObj[0]["meta"]["picChange"].ToString();
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
jsonObj = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (picChange == "Y")
|
||||||
|
{
|
||||||
|
isChange = true;
|
||||||
|
base64Img = jsonObj[0]["output"]["image"].ToString();
|
||||||
|
objUrl.pic_image = globalClass.Base64ToImage(base64Img);
|
||||||
|
|
||||||
|
//if (objUrl.pic_image.Width > 702) {
|
||||||
|
// float ratoF = 702f / float.Parse(objUrl.pic_image.Width.ToString());
|
||||||
|
// int newW = Convert.ToInt32(objUrl.pic_image.Width * ratoF);
|
||||||
|
// int newH = Convert.ToInt32(objUrl.pic_image.Height * ratoF);
|
||||||
|
// objUrl.pic_image = globalClass.resizeImage(objUrl.pic_image, newW, newH);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
objUrl.url_descript = url_descript;
|
||||||
|
objUrl.url_directToUrl = url_directToUrl;
|
||||||
|
objUrl.url_playBtn = url_playBtn;
|
||||||
|
objUrl.url_gifTag = url_gifTag;
|
||||||
|
objUrl.url_gifLink = url_gifLink;
|
||||||
|
objUrl.url_fbTag = url_fbTag;
|
||||||
|
objUrl.url_fbTitle = url_fbTitle;
|
||||||
|
objUrl.url_fbDescript = url_fbDescript;
|
||||||
|
objUrl.url_fbPixel = url_fbPixel;
|
||||||
|
objUrl.url_fbPixelCode = url_fbPixelCode;
|
||||||
|
objUrl.url_googleAds = url_googleAds;
|
||||||
|
objUrl.url_googleAwConversionId = url_googleAwConversionId;
|
||||||
|
objUrl.url_uploadFileLinkName = url_uploadFileLinkName;
|
||||||
|
objUrl.url_uploadFile = url_uploadFile;
|
||||||
|
objUrl.url_uploadFileClientName = url_uploadFileClientName;
|
||||||
|
objUrl.url_uploadFileType = url_uploadFileType;
|
||||||
|
|
||||||
|
if (objUrl.updateData())
|
||||||
|
{
|
||||||
|
if (isChange) {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string AppID = "563584377383502";
|
||||||
|
string AppSecret = "0a8211ad839ec0ffbd5955ef3d4709ec";
|
||||||
|
|
||||||
|
WebClient wc = new WebClient(); //每次重新取一次token
|
||||||
|
|
||||||
|
string result = wc.DownloadString("https://graph.facebook.com/oauth/access_token?client_id=" + AppID + "&client_secret=" + AppSecret + "&grant_type=client_credentials");//自動取得發文授權碼
|
||||||
|
dynamic resultJson = JValue.Parse(result);
|
||||||
|
string access_token = resultJson["access_token"];
|
||||||
|
|
||||||
|
string url = string.Format("https://graph.facebook.com/?id={0}&scrape=true", HttpUtility.UrlEncode(objUrl.url_shortUrl));
|
||||||
|
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
request.Method = "POST";
|
||||||
|
//request.ContentType = "application/x-www-form-urlencoded";
|
||||||
|
|
||||||
|
//必須透過ParseQueryString()來建立NameValueCollection物件,之後.ToString()才能轉換成queryString
|
||||||
|
NameValueCollection postParams = System.Web.HttpUtility.ParseQueryString(string.Empty);
|
||||||
|
|
||||||
|
postParams.Add("access_token", access_token);
|
||||||
|
|
||||||
|
//Console.WriteLine(postParams.ToString());// 將取得"version=1.0&action=preserveCodeCheck&pCode=pCode&TxID=guid&appId=appId", key和value會自動UrlEncode
|
||||||
|
//要發送的字串轉為byte[]
|
||||||
|
byte[] byteArray = Encoding.UTF8.GetBytes(postParams.ToString());
|
||||||
|
using (Stream reqStream = request.GetRequestStream())
|
||||||
|
{
|
||||||
|
reqStream.Write(byteArray, 0, byteArray.Length);
|
||||||
|
}//end using
|
||||||
|
|
||||||
|
//API回傳的字串
|
||||||
|
string responseStr = "";
|
||||||
|
//發出Request
|
||||||
|
using (WebResponse response = request.GetResponse())
|
||||||
|
{
|
||||||
|
using (StreamReader sr = new StreamReader(response.GetResponseStream(),Encoding.UTF8))
|
||||||
|
{
|
||||||
|
responseStr = sr.ReadToEnd();
|
||||||
|
}//end using
|
||||||
|
}
|
||||||
|
|
||||||
|
dynamic resultStrJson = JValue.Parse(responseStr);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.data = objUrl;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.message = objUrl.update_result;
|
||||||
|
objRet.data = objUrl;
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public urlObj data = new urlObj();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="urlsList" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class urlsList : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
string project_uid = (context.Request["project_uid"] == null) ? "" : context.Request["project_uid"].ToString();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.user_perm = objAuth.user_perm;
|
||||||
|
|
||||||
|
if (objAuth.user_perm != "A")
|
||||||
|
{
|
||||||
|
string projectString = string.Format("select A.* from projects A, projectUser B where A.project_uid = B.project_uid and A.project_isRevoke = 'N' and A.project_uid = '{0}' and B.user_uid = '{1}'", project_uid, objAuth.user_uid);
|
||||||
|
autoBindDataTable projectSQL = new autoBindDataTable(projectString);
|
||||||
|
|
||||||
|
if (projectSQL.dataRows.Count == 0 && project_uid != "") {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "無權限讀取此專案的短網址資料!";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string urlString = string.Format("select * from url where project_uid = '{0}' and url_isRevoke = 'N'", project_uid);
|
||||||
|
autoBindDataTable urlSQL = new autoBindDataTable(urlString);
|
||||||
|
|
||||||
|
foreach (DataRow objRow in urlSQL.dataRows) {
|
||||||
|
urlBase objUrl = new urlBase(objRow);
|
||||||
|
objRet.urllist.Add(objUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public string user_perm = "N";
|
||||||
|
public List<urlBase> urllist = new List<urlBase>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="user_profile" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class user_profile : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string user_email = (context.Request["input_email"] == null) ? "" : context.Request["input_email"].ToString();
|
||||||
|
string result = (context.Request["pic_data"] == null) ? "" : context.Request["pic_data"].ToString();
|
||||||
|
string pass = (context.Request["pass"] == null) ? "" : context.Request["pass"].ToString();
|
||||||
|
|
||||||
|
if (user_email == null || result == null)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "沒有資料可以儲存";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
userdata objUser = new userdata(objAuth.user_uid);
|
||||||
|
|
||||||
|
objUser.user_email = user_email;
|
||||||
|
|
||||||
|
JToken jsonObj = JValue.Parse(result);
|
||||||
|
|
||||||
|
string base64Img = "";
|
||||||
|
string picChange = jsonObj[0]["meta"]["picChange"].ToString();
|
||||||
|
|
||||||
|
if (picChange == "Y")
|
||||||
|
{
|
||||||
|
base64Img = jsonObj[0]["output"]["image"].ToString();
|
||||||
|
objUser.pic_image = globalClass.Base64ToImage(base64Img);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (objUser.updateData())
|
||||||
|
{
|
||||||
|
if (pass != "")
|
||||||
|
{
|
||||||
|
autoExecSQL objPass = new autoExecSQL(string.Format("update users set user_pwd = '{0}' where user_uid = '{1}' ", pass, objAuth.user_uid));
|
||||||
|
}
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0004";
|
||||||
|
objRet.message = objUser.update_result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0005";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result
|
||||||
|
{
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,237 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="userData" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class userData : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objAuth.user_perm != "A" && objAuth.user_perm != "P")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0002";
|
||||||
|
objRet.message = "權限不足,無法使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string method = (context.Request["method"] == null) ? "" : context.Request["method"].ToString();
|
||||||
|
string type = (context.Request["type"] == null) ? "" : context.Request["type"].ToString();
|
||||||
|
string elab_select = (context.Request["elab_select"] == null) ? "" : context.Request["elab_select"].ToString();
|
||||||
|
string sys_name = (context.Request["sys_name"] == null) ? "" : context.Request["sys_name"].ToString();
|
||||||
|
string sys_id = (context.Request["sys_id"] == null) ? "" : context.Request["sys_id"].ToString();
|
||||||
|
string sys_email = (context.Request["sys_email"] == null) ? "" : context.Request["sys_email"].ToString();
|
||||||
|
string sys_pwd = (context.Request["sys_pwd"] == null) ? "" : context.Request["sys_pwd"].ToString();
|
||||||
|
string user_perm = (context.Request["user_perm"] == null) ? "" : context.Request["user_perm"].ToString();
|
||||||
|
string user_uid = (context.Request["uid"] == null) ? "" : context.Request["uid"].ToString();
|
||||||
|
|
||||||
|
autoBindDataTable userSQL;
|
||||||
|
userdata userObj;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (method == "")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0999";
|
||||||
|
objRet.message = "沒有Method,無法使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "delete") {
|
||||||
|
string disableSQL = string.Format("update users set user_onjob = 'N' where user_uid = '{0}'", user_uid);
|
||||||
|
|
||||||
|
autoExecSQL delSQL = new autoExecSQL(disableSQL);
|
||||||
|
|
||||||
|
if (delSQL.effectDataCount > 0)
|
||||||
|
{
|
||||||
|
objRet.ret = "yes";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.message = "無任何資料被刪除!";
|
||||||
|
}
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "edit") {
|
||||||
|
userObj = new userdata(user_uid);
|
||||||
|
|
||||||
|
userObj.user_type = type;
|
||||||
|
|
||||||
|
if (sys_pwd != "") {
|
||||||
|
userObj.user_pwd = sys_pwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "Y") {
|
||||||
|
userObj.user_email = sys_email;
|
||||||
|
}
|
||||||
|
|
||||||
|
userObj.user_perm = user_perm;
|
||||||
|
|
||||||
|
try {
|
||||||
|
userObj.updateData();
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.data = userObj;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0099";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "get") {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userObj = new userdata(user_uid);
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.data = userObj;
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0044";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method == "add") {
|
||||||
|
if (type == "N")
|
||||||
|
{
|
||||||
|
userSQL = new autoBindDataTable(string.Format("select * from users where user_id = '{0}'", elab_select));
|
||||||
|
|
||||||
|
if (userSQL.dataRows.Count > 0)
|
||||||
|
{
|
||||||
|
if (userSQL.dataRows[0]["user_onjob"].ToString() == "Y")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0010";
|
||||||
|
objRet.message = "此帳號已經存在! ";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userObj = new userdata(userSQL.dataRows[0]["user_uid"].ToString());
|
||||||
|
userObj.user_onjob = "Y";
|
||||||
|
userObj.user_type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
|
||||||
|
autoBindElab elabObj = new autoBindElab(string.Format("select * from new_userdata where onjob = 0 and userid = '{0}'", elab_select));
|
||||||
|
|
||||||
|
if (elabObj.dataRows.Count == 0) {
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0011";
|
||||||
|
objRet.message = "E白板無此帳號! ";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
userObj = new userdata();
|
||||||
|
userObj.user_id = elab_select;
|
||||||
|
userObj.user_onjob = "Y";
|
||||||
|
userObj.user_type = type;
|
||||||
|
userObj.user_name = elabObj.dataRows[0]["username"].ToString();
|
||||||
|
userObj.user_email = elabObj.dataRows[0]["mail"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
userSQL = new autoBindDataTable(string.Format("select * from users where user_id = '{0}'", sys_id));
|
||||||
|
|
||||||
|
if (userSQL.dataRows.Count > 0)
|
||||||
|
{
|
||||||
|
if (userSQL.dataRows[0]["user_onjob"].ToString() == "Y")
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0010";
|
||||||
|
objRet.message = "此帳號已經存在! ";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userObj = new userdata(userSQL.dataRows[0]["user_uid"].ToString());
|
||||||
|
userObj.user_onjob = "Y";
|
||||||
|
userObj.user_type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
userObj = new userdata();
|
||||||
|
userObj.user_id = sys_id;
|
||||||
|
userObj.user_onjob = "Y";
|
||||||
|
userObj.user_name = sys_name;
|
||||||
|
userObj.user_email = sys_email;
|
||||||
|
userObj.user_pwd = sys_pwd;
|
||||||
|
userObj.user_type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
userObj.user_perm = user_perm;
|
||||||
|
|
||||||
|
try {
|
||||||
|
userObj.updateData();
|
||||||
|
objRet.ret = "yes";
|
||||||
|
objRet.data = userObj;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0099";
|
||||||
|
objRet.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public userdata data = new userdata();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
<%@ WebHandler Language="C#" Class="usersList" %>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization.Json;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Web.Services.Protocols;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public class usersList : IHttpHandler, IReadOnlySessionState {
|
||||||
|
|
||||||
|
public void ProcessRequest (HttpContext context) {
|
||||||
|
result objRet = new result();
|
||||||
|
DataContractJsonSerializer json = new DataContractJsonSerializer(objRet.GetType());
|
||||||
|
context.Response.ContentType = "application/json;charset=utf-8";
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
authPermission objAuth = new authPermission();
|
||||||
|
|
||||||
|
if (!objAuth.isLogin())
|
||||||
|
{
|
||||||
|
objRet.ret = "no";
|
||||||
|
objRet.err_code = "0001";
|
||||||
|
objRet.message = "尚未登入,請登入後使用";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (objAuth.user_perm != "A" && objAuth.user_perm != "P")
|
||||||
|
//{
|
||||||
|
// objRet.ret = "no";
|
||||||
|
// objRet.err_code = "0002";
|
||||||
|
// objRet.message = "權限不足,無法使用";
|
||||||
|
// json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
autoBindDataTable userSQL = new autoBindDataTable("select * from users where user_onjob = 'Y' and user_ishidden = 'N'");
|
||||||
|
|
||||||
|
foreach (DataRow tmpRow in userSQL.dataRows)
|
||||||
|
{
|
||||||
|
userdata objUser = new userdata(tmpRow["user_uid"].ToString());
|
||||||
|
|
||||||
|
objRet.userlist.Add(objUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
objRet.ret = "yes";
|
||||||
|
json.WriteObject(context.Response.OutputStream, objRet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class result {
|
||||||
|
public string ret = "no";
|
||||||
|
public string err_code = "0000";
|
||||||
|
public string message = "";
|
||||||
|
public List<userdata> userlist = new List<userdata>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReusable {
|
||||||
|
get {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
|
|
@ -0,0 +1,517 @@
|
||||||
|
{
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "1",
|
||||||
|
"name": "Tiger Nixon",
|
||||||
|
"position": "System Architect",
|
||||||
|
"salary": "$320,800",
|
||||||
|
"start_date": "2011/04/25",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "5421"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "2",
|
||||||
|
"name": "Garrett Winters",
|
||||||
|
"position": "Accountant",
|
||||||
|
"salary": "$170,750",
|
||||||
|
"start_date": "2011/07/25",
|
||||||
|
"office": "Tokyo",
|
||||||
|
"extn": "8422"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3",
|
||||||
|
"name": "Ashton Cox",
|
||||||
|
"position": "Junior Technical Author",
|
||||||
|
"salary": "$86,000",
|
||||||
|
"start_date": "2009/01/12",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "1562"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "4",
|
||||||
|
"name": "Cedric Kelly",
|
||||||
|
"position": "Senior Javascript Developer",
|
||||||
|
"salary": "$433,060",
|
||||||
|
"start_date": "2012/03/29",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "6224"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5",
|
||||||
|
"name": "Airi Satou",
|
||||||
|
"position": "Accountant",
|
||||||
|
"salary": "$162,700",
|
||||||
|
"start_date": "2008/11/28",
|
||||||
|
"office": "Tokyo",
|
||||||
|
"extn": "5407"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6",
|
||||||
|
"name": "Brielle Williamson",
|
||||||
|
"position": "Integration Specialist",
|
||||||
|
"salary": "$372,000",
|
||||||
|
"start_date": "2012/12/02",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "4804"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7",
|
||||||
|
"name": "Herrod Chandler",
|
||||||
|
"position": "Sales Assistant",
|
||||||
|
"salary": "$137,500",
|
||||||
|
"start_date": "2012/08/06",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "9608"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8",
|
||||||
|
"name": "Rhona Davidson",
|
||||||
|
"position": "Integration Specialist",
|
||||||
|
"salary": "$327,900",
|
||||||
|
"start_date": "2010/10/14",
|
||||||
|
"office": "Tokyo",
|
||||||
|
"extn": "6200"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "9",
|
||||||
|
"name": "Colleen Hurst",
|
||||||
|
"position": "Javascript Developer",
|
||||||
|
"salary": "$205,500",
|
||||||
|
"start_date": "2009/09/15",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "2360"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "10",
|
||||||
|
"name": "Sonya Frost",
|
||||||
|
"position": "Software Engineer",
|
||||||
|
"salary": "$103,600",
|
||||||
|
"start_date": "2008/12/13",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "1667"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "11",
|
||||||
|
"name": "Jena Gaines",
|
||||||
|
"position": "Office Manager",
|
||||||
|
"salary": "$90,560",
|
||||||
|
"start_date": "2008/12/19",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "3814"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "12",
|
||||||
|
"name": "Quinn Flynn",
|
||||||
|
"position": "Support Lead",
|
||||||
|
"salary": "$342,000",
|
||||||
|
"start_date": "2013/03/03",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "9497"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "13",
|
||||||
|
"name": "Charde Marshall",
|
||||||
|
"position": "Regional Director",
|
||||||
|
"salary": "$470,600",
|
||||||
|
"start_date": "2008/10/16",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "6741"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "14",
|
||||||
|
"name": "Haley Kennedy",
|
||||||
|
"position": "Senior Marketing Designer",
|
||||||
|
"salary": "$313,500",
|
||||||
|
"start_date": "2012/12/18",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "3597"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "15",
|
||||||
|
"name": "Tatyana Fitzpatrick",
|
||||||
|
"position": "Regional Director",
|
||||||
|
"salary": "$385,750",
|
||||||
|
"start_date": "2010/03/17",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "1965"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "16",
|
||||||
|
"name": "Michael Silva",
|
||||||
|
"position": "Marketing Designer",
|
||||||
|
"salary": "$198,500",
|
||||||
|
"start_date": "2012/11/27",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "1581"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "17",
|
||||||
|
"name": "Paul Byrd",
|
||||||
|
"position": "Chief Financial Officer (CFO)",
|
||||||
|
"salary": "$725,000",
|
||||||
|
"start_date": "2010/06/09",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "3059"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "18",
|
||||||
|
"name": "Gloria Little",
|
||||||
|
"position": "Systems Administrator",
|
||||||
|
"salary": "$237,500",
|
||||||
|
"start_date": "2009/04/10",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "1721"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "19",
|
||||||
|
"name": "Bradley Greer",
|
||||||
|
"position": "Software Engineer",
|
||||||
|
"salary": "$132,000",
|
||||||
|
"start_date": "2012/10/13",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "2558"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "20",
|
||||||
|
"name": "Dai Rios",
|
||||||
|
"position": "Personnel Lead",
|
||||||
|
"salary": "$217,500",
|
||||||
|
"start_date": "2012/09/26",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "2290"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "21",
|
||||||
|
"name": "Jenette Caldwell",
|
||||||
|
"position": "Development Lead",
|
||||||
|
"salary": "$345,000",
|
||||||
|
"start_date": "2011/09/03",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "1937"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "22",
|
||||||
|
"name": "Yuri Berry",
|
||||||
|
"position": "Chief Marketing Officer (CMO)",
|
||||||
|
"salary": "$675,000",
|
||||||
|
"start_date": "2009/06/25",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "6154"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "23",
|
||||||
|
"name": "Caesar Vance",
|
||||||
|
"position": "Pre-Sales Support",
|
||||||
|
"salary": "$106,450",
|
||||||
|
"start_date": "2011/12/12",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "8330"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "24",
|
||||||
|
"name": "Doris Wilder",
|
||||||
|
"position": "Sales Assistant",
|
||||||
|
"salary": "$85,600",
|
||||||
|
"start_date": "2010/09/20",
|
||||||
|
"office": "Sidney",
|
||||||
|
"extn": "3023"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "25",
|
||||||
|
"name": "Angelica Ramos",
|
||||||
|
"position": "Chief Executive Officer (CEO)",
|
||||||
|
"salary": "$1,200,000",
|
||||||
|
"start_date": "2009/10/09",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "5797"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "26",
|
||||||
|
"name": "Gavin Joyce",
|
||||||
|
"position": "Developer",
|
||||||
|
"salary": "$92,575",
|
||||||
|
"start_date": "2010/12/22",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "8822"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "27",
|
||||||
|
"name": "Jennifer Chang",
|
||||||
|
"position": "Regional Director",
|
||||||
|
"salary": "$357,650",
|
||||||
|
"start_date": "2010/11/14",
|
||||||
|
"office": "Singapore",
|
||||||
|
"extn": "9239"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "28",
|
||||||
|
"name": "Brenden Wagner",
|
||||||
|
"position": "Software Engineer",
|
||||||
|
"salary": "$206,850",
|
||||||
|
"start_date": "2011/06/07",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "1314"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "29",
|
||||||
|
"name": "Fiona Green",
|
||||||
|
"position": "Chief Operating Officer (COO)",
|
||||||
|
"salary": "$850,000",
|
||||||
|
"start_date": "2010/03/11",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "2947"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "30",
|
||||||
|
"name": "Shou Itou",
|
||||||
|
"position": "Regional Marketing",
|
||||||
|
"salary": "$163,000",
|
||||||
|
"start_date": "2011/08/14",
|
||||||
|
"office": "Tokyo",
|
||||||
|
"extn": "8899"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "31",
|
||||||
|
"name": "Michelle House",
|
||||||
|
"position": "Integration Specialist",
|
||||||
|
"salary": "$95,400",
|
||||||
|
"start_date": "2011/06/02",
|
||||||
|
"office": "Sidney",
|
||||||
|
"extn": "2769"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "32",
|
||||||
|
"name": "Suki Burks",
|
||||||
|
"position": "Developer",
|
||||||
|
"salary": "$114,500",
|
||||||
|
"start_date": "2009/10/22",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "6832"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "33",
|
||||||
|
"name": "Prescott Bartlett",
|
||||||
|
"position": "Technical Author",
|
||||||
|
"salary": "$145,000",
|
||||||
|
"start_date": "2011/05/07",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "3606"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "34",
|
||||||
|
"name": "Gavin Cortez",
|
||||||
|
"position": "Team Leader",
|
||||||
|
"salary": "$235,500",
|
||||||
|
"start_date": "2008/10/26",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "2860"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "35",
|
||||||
|
"name": "Martena Mccray",
|
||||||
|
"position": "Post-Sales support",
|
||||||
|
"salary": "$324,050",
|
||||||
|
"start_date": "2011/03/09",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "8240"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "36",
|
||||||
|
"name": "Unity Butler",
|
||||||
|
"position": "Marketing Designer",
|
||||||
|
"salary": "$85,675",
|
||||||
|
"start_date": "2009/12/09",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "5384"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "37",
|
||||||
|
"name": "Howard Hatfield",
|
||||||
|
"position": "Office Manager",
|
||||||
|
"salary": "$164,500",
|
||||||
|
"start_date": "2008/12/16",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "7031"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "38",
|
||||||
|
"name": "Hope Fuentes",
|
||||||
|
"position": "Secretary",
|
||||||
|
"salary": "$109,850",
|
||||||
|
"start_date": "2010/02/12",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "6318"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "39",
|
||||||
|
"name": "Vivian Harrell",
|
||||||
|
"position": "Financial Controller",
|
||||||
|
"salary": "$452,500",
|
||||||
|
"start_date": "2009/02/14",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "9422"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "40",
|
||||||
|
"name": "Timothy Mooney",
|
||||||
|
"position": "Office Manager",
|
||||||
|
"salary": "$136,200",
|
||||||
|
"start_date": "2008/12/11",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "7580"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "41",
|
||||||
|
"name": "Jackson Bradshaw",
|
||||||
|
"position": "Director",
|
||||||
|
"salary": "$645,750",
|
||||||
|
"start_date": "2008/09/26",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "1042"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "42",
|
||||||
|
"name": "Olivia Liang",
|
||||||
|
"position": "Support Engineer",
|
||||||
|
"salary": "$234,500",
|
||||||
|
"start_date": "2011/02/03",
|
||||||
|
"office": "Singapore",
|
||||||
|
"extn": "2120"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "43",
|
||||||
|
"name": "Bruno Nash",
|
||||||
|
"position": "Software Engineer",
|
||||||
|
"salary": "$163,500",
|
||||||
|
"start_date": "2011/05/03",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "6222"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "44",
|
||||||
|
"name": "Sakura Yamamoto",
|
||||||
|
"position": "Support Engineer",
|
||||||
|
"salary": "$139,575",
|
||||||
|
"start_date": "2009/08/19",
|
||||||
|
"office": "Tokyo",
|
||||||
|
"extn": "9383"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "45",
|
||||||
|
"name": "Thor Walton",
|
||||||
|
"position": "Developer",
|
||||||
|
"salary": "$98,540",
|
||||||
|
"start_date": "2013/08/11",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "8327"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "46",
|
||||||
|
"name": "Finn Camacho",
|
||||||
|
"position": "Support Engineer",
|
||||||
|
"salary": "$87,500",
|
||||||
|
"start_date": "2009/07/07",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "2927"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "47",
|
||||||
|
"name": "Serge Baldwin",
|
||||||
|
"position": "Data Coordinator",
|
||||||
|
"salary": "$138,575",
|
||||||
|
"start_date": "2012/04/09",
|
||||||
|
"office": "Singapore",
|
||||||
|
"extn": "8352"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "48",
|
||||||
|
"name": "Zenaida Frank",
|
||||||
|
"position": "Software Engineer",
|
||||||
|
"salary": "$125,250",
|
||||||
|
"start_date": "2010/01/04",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "7439"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "49",
|
||||||
|
"name": "Zorita Serrano",
|
||||||
|
"position": "Software Engineer",
|
||||||
|
"salary": "$115,000",
|
||||||
|
"start_date": "2012/06/01",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "4389"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "50",
|
||||||
|
"name": "Jennifer Acosta",
|
||||||
|
"position": "Junior Javascript Developer",
|
||||||
|
"salary": "$75,650",
|
||||||
|
"start_date": "2013/02/01",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "3431"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "51",
|
||||||
|
"name": "Cara Stevens",
|
||||||
|
"position": "Sales Assistant",
|
||||||
|
"salary": "$145,600",
|
||||||
|
"start_date": "2011/12/06",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "3990"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "52",
|
||||||
|
"name": "Hermione Butler",
|
||||||
|
"position": "Regional Director",
|
||||||
|
"salary": "$356,250",
|
||||||
|
"start_date": "2011/03/21",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "1016"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "53",
|
||||||
|
"name": "Lael Greer",
|
||||||
|
"position": "Systems Administrator",
|
||||||
|
"salary": "$103,500",
|
||||||
|
"start_date": "2009/02/27",
|
||||||
|
"office": "London",
|
||||||
|
"extn": "6733"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "54",
|
||||||
|
"name": "Jonas Alexander",
|
||||||
|
"position": "Developer",
|
||||||
|
"salary": "$86,500",
|
||||||
|
"start_date": "2010/07/14",
|
||||||
|
"office": "San Francisco",
|
||||||
|
"extn": "8196"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "55",
|
||||||
|
"name": "Shad Decker",
|
||||||
|
"position": "Regional Director",
|
||||||
|
"salary": "$183,000",
|
||||||
|
"start_date": "2008/11/13",
|
||||||
|
"office": "Edinburgh",
|
||||||
|
"extn": "6373"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "56",
|
||||||
|
"name": "Michael Bruce",
|
||||||
|
"position": "Javascript Developer",
|
||||||
|
"salary": "$183,000",
|
||||||
|
"start_date": "2011/06/27",
|
||||||
|
"office": "Singapore",
|
||||||
|
"extn": "5384"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "57",
|
||||||
|
"name": "Donna Snider",
|
||||||
|
"position": "Customer Support",
|
||||||
|
"salary": "$112,000",
|
||||||
|
"start_date": "2011/01/25",
|
||||||
|
"office": "New York",
|
||||||
|
"extn": "4226"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
["Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Åland","Azerbaijan","Bosnia and Herzegovina","Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Saint Barthélemy","Bermuda","Brunei","Bolivia","Bonaire","Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos [Keeling] Islands","Congo","Central African Republic","Republic of the Congo","Switzerland","Ivory Coast","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba","Cape Verde","Curacao","Christmas Island","Cyprus","Czechia","Germany","Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji","Falkland Islands","Micronesia","Faroe Islands","France","Gabon","United Kingdom","Grenada","Georgia","French Guiana","Guernsey","Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala","Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","Isle of Man","India","British Indian Ocean Territory","Iraq","Iran","Iceland","Italy","Jersey","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","North Korea","South Korea","Kuwait","Cayman Islands","Kazakhstan","Laos","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania","Luxembourg","Latvia","Libya","Morocco","Monaco","Moldova","Montenegro","Saint Martin","Madagascar","Marshall Islands","Macedonia","Mali","Myanmar [Burma]","Mongolia","Macao","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua","Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestine","Portugal","Palau","Paraguay","Qatar","Réunion","Romania","Serbia","Russia","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname","South Sudan","São Tomé and Príncipe","El Salvador","Sint Maarten","Syria","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand","Tajikistan","Tokelau","East Timor","Turkmenistan","Tunisia","Tonga","Turkey","Trinidad and Tobago","Tuvalu","Taiwan","Tanzania","Ukraine","Uganda","U.S. Minor Outlying Islands","United States","Uruguay","Uzbekistan","Vatican City","Saint Vincent and the Grenadines","Venezuela","British Virgin Islands","U.S. Virgin Islands","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Kosovo","Yemen","Mayotte","South Africa","Zambia","Zimbabwe"]
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"title": "Redesign website",
|
||||||
|
"start": "2019-03-01",
|
||||||
|
"textColor": "rgb(52, 108, 176)",
|
||||||
|
"backgroundColor": "rgba(52, 108, 176, .12)",
|
||||||
|
"borderColor": "rgb(52, 108, 176)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Write new content",
|
||||||
|
"start": "2019-03-07",
|
||||||
|
"end": "2019-03-10",
|
||||||
|
"textColor": "rgb(0, 162, 138)",
|
||||||
|
"backgroundColor": "rgba(0, 162, 138, .12)",
|
||||||
|
"borderColor": "rgb(0, 162, 138)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 999,
|
||||||
|
"title": "Apply new styles",
|
||||||
|
"start": "2019-03-09T16:00:00",
|
||||||
|
"textColor": "rgb(95, 75, 139)",
|
||||||
|
"backgroundColor": "rgba(95, 75, 139, .12)",
|
||||||
|
"borderColor": "rgb(95, 75, 139)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 999,
|
||||||
|
"title": "Review",
|
||||||
|
"start": "2019-03-16T16:00:00",
|
||||||
|
"textColor": "rgb(0, 162, 138)",
|
||||||
|
"backgroundColor": "rgba(0, 162, 138, .12)",
|
||||||
|
"borderColor": "rgb(0, 162, 138)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Conference",
|
||||||
|
"start": "2019-03-11",
|
||||||
|
"end": "2019-03-13",
|
||||||
|
"textColor": "rgb(1, 121, 168)",
|
||||||
|
"backgroundColor": "rgba(1, 121, 168, .12)",
|
||||||
|
"borderColor": "rgb(1, 121, 168)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Meeting",
|
||||||
|
"start": "2019-03-12T10:30:00",
|
||||||
|
"end": "2019-03-12T12:30:00",
|
||||||
|
"textColor": "rgb(249, 172, 47)",
|
||||||
|
"backgroundColor": "rgba(249, 172, 47, .12)",
|
||||||
|
"borderColor": "rgb(249, 172, 47)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Deploy",
|
||||||
|
"start": "2019-03-12T12:00:00",
|
||||||
|
"textColor": "rgb(0, 162, 138)",
|
||||||
|
"backgroundColor": "rgba(0, 162, 138, .12)",
|
||||||
|
"borderColor": "rgb(0, 162, 138)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Meeting",
|
||||||
|
"start": "2019-03-25T14:30:00",
|
||||||
|
"textColor": "rgb(249, 172, 47)",
|
||||||
|
"backgroundColor": "rgba(249, 172, 47, .12)",
|
||||||
|
"borderColor": "rgb(249, 172, 47)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Go live!",
|
||||||
|
"start": "2019-03-30T07:00:00",
|
||||||
|
"textColor": "rgb(183, 107, 163)",
|
||||||
|
"backgroundColor": "rgba(183, 107, 163, .12)",
|
||||||
|
"borderColor": "rgb(183, 107, 163)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Click for Project",
|
||||||
|
"url": "page-project.html",
|
||||||
|
"start": "2019-03-28",
|
||||||
|
"textColor": "rgb(95, 75, 139)",
|
||||||
|
"backgroundColor": "rgba(95, 75, 139, .12)",
|
||||||
|
"borderColor": "rgb(95, 75, 139)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,452 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1961",
|
||||||
|
"value": "West Side Story",
|
||||||
|
"tokens": [
|
||||||
|
"West",
|
||||||
|
"Side",
|
||||||
|
"Story"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1962",
|
||||||
|
"value": "Lawrence of Arabia",
|
||||||
|
"tokens": [
|
||||||
|
"Lawrence",
|
||||||
|
"of",
|
||||||
|
"Arabia"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1963",
|
||||||
|
"value": "Tom Jones",
|
||||||
|
"tokens": [
|
||||||
|
"Tom",
|
||||||
|
"Jones"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1964",
|
||||||
|
"value": "My Fair Lady",
|
||||||
|
"tokens": [
|
||||||
|
"My",
|
||||||
|
"Fair",
|
||||||
|
"Lady"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1965",
|
||||||
|
"value": "The Sound of Music",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Sound",
|
||||||
|
"of",
|
||||||
|
"Music"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1966",
|
||||||
|
"value": "A Man for All Seasons",
|
||||||
|
"tokens": [
|
||||||
|
"A",
|
||||||
|
"Man",
|
||||||
|
"for",
|
||||||
|
"All",
|
||||||
|
"Seasons"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1967",
|
||||||
|
"value": "In the Heat of the Night",
|
||||||
|
"tokens": [
|
||||||
|
"In",
|
||||||
|
"the",
|
||||||
|
"Heat",
|
||||||
|
"of",
|
||||||
|
"the",
|
||||||
|
"Night"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1968",
|
||||||
|
"value": "Oliver!",
|
||||||
|
"tokens": [
|
||||||
|
"Oliver!"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1969",
|
||||||
|
"value": "Midnight Cowboy",
|
||||||
|
"tokens": [
|
||||||
|
"Midnight",
|
||||||
|
"Cowboy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1970",
|
||||||
|
"value": "Patton",
|
||||||
|
"tokens": [
|
||||||
|
"Patton"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1971",
|
||||||
|
"value": "The French Connection",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"French",
|
||||||
|
"Connection"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1972",
|
||||||
|
"value": "The Godfather",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Godfather"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1973",
|
||||||
|
"value": "The Sting",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Sting"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1974",
|
||||||
|
"value": "The Godfather Part II",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Godfather",
|
||||||
|
"Part",
|
||||||
|
"II"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1975",
|
||||||
|
"value": "One Flew over the Cuckoo's Nest",
|
||||||
|
"tokens": [
|
||||||
|
"One",
|
||||||
|
"Flew",
|
||||||
|
"over",
|
||||||
|
"the",
|
||||||
|
"Cuckoo's",
|
||||||
|
"Nest"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1976",
|
||||||
|
"value": "Rocky",
|
||||||
|
"tokens": [
|
||||||
|
"Rocky"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1977",
|
||||||
|
"value": "Annie Hall",
|
||||||
|
"tokens": [
|
||||||
|
"Annie",
|
||||||
|
"Hall"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1978",
|
||||||
|
"value": "The Deer Hunter",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Deer",
|
||||||
|
"Hunter"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1979",
|
||||||
|
"value": "Kramer vs. Kramer",
|
||||||
|
"tokens": [
|
||||||
|
"Kramer",
|
||||||
|
"vs.",
|
||||||
|
"Kramer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1980",
|
||||||
|
"value": "Ordinary People",
|
||||||
|
"tokens": [
|
||||||
|
"Ordinary",
|
||||||
|
"People"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1981",
|
||||||
|
"value": "Chariots of Fire",
|
||||||
|
"tokens": [
|
||||||
|
"Chariots",
|
||||||
|
"of",
|
||||||
|
"Fire"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1982",
|
||||||
|
"value": "Gandhi",
|
||||||
|
"tokens": [
|
||||||
|
"Gandhi"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1983",
|
||||||
|
"value": "Terms of Endearment",
|
||||||
|
"tokens": [
|
||||||
|
"Terms",
|
||||||
|
"of",
|
||||||
|
"Endearment"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1984",
|
||||||
|
"value": "Amadeus",
|
||||||
|
"tokens": [
|
||||||
|
"Amadeus"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1985",
|
||||||
|
"value": "Out of Africa",
|
||||||
|
"tokens": [
|
||||||
|
"Out",
|
||||||
|
"of",
|
||||||
|
"Africa"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1986",
|
||||||
|
"value": "Platoon",
|
||||||
|
"tokens": [
|
||||||
|
"Platoon"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1987",
|
||||||
|
"value": "The Last Emperor",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Last",
|
||||||
|
"Emperor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1988",
|
||||||
|
"value": "Rain Man",
|
||||||
|
"tokens": [
|
||||||
|
"Rain",
|
||||||
|
"Man"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1989",
|
||||||
|
"value": "Driving Miss Daisy",
|
||||||
|
"tokens": [
|
||||||
|
"Driving",
|
||||||
|
"Miss",
|
||||||
|
"Daisy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1990",
|
||||||
|
"value": "Dances With Wolves",
|
||||||
|
"tokens": [
|
||||||
|
"Dances",
|
||||||
|
"With",
|
||||||
|
"Wolves"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1991",
|
||||||
|
"value": "The Silence of the Lambs",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Silence",
|
||||||
|
"of",
|
||||||
|
"the",
|
||||||
|
"Lambs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1992",
|
||||||
|
"value": "Unforgiven",
|
||||||
|
"tokens": [
|
||||||
|
"Unforgiven"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1993",
|
||||||
|
"value": "Schindler’s List",
|
||||||
|
"tokens": [
|
||||||
|
"Schindler’s",
|
||||||
|
"List"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1994",
|
||||||
|
"value": "Forrest Gump",
|
||||||
|
"tokens": [
|
||||||
|
"Forrest",
|
||||||
|
"Gump"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1995",
|
||||||
|
"value": "Braveheart",
|
||||||
|
"tokens": [
|
||||||
|
"Braveheart"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1996",
|
||||||
|
"value": "The English Patient",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"English",
|
||||||
|
"Patient"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1997",
|
||||||
|
"value": "Titanic",
|
||||||
|
"tokens": [
|
||||||
|
"Titanic"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1998",
|
||||||
|
"value": "Shakespeare in Love",
|
||||||
|
"tokens": [
|
||||||
|
"Shakespeare",
|
||||||
|
"in",
|
||||||
|
"Love"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1999",
|
||||||
|
"value": "American Beauty",
|
||||||
|
"tokens": [
|
||||||
|
"American",
|
||||||
|
"Beauty"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2000",
|
||||||
|
"value": "Gladiator",
|
||||||
|
"tokens": [
|
||||||
|
"Gladiator"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2001",
|
||||||
|
"value": "A Beautiful Mind",
|
||||||
|
"tokens": [
|
||||||
|
"A",
|
||||||
|
"Beautiful",
|
||||||
|
"Mind"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2002",
|
||||||
|
"value": "Chicago",
|
||||||
|
"tokens": [
|
||||||
|
"Chicago"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2003",
|
||||||
|
"value": "The Lord of the Rings: The Return of the King",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Lord",
|
||||||
|
"of",
|
||||||
|
"the",
|
||||||
|
"Rings:",
|
||||||
|
"The",
|
||||||
|
"Return",
|
||||||
|
"of",
|
||||||
|
"the",
|
||||||
|
"King"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2004",
|
||||||
|
"value": "Million Dollar Baby",
|
||||||
|
"tokens": [
|
||||||
|
"Million",
|
||||||
|
"Dollar",
|
||||||
|
"Baby"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2005",
|
||||||
|
"value": "Crash",
|
||||||
|
"tokens": [
|
||||||
|
"Crash"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2006",
|
||||||
|
"value": "The Departed",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Departed"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2007",
|
||||||
|
"value": "No Country for Old Men",
|
||||||
|
"tokens": [
|
||||||
|
"No",
|
||||||
|
"Country",
|
||||||
|
"for",
|
||||||
|
"Old",
|
||||||
|
"Men"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2008",
|
||||||
|
"value": "Slumdog Millionaire",
|
||||||
|
"tokens": [
|
||||||
|
"Slumdog",
|
||||||
|
"Millionaire"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2009",
|
||||||
|
"value": "The Hurt Locker",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Hurt",
|
||||||
|
"Locker"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2010",
|
||||||
|
"value": "The King's Speech",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"King's",
|
||||||
|
"Speech"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2011",
|
||||||
|
"value": "The Artist",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Artist"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "2012",
|
||||||
|
"value": "Argo",
|
||||||
|
"tokens": [
|
||||||
|
"Argo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1929/1930",
|
||||||
|
"value": "All Quiet on the Western Front",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"Quiet",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Western",
|
||||||
|
"Front"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1949",
|
||||||
|
"value": "All the Kings Men",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"the",
|
||||||
|
"Kings",
|
||||||
|
"Men"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1947",
|
||||||
|
"value": "Gentleman's Agreement",
|
||||||
|
"tokens": [
|
||||||
|
"Gentleman's",
|
||||||
|
"Agreement"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1929/1930",
|
||||||
|
"value": "All Quiet on the Western Front",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"Quiet",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Western",
|
||||||
|
"Front"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1949",
|
||||||
|
"value": "All the Kings Men",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"the",
|
||||||
|
"Kings",
|
||||||
|
"Men"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1929/1930",
|
||||||
|
"value": "All Quiet on the Western Front",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"Quiet",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Western",
|
||||||
|
"Front"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1949",
|
||||||
|
"value": "All the Kings Men",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"the",
|
||||||
|
"Kings",
|
||||||
|
"Men"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1950",
|
||||||
|
"value": "All About Eve",
|
||||||
|
"tokens": [
|
||||||
|
"All",
|
||||||
|
"About",
|
||||||
|
"Eve"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1951",
|
||||||
|
"value": "An American in Paris",
|
||||||
|
"tokens": [
|
||||||
|
"An",
|
||||||
|
"American",
|
||||||
|
"in",
|
||||||
|
"Paris"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1960",
|
||||||
|
"value": "The Apartment",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Apartment"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1956",
|
||||||
|
"value": "Around the World in 80 Days",
|
||||||
|
"tokens": [
|
||||||
|
"Around",
|
||||||
|
"the",
|
||||||
|
"World",
|
||||||
|
"in",
|
||||||
|
"80",
|
||||||
|
"Days"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1928/1929",
|
||||||
|
"value": "The Broadway Melody",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Broadway",
|
||||||
|
"Melody"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1935",
|
||||||
|
"value": "Mutiny on the Bounty",
|
||||||
|
"tokens": [
|
||||||
|
"Mutiny",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Bounty"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1946",
|
||||||
|
"value": "The Best Years of Our Lives",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Best",
|
||||||
|
"Years",
|
||||||
|
"of",
|
||||||
|
"Our",
|
||||||
|
"Lives"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1957",
|
||||||
|
"value": "The Bridge on the River Kwai",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Bridge",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"River",
|
||||||
|
"Kwai"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1959",
|
||||||
|
"value": "Ben-Hur",
|
||||||
|
"tokens": [
|
||||||
|
"Ben-Hur"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1946",
|
||||||
|
"value": "The Best Years of Our Lives",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Best",
|
||||||
|
"Years",
|
||||||
|
"of",
|
||||||
|
"Our",
|
||||||
|
"Lives"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1959",
|
||||||
|
"value": "Ben-Hur",
|
||||||
|
"tokens": [
|
||||||
|
"Ben-Hur"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1959",
|
||||||
|
"value": "Ben-Hur",
|
||||||
|
"tokens": [
|
||||||
|
"Ben-Hur"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1959",
|
||||||
|
"value": "Ben-Hur",
|
||||||
|
"tokens": [
|
||||||
|
"Ben-Hur"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1959",
|
||||||
|
"value": "Ben-Hur",
|
||||||
|
"tokens": [
|
||||||
|
"Ben-Hur"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1959",
|
||||||
|
"value": "Ben-Hur",
|
||||||
|
"tokens": [
|
||||||
|
"Ben-Hur"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1946",
|
||||||
|
"value": "The Best Years of Our Lives",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Best",
|
||||||
|
"Years",
|
||||||
|
"of",
|
||||||
|
"Our",
|
||||||
|
"Lives"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1946",
|
||||||
|
"value": "The Best Years of Our Lives",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Best",
|
||||||
|
"Years",
|
||||||
|
"of",
|
||||||
|
"Our",
|
||||||
|
"Lives"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1935",
|
||||||
|
"value": "Mutiny on the Bounty",
|
||||||
|
"tokens": [
|
||||||
|
"Mutiny",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Bounty"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1935",
|
||||||
|
"value": "Mutiny on the Bounty",
|
||||||
|
"tokens": [
|
||||||
|
"Mutiny",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Bounty"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1935",
|
||||||
|
"value": "Mutiny on the Bounty",
|
||||||
|
"tokens": [
|
||||||
|
"Mutiny",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Bounty"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1935",
|
||||||
|
"value": "Mutiny on the Bounty",
|
||||||
|
"tokens": [
|
||||||
|
"Mutiny",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Bounty"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1935",
|
||||||
|
"value": "Mutiny on the Bounty",
|
||||||
|
"tokens": [
|
||||||
|
"Mutiny",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"Bounty"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1928/1929",
|
||||||
|
"value": "The Broadway Melody",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Broadway",
|
||||||
|
"Melody"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"year": "1957",
|
||||||
|
"value": "The Bridge on the River Kwai",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Bridge",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"River",
|
||||||
|
"Kwai"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1957",
|
||||||
|
"value": "The Bridge on the River Kwai",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Bridge",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"River",
|
||||||
|
"Kwai"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1957",
|
||||||
|
"value": "The Bridge on the River Kwai",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Bridge",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"River",
|
||||||
|
"Kwai"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1957",
|
||||||
|
"value": "The Bridge on the River Kwai",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Bridge",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"River",
|
||||||
|
"Kwai"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1957",
|
||||||
|
"value": "The Bridge on the River Kwai",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Bridge",
|
||||||
|
"on",
|
||||||
|
"the",
|
||||||
|
"River",
|
||||||
|
"Kwai"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1928/1929",
|
||||||
|
"value": "The Broadway Melody",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Broadway",
|
||||||
|
"Melody"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"year": "1928/1929",
|
||||||
|
"value": "The Broadway Melody",
|
||||||
|
"tokens": [
|
||||||
|
"The",
|
||||||
|
"Broadway",
|
||||||
|
"Melody"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue