?
Path : /home/admin/public_html/modules/content/ |
Current File : /home/admin/public_html/modules/content/list_group.php |
<? session_start(); require_once('../../../config.php'); require_once('../../../libs/MySql.php'); $db=new MySql; function get_sub_cat($parent,$option){ global $user_login,$db; $u=$user_login['ID']; $access=$user_login['Access']; if($parent!=''){ $option.=" "; } if ($_SESSION["la"] == 1){ $rs=$db->Query("SELECT * FROM content_cat where CatParentID='$parent' "); }else{ $rs=$db->Query("SELECT * FROM content_cat_en where CatParentID='$parent' "); } while($arr=mysql_fetch_array($rs)){ $id=$arr['CatID']; $name=$arr['CatName']; if($parent!=''){ echo"<OPTION VALUE=\"$id\">$option $name</OPTION>"; }else{ echo"<OPTION VALUE=\"$id\">-$name</OPTION>"; } get_sub_cat($arr['CatID'],$option); }//end while } ?> <br> <script> function jsLink(link){ var id=document.webForm.parent_group; if(id.selectedIndex==-1){ alert('Select Parent Group'); id.focus(); }else{ location.href=link; } }//end function function swapEditPage() { var selector=document.getElementById('parent_group'); //alert(selector.options[selector.selectedIndex].value); window.parent.frames[1].location='com_edit_category.php?&group_id='+selector.options[selector.selectedIndex].value; } function newGroup() { var selector=document.getElementById('parent_group'); //alert(selector.options[selector.selectedIndex].value); if(selector.selectedIndex!=-1){ window.parent.frames[1].location='com_new_group.php?parent='+selector.options[selector.selectedIndex].value; }else{ window.parent.frames[1].location='com_new_group.php?parent='; } } </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE><?echo $cfg['site_name'];?></TITLE> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <META content="" name=Keywords> <META content="<?echo $cfg['site_name'];?>" name="Description"> <META content="<?echo $cfg['site_name'];?>" name="Author"> <META content="<?echo $cfg['site_name'];?>" name="Copyright"> <LINK href="../css/backend_style2.css" type="text/css" rel="stylesheet"> <body bgcolor="#EFF5FB"> <SELECT MULTIPLE id="parent_group" name="parent_group" style="width:500px;height:500px;" class="backend_inputbox" onChange="swapEditPage()"> <option value=""> หมวดหมู่หลัก </option> <? $space=" "; get_sub_cat($parent='',$space); ?> </SELECT> <input type="button" value=" AddCategory " name="subgroup" onClick="javascript:newGroup();">