<?php
require("session_check.php");	
	
	//变量区
	$sort_id=short_check(get_argg('sort_id'));
	$module=short_check(get_argg('module'));
	$type=short_check(get_argg('type_value'));

	$dbo = new dbex;
	dbtarget('w',$dbServs);
	
	if($module=="group"){
		
		//表定义区
		$sort_table=$tablePreStr."group_type";
		$main_table=$tablePreStr."groups";
	}
	
	if($module=="pals"){
		
		//表定义区
		$main_table=$tablePreStr."pals_mine";
		$t_pals_sort=$tablePreStr."pals_sort";
		$sort_table=$tablePreStr."pals_def_sort";
	}
	
		switch($type){
			case "add":
				$sort_name=get_argp('sort_name');
				$sort_order=intval(get_argp('sort_order'));
				$sql="insert into $sort_table(name,order_num) value('$sort_name',$sort_order)";
				$dbo->exeUpdate($sql);
//				echo "添加成功";
			break;
			
			case "del":
				$sql="delete from $sort_table where id=$sort_id";
				$dbo->exeUpdate($sql);
//				echo "删除成功";
			break;
			
			case "change":
				$sort_name=get_argp('sort_name');
				$sort_order=get_argp('sort_order');
				$sql="update $sort_table set name='$sort_name',order_num=$sort_order where id=$sort_id";
				$dbo->exeUpdate($sql);
//				echo "修改成功";
			break;
			
			default:
			echo "error";
			break;
			
		}
?>