ACC SHELL

Path : /srv/www/vhosts/petrikov/admin/pages/user/
File Upload :
Current File : /srv/www/vhosts/petrikov/admin/pages/user/informations.php

<?php
	$query = "SELECT `informations` FROM `hotels` WHERE `ID_user` = ". $_SESSION[ "ID" ];
			 
	$result = mysql_query( $query, $dbc );
		
	if ( mysql_num_rows( $result ) > 0 )
	{
		$row = mysql_fetch_row( $result );

		if ( empty( $_POST[ "content" ] ) ) {
			$content = $row[ 0 ];
		} else {
			$content = $_POST[ "content" ];
		}

		if ( isset( $_POST[ "submit" ] ) ) {
			$query = "UPDATE `hotels` SET `informations` = '$content' WHERE ID_user = ". $_SESSION[ "ID" ];
			
			$result = @mysql_query( $query, $dbc );

			if ( $result ) {
				message( "Informace byly uloženy" );
			} else {
				message( "uložení nebylo možné kůli systémové chybě." );
			}
		}

		$smarty->assign( 'content', $content );
		$smarty->display( "user/informations.tpl" );
		echo '<script language="javascript" type="text/javascript" src="./scripts/tiny_mce/tiny_mce.js"></script>
			<script language="javascript" type="text/javascript">
			tinyMCE.init({
				mode : "textareas",
				theme : "advanced",
				language : "cs"
			});
			</script>';
	} else {
		message( "Systemova chyba!!!" );
	}
?>

ACC SHELL 2018