diff --git a/web/admin/follower/index.aspx.cs b/web/admin/follower/index.aspx.cs
index 9de0fed..592df7b 100644
--- a/web/admin/follower/index.aspx.cs
+++ b/web/admin/follower/index.aspx.cs
@@ -13,6 +13,7 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
+using System.Windows.Controls;
using System.Windows.Interop;
using static TreeView;
@@ -243,7 +244,7 @@ public partial class admin_follower_index : MyWeb.config
int selMonth = !string.IsNullOrEmpty(hid_print_month.Value) ? int.Parse(hid_print_month.Value) : 0;
int selSeason = !string.IsNullOrEmpty(hid_print_season.Value) ? int.Parse(hid_print_season.Value) : 0;
string selMode = !string.IsNullOrEmpty(hid_print_mode.Value) ? hid_print_mode.Value : "";
-
+
var qry = _db.followers.AsQueryable();
if (selYear > 0)
{
@@ -255,7 +256,7 @@ public partial class admin_follower_index : MyWeb.config
}
else if (selMode == "ss" && selSeason > 0)
{
- urlParams += "&season=" + selSeason;
+ urlParams += "&season=" + selSeason;
}
if (list.Count > 0)
@@ -266,17 +267,12 @@ public partial class admin_follower_index : MyWeb.config
hid_print_season.Value = selSeason.ToString();
hid_print_mode.Value = selMode;
- string script = $@"window.open('print.aspx?{urlParams}&mode={selMode}', '列印信眾資料');";
+ string script = $@"window.open('print.aspx?{urlParams}&mode={selMode}', '列印信眾資料', 'noopener,noreferrer');";
ScriptManager.RegisterStartupScript(this, GetType(), "ExecutePrint", script, true);
}
else
{
hid_err_msg.Value = "nodata";
- string script = $@"
- var win = window.open('', '列印信眾資料');
- if (win) win.close()";
-
- ScriptManager.RegisterStartupScript(this, GetType(), "CancelPrint", script, true);
}
}
}
@@ -357,7 +353,7 @@ public partial class admin_follower_index : MyWeb.config
qry = qry.Where(o => o.address.Contains(s_address.Value.Trim()));
_query += "地址:" + s_address.Value.Trim() + "\n";
}
-
+
// 電話/證號搜尋 (使用 search_keywords HEX 編碼)
if (!isStrNull(s_phone_idcode.Value) && GlobalVariables.UseSearchKeywords)
{
@@ -372,12 +368,14 @@ public partial class admin_follower_index : MyWeb.config
if (!isStrNull(s_birthday.Value) && isDate(s_birthday.Value))
{
- qry = qry.Where(o => o.birthday >= ValDate(s_birthday.Value));
+ var tmp_s_birthday = ValDate(s_birthday.Value);
+ qry = qry.Where(o => o.birthday >= tmp_s_birthday);
_query += "生日(起):" + s_birthday.Value.Trim() + "\n";
}
if (!isStrNull(s_birthday2.Value) && isDate(s_birthday2.Value))
{
- qry = qry.Where(o => o.birthday < Convert.ToDateTime(s_birthday2.Value).AddDays(1));
+ var tmp_s_birthday2 = Convert.ToDateTime(s_birthday2.Value).AddDays(1);
+ qry = qry.Where(o => o.birthday < tmp_s_birthday2);
_query += "生日(訖):" + s_birthday2.Value.Trim() + "\n";
}
qry = qry.OrderByDescending(o => o.num);
diff --git a/web/admin/follower/print.aspx.cs b/web/admin/follower/print.aspx.cs
index c4e7728..614623b 100644
--- a/web/admin/follower/print.aspx.cs
+++ b/web/admin/follower/print.aspx.cs
@@ -61,7 +61,8 @@ public partial class admin_follower_print_ : System.Web.UI.Page
if (!string.IsNullOrEmpty(Request["birthday2"]))
{
DateTime birthday2Param = Convert.ToDateTime(Request["birthday2"].Trim());
- qry = qry.Where(o => o.birthday < birthday2Param.AddDays(1));
+ var tmpBirthday2Param = birthday2Param.AddDays(1);
+ qry = qry.Where(o => o.birthday < tmpBirthday2Param);
_query += "生日(訖):" + birthday2Param.ToString("yyyy/MM/dd") + "\n";
}
// ❌ 錯誤寫法: _db.countries.Where(x => x.ID == Request["country"].ToString())
@@ -87,6 +88,18 @@ public partial class admin_follower_print_ : System.Web.UI.Page
_query += "國家:" + (_db.countries.Where(x => x.ID == country2Id).Select(x => x.name_zh).FirstOrDefault() ?? "") + "\n";
}
+ string phone_ipcode = Request["phone_idcode"]?.ToString();
+ if (!string.IsNullOrEmpty(phone_ipcode) && GlobalVariables.UseSearchKeywords)
+ {
+ MyWeb.encrypt encrypt = new MyWeb.encrypt();
+ string hexSearch = encrypt.ConvertToHex(phone_ipcode.Trim());
+ if (!string.IsNullOrEmpty(hexSearch))
+ {
+ qry = qry.Where(o => o.search_keywords != null && o.search_keywords.Contains(hexSearch));
+ _query += "電話/證號:" + phone_ipcode.Trim() + "\n";
+ }
+ }
+
//管理報表
if (!string.IsNullOrEmpty(Request["year"]))
{
diff --git a/web/admin/follower/reg.aspx b/web/admin/follower/reg.aspx
index 93d8e6e..0d21b38 100644
--- a/web/admin/follower/reg.aspx
+++ b/web/admin/follower/reg.aspx
@@ -1318,13 +1318,32 @@
$('.tab-pane,.edit_Click').removeClass('pe-none'); // 移除 pe-none 類,允許編輯
}
});
+
+ let isComposing = false;
+ const cellphoneInput = document.querySelector('[id$="cellphone"]');
+ if (cellphoneInput) {
+ cellphoneInput.addEventListener('compositionstart', () => {
+ isComposing = true;
+ });
+ cellphoneInput.addEventListener('compositionend', (e) => {
+ isComposing = false;
+ formatCellphone(e.target);
+ });
+ cellphoneInput.addEventListener('input', (e) => {
+ if (!isComposing) {
+ formatCellphone(e.target);
+ }
+ });
+ }
+
+