Sh3ll
OdayForums


Server : Apache
System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
User : apache ( 48)
PHP Version : 8.0.28
Disable Function : NONE
Directory :  /var/www/html/mmishra/erp-19-12-2019/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/mmishra/erp-19-12-2019/outer.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  	<title>ERP @ IIITA</title>
	<base href="https://erp.iiita.ac.in/" />
	<link rel="shortcut icon" href="favicon.ico">
	<link rel="icon" type="image/gif" href="animated_favicon1.gif">	
		
	<meta charset="utf-8">
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta name="description" content="enterprise resource planning, institute resource planning, iiita resource planning" />
	<meta name="author" content="Dr. M.K. Mishra, System Analyst" />
	
	<link rel='SHORTCUT ICON' href="images/logo.ico" />
	<link rel="stylesheet" type="text/css" href="css/erp_style.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="css/erp_menu.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="css/calendar.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="css/fontawesome-all.css" media="screen" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous" />

  	<script type="text/javascript" src="js/calendar.js"></script>
	<script type="text/javascript" src="js/fontawesome-all.js"></script>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/erp_ajax.js"></script>
	<script type="text/javascript" src="js/hilitor.js"></script>
</head>
<body>
	<script type="text/javascript" src="js/erp_body.js"></script>
	<form id='erpForm' name='erpForm' method='POST' enctype='multipart/form-data'>
	<div id='contentbar' class='outerbar'><span id='outerbar'> 		
	<?php

	$url 							= (isset($_SERVER['PATH_INFO']) ? explode('/', ltrim($_SERVER['PATH_INFO'], '/')) : '/');
	if ($url[0] == '/') {
		header('Location: /');
	} else if (!empty($url)) {
		// incoming request format /app/interface/action/tuple
		// app is application MVC to be invoked
		// interface is View method to be called
		// action is Controller action to be performed
		// tuple is record ID of Model for Controller action

		list($app, $intface, $action, $tuple) = array_slice($url, 0, 4);
		$params						= array_slice($url, 4);	// rest of the elements

		// Initiate the appropriate controller and render the required view
		// Check if controller exists. NB: it is needed to check for model and view too
	
		if ($app != 'erp') {
			// include parent classes so that classes can extend them
			require_once(__DIR__ .'/models/erp_model.php');
			require_once(__DIR__ .'/views/erp_view.php');
			require_once(__DIR__ .'/controllers/erp_controller.php');
		}
		$appModel 					= __DIR__ .'/models/' .$app. '_model.php';
		$appView 					= __DIR__ .'/views/' .$app. '_view.php';
		$appController 				= __DIR__ .'/controllers/' .$app. '_controller.php';

		if (file_exists($appController) && file_exists($appModel) && file_exists($appView)) {
			require_once($appModel);
			require_once($appView);
			require_once($appController);

			$modelName      		= $app. 'Model';
			$viewName       		= $app. 'View';
			$controllerName 		= $app. 'Controller';

			$appModel       		= new $modelName();
			$appView        		= new $viewName($appModel);
			
			// set appID and interfaceID
			$appView->app 			= $app;
			$appView->intface		= $intface;
			$appView->action 		= $action;
			$appView->tuple 		= $tuple;
			$appView->params		= $params;

			$appController  		= new $controllerName($appModel, $appView);
			$render 				= 'manage' .ucwords($intface); // first and second parameter
		
			if ($appController->checkProtection($intface) && empty($_SESSION['sessionID'])) {
				header('Location: /'); // session expired
			} else if ($appController->checkPermission($appView->intface) == TRUE) {
				print $appController->$render(); 		
			} else {
				print "<h1>Access permission denied [ $app ].</h1>";
			}
		} else {
			print '<h1>ERP detects unsupported URL [ ' .$_SERVER['PATH_INFO']. ' ]</h1>';
		}    
	} else {
		print '<h1>ERP detects unsupported URL [ ' .$_SERVER['PATH_INFO']. ' ]</h1>';
	}

	?>
	</span></div>
	</form>
</body>
</html>


ZeroDay Forums Mini