HEX
Server: Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 mod_fcgid/2.3.9 PHP/5.4.16
System: Linux dvm.vladweb.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: region-gk.ru (1016)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: //var/www/bk/efi/eficenter.ru/old/admin_scheme_edit.php
<?
include("cfg/connect.inc.php");
	include("cfg/mysql.php");
	include("cfg/general.inc.php");
	include("cfg/lang.inc.php");
	include("cfg/functions.php");
require 'smarty/Smarty.class.php';

//connect to database
	db_connect(DB_HOST,DB_USER,DB_PASS) or die (db_error());
	db_select_db(DB_NAME) or die (db_error());

	$smarty = new Smarty; //core smarty object
	$smarty_mail = new Smarty; //for e-mails


//connect to database
	db_connect(DB_HOST,DB_USER,DB_PASS) or die (db_error());
	db_select_db(DB_NAME) or die (db_error());

	$smarty = new Smarty; //core smarty object
	$smarty_mail = new Smarty; //for e-mails

//authorized login check

	session_start();
	include("./checklogin.php");
	if (!isset($_SESSION["login"]) || strcmp($_SESSION["login"],ROOT_LOGIN)) //unauthorized
	{
		die ("You are not authorized to view this page");
	}

$smarty->template_dir = $template_path."/admin";
	$smarty_mail->template_dir = $template_path."/mail";
if(isset($_GET['SCHEME_EDT']))
{
   $QA="SELECT * FROM scheme WHERE id_sch={$_GET['SCHEME_EDT']} " ;
$res=mysql_query($QA) or DIE ("SELECT * FROM scheme ERROR! ".MYSQL_ERROR());
$rowa=array();
	$rowa=mysql_fetch_array($res) ;
     echo "-";
$smarty->assign("row", $rowa);
$smarty->display($template_path."admin/admin_scheme_edit.tpl");
}   ;

if(isset($_POST['SCHEME_EDT'])&&isset($_POST['save_scheme'])&&$_POST['save_scheme']="1")
{ $Query="UPDATE scheme SET firma='".$_POST['company']."',model='".$_POST['model']."', engine='".$_POST['engine']."',  basket='".$_POST['basket']."', year='".$_POST['year']."',num_page='".$_POST['num_page']."', price='".$_POST['price']."' WHERE id_sch='".$_POST['SCHEME_EDT']."'";
 mysql_query($Query) or DIE ("UPDATE * FROM scheme ERROR! ".MYSQL_ERROR());
//close window
				echo "<script>\n";
				echo "window.opener.location.reload();\n";
				echo "window.close();\n";
				echo "</script>\n</body>\n</html>";
				exit;

};


?>