|
Server : Microsoft-IIS/10.0 System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586 User : jxgj ( 0) PHP Version : 7.0.33 Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server Directory : D:/tmp_aspnet/root/54f3ceba/6be944cd/ |
?#pragma checksum "D:\wwwroot\klbttc\wwwroot\control\footer.ascx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E869C311E2C181B9D1C3D54479A4B2CA7675D608"
#line 1 "D:\wwwroot\klbttc\wwwroot\control\footer.ascx.cs"
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class control_footer : System.Web.UI.UserControl
{
C mdb = new C();
DataSet mds = new DataSet();
public string linkHtml = "";//侧边栏牌照
public string layer, menustr1, menustr2, menustr3 = "";
public int mid = 0;
public string menutitle, menutitle1 = "";
public string textArr = "", linkArr = "";
public int vid, pid, menuid, cid = 0;
public string hidemids = "212,230";//栏目ID|文件名|分类ID 组合以","分隔
protected void Page_Load(object sender, EventArgs e)
{
////MyFunction.repeater(0, "link", "link5 = 116", " order by ISNULL(link6,9999),link4 desc", Rep_Link_116);//交谊链接
//MyFunction.repeater(0, "link", "link5 = 190 and link7 = 1", " order by ISNULL(link6,9999),link4 desc", Rep_QR_190);//二维码
//if (Request.Url.AbsolutePath == "/index.aspx") NewNotices();
////交谊链接
//linkHtml = BuilerLink();
}
/// <summary>
///
/// </summary>
/// <param name="mid"></param>
/// <returns></returns>
private string GetFooterMeun(int mids)
{
string menustr = "";
try
{
mds = mdb.GetDs(" SELECT MenuSys_1.MenuSys1 as title, MenuSys_2.*,'' as MenuSyssub FROM MenuSys AS MenuSys_2 INNER JOIN (MenuSys INNER JOIN MenuSys AS MenuSys_1 ON MenuSys.MenuSys3 = MenuSys_1.MenuSys0) ON MenuSys_2.MenuSys3 = MenuSys_1.MenuSys0 WHERE (((MenuSys.MenuSys0)=" + mids.ToString() + ") and (MenuSys_2.MenuSys2 <> N'classsys/') and (MenuSys_2.MenuSys11=0)) ORDER BY MenuSys_2.MenuSys4 asc,MenuSys_2.MenuSys3 desc; ");
if (mds.Tables.Count > 0)
{
if (mds.Tables[0].Rows.Count > 0)
{
menutitle = mds.Tables[0].Rows[0][0].ToString();
menuid = int.Parse(mds.Tables[0].Rows[0][4].ToString());
}
for (int i = 0; i < mds.Tables[0].Rows.Count; i++)
{
if (IsInIDS(hidemids, mds.Tables[0].Rows[i]["MenuSys0"].ToString()))
{
menustr += GetClassMenuByMid(hidemids, mds.Tables[0].Rows[i]["MenuSys0"].ToString());
}
else
{
string url = string.Empty;
if (!string.IsNullOrWhiteSpace(mds.Tables[0].Rows[i]["MenuSys15"].ToString()))
{
url = mds.Tables[0].Rows[i]["MenuSys15"].ToString() + ".aspx?ac=Left_Menulist&mid=" + mds.Tables[0].Rows[i]["MenuSys0"].ToString() + "&sid=" + mds.Tables[0].Rows[i]["MenuSyssub"].ToString() + "";
}
else
{
url = mds.Tables[0].Rows[i]["MenuSys9"].ToString() + ".aspx?ac=Left_Menulist&mid=" + mds.Tables[0].Rows[i]["MenuSys0"].ToString() + "&sid=" + mds.Tables[0].Rows[i]["MenuSyssub"].ToString() + "";
}
string ss = mds.Tables[0].Rows[i]["MenuSys1"].ToString().Length > 15 ? mds.Tables[0].Rows[i]["MenuSys1"].ToString().Substring(0, 15) + ".." : mds.Tables[0].Rows[i]["MenuSys1"].ToString();
if (mds.Tables[0].Rows[i]["MenuSys0"].ToString().Equals(mids))
{
menustr += "<a class=\"active\" title='" + mds.Tables[0].Rows[i]["MenuSys1"].ToString() + "' href=\"" + url + "\">" + ss + "</a>";
}
else
{
menustr += "<a title='" + mds.Tables[0].Rows[i]["MenuSys1"].ToString() + "' href=\"" + url + "\">" + ss + "</a>";
}
}
}
}
}
catch { }
return menustr;
}
/// <summary>
/// 最新通知
/// </summary>
private void NewNotices()
{
//textArr
var ds = mdb.GetDs("select top 6 news0,news1,news9,news7 from news where news9 = 24 order by news7 desc");
if (ds.Tables.Count > 0)
{
var table = ds.Tables[0];
if (table.Rows.Count > 0)
{
var textList = new List<string>();
var linkList = new List<string>();
for (int i = 0; i < table.Rows.Count; i++)
{
var txt = table.Rows[i]["news1"].ToString();
var dat = Convert.ToDateTime(table.Rows[i]["news7"].ToString()).ToString("yyyy-MM-dd");
textList.Add(string.Format("{0} ————— {1}", new C().LeftStr(txt, 60, "..."), dat));
linkList.Add(string.Format("newsshow.aspx?mid={0}&id={1}", table.Rows[i]["news9"].ToString(), table.Rows[i]["news0"].ToString()));
}
textArr = string.Join("','", textList);
linkArr = string.Join("','", linkList);
}
}
}
private bool IsInIDS(string hidemids, string p)
{
bool istf = false;
string[] hms;
hms = hidemids.Split(',');
for (int i = 0; i < hms.Length; i++)
{
if (hms[i].Split('|')[0] == p)
{
istf = true;
}
}
return istf;
}
private string GetClassMenuByMid(string hidemids, string p)
{
string revars = "";
string[] hms;
string[] hmssub;
hms = hidemids.Split(',');
for (int j = 0; j < hms.Length; j++)
{
hmssub = hms[j].Split('|');
if (hmssub[0] == p)
{
if (hmssub.Length > 2)
{
C mdb = new C();
DataSet mds = new DataSet();
mds = mdb.GetDs(" SELECT '" + hmssub[1] + "' as MenuSys9," + hmssub[0] + " as MenuSys0,ClassSys.ClassSys0 as MenuSyssub,ClassSys.ClassSys1 as MenuSys1 FROM ClassSys WHERE ClassSys4=" + hmssub[2] + " and ClassSys2=0 ORDER BY ClassSys3 asc,ClassSys0 asc ");
for (int i = 0; i < mds.Tables[0].Rows.Count; i++)
{
if (mds.Tables[0].Rows[i]["MenuSyssub"].ToString().Equals(cid.ToString()))
{
revars += " <a class=\"active\" href=\"" + mds.Tables[0].Rows[i]["MenuSys9"].ToString() + ".aspx?mid=" + mds.Tables[0].Rows[i]["MenuSys0"].ToString() + "&cid=" + mds.Tables[0].Rows[i]["MenuSyssub"].ToString() + "\">" + mds.Tables[0].Rows[i]["MenuSys1"].ToString() + "</a>";
}
else
{
revars += " <a href=\"" + mds.Tables[0].Rows[i]["MenuSys9"].ToString() + ".aspx?mid=" + mds.Tables[0].Rows[i]["MenuSys0"].ToString() + "&cid=" + mds.Tables[0].Rows[i]["MenuSyssub"].ToString() + "\">" + mds.Tables[0].Rows[i]["MenuSys1"].ToString() + "</a>";
}
}
}
}
}
return revars;
}
/// <summary>
/// 构建交谊链接
/// </summary>
/// <returns></returns>
private string BuilerLink()
{
StringBuilder builder = new StringBuilder();
var ds = mdb.GetDs("select * from link where link5 = 116 order by ISNULL(link6,9999),link4 desc;");
if (ds.Tables.Count > 0)
{
var table = ds.Tables[0];
var count = table.Rows.Count;
if (count > 0)
{
var foreachCount = count % 4 == 0 ? count / 4 : count / 4 + 1;
for (int c = 0; c < foreachCount; c++)
{
builder.AppendLine("<div class=\"swiper-slide\">");
builder.AppendLine("<div class=\"swiper_item\">");
builder.AppendLine("<ul>");
var maxcount = (c * 4 + 4) > count ? count : c * 4 + 4;
for (int i = c * 4; i < maxcount; i++)
{
builder.AppendLine("<li><a target=\"_blank\" href = \"" + table.Rows[i]["link3"].ToString() + "\">" + table.Rows[i]["link1"].ToString() + "</a></li>");
}
builder.AppendLine("</ul>");
builder.AppendLine("</div>");
builder.AppendLine("</div>");
}
}
}
return builder.ToString();
}
}
#line default
#line hidden