Explorar el Código

fleat: update system js

igb hace 3 semanas
padre
commit
4facc17fed
Se han modificado 3 ficheros con 57 adiciones y 2 borrados
  1. 1 1
      system/country.php
  2. 55 0
      system/js/js.js
  3. 1 1
      system/product_category.php

+ 1 - 1
system/country.php

@@ -540,7 +540,7 @@ $hrefstr = "?keys=$keys";
                             <option value="1">请选择</option>
                             <option value="-1">删除</option>
                         </select>
-                        <input type="button" value="执行" onClick="postchk(1)" class="btn1" />
+                        <input type="button" value="执行" onClick="postchk_new(1)" class="btn1" />
                         <input type="button" value="新增" onClick="location.href='?act=add'" class="btn1" />
                     </div>
                 </td>

+ 55 - 0
system/js/js.js

@@ -90,6 +90,61 @@ return false;
 }
 
 
+function postchk_new(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();
 }

+ 1 - 1
system/product_category.php

@@ -644,7 +644,7 @@ if ($act == 'edit' || $act == 'add') {
                                 <select id="chkact" name="chkact">
                                     <option value="-1">删除</option>
                                 </select>
-                                <input type="button" value="执行" onClick="postchk(1)" class="btn1" />
+                                <input type="button" value="执行" onClick="postchk_new(1)" class="btn1" />
                             </div>
                         </td>
                     </tr>