<? 
ob_start();
session_start();
require_once("../dbconnect.php");
 $action = isset($_GET['action']) ? $_GET['action'] : '';

switch ($action) {
	

   case 'delete' :
	     deleteCategory();
         break;
		

		
   case 'adminsettings' :
	     adminsettings();
         break; 
		 
		 
		 
   case 'password' :
	     chapasswoed();
         break; 		 
		 
     case 'pay' :
	     paypal();
         break; 		 
		  		 
	
	
		default :
        // if action is not defined or unknown
        // move to main category page
        header('Location: addcategory.php');
		
		}
		
		


/*
   Delete Category
*/


function deleteCategory()
{

  $userid=$_POST['userid'];




     echo  $sql3 = "DELETE FROM register WHERE  user_id=".$userid;
	      mysql_query($sql3);	



 header('Location: customers.php');  


 }

//* admin settings *//
function adminsettings()
{
 $query="update admin set  username='".$_POST['adminname']."',email='".$_POST['email']."' where admin_id=".$_POST['admid'];
	
	
	$exe=mysql_query($query);

header("location:adminsettings.php?up=up");

	
	
}
//change password/////////
	
function chapasswoed()
{


 $query="update admin set password='".$_POST['new_password']."' where admin_id=".$_POST['admid'];

$query1=mysql_query($query);

header("location:adminsettings.php?cp=cp");

}

function paypal()
{

 $query="update admin set paypalid='".$_POST['paypalid']."' where admin_id=".$_POST['admid'];

$query1=mysql_query($query);

header("location:modules.php?up=up");

}



?>