Location: PHPKode > projects > Hosting App > hosting/modify.php
<?php
////////////////////////////////////////////////////////////////////////////////
//   Copyright (c), 2002, Sadri Sahraoui <hide@address.com>               //
//   Hosting App - A web based hosting management system                      //
//   http://sf.net/projetcs/hostingapp/                                       //
//   				                                                                  //
//   This program is free software. You can redistribute it and/or modify     //
//   it under the terms of the GNU General Public License                     //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             //
//   GNU General Public License for more details															//
// 																		                                        //
//   You should have received a copy of GNU General Public License            //
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////

/**
 * 
 * @version v1.3, 20/09/2002
 * 
 */

session_start();

define('MX_GENERAL_PATH', 'config/');  			// path to Mxconf.php

define('MX_ERROR_PATH', 'modules/Mx/');    	// path to ErrorManager.php

require("./config/config.inc.php");

	$tpl = new ModeliXe("admin/main.mxt", session_name()."=".session_id()); // Instantiation of Modelixe Class

	$tpl -> SetModeliXe();

	$tpl -> SetMxLang("./lang/index.lang.".$lang);

	$tpl -> MxText('title', $app_name." ".$app_version);

	$tpl -> MxBloc('header', 'modify', './tpl/admin/header.mxt');

	$tpl -> MxBloc('body', 'modify', './tpl/admin/body.mxt');

	if (!isset($HTTP_GET_VARS['what'])) {

				$tpl -> MxBloc('sub_menu', 'modify', './tpl/admin/sub.menu.mxt');

		}else{

			switch($HTTP_GET_VARS['what']){ 

				case "user": 

					$tpl -> MxBloc('sub_menu', 'modify', './tpl/admin/sub.users.mxt');

					build_subUsers(& $tpl);

					view_user ($tpl, $HTTP_GET_VARS['id'], 'edit');

					$tpl -> MxText('body.main_bloc.form_url', "modify.php?".$HTTP_ENV_VARS['QUERY_STRING']);

					break;

				case "domain": 

					$tpl -> MxBloc('sub_menu', 'modify', './tpl/admin/sub.domains.mxt');

					view_domain ($tpl, $HTTP_GET_VARS['id'], 'edit');
					
					build_subDomains(& $tpl);

					$tpl -> MxText('body.main_bloc.form_url', "modify.php?".$HTTP_ENV_VARS['QUERY_STRING']);

					break;

				case "product":

					$tpl -> MxBloc('sub_menu', 'modify', './tpl/admin/sub.products.mxt');

					build_subProducts(& $tpl);

					view_product ($tpl, $HTTP_GET_VARS['id'], 'edit');					

					$tpl -> MxText('body.main_bloc.form_url', "modify.php?".$HTTP_ENV_VARS['QUERY_STRING']);
					
					break;

				case "email":

					$tpl -> MxBloc('sub_menu', 'modify', './tpl/admin/sub.emails.mxt');

					build_subEmails(& $tpl);

					view_email ($tpl, $HTTP_GET_VARS['id'], 'edit');					

					$tpl -> MxText('body.main_bloc.form_url', "modify.php?".$HTTP_ENV_VARS['QUERY_STRING']);
					
					break;					
					
				case "conf"	:

					$tpl -> MxBloc('sub_menu', 'modify', './tpl/admin/sub.conf.mxt');

//					build_subConf();

					break;
			} // switch
		}

		if (isset($HTTP_POST_VARS['form'])) {

		    switch($HTTP_POST_VARS['what']){

		    	case "user": 

						validate_user_data ($HTTP_POST_VARS['first'], $HTTP_POST_VARS['last'], $HTTP_POST_VARS['email'], $HTTP_POST_VARS['login'] , $HTTP_POST_VARS['password'] , $HTTP_POST_VARS['company'], $HTTP_POST_VARS['address'], $HTTP_POST_VARS['city'], $HTTP_POST_VARS['zip_code'], $HTTP_POST_VARS['phone'], 'update', $HTTP_POST_VARS['id']);

		    		break;

		    	case "domain": 

		    		validate_domain ($HTTP_POST_VARS['domain'], $HTTP_POST_VARS['domain_admin'], $HTTP_POST_VARS['products'], $HTTP_POST_VARS['create_mail'], 'update', $HTTP_POST_VARS['id']);

		    		break;

		    	case "product":

						validate_product_data ($HTTP_POST_VARS['pack_name'], $HTTP_POST_VARS['space'],$HTTP_POST_VARS['num_mail'], $HTTP_POST_VARS['hits'], $HTTP_POST_VARS['bandwidth'], 'update', $HTTP_POST_VARS['id']);				 

						break;
						
					case "email":
					
						validate_email ($HTTP_POST_VARS['email']);
						update_email($HTTP_POST_VARS['id'], $HTTP_POST_VARS['email'], $HTTP_POST_VARS['password']);
		    } // switch
		}

switch($HTTP_SERVER_VARS['REQUEST_METHOD']){

	case "GET": 

		$tpl -> MxImage('body.cat_img', "img/".$HTTP_GET_VARS['what']."s.1.gif");

		break;

	case "POST": 

		$tpl -> MxImage('body.cat_img', "img/".$HTTP_POST_VARS['what']."s.1.gif");

		break;

	default:

		$tpl -> MxImage('body.cat_img', "img/".$HTTP_GET_VARS['what']."s.1.gif");

} // switch 

	$tpl -> MxBloc('footer', 'modify', './tpl/admin/footer.mxt');

	$tpl -> MxWrite();

	

?>
Return current item: Hosting App