View file m/office.php

File size: 26.46Kb
<?php
ob_start();
define('NTOP', 1);
$title = 'office';
require_once ('../system/connect.php');
require_once ('../system/core.php');
require_once ('../system/function.php');
require_once ('head.php');
reg();
$mod = isset($_GET['mod']) ? (string)$_GET['mod'] : '';
switch($act)
	{
		default:
	$platforms = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id_user` = '".$user_data['id']."'"));
	$news_all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."news`"));
    $plaforms_no_moder = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '0'"));
		echo '<div class="title2">office</div>';

		echo '<div class="stat">';
		
	if($user_data['level'] == 2) echo '<img src="/img/index/icon.png" alt="*" /> <a href="http://'.$set['home'].'/adm_panel/index.php">Admin control</a></br>';

		echo '<img src="/img/index/icon.png" alt="*" /> <a href="http://'.$set['home'].'/m/office/platforms"><b>platforms</b></a> ['.$platforms.'of'.$set['max_platforms'].']</br>';
		echo '<img src="/img/index/icon.png" alt="*" /> <a href="http://'.$set['home'].'/m/office/settings">settings</a></br>';
		echo '<img src="/img/index/icon.png" alt="*" /> <a href="http://'.$set['home'].'/m/new">under moderation</a> ['.$plaforms_no_moder.']</br>';
		echo '<img src="/img/index/icon.png" alt="*" /> <a href="http://'.$set['home'].'/m/news">news</a>[<b>'.$news_all.'</b>]</br>';
		echo '<img src="/img/index/icon.png" alt="*" /> <a href="http://'.$set['home'].'/exit">exit</a></div>';

		break;

		case 'platforms':
		$platform = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id_user` = '".$user_data['id']."'");
		$platforms = mysql_num_rows($platform);
		echo '<div class="title2">Platforms | <small>your active counters: <strong>'.$platforms.'</strong> of <strong>'.$set['max_platforms'].'</strong></small></div>';
		if($platforms == 0)
			{
				echo '<div class="stat">';
				echo 'you have no platforms.</div>';
				echo '<div class="stat">';
				echo '<a href="http://'.$set['home'].'/m/office/addPlatform">add platform</a><br/>';
				echo '</div>';
			}
		else
			{
				$total=intval(($platforms-1)/$page_platforms)+1;
				$page=abs(intval($_GET['page']));
				if(empty($page) OR $page < 0)
					{
						$page = 1;
					}
				if($page > $total)
					{
						$page = $total;
					}
				$past=intval($platforms/$page_platforms);
				$start=$page*$page_platforms-$page_platforms;
				$platform = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id_user` = '".$user_data['id']."' ORDER BY `id` DESC LIMIT ".$start.",".$page_platforms."");
				while($row = mysql_fetch_array($platform))
					{
					echo '<div class="stat">';
						$status = $row['status'] == 1 ? '<font color=green>checked</font>' : '<font color=red>unchecked</font>';

						$start++;
						echo '<a href="http://'.$set['home'].'/out/'.$row['id'].'"><strong>'.$row['name'].'</strong></a> [ID: '.$row['id'].' | '.$status.'] <a href="http://'.$set['home'].'/stats/'.$row['id'].'"> <img src="/img/index/s.gif" alt="?"></a> <br/> ';

						if(mb_strlen($row['about']) > 50)
							{
								$text = substr($row['about'],0,50);
								echo ''.$text.'...<br/>';
							}
						else
							{
								echo ''.$row['about'].'<br/>';
							}

						echo '
<a href="http://'.$set['home'].'/m/office/editPlatform/'.$row['id'].'">edit</a> |
<a href="http://'.$set['home'].'/m/office/deletePlatform/'.$row['id'].'">delete</a> |
<a href="http://'.$set['home'].'/m/office/code/'.$row['id'].'">code</a></div>';
					}
				navigation($platforms,$page_platforms,$page,'http://'.$set['home'].'/m/office.php?act=platforms&',$total);
				echo '<div class="main"><a href="http://'.$set['home'].'/m/office/addPlatform">add platform</a></div>';
			}
		break;

		case 'add_platform':
		echo '<div class="title2">add platform</div>';
		if(!isset($_POST['ok']))
			{
				$image_big = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'big'");
				$image_small = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'small'");
				$image_biger = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'biger'");
				$image_one = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'one'");
				echo '<div class="main">';
				echo '
				<form action="http://'.$set['home'].'/m/office/addPlatform/2" method="post">
				site name [max. 35]:<br/>
				<input type="text"  class="input" name="name" maxlength="35" value="" /><br/>
				URL address(no http://)[max. 35]:<br/>
				<input type="text"  class="input" name="url" maxlength="35" value="" /><br/>
				description [max. 250]:<br/>
				<textarea name="about" cols="38" rows="8"></textarea><br/>
				categories:<br/>
				<select name="cat">
				';
				$cats = mysql_query("SELECT * FROM `".$prefix."cat` ORDER BY `position` ASC");
				if(mysql_num_rows($cats) > 0)
				{
				while($cat = mysql_fetch_assoc($cats))
				{
				echo '<option value="'.$cat['id'].'">'.$cat['name'].'</option>';
				}
				}
				echo '</select><br/><br/>';
				
             
				echo '<small><strong>select counter style: <font size=2>*</font></strong></small><br/>';
				
				///////////////////////// Веритикальный Счетчик
				
				while($count_big = mysql_fetch_array($image_big))
				{
				echo '<input type="radio" name="imagebig" value="'.$count_big['name'].'">';
				echo '<img src="http://'.$set['home'].'/images/big/'.$count_big['name'].'.gif" alt=""><br/>';
				}
				
				//////////////////////// Горизонтальный Счетчик
				
				while($count_biger = mysql_fetch_array($image_biger))
				{
				echo '<input type="radio" name="imagebig" value="'.$count_biger['name'].'">';
				echo '<img src="http://'.$set['home'].'/images/big/'.$count_biger['name'].'.gif" alt=""><br/>';
				}
             
				echo '<hr/>';
				echo '<small><strong>select small counter style: <font size=2>*</font></strong></small><br/>';
				while($count_small = mysql_fetch_array($image_small))
				{
				echo '<input type="radio" name="imagesm" value="'.$count_small['name'].'">';
				echo '<img src="http://'.$set['home'].'/images/mini/'.$count_small['name'].'.gif" alt=""><br/>';
				}
				
				echo '<hr/>';
				echo '<small><strong>online: <font size=2>*</font></strong></small><br/>';
				while($count_one = mysql_fetch_array($image_one))
				{
				echo '<input type="radio" name="imageone" value="'.$count_one['name'].'">';
				echo '<img src="http://'.$set['home'].'/images/on/'.$count_one['name'].'.gif" alt=""><br/>';
				}		

				echo '</br><font size=2>*</font></strong> - required for successful submission</br></br><input name="ok" type="submit" value="submit" />
				</form>
				</div>';
			}
		else
			{
				$platform = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id_user` = '".$user_data['id']."'");
				$platforms_count = mysql_num_rows($platform);
				if($platforms_count >= $set['max_platforms'])
					{
						echo '<div class="error">';
						echo 'Достигнут лимит площадок <strong>'.$set['max_platforms'].'</strong> , удалите лишние площадки или создайте новый аккаунт!<br/>';
						echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
						echo '</div>';
					}
				else
					{
						$url = htmlspecialchars(trim($_POST['url']));
						$name = htmlspecialchars(trim($_POST['name']));
						$about = htmlspecialchars(trim($_POST['about']));
						$cat = intval($_POST['cat']);
						$imagebig = htmlspecialchars(trim($_POST['imagebig']));
                        $imagesm = htmlspecialchars(trim($_POST['imagesm']));
						$imageone = htmlspecialchars(trim($_POST['imageone']));
						$pr=getpr($url);
						$cy=getCI($url);
						$error = '';
						$isset_cat = mysql_num_rows(mysql_query("SELECT `id` FROM `".$prefix."cat` WHERE `id` = '".$cat."'"));
						$isset_image = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."images` WHERE `name` = '".$imagebig."'"));
						if($isset_image == 0)
							{
								$error .= 'Ошибка! Нет такого изображения!<br/>';
							}
						if($isset_cat == 0)
							{
								$error .= 'Ошибка! Нет такой категории!<br/>';
							}
						if(empty($url) OR empty($name) OR empty($about) OR empty($cat) OR empty($imagebig) OR empty($imagesm) OR empty($imageone))
							{
								$error .= 'Ошибка! Не заполнены поля!<br/>';
							}
						if(mb_strlen($url) >= 35)
							{
								$error .= 'Ошибка! Поле "URL сайта" не должно быть больше 35 символов!<br/>';
							}
						if(mb_strlen($name) >= 35)
							{
								$error .= 'Ошибка! Поле "Название сайта" не должно быть больше 35 символов!<br/>';
							}
						if(mb_strlen($about) >= 250)
							{
								$error .= 'Ошибка! Поле "Описание сайта" не должно быть больше 250 символов!<br/>';
							}
						if(!empty($error))
							{
								echo '<div class="topni">';
								echo $error;
								echo '<a href="http://'.$set['home'].'/m/office/addPlatform">add platform</a></div>';
							}
						else
							{
				$insert_platform = mysql_query("INSERT INTO `".$prefix."sait` SET
              `id_user` = '" . $user_data['id'] . "',
              `name` = '" . mysql_real_escape_string($name) . "',
              `about` = '" . mysql_real_escape_string($about) . "',
              `category` = '" . $cat . "',
              `url` = '" . mysql_real_escape_string($url) . "',
              `imagebig` = '" . mysql_real_escape_string($imagebig) . "',
              `imagesm` = '" . mysql_real_escape_string($imagesm) . "',
			  `imageone` = '" . mysql_real_escape_string($imageone) . "',
              `status` = '" . $set['moderacia'] . "',
              `pr` = '" . mysql_real_escape_string($pr) . "',
              `cy` = '" . mysql_real_escape_string($cy) . "'");
								if($insert_platform)
									{
										echo '<div class="topni">';
										echo 'success!! now get your code!<br/>';
										echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
										echo '</div>';
									}
								else
									{
										echo '<div class="topni">';
										echo 'Площадка не добавлена , попробуйте снова!<br/>';
										echo '<a href="http://'.$set['home'].'/m/office/addPlatform">add platform</a><br/>';
										echo '</div>';
									}
							}
					}
			}
		break;
		case 'edit_platform':
		if(!isset($_POST['ok']))
			{
				echo '<div class="title2">edit platform</div>';
				$platform = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id` = '".$id."' AND `id_user` = '".$user_data['id']."' LIMIT 1");
				$platform_count = mysql_num_rows($platform);
				$user_platform = mysql_fetch_array($platform);
				$image_big = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'big'");
				$image_small = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'small'");
				$image_biger = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'biger'");
				$image_one = mysql_query("SELECT * FROM `".$prefix."images` WHERE `type` = 'one'");
				if($platform_count > 0)
					{
						echo '<div class="main">';
						echo '
						<form action="http://'.$set['home'].'/m/office/editPlatform/2/'.$id.'" method="post">
						site name [max. 35]:<br/>
						<input type="text"  class="input" name="name" maxlength="35" value="'.$user_platform['name'].'" /><br/>
						URL address(no http://)[max. 35]:<br/>
						<input type="text"  class="input" name="url" maxlength="35" value="'.$user_platform['url'].'" /><br/>
						description [max. 250]:<br/>
						<textarea name="about" cols="38" rows="8">'.$user_platform['about'].'</textarea><br/>
						categories:<br/>
						<select name="cat">';
						$cats = mysql_query("SELECT * FROM `".$prefix."cat` ORDER BY `position` ASC");
						if(mysql_num_rows($cats) > 0)
							{
								while($cat = mysql_fetch_assoc($cats))
									{
										$selected = ($user_platform['category'] == $cat['id']) ? ' selected="selected"' : '';
										echo '<option value="'.$cat['id'].'"'.$selected.'>'.$cat['name'].'</option>';
									}
							}
						echo '</select><br/><br/>';

						echo '<small><strong>select counter: <font size=2>*</font></strong></small><br/>';
						
						/////////////////// Вертикальный счетчик
						
						while($count_big = mysql_fetch_array($image_big))
							{
					$checked = ($user_platform['imagebig'] == $count_big['name']) ? ' checked="checked"' : '';
			echo '<input type="radio" name="imagebig" value="'.$count_big['name'].'"'.$checked.'>';
			echo '<img src="http://'.$set['home'].'/images/big/'.$count_big['name'].'.gif" alt=""><br/>';
							}
							
						/////////////////// Горизонтальный счетчик	
							
							while($count_biger = mysql_fetch_array($image_biger))
							{
					$checked = ($user_platform['imagebig'] == $count_biger['name']) ? ' checked="checked"' : '';
			echo '<input type="radio" name="imagebig" value="'.$count_biger['name'].'"'.$checked.'>';
			echo '<img src="http://'.$set['home'].'/images/big/'.$count_biger['name'].'.gif" alt=""><br/>';
							}

						echo '<hr/>';
				echo '<small><strong>select small counter: <font size=2>*</font></strong></small><br/>';
						while($count_small = mysql_fetch_array($image_small))
							{
								$checked = ($user_platform['imagesm'] == $count_small['name']) ? ' checked="checked"' : '';
								echo '<input type="radio" name="imagesm" value="'.$count_small['name'].'"'.$checked.'>';
								echo '<img src="http://'.$set['home'].'/images/mini/'.$count_small['name'].'.gif" alt=""><br/>';
							}
							
							echo '<hr>';
				echo '<small><strong>online: <font size=2>*</font></strong></small><br/>';
				while($count_one = mysql_fetch_array($image_one))
							{
								$checked = ($user_platform['imageone'] == $count_one['name']) ? ' checked="checked"' : '';
								echo '<input type="radio" name="imageone" value="'.$count_one['name'].'"'.$checked.'>';
								echo '<img src="http://'.$set['home'].'/images/on/'.$count_one['name'].'.gif" alt=""><br/>';
							}
							

						echo '</br><font size=2>*</font></strong> - required field for submission</br></br><input name="ok" type="submit" value="submit" />
						</form>
						</div>';
					}
				else
					{
						echo '<div class="topni">';
						echo 'success!!now code your meter!<br/>';
						echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
						echo '</div>';
					}
			}
		else
			{
				$cat = intval($_POST['cat']);
				$imagebig = htmlspecialchars(trim($_POST['imagebig']));
                $imagesm = htmlspecialchars(trim($_POST['imagesm']));
				$imageone = htmlspecialchars(trim($_POST['imageone']));
				$name = htmlspecialchars(trim($_POST['name']));
				$url = htmlspecialchars(trim($_POST['url']));
				$url = str_replace("http://","",$url);
				$about = htmlspecialchars(trim($_POST['about']));
				$platform_isset = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id` = '".$id."' AND `id_user` = '".$user_data['id']."' LIMIT 1"));
				$error = '';
				$isset_cat = mysql_num_rows(mysql_query("SELECT `id` FROM `".$prefix."cat` WHERE `id` = '".$cat."'"));
				$isset_image = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."images` WHERE `name` = '".$imagebig."'"));
				if($isset_image == 0)
					{
						$error .= 'Ошибка! Нет такого изображения!<br/>';
					}
				if($isset_cat == 0)
					{
						$error .= 'Ошибка! Нет такой категории!<br/>';
					}
				if(empty($cat) OR empty($imagebig) OR empty($imagesm) OR empty($imageone) OR empty($name) OR empty($url) OR empty($about))
					{
						$error .= 'Ошибка!Не заполнены поля!<br/>';
					}
				if($platform_isset == 0)
					{
						$error .= 'У вас нет такой площадки!<br/>';
					}
				if(!empty($error))
					{
						echo '<div class="topni">';
						echo $error;
						echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a></div>';
					}
				else
					{
				$update_platform = mysql_query("UPDATE `".$prefix."sait` SET
                     `category` = '" . $cat . "',
                     `imagebig` = '" . mysql_real_escape_string($imagebig) . "',
                     `imagesm` = '" . mysql_real_escape_string($imagesm) . "',
					 `imageone` = '" . mysql_real_escape_string($imageone) . "',
                     `name` = '" . mysql_real_escape_string($name) . "',
                     `url` = '" . mysql_real_escape_string($url) . "',
                     `about` = '" . mysql_real_escape_string($about) . "',
                     `status` = '" . $set['moderacia'] . "'
                     WHERE `id` = '".$id."'");
						if($update_platform)
							{
								echo '<div class="topni">';
								echo 'success!<br/>';
								echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
								echo '</div>';
							}
						else
							{
								echo '<div class="topni">';
								echo 'Площадка не отредактирована , попробуйте снова!<br/>';
								echo '<a href="http://'.$set['home'].'m/office/editPlatform/'.$id.'">edit platform</a><br/>';
								echo '</div>';
							}
					}
			}
		break;
		case 'del_platform':
		$platform_isset = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id` = '".$id."' AND `id_user` = '".$user_data['id']."' LIMIT 1");
		$platform_isset_c = mysql_num_rows($platform_isset);
		if($platform_isset_c > 0)
			{
				$platform = mysql_fetch_array($platform_isset );
				echo '<div class="title2">delete platform<strong>'.$platform['name'].'</strong></div>';
				if(!isset($_GET['ok']))
					{
						echo '<div class="main">';
						echo 'delete this platform?<strong>'.$platform['name'].'</strong>?<br/>';
						echo '<a href="http://'.$set['home'].'/m/office/deletePlatform/'.$id.'/ok">delete</a> | <a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
						echo '</div>';
					}
				else
					{
						$del_hosts = mysql_query("DELETE FROM `".$prefix."hosts` WHERE `id_sait` = '".$id."'");
						$del_hits = mysql_query("DELETE FROM `".$prefix."hits` WHERE `id_sait` = '".$id."'");
						$del_online = mysql_query("DELETE FROM `".$prefix."sait_online` WHERE `id_sait` = '".$id."'");
						$del_platform = mysql_query("DELETE FROM `".$prefix."sait` WHERE `id` = '".$id."'");
						if($del_hosts AND $del_hits AND $del_online AND $del_platform)
							{
								echo '<div class="topni">';
								echo 'platform deleted!<br/>';
								echo '<a href="http://'.$set['home'].'/m/office">office</a><br/>';
								echo '</div>';
							}
						else
							{
								echo '<div class="topni">';
								echo 'why delete!<br/>';
								echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
								echo '</div>';
							}
					}
			}
		else
			{
				echo '<div class="topni">';
				echo 'У вас нет такой площадки!<br/>';
				echo '<a href="http://'.$set['home'].'/m/office/platforms">platforms</a><br/>';
				echo '</div>';
			}
		break;
		case 'code':
			echo '<div class="title2">HTML-counter codes</div>';
			if(!isset($_GET['id']))
				{
			echo '<div class="main">';
			echo 'code for big counter:<br/>';
			echo '<strong>'.htmlspecialchars('<a').' href="http://'.$set['home'].'/go/<font color=red>ID_ПЛОЩАДКИ</font>">'.htmlspecialchars('<img').' src="http://'.$set['home'].'/image/<font color=red>ID_ПЛОЩАДКИ</font>" alt="'.$set['home'].'"/>'.htmlspecialchars('<').'/а></strong> <br/>';
			echo '<hr/>';
             echo 'code for small counter:<br/>';
			echo '<strong>'.htmlspecialchars('<a').' href="http://'.$set['home'].'/go/<font color=red>ID_ПЛОЩАДКИ</font>">'.htmlspecialchars('<img').' src="http://'.$set['home'].'/imageOther/<font color=red>ID_ПЛОЩАДКИ</font>" alt="'.$set['home'].'"/>'.htmlspecialchars('<').'/а></strong> <br/>';
			echo '<hr/>';
			 echo 'online counter code:<br/>';
			echo '<strong>'.htmlspecialchars('<a').' href="http://'.$set['home'].'/go/<font color=red>ID_ПЛОЩАДКИ</font>">'.htmlspecialchars('<img').' src="http://'.$set['home'].'/imageone/<font color=red>ID_ПЛОЩАДКИ</font>" alt="'.$set['home'].'"/>'.htmlspecialchars('<').'/а></strong> <br/>';
			echo '<hr/>';
			echo 'Где <strong>ID_ПЛОЩАДКИ</strong> - ID площадки , счётчик которой вы хотите поставить , ID - показывается рядом с площадкой!<br/>';
			echo '</div>';
			
				}
			else
				{
					$id = intval($_GET['id']);
					echo '<div class="main">';
					echo 'big counter code [ID checked: '.$id.']:<br/>';
					echo '<strong>'.htmlspecialchars('<a').' href="http://'.$set['home'].'/go/'.$id.'">'.htmlspecialchars('<img').' src="http://'.$set['home'].'/image/'.$id.'" alt="'.$set['home'].'"/>'.htmlspecialchars('<').'/а><br/></strong>';

		            echo '<input type="text" name="" maxlength="200" class="do_button" value="'.htmlspecialchars('<a href="http://'.$set['home'].'/go/'.$id.'"><img src="http://'.$set['home'].'/image/'.$id.'" alt="'.$set['home'].'"/></a>').'"/><br/>';
		            echo '<hr/>';
                    echo 'small counter code [ID checked: '.$id.']:<br/>';
                    echo '<strong>'.htmlspecialchars('<a').' href="http://'.$set['home'].'/go/'.$id.'">'.htmlspecialchars('<img').' src="http://'.$set['home'].'/imageOther/'.$id.'" alt="'.$set['home'].'"/>'.htmlspecialchars('<').'/а><br/></strong>';

		            echo '<input type="text" name="" maxlength="200" class="do_button" value="'.htmlspecialchars('<a href="http://'.$set['home'].'/go/'.$id.'"><img src="http://'.$set['home'].'/imageOther/'.$id.'" alt="'.$set['home'].'"/></a>').'"/><br/>';
					
					echo '<hr/>';
					echo 'online counter code: [ID checked: '.$id.']:<br/>';
                    echo '<strong>'.htmlspecialchars('<a').' href="http://'.$set['home'].'/go/'.$id.'">'.htmlspecialchars('<img').' src="http://'.$set['home'].'/imageone/'.$id.'" alt="'.$set['home'].'"/>'.htmlspecialchars('<').'/а><br/></strong>';

		             echo '<input type="text" name="" maxlength="200" class="do_button" value="'.htmlspecialchars('<a href="http://'.$set['home'].'/go/'.$id.'"><img src="http://'.$set['home'].'/imageone/'.$id.'" alt="'.$set['home'].'"/></a>').'"/><br/>';
					
					echo '<hr>';
					
					echo '<a href="http://'.$set['home'].'/m/office">office</a><br/>';
					echo '</div>';
				}
		break;
		
		
		case 'settings':
		echo '<div class="title2">settings</div>';
		if(!isset($_POST['ok']))
			{
				echo '<div class="main">';
				echo '<form action="http://'.$set['home'].'/m/office/settings" method="post" name="form">';
				echo 'Areas on the page in the office:<br/>';
				echo '<input type="text" name="page_platforms" maxlength="2" class="do_button" value="'.$user_data['page_platforms'].'"/><br/>';
				echo 'Elements on the page in the statistics:<br/>';
				echo '<input type="text" name="pages" maxlength="2" class="do_button" value="'.$user_data['pages'].'"/><br/>';
				echo 'Sites on the page in the category:<br/>';
				echo '<input type="text" name="page_sait" maxlength="2" class="do_button" value="'.$user_data['page_sait'].'"/><br/>';
				echo 'Top sites on page 100 (Home page)::<br/>';
				echo '<input type="text" name="page_top" maxlength="2" class="do_button" value="'.$user_data['page_top'].'"/><br/>';
				echo 'News page:<br/>';
				echo '<input type="text" name="page_news" maxlength="2" class="do_button" value="'.$user_data['page_news'].'"/><br/>';
				echo 'Comments to the news page:<br/>';
				echo '<input type="text" name="page_newsc" maxlength="2" class="do_button" value="'.$user_data['page_newsc'].'"/><br/>';
				echo 'Comments to the sites of the page:<br/>';
				echo '<input type="text" name="page_sait_comments" maxlength="2" class="do_button" value="'.$user_data['page_sait_comments'].'"/><br/>';
				echo '<input name="ok" type="submit" value="submit" /></form></div>';
				echo '</div>';
			}
		else
			{
				$page_platforms = abs(intval($_POST['page_platforms']));
				$pages = abs(intval($_POST['pages']));
				$page_sait = abs(intval($_POST['page_sait']));
				$page_top = abs(intval($_POST['page_top']));
				$page_news = abs(intval($_POST['page_news']));
				$page_newsc = abs(intval($_POST['page_newsc']));
				$page_sait_comments = abs(intval($_POST['page_sait_comments']));
				$error = '';
				if(empty($page_platforms) or empty($pages) or empty($page_sait) or empty($page_top) or empty($page_news) or empty($page_newsc) or empty($page_sait_comments))
					{
						$error .= 'Ошибка!Одно из полей не заполнено<br/>';
					}
				if(mb_strlen($pages) > 2)
					{
						$error .= 'Ошибка! Поле "Элементов на страницу в статистике" содержит больше 2 символов! <br/>';
					}
				if(mb_strlen($page_sait) > 2)
					{
						$error .= 'Ошибка! Поле "Сайтов на страницу в категории" содержит больше 2 символов! <br/>';
					}
				if(mb_strlen($page_platforms) > 2)
					{
						$error .= 'Ошибка! Поле "Площадок на страницу" содержит больше 2 символов! <br/>';
					}
				if(mb_strlen($page_top) > 2)
					{
						$error .= 'Ошибка! Поле "Сайтов на страницу Топ-100" содержит больше 2 символов! <br/>';
					}
				if(mb_strlen($page_news) > 2)
					{
						$error .= 'Ошибка! Поле "Новостей на страницу" содержит больше 2 символов! <br/>';
					}
				if(mb_strlen($page_newsc) > 2)
					{
						$error .= 'Ошибка! Поле "Комментариев к новостям на страницу" содержит больше 2 символов! <br/>';
					}
				if(mb_strlen($page_sait_comments) > 2)
					{
						$error .= 'Ошибка! Поле "Комментариев к сайтам на страницу" содержит больше 2 символов! <br/>';
					}
				if(!empty($error))
					{
						echo '<div class="topni">';
						echo $error;
						echo '<a href="http://'.$set['home'].'/m/office/settings">settings</a></div>';
					}
				else
					{
						$up = mysql_query("UPDATE `".$prefix."users` SET `page_platforms` = '".$page_platforms."', `pages` = '".$pages."', `page_sait` = '".$page_sait."', `page_top` = '".$page_top."', `page_news` = '".$page_news."', `page_newsc` = '".$page_newsc."', `page_sait_comments` = '".$page_sait_comments."' WHERE `id` = '".$user_data['id']."'");
						if($up)
							{
								echo '<div class="topni">';
								echo '<font color=green>Its all good now add more sites!</font><br/>';
								echo '</div>';
							}
					}
			}
		break;

	}

require_once ('foot.php');
?>