123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- $(function() {
- $(".filterSearch").change(function() {
- var cururl = window.location.href;
- var fliter = $(this).attr("name").toString();
- var fliterval = $(this).val();
- var separator = cururl.indexOf('?') !== -1 ? "&": "?";
- var re = new RegExp("([?&])");
- var urlarr;
- var newurl = "";
- if (cururl.indexOf(fliter) > 0) {
- urlarr = cururl.split(re);
- for (i = 0; i < urlarr.length; i++) {
- urlarr[i] = urlarr[i].indexOf(fliter) ? urlarr[i] : fliter + "=" + fliterval;
- urlarr[i] = urlarr[i].indexOf("Page") ? urlarr[i] : "Page=1";
- newurl = newurl + urlarr[i];
- }
- } else {
- newurl = cururl + separator + fliter + "=" + fliterval;
- }
- window.location.href = newurl;
- })
-
-
- $(".code").click(function(){
- var sltid=".code"+$(this).data("id")+"__panel";
- if ($(sltid).hasClass("showPanel"))
- {$(sltid).removeClass("showPanel").hide();}
- else
- {$(sltid).addClass("showPanel").show();}
- })
- })
- function chkboxall(t0,t1){
- ischk = t0.checked;
- for (var i=0;i<$("input[type=checkbox][name="+t1+"]").size();i++ ){ $("input[type=checkbox][name="+t1+"]").eq(i).attr("checked",ischk); }
- }
- function postchk(t){
- var $form = document.getElementById('form1'),
- chkact = parseInt(document.getElementById("chkact").value),
- ischk = false;
- for (var i=0;i<$form.elements.length;i++){
- if($form.elements[i].name=="chkbox" && $form.elements[i].checked == true){ischk = true;}
- }
- if(!ischk){alert('请至少选择一条数据');return false;}
- switch(t){
- case 1:
- switch(chkact){
- case 1:
- if(confirm('确认要设置所选状态为【显示】吗?'))$form.submit();
- break;
- case 0:
- if(confirm('确认要设置所选状态为【隐藏】吗?'))$form.submit();
- break;
- default:
- if(confirm('确认要删除吗?\n删除后不可恢复'))$form.submit();
- }
- break;
- case 2:
- switch(chkact){
- case 1:
- if(confirm('确认要设置所选状态为【正常】吗?'))$form.submit();
- break;
- case 0:
- if(confirm('确认要设置所选状态为【隐藏】吗?'))$form.submit();
- break;
- default:
- if(confirm('确认要删除吗?\n删除后不可恢复'))$form.submit();
- }
- break;
- case 3:
- switch(chkact){
- case 1:
- if(confirm('确认要设置所选状态为【已读】吗?'))$form.submit();
- break;
- case 0:
- if(confirm('确认要设置所选状态为【未读】吗?'))$form.submit();
- break;
- default:
- if(confirm('确认要删除吗?\n删除后不可恢复'))$form.submit();
- }
- break;
- default:
- return false;
- }
-
- return false;
- }
- function subform(){
- $("#form1").submit();
- }
- function subform2(){
- var p1=$("#em_password").val();
- var p2=$("#re_password").val();
- if(p1!==p2)
- {alert("密码与重复密码不一致!"); return false;}
- return true;
- }
- function flcountry(){
- var country=$("#Country").val();
- if(country==""||country==null)
- {location.href="customers.php";}
- else
- {location.href="?country="+escape(country);}
- }
- function flchanel(){
- var chanel=$("#Chanel").val();
- if(chanel==""||chanel==null)
- {location.href="customers.php";}
- else
- {location.href="?chanel="+escape(chanel);}
- }
- function flemployee(){
- var employee=$("#Employee").val();
- if(employee==""||employee==null)
- {location.href="customers.php";}
- else
- {location.href="?employee="+escape(employee);}
- }
- function fldeal(){
- var deal=$("#deal").val();
- if(deal==""||deal==null)
- {location.href="customers.php";}
- else
- {location.href="?deal="+escape(deal);}
- }
|