?
Path : /home/admin/public_html/modules/users/ |
Current File : /home/admin/public_html/modules/users/com_category1.php |
<? class category extends backoff { function Search(){ $output.="<table width=\"350\" height=\"20\"><form method=\"GET\" action=\"$link\" name=\"search\"><tr><td width=\"100%\"> <input type='hidden' name='option' value='search'> <input type='hidden' name='page' value='1'> <select size=\"1\" name=\"key\">"; $keysearch=array('article_cat_name'=>"Category Name"); foreach($keysearch as $key=>$value){ if($_GET['key']==$key){ $output.="<option value=\"$key\" selected>$value</option>"; }//end if $_GET['key'] else{ $output.="<option value=\"$key\">$value</option>"; } } if($_GET){ foreach ($_GET as $key => $value){ if($key != "key" && $key != "keyword" && $key !="search"&&$key!="page"){ $output.= "<input type='hidden' name='$key' value='$value'>\n"; } } } $output.="</select>"; if($_GET['keyword']!=""){ $output.="<input type='textbox' name='keyword' size=\"20\" value=".$_GET['keyword'].">"; }else{ $output.="<input type='textbox' name='keyword' size=\"25\">"; } $output.="<input type='submit' value=\"search\" size=10>"; $output.="</td></tr></form></table>"; return $output; } function listData($table,$condition,$orderby,$sort,$chksort,$header_txt,$header_td_width,$link){ $this->_header_txt=$header_txt; $output.="<table width=\"99%\" class=table_data><tr><td>"; $output.="<table width=\"100%\" height=\"1\" class=table_option> <tr> <td width=\"350\" align=\"left\" height=\"15\"></td> <td width=\"250\" align=\"left\" height=\"15\"></td> <td width=\"150\" align=\"left\" height=\"15\">".$this->Search()."</td> </tr> <tr></table>"; //$output=$this->PerPageDropList($link); foreach($header_txt as $table_colum => $header_txt_name){ if($orderby==$header_txt_name){$orderby2="binary $table_colum";} } //start $check sort if($chksort=='Yes'){ if($sort=="Min2Max"){ $sort="Max2Min"; $sort2="ASC";$sort3=$sort; }else if($sort=="Max2Min"){ $sort="Min2Max"; $sort2="DESC";$sort3=$sort; } }else{ if($sort=="Min2Max"){ $sort="Min2Max";$sort2="ASC";$sort3="Max2Min"; }else if($sort=="Max2Min"){ $sort="Max2Min";$sort2="DESC";$sort3="Min2Max"; } } //end if check chsort='Yes' if($_GET['option']=="search"){ $key=$_GET['key'];$keyword=$_GET['keyword']; $search="WHERE $key LIKE '%$keyword%'"; $condition=$search; } if($orderby2==""){$orderby2="usertype_id";} $this->_Start = ($this->_Page * $this->_Limit) - $this->_Limit; $sql= "SELECT * FROM $table $condition ORDER BY $orderby2 $sort2 "; $this->setQuery($sql); $result=$this->QueryReturn(); $this->_total=$this->NumRows(); $this->_Next_Page = ceil($this->_total/$this->_Limit); $sql.= " LIMIT " . $this->_Start . "," . $this->_Limit; $this->setQuery($sql); $result2=$this->QueryReturn(); $this->PageNavigator(); //set output table data Header Colum $link2=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."&ac=deltrick"; $output.=" <table width=\"100%\" class=\"Table_backend\"><tr>"; $output.="<form method=\"POST\" action=\"$link2\" name=\"backend_form\" >"; $output.="<th width=\"20\"> <input name=\"allbox\" type=\"checkbox\" value=\"ON\" onClick=\"CheckAll(this.form,this.checked);\" title=\"Select or de-select all messages\" tabindex=\"105\" value=\"ON\"></th>"; $i=0; if($sort2=="ASC"){$sortgif="sort_d.gif";}else{$sortgif="sort_u.gif";} $link_sort=$PHPSELF."?"; if($_GET){ foreach ($_GET as $key => $value){ if($key != "orderby"&&$key!="sort"&&$key!="chksort"){ $link_sort.="$key=$value&"; } } } foreach($header_txt as $table_colum => $header_txt_name){ if($orderby==$header_txt_name){ $output.="<th width=$header_td_width[$i] ><a href=\"$link_sort&orderby=$header_txt_name&sort=$sort3&chksort=Yes\" title=\"Sort $header_txt_name by $sort3\"><img src=\"images/$sortgif\" border=0>$header_txt_name</a></th>"; }else{ $output.="<th width=$header_td_width[$i] ><a href=\"$link_sort&orderby=$header_txt_name&sort=$sort3&chksort=Yes\" title=\"Sort $header_txt_name Order $sort3\">$header_txt_name</a></th>"; } $i++; }//end forsearch $output.="<th width=\"20\"> </th><th width=\"20\"> </th>"; $output.="</tr>"; $data_colum=Array(); $tooltip=Array(); $count=0; while($arr=mysql_fetch_array($result2)) { $id=$arr['usertype_id']; $msg="<br><img src=$_Config_image_bookstore_path/$picture width=100 border=0>"; $ChkColor=$this->_total -$count; if($ChkColor%2!=0){$color="#f8f8f9";}else{$color="#f3f3f3";} $j=0; foreach($header_txt as $colum => $key){ $data_colum[$j]=$arr[$colum]; $j++; }//end foreach $link=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; $output.="<tr bgcolor=\"$color\">"; $output.="<td width=\"20\"><input type=\"checkbox\" name=\"checkbox[$count]\" id=\"checkbox_$count\" value=\"$id\" onClick=\"checkbox_color(this) \"></td>"; for($i=0;$i<count($data_colum);$i++){ $output.="<td width=\"$header_td_width[$i]\" height=\"20\">"; if($i==0){ $output.="<a href=\"$PHPSELF?mod=user&ac=edit_group&group_id=$id\">$data_colum[$i]</a></td>"; }else{ $output.="$data_colum[$i]</td>"; }//end if $i==1 } $link=$_SERVER['PHP_SELF']."?mod=user&ac=del_group&group_id=$id"; $comment="ยืนยันคำสั่งลบข้อมูล"; $alt="ลบข้อมูล"; $output.="<td width=\"20\"><a href=\"$PHPSELF?mod=user&ac=edit_group&group_id=$id\">$data_colum[$i]<img src=\"images/bt_edit.png\" border=0 heith=15></a></td><td width=\"20\" >"; if($chk_topic==0){$output.=confirm_del($link,$comment,$alt);} $output.="</td>"; $count++; } $output.="</tr>"; $output.="</td></tr></form> </table>"; $output.="<table width=\"100%\" class=Table_backend border=0> <tr> <td width=\"1\" valign=\"top\" align=\"center\" height=\"15\" class=table_backend_bottom><img src=\"images/space.gif\" height=\"24\"></td> <td width=\"250\" align=\"left\" height=\"15\" class=table_backend_bottom>".$this->PageLink()."</td> <td width=\"250\" align=\"center\" height=\"15\" class=table_backend_bottom>".$this->total_record()."</td> <td width=\"250\" align=\"right\" height=\"15\" class=table_backend_bottom>".$this->PreNext()."</td> </tr></table> <table width=\"100%\" border=0> <tr><center> <td width=\"350\" align=\"left\" height=\"15\"></td> <td width=\"200\" align=\"right\" height=\"15\">".$this->set_per_page()."</td> <td width=\"150\" align=\"left\" height=\"15\">".$this->PerPageDropList()."</td> <td width=\"200\" align=\"right\" height=\"15\">".$this->jump2page()."</td> </tr> </table> "; $output.="</td></tr></table>";//end table class table_data return $output; }//end listData }//end class BackEndData ?>