<?php include ("app_needed/config.php");
if(!$_SESSION[unique] || !$logged->is_admin())
header("Location: ".APP_WEBSITE."/login.html");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= language("CHARSET") ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?= language('PAGE_admin_general_settings_title') ?> - <?= $config->get_value('platform_title') ?></title>
<link rel="shortcut icon" type="image/png" href="<?= $config->get_value('platform_favicon') ?>"/>
<link href="app_needed/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="app_needed/style.tipsy.css" type="text/css" />
</head>

<body>
<div id="wrapper">
	<?php include("module.header.php"); ?>
	<?php include ("module.menu.php"); ?>
	<div class="content">
		<div class="info">
		<h1><?= language('PAGE_admin_general_settings_title') ?> </h1>
		</div>
        <form name="my-form" action="app_needed/ajax.functions.php" method="POST" enctype="multipart/form-data">
        <input type="hidden" name="general_settings" value="1" />
        <div class="box">
		  <div class="inside">
           	<div class="title">
                <h2><?= language('PAGE_admin_general_settings_subtitle') ?></h2>
            	</div>
            <table width="100%" border="0">
            	<tr>
            	  <td>Platform Title:</td>
            	  <td><input type="text" placeholder="" name="platform_title" value="<?= $config->get_value('platform_title')?>"/>
            	    <br /></td>
          	  </tr>
            	<tr>
            	  <td>Watermark ads</td>
            	  <td>
				  <input type="radio" name="watermark" value="1" <?php if($config->get_value('watermark'))  echo " checked";  ?> > Yes<br />
				  <input type="radio" name="watermark" value="0" <?php if(!$config->get_value('watermark'))  echo " checked";  ?> > No
                  </td>
          	  </tr>
            	<tr>
            	  <td>Watermark title</td>
            	  <td><input type="text" placeholder="" name="watermark_title" value="<?= $config->get_value('watermark_title')?>"/></td>
          	  </tr>
            	<tr>
            	  <td>Watermark Url</td>
            	  <td><input type="text" placeholder="" name="watermark_url" value="<?= $config->get_value('watermark_url')?>"/></td>
          	  </tr>
            	<tr>
            	  <td width="17%">Platform Logo:</td>
            	  <td width="83%"><input type="file" size="60" name="upload_logo" /></td>
          	  </tr>
            	<tr>
            	  <td>Or URL Platform Logo</td>
            	  <td><input type="text" placeholder="" name="platform_logo" value="<?= $config->get_value('platform_logo')?>"/></td>
          	  </tr>
            	<tr>
            	  <td>Platform Favicon:</td>
            	  <td><input type="file" size="60" name="upload_favicon" /></td>
          	  </tr>
            	<tr>
            	  <td>Or URL Platform Favicon</td>
            	  <td><input type="text" placeholder="" name="platform_favicon" value="<?= $config->get_value('platform_favicon')?>"/></td>
          	  </tr>
            	<tr>
            	  <td><strong>Language</strong></td>
            	  <td>&nbsp;</td>
          	  </tr>
            	<tr>
            	  <td>Language File</td>
            	  <td>
                  <select name="language">
                  <?php
				  $files=scandir("languages_data");
					$nr=count($files);
					for($index=0;$index<$nr;$index++)
   				 if($files[$index]=='.'||$files[$index]=='..')
       			 unset($files[$index]);
				//o afisare de test!
				foreach($files as $v)
    			{ if($v == $config->get_value('language')) $selected = 'selected';
					echo "<option value='".$v."' ".$selected." >".$v."</option>";
					}
				  ?>
                  </select>
                  </td>
          	  </tr>
            	<tr>
            	  <td><input type="submit" name="general_settings" value="<?= language('BUTTON_submit') ?>" /></td>
            	  <td id="response"></td>
          	  </tr>
          	</table>
          </div>
        </div>
        </form>
	</div>
</div>
<div id='confirm'>
<div class="left">
	<div class='title'><span><?= language('CONFIRM') ?></span></div>
	<div class='message'></div>
</div>
<div class="right">
	<div class='buttons'>
				<span class='no simplemodal-close'><?= language('NO') ?></span><span class='yes'><?= language('YES') ?></span>
               
	</div>
</div>
<div class="clear"></div>
	</div>
		<!-- preload the images -->
	<div style='display:none'>
		<img src='img/confirm/header.gif' alt='' />
		<img src='img/confirm/button.gif' alt='' />
	</div>

<script type="text/javascript" src="app_needed/jquery-1.9.0.min.js"></script>
<script type='text/javascript' src='app_needed/jquery.accordionmenu.js'></script>
<script type='text/javascript' src='app_needed/jquery.checkbox.js'></script>
<script type='text/javascript' src='app_needed/jquery.tipsy.js'></script>
<script type='text/javascript' src='app_needed/function.ajax.js'></script>
<script type='text/javascript' src='app_needed/simply-toast.min.js'></script>
<script type='text/javascript' src='app_needed/jquery.simplemodal.js'></script>
<script type='text/javascript' src='app_needed/functions.js'></script>
</body>
</html>
<?php mysql_close($conn); ?>