<?
error_reporting(E_ALL^E_NOTICE);
if(isset($_FILES['file']))
{
$type = $_FILES['file']['type'];
if ($type!=='image/jpeg' && $type!=='image/jpg' && $type!=='image/gif' && $type!=='image/png'){$err=1;err_game('Это не картинка');}

if($ku['rubies']==347){
if (!isset($err))
{
$tmp = $_FILES['file']['tmp_name'];
move_uploaded_file($tmp, "images/kollxoz/$mc[id].php");
header("location: ?mycollective=$mc[id]");
}
}
else
if (!isset($err))
{
$tmp = $_FILES['file']['tmp_name'];
move_uploaded_file($tmp, "images/kollxoz/$mc[id].png");
header("location: ?mycollective=$mc[id]");
}
}
echo '<div class="event"><h1>Настройка колхоза</h1></div>';
echo "</div><div class='block'>Текущее фото колхоза:</br>";
if (file_exists('images/kollxoz/'.$mc['id'].'.png')){echo "<img src='images/kollxoz/$mc[id].png' alt='o'>";} else {echo "<img src='images/khha.jpg' alt='o'>";}
if(!isset($mc[avakx])){echo'</br>Заменить фото:';}else{echo'</br>Загрузить аватар:';}
echo "<form method=\"post\" enctype='multipart/form-data'>\n";
echo "<input type='file' name='file' /><br/>\n";
echo "<input value='Загрузить' type='submit' name='ok' /><br /></form></div>\n";

include_once 'inc/foot.php';?>